public class DiagramWorkflowNode
extends javax.swing.JPanel
implements java.lang.Comparable
This class holds a single node in the diagram
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected int |
centerPoint |
protected static java.awt.Image |
errorImage |
protected java.awt.Image |
image |
protected javax.swing.JLabel |
imageLabel |
protected java.util.TreeSet |
inRels |
protected boolean |
inToolbar |
protected WorkflowNode |
node |
protected java.util.TreeSet |
outRels |
protected int |
scale |
protected java.awt.Color |
selectedBackground |
protected java.awt.Color |
selectedForeground |
protected boolean |
state |
protected javax.swing.JLabel |
textLabel |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DiagramWorkflowNode(WorkflowNode node,
int scale)
Constructs a diagram node
|
DiagramWorkflowNode(WorkflowNode node,
int scale,
boolean inToolbar)
Constructs a diagram node
|
Modifier and Type | Method and Description |
---|---|
void |
addIncomingRelationship(WorkflowRelationship rel)
Adds an incoming relationship to the node
|
void |
addOutgoingRelationship(WorkflowRelationship rel)
Adds an outgoing relationship to the node
|
int |
compareTo(java.lang.Object o)
Compares 2 nodes for the Comparable interface
|
protected void |
draw(java.awt.Graphics g)
Draws the node onto a graphics context.
|
boolean |
equals(java.lang.Object o) |
protected javax.swing.Icon |
generateErrorIcon()
Generates the icon for the image label
|
protected javax.swing.Icon |
generateIcon()
Generates the icon for the image label
|
int |
getCenterPoint()
Gets the center point for the line connections
|
int |
getColumn()
Gets the column
|
java.util.Vector |
getIncomingRelationships()
Gets the incoming relationships
|
java.util.Vector |
getOutgoingRelationships()
Gets the outgoing relationships
|
int |
getRelationshipLocation(WorkflowRelationship rel,
boolean incoming)
Gets the location of the relationship amoung the incoming/outgoing
relationships
|
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 |
isFocusTraversable()
Indentifies whether the component can receive focus
|
boolean |
isIndexUsed(int index,
boolean incoming)
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(WorkflowRelationship rel)
Removes an incoming relationship from the node
|
void |
removeOutgoingRelationship(WorkflowRelationship rel)
Removes an outgoing relationship from the node
|
void |
setBackground(java.awt.Color background)
Sets the background color
|
static void |
setErrorIcon(javax.swing.Icon errorIcon)
Sets the error icon for the class
|
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
|
java.lang.String |
toString()
Returns the string representation of the node
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocusUpCycle
protected WorkflowNode node
protected java.util.TreeSet inRels
protected java.util.TreeSet outRels
protected javax.swing.JLabel imageLabel
protected javax.swing.JLabel textLabel
protected int centerPoint
protected int scale
protected boolean state
protected java.awt.Color selectedForeground
protected java.awt.Color selectedBackground
protected boolean inToolbar
protected java.awt.Image image
protected static java.awt.Image errorImage
public DiagramWorkflowNode(WorkflowNode node, int scale)
node
- The workflow nodescale
- The percentage scalepublic DiagramWorkflowNode(WorkflowNode node, int scale, boolean inToolbar)
node
- The workflow nodescale
- The percentage scaleinToolbar
- If true it is to be shown in a toolbarprotected javax.swing.Icon generateIcon()
protected javax.swing.Icon generateErrorIcon()
public void setFont(java.awt.Font font)
setFont
in class javax.swing.JComponent
font
- The forn to setpublic WorkflowNode getWorkflowNode()
public boolean isSuccessorOf(DiagramWorkflowNode dnode)
dnode
- The node to testpublic void addIncomingRelationship(WorkflowRelationship rel)
rel
- The incoming relationshippublic void removeIncomingRelationship(WorkflowRelationship rel)
rel
- The incoming relationshippublic void addOutgoingRelationship(WorkflowRelationship rel)
rel
- The outgoing relationshippublic void removeOutgoingRelationship(WorkflowRelationship rel)
rel
- The outgoing relationshippublic java.util.Vector getIncomingRelationships()
public java.util.Vector getOutgoingRelationships()
public int getRelationshipLocation(WorkflowRelationship rel, boolean incoming)
rel
- The relationship to findincoming
- If true look in the incoming else the outgoingpublic boolean isIndexUsed(int index, boolean incoming)
index
- The index to testincoming
- If true look in the incoming else the outgoingpublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- The object to compare topublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int getColumn()
public int getRow()
public int getCenterPoint()
public void setSelected(boolean state)
state
- the selection statepublic void setBackground(java.awt.Color background)
setBackground
in class javax.swing.JComponent
background
- 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.Component
protected void draw(java.awt.Graphics g)
g
- The graphics contextpublic boolean isFocusTraversable()
isFocusTraversable
in class java.awt.Component
public static void setErrorIcon(javax.swing.Icon errorIcon)
errorIcon
- The error icon