fr.emn.inputeditor
Class LiteLink

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byfr.emn.lite.Lite
              extended byfr.emn.lite.LiteContainer
                  extended byfr.emn.inputeditor.LiteLink
All Implemented Interfaces:
java.util.Collection, java.util.List, Manipulable, Uniteable

public class LiteLink
extends LiteContainer
implements Manipulable, Uniteable


Field Summary
 
Fields inherited from class fr.emn.lite.LiteContainer
children
 
Fields inherited from class fr.emn.lite.Lite
model, oldParent, parent, PICK_ACTIVEBOUNDS, PICK_ALL, PICK_DEEPEST, PICK_FIRST, PICK_GRAPHBOUNDS, PICK_INSIDE, PICK_INTER, PICK_MANIPULABLE, visible
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LiteLink(LiteInSlot IN, LiteOutSlot OUT)
           
 
Method Summary
 boolean canClone()
           
 boolean canDelete()
           
 boolean canScale()
           
 boolean canSelect()
           
 boolean canShortcut()
           
 boolean canTranslate()
           
 boolean canUniteWith(Lite l)
          Returns true if l is an instance of LiteLink and if it shares the same parent with this object.
 void concatenate(java.awt.geom.AffineTransform t)
          no transform
 void delete()
           
 void doPaint(java.awt.Graphics2D g)
          Include painting code here.
 void fitParent()
          Update LiteLink's parent so that it is the nearest common ancestor of both slots.
 java.awt.geom.Rectangle2D getBounds()
          Returns the bounds of the Lite object in its own coordinate system.
 java.awt.geom.GeneralPath getGhostPath(int maxDepth)
          This method returns the ghost shape of this object.
 LiteInSlot getInSlot()
           
 LiteSlot getOtherSlot(LiteSlot slot)
           
 LiteOutSlot getOutSlot()
           
 LiteUnion getUnionInstance()
          Returns an instance of LiteLinkUnion.
 void invalidate()
          Update link path (link path is drawn only if it is valid).
static void invalidate(java.util.Vector v)
          Updates links given in vector v, by calling retrace().
 boolean isValid()
          Returns true if this link has in and out slots, and a parent.
 boolean pick(java.awt.Graphics2D g, java.awt.geom.Rectangle2D rect, int strategy, PickedList picked)
          A link is not interactive, but delegates manipulation to its children.
 void preConcatenate(java.awt.geom.AffineTransform t)
          no transform
 void setTransform(java.awt.geom.AffineTransform t)
          no transform
static void traceLink(java.awt.geom.Point2D outP, java.awt.geom.Point2D inP, java.awt.geom.Rectangle2D outMask, java.awt.geom.Rectangle2D inMask, boolean circuitStyle, java.awt.geom.GeneralPath p)
          Draws a link between two points and appends the result to p.
 
Methods inherited from class fr.emn.lite.LiteContainer
add, add, get, getChildrenBounds, remove, remove, set, set, size
 
Methods inherited from class fr.emn.lite.Lite
changeTransform, context, dist, equals, getActiveBounds, getActiveBoundsFrom, getAncestor, getAncestor, getBoundsFrom, getBoundsFromNoCorrect, getChildrenGhostPath, getCommonAncestor, getGhost_old, getGhost, getParent, getShadow, getTransform, getTransformFrom, getTransformNoCopy, isVisible, migrateBack, migrateTo, paint_old, paint, paintChildren, paintShadows, pickChildren, setContext, setParent, setVisible, toString, transformBounds
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

LiteLink

public LiteLink(LiteInSlot IN,
                LiteOutSlot OUT)
Method Detail

canClone

public boolean canClone()
Specified by:
canClone in interface Manipulable

canDelete

public boolean canDelete()
Specified by:
canDelete in interface Manipulable

canScale

public boolean canScale()
Specified by:
canScale in interface Manipulable

canSelect

public boolean canSelect()
Specified by:
canSelect in interface Manipulable

canShortcut

public boolean canShortcut()
Specified by:
canShortcut in interface Manipulable

canTranslate

public boolean canTranslate()
Specified by:
canTranslate in interface Manipulable

canUniteWith

public boolean canUniteWith(Lite l)
Returns true if l is an instance of LiteLink and if it shares the same parent with this object.

Specified by:
canUniteWith in interface Uniteable

concatenate

public void concatenate(java.awt.geom.AffineTransform t)
no transform

Overrides:
concatenate in class Lite

delete

public void delete()

doPaint

public void doPaint(java.awt.Graphics2D g)
Description copied from class: Lite
Include painting code here.

Call PaintChildren if Lite object is a container.

Specified by:
doPaint in class Lite

fitParent

public void fitParent()
Update LiteLink's parent so that it is the nearest common ancestor of both slots.


getBounds

public java.awt.geom.Rectangle2D getBounds()
Description copied from class: Lite
Returns the bounds of the Lite object in its own coordinate system. Warning : don't change the Rectangle2D returned. Instead, work on a copy.

Specified by:
getBounds in class Lite

getGhostPath

public java.awt.geom.GeneralPath getGhostPath(int maxDepth)
Description copied from class: Lite
This method returns the ghost shape of this object. (implemented here for debug reasons).

By default, this method returns the path iterator of this object's bounds and appends its children's ghost path.

Overrides:
getGhostPath in class Lite
See Also:
#getChildrenGhostPath()

getInSlot

public LiteInSlot getInSlot()

getOtherSlot

public LiteSlot getOtherSlot(LiteSlot slot)

getOutSlot

public LiteOutSlot getOutSlot()

getUnionInstance

public LiteUnion getUnionInstance()
Returns an instance of LiteLinkUnion.

Specified by:
getUnionInstance in interface Uniteable

invalidate

public void invalidate()
Update link path (link path is drawn only if it is valid).


invalidate

public static void invalidate(java.util.Vector v)
Updates links given in vector v, by calling retrace().


isValid

public boolean isValid()
Returns true if this link has in and out slots, and a parent.


pick

public boolean pick(java.awt.Graphics2D g,
                    java.awt.geom.Rectangle2D rect,
                    int strategy,
                    PickedList picked)
A link is not interactive, but delegates manipulation to its children.

Overrides:
pick in class Lite
Parameters:
rect - The picking rectangle
strategy - The picking strategy to be used, i.e. a combination of a depth strategy and a geometrical strategy. Default value (0) is PICK_DEEPEST | PICK_INTER.
picked - if this argument is not null, picked objects are added to the pick list.

preConcatenate

public void preConcatenate(java.awt.geom.AffineTransform t)
no transform

Overrides:
preConcatenate in class Lite

setTransform

public void setTransform(java.awt.geom.AffineTransform t)
no transform

Overrides:
setTransform in class Lite

traceLink

public static void traceLink(java.awt.geom.Point2D outP,
                             java.awt.geom.Point2D inP,
                             java.awt.geom.Rectangle2D outMask,
                             java.awt.geom.Rectangle2D inMask,
                             boolean circuitStyle,
                             java.awt.geom.GeneralPath p)
Draws a link between two points and appends the result to p. Masks are optional.