public class DiagramWorkflowNode
extends javax.swing.JPanel
implements java.lang.Comparable
This class holds a single node in the diagram
| Modifier and Type | Field and Description |
|---|---|
static int |
REL_ENTER |
static int |
REL_EXIT |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
DiagramWorkflowNode(WorkflowNode node,
DiagramConfiguration configuration)
Constructs a diagram node
|
DiagramWorkflowNode(WorkflowNode node,
DiagramConfiguration configuration,
boolean inToolbar)
Constructs a diagram node
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIncomingRelationship(DiagramWorkflowRelationship rel)
Adds an incoming relationship to the node
|
void |
addOutgoingRelationship(DiagramWorkflowRelationship rel)
Adds an outgoing relationship to the node
|
int |
compareTo(java.lang.Object o)
Compares 2 nodes for the Comparable interface
|
boolean |
connectedTo(DiagramWorkflowNode dnode,
boolean isNegative)
Returns true if this node is connected to the passed node
by the same line type
|
int |
getCenterPoint()
Gets the center point for the line connections
|
int |
getColumn()
Gets the column
|
java.awt.Cursor |
getCursorFromImage()
Generates the icon for the image label
|
java.util.Vector |
getIncomingRelationships()
Gets the incoming relationships
|
java.awt.Point |
getLocation()
point location
|
java.util.Vector |
getOutgoingRelationships()
Gets the outgoing relationships
|
int |
getRelationshipLocation(DiagramWorkflowRelationship rel,
int type)
Gets the location of the relationship amoung the incoming/outgoing
relationships
|
java.util.Vector |
getRelationships(int type)
Gets the relationships of the passed type
|
int |
getRow()
Gets the row
|
java.awt.Color |
getSelectedBackground()
Gets the selected background color
|
java.awt.Color |
getSelectedForeground()
Gets the selected foreground color
|
WorkflowNode |
getWorkflowNode()
Gets the workflow node for this diagram node
|
boolean |
isIndexUsed(int index,
int type)
Returns true if the index is used and false otherwise
|
boolean |
isSuccessorOf(DiagramWorkflowNode dnode)
Returns true if this node is a successor of the passed node
|
boolean |
moreInomingAllowed()
Returns true if it is possible to have more incoming relationships
|
boolean |
moreOutgoingAllowed()
Returns true if it is possible to have more outgoing relationships
|
void |
removeIncomingRelationship(DiagramWorkflowRelationship rel)
Removes an incoming relationship from the node
|
void |
removeOutgoingRelationship(DiagramWorkflowRelationship rel)
Removes an outgoing relationship from the node
|
void |
setBackground(java.awt.Color background)
Sets the background color
|
void |
setFont(java.awt.Font font)
Sets the font for the label
|
void |
setSelected(boolean state)
Sets the selection state of the node
|
void |
setSelectedBackground(java.awt.Color selectedBackground)
Sets the selected background color
|
void |
setSelectedForeground(java.awt.Color selectedForeground)
Sets the selected foreground color
|
void |
sortRelationships()
Sorts the relationships
|
java.lang.String |
toString()
Returns the string representation of the node
|
getAccessibleContext, getUI, getUIClassID, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int REL_EXIT
public static final int REL_ENTER
public DiagramWorkflowNode(WorkflowNode node, DiagramConfiguration configuration)
node - The workflow nodeconfiguration - The configuration object for the diagrampublic DiagramWorkflowNode(WorkflowNode node, DiagramConfiguration configuration, boolean inToolbar)
node - The workflow nodeconfiguration - The configuration object for the diagraminToolbar - If true it is to be shown in a toolbarpublic java.awt.Cursor getCursorFromImage()
public void setFont(java.awt.Font font)
setFont in class javax.swing.JComponentfont - The forn to setpublic WorkflowNode getWorkflowNode()
public boolean isSuccessorOf(DiagramWorkflowNode dnode)
dnode - The node to testpublic boolean connectedTo(DiagramWorkflowNode dnode, boolean isNegative)
dnode - The node to testisNegative - If true then the new connection is negativepublic void addIncomingRelationship(DiagramWorkflowRelationship rel)
rel - The incoming relationshippublic void removeIncomingRelationship(DiagramWorkflowRelationship rel)
rel - The incoming relationshippublic void addOutgoingRelationship(DiagramWorkflowRelationship rel)
rel - The outgoing relationshippublic void removeOutgoingRelationship(DiagramWorkflowRelationship rel)
rel - The outgoing relationshippublic java.util.Vector getIncomingRelationships()
public java.util.Vector getRelationships(int type)
type - The relationship typepublic java.util.Vector getOutgoingRelationships()
public int getRelationshipLocation(DiagramWorkflowRelationship rel, int type)
rel - The relationship to findtype - Exit/enter typepublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - The object to compare topublic int getColumn()
public int getRow()
public java.awt.Point getLocation()
getLocation in class java.awt.Componentpublic int getCenterPoint()
public void setSelected(boolean state)
state - the selection statepublic void setBackground(java.awt.Color background)
setBackground in class javax.swing.JComponentbackground - The background colorpublic java.awt.Color getSelectedForeground()
public void setSelectedForeground(java.awt.Color selectedForeground)
selectedForeground - The selected foreground colorpublic java.awt.Color getSelectedBackground()
public void setSelectedBackground(java.awt.Color selectedBackground)
selectedBackground - The selected background colorpublic boolean moreInomingAllowed()
public boolean moreOutgoingAllowed()
public java.lang.String toString()
toString in class java.awt.Componentpublic void sortRelationships()
public boolean isIndexUsed(int index,
int type)
index - The index to testtype - If relationship type