fr.emn.inputeditor
Class LiteNode

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.LiteNode
All Implemented Interfaces:
java.util.Collection, java.util.List, Manipulable, Uniteable
Direct Known Subclasses:
LitePin

public class LiteNode
extends LiteContainer
implements Manipulable, Uniteable


Field Summary
protected  java.awt.geom.Rectangle2D.Double activeBounds
           
protected  java.awt.geom.Rectangle2D.Double bounds
           
protected  java.lang.String label
           
static java.awt.Font titleFont
           
 
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
LiteNode()
           
LiteNode(java.lang.String lbl, boolean hasExtIn, boolean hasExtOut)
           
LiteNode(java.lang.String lbl, boolean hasExtIn, boolean hasExtOut, boolean isMissing)
           
 
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 LiteNode and if it shares the same parent with this object.
 void doPaint(java.awt.Graphics2D g)
          Include painting code here.
 java.awt.geom.Rectangle2D getActiveBounds()
           
 java.util.Vector getAssociatedLinks()
          Returns the links attached to the slots of this node.
 java.util.Vector getAssociatedShortcuts()
           
 java.awt.geom.Rectangle2D getBounds()
          Returns the bounds of the Lite object in its own coordinate system.
 LiteSlot[] getIns()
           
 java.lang.String getLabel()
           
 LiteInSlots getLiteInSlots()
           
 LiteOutSlots getLiteOutSlots()
           
 LiteSlot[] getOuts()
           
 java.awt.Shape getShadow()
          Returns this lite's own shadow, WITHOUT its children's shadows.
 LiteSlot getSlot(java.lang.String lbl)
           
 LiteUnion getUnionInstance()
          Returns an instance of LiteNodeUnion.
 boolean hasExternalInput()
           
 boolean hasExternalOutput()
           
 void invalidate()
           
 boolean isExpanded()
           
 boolean isMissing()
           
 void migrateBack()
          Also calls fitParent() on all associated links
 void migrateTo(LiteContainer newParent)
          Also calls fitParent() on all associated links
 void setExpanded(boolean expand)
           
 void setExternal(boolean in, boolean out)
           
 void setLabel(java.lang.String label)
           
 
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, concatenate, context, dist, equals, getActiveBoundsFrom, getAncestor, getAncestor, getBoundsFrom, getBoundsFromNoCorrect, getChildrenGhostPath, getCommonAncestor, getGhost_old, getGhost, getGhostPath, getParent, getTransform, getTransformFrom, getTransformNoCopy, isVisible, paint_old, paint, paintChildren, paintShadows, pick, pickChildren, preConcatenate, setContext, setParent, setTransform, 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
 

Field Detail

titleFont

public static java.awt.Font titleFont

label

protected java.lang.String label

bounds

protected java.awt.geom.Rectangle2D.Double bounds

activeBounds

protected java.awt.geom.Rectangle2D.Double activeBounds
Constructor Detail

LiteNode

public LiteNode()

LiteNode

public LiteNode(java.lang.String lbl,
                boolean hasExtIn,
                boolean hasExtOut)

LiteNode

public LiteNode(java.lang.String lbl,
                boolean hasExtIn,
                boolean hasExtOut,
                boolean isMissing)
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 LiteNode and if it shares the same parent with this object.

Specified by:
canUniteWith in interface Uniteable

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

getActiveBounds

public java.awt.geom.Rectangle2D getActiveBounds()
Overrides:
getActiveBounds in class Lite

getAssociatedLinks

public java.util.Vector getAssociatedLinks()
Returns the links attached to the slots of this node.


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

getIns

public LiteSlot[] getIns()

getLabel

public java.lang.String getLabel()

getLiteInSlots

public LiteInSlots getLiteInSlots()

getLiteOutSlots

public LiteOutSlots getLiteOutSlots()

getOuts

public LiteSlot[] getOuts()

getShadow

public java.awt.Shape getShadow()
Description copied from class: Lite
Returns this lite's own shadow, WITHOUT its children's shadows.

By default, this method returns null. If you want your object to cast shadows, subclass it and return your shadow's shape (the most simple is getBounds()). Be careful : your shadow must stay inside lite's bounds.

Overrides:
getShadow in class Lite

getSlot

public LiteSlot getSlot(java.lang.String lbl)

getUnionInstance

public LiteUnion getUnionInstance()
Returns an instance of LiteNodeUnion.

Specified by:
getUnionInstance in interface Uniteable

hasExternalInput

public boolean hasExternalInput()

hasExternalOutput

public boolean hasExternalOutput()

invalidate

public void invalidate()

getAssociatedShortcuts

public java.util.Vector getAssociatedShortcuts()

isMissing

public boolean isMissing()

migrateBack

public void migrateBack()
Also calls fitParent() on all associated links

Overrides:
migrateBack in class Lite
See Also:
Lite.migrateTo(fr.emn.lite.LiteContainer)

migrateTo

public void migrateTo(LiteContainer newParent)
Also calls fitParent() on all associated links

Overrides:
migrateTo in class Lite
Parameters:
newParent - fr.emn.lite.Lite
See Also:
Lite.migrateBack()

setExternal

public void setExternal(boolean in,
                        boolean out)

setLabel

public void setLabel(java.lang.String label)

setExpanded

public void setExpanded(boolean expand)

isExpanded

public boolean isExpanded()