public abstract class AbstractIdNode
extends org.piccolo2d.PNode
An icon bundle image node and name text node are provided by this class but are not added as child nodes. That is left up to the subclass.
This node is backed by a state machine which is responsible
for managing all state transitions. Mouse events are translated
into state transitions by drag and mouseover event handlers. Clients
may fire additional state transitions using methods on this class (see e.g.
enable()
. Invalid state transitions
are ignored.
Subclasses may associate visual properties and behavior with states by providing private no-arg state methods which will be called via reflection on entry by the state machine engine.
For example:
class MyIdNode extends AbstractIdNode { // ... private void normal() { setBackground(Color.WHITE); setForeground(Color.BLACK); } private void selected() { setBackground(Color.BLACK); setForeground(Color.WHITE); } }
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractIdNode.IconBundleImageNode
Icon bundle image node.
|
protected class |
AbstractIdNode.NameTextNode
Name text node.
|
Modifier and Type | Field and Description |
---|---|
static IconSize |
DEFAULT_ICON_SIZE
Default icon size, 32x32.
|
static IconState |
DEFAULT_ICON_STATE
Default icon state, normal.
|
static IconTextDirection |
DEFAULT_ICON_TEXT_DIRECTION
Default icon text direction, left to right.
|
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
NO_SUCH_PAGE, PAGE_EXISTS
Modifier | Constructor and Description |
---|---|
protected |
AbstractIdNode(Object value)
Create a new abstract id node with the specified value.
|
Modifier and Type | Method and Description |
---|---|
void |
deselect()
Fire a
"deselect" state transition event. |
void |
disable()
Fire a
"disable" state transition event. |
void |
enable()
Fire an
"enable" state transition event. |
void |
endDrag()
Fire a
"endDrag" state transition event. |
org.dishevelled.piccolo.identify.AbstractIdNode.DragHandler |
getDragHandler()
Return the drag handler for this id node.
|
protected AbstractIdNode.IconBundleImageNode |
getIconBundleImageNode()
Return the icon bundle image node for this id node.
|
IconSize |
getIconSize()
Return the icon size for this id node.
|
IconState |
getIconState()
Return the icon state for this id node.
|
IconTextDirection |
getIconTextDirection()
Return the icon text direction for this id node.
|
org.dishevelled.piccolo.identify.AbstractIdNode.MouseoverHandler |
getMouseoverHandler()
Return the mouseover handler for this id node.
|
protected AbstractIdNode.NameTextNode |
getNameTextNode()
Return the name text node for this id node.
|
Object |
getValue()
Return the value for this id node.
|
void |
mouseEntered()
Fire a
"mouseEntered" state transition event. |
void |
mouseExited()
Fire a
"mouseExited" state transition event. |
void |
mousePressed()
Fire a
"mousePressed" state transition event. |
void |
mouseReleased()
Fire a
"mouseReleased" state transition event. |
protected void |
resetStateMachine()
Reset the state machine to its "initial" configuration.
|
void |
reverseVideo()
Fire a
"reverseVideo" state transition event. |
void |
select()
Fire a
"select" state transition event. |
void |
setFont(Font font)
Set the font for the name text node to
font . |
void |
setIconSize(IconSize iconSize)
Set the icon size for this id node to
iconSize . |
void |
setIconState(IconState iconState)
Set the icon state for this id node to
iconState . |
void |
setIconTextDirection(IconTextDirection iconTextDirection)
Set the icon text direction for this id node to
iconTextDirection . |
void |
setValue(Object value)
Set the value for this id node to
value . |
void |
startDrag()
Fire a
"startDrag" state transition event. |
addActivity, addAttribute, addChild, addChild, addChildren, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientPropertyKeysEnumeration, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, lower, lower, lowerBelow, lowerToBottom, lowerToBottom, offset, paint, paintAfterChildren, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, print, print, raise, raise, raiseAbove, raiseToTop, raiseToTop, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
public static final IconSize DEFAULT_ICON_SIZE
public static final IconState DEFAULT_ICON_STATE
public static final IconTextDirection DEFAULT_ICON_TEXT_DIRECTION
protected AbstractIdNode(Object value)
value
- value for this id nodepublic final Object getValue()
public final void setValue(Object value)
value
.
This is a bound property.
value
- value for this id nodepublic final IconSize getIconSize()
public final void setIconSize(IconSize iconSize)
iconSize
.
This is a bound property.
iconSize
- icon size for this id node, must not be nullpublic final IconState getIconState()
public final void setIconState(IconState iconState)
iconState
.
This is a bound property.
iconState
- icon state for this id node, must not be nullpublic final IconTextDirection getIconTextDirection()
public final void setIconTextDirection(IconTextDirection iconTextDirection)
iconTextDirection
.
This is a bound property.
iconTextDirection
- icon text direction for this id node, must not be nullpublic final void setFont(Font font)
font
.font
- font for the name text nodeprotected final AbstractIdNode.IconBundleImageNode getIconBundleImageNode()
protected final AbstractIdNode.NameTextNode getNameTextNode()
public final org.dishevelled.piccolo.identify.AbstractIdNode.DragHandler getDragHandler()
public final org.dishevelled.piccolo.identify.AbstractIdNode.MouseoverHandler getMouseoverHandler()
protected final void resetStateMachine()
public final void reverseVideo()
"reverseVideo"
state transition event.public final void enable()
"enable"
state transition event.public final void disable()
"disable"
state transition event.public final void mouseEntered()
"mouseEntered"
state transition event.public final void mouseExited()
"mouseExited"
state transition event.public final void mouseReleased()
"mouseReleased"
state transition event.public final void mousePressed()
"mousePressed"
state transition event.public final void select()
"select"
state transition event.public final void deselect()
"deselect"
state transition event.public final void startDrag()
"startDrag"
state transition event.public final void endDrag()
"endDrag"
state transition event.Copyright (c) 2007-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).