Together Workflow Editor 3.0-1 API

org.enhydra.jawe.components.graph
Class Graph

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byorg.jgraph.JGraph
                  extended byorg.enhydra.jawe.components.graph.Graph
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable

public class Graph
extends org.jgraph.JGraph

Standard implementation of JGraph. Represents a WorkflowProcess or ActivitySet graph.

Author:
Sasa Bojanic
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.jgraph.JGraph
org.jgraph.JGraph.EmptySelectionModel, org.jgraph.JGraph.GraphSelectionRedirector
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  org.enhydra.shark.xpdl.elements.ActivitySet as
           
protected  GraphController graphController
           
protected  GraphManager graphManager
          WorkflowManager that controls various things
protected  org.enhydra.shark.xpdl.elements.WorkflowProcess wp
           
 
Fields inherited from class org.jgraph.JGraph
antiAliased, ANTIALIASED_PROPERTY, bendable, cloneable, connectable, CROSS_GRID_MODE, disconnectable, disconnectOnMove, DOT_GRID_MODE, dragEnabled, dropEnabled, editable, EDITABLE_PROPERTY, editClickCount, enabled, GRAPH_LAYOUT_CACHE_PROPERTY, GRAPH_MODEL_PROPERTY, graphLayoutCache, graphModel, GRID_COLOR_PROPERTY, GRID_SIZE_PROPERTY, GRID_VISIBLE_PROPERTY, gridColor, gridEnabled, gridMode, gridSize, gridVisible, HANDLE_COLOR_PROPERTY, HANDLE_SIZE_PROPERTY, handleColor, handleSize, highlightColor, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, isJumpToDefaultPort, isMoveIntoGroups, isMoveOutOfGroups, LINE_GRID_MODE, LOCKED_HANDLE_COLOR_PROPERTY, lockedHandleColor, marquee, MARQUEE_HANDLER_PROPERTY, marqueeColor, minimumMove, moveable, moveBelowZero, PORTS_SCALED_PROPERTY, PORTS_VISIBLE_PROPERTY, portsScaled, portsVisible, previewInvalidNullPorts, scale, SCALE_PROPERTY, SELECTION_MODEL_PROPERTY, selectionEnabled, SELECTIONENABLED_PROPERTY, selectionModel, selectionRedirector, sizeable, tolerance, VERSION
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Graph(Graph g)
           
Graph(GraphController gc, org.jgraph.graph.GraphModel model, org.jgraph.graph.BasicMarqueeHandler mh, org.enhydra.shark.xpdl.elements.ActivitySet as)
           
Graph(GraphController gc, org.jgraph.graph.GraphModel model, org.jgraph.graph.BasicMarqueeHandler mh, org.enhydra.shark.xpdl.elements.WorkflowProcess wp)
          Constructs process graph based on a given model.
Graph(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphLayoutCache view)
           
 
Method Summary
static void addSampleData(org.jgraph.graph.GraphModel model)
          Overrides super method - don't need to waste a time for this.
 java.util.List checkConnections(boolean fullCheck)
           
 void clearXPDLObjectReferences()
           
 java.lang.String convertValueToString(java.lang.Object value)
          Overrides Superclass method.
protected  GraphManager createGraphManager()
           
 org.enhydra.shark.xpdl.elements.ActivitySet getActivitySet()
           
 java.lang.Object getFirstParticipantForLocation(int x, int y)
          Finds the topmost Participant at specified location.
 GraphController getGraphController()
           
 WorkflowElement getGraphInterface(org.enhydra.shark.xpdl.XMLElement el)
           
 GraphManager getGraphManager()
           
 java.util.Set getImproperlyConnectedEnds(boolean fullCheck)
           
 java.util.Set getImproperlyConnectedStarts(boolean fullCheck)
           
 org.jgraph.graph.CellView getNextViewAt(org.jgraph.graph.CellView[] cells, org.jgraph.graph.CellView c, double x, double y)
          Modified from original to suite our needs.
 org.jgraph.graph.CellView getNextViewAt(org.jgraph.graph.CellView current, double x, double y)
          Modified from original to support all views
private  org.jgraph.graph.CellView[] getOrderedAllSelectableCells()
          This method gets all selectable views and puts it in an order that suites to our needs (first comes activities and transitions(edges), and then Participants sorted by level - root Participants comes last)
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
          Overrides JComponent's getToolTipText method in order to allow the graph controller to create a tooltip for the topmost cell under the mousepointer.
 org.enhydra.shark.xpdl.elements.WorkflowProcess getWorkflowProcess()
           
 org.enhydra.shark.xpdl.XMLCollectionElement getXPDLObject()
           
protected  void init(GraphController gc, org.jgraph.graph.GraphModel model, org.jgraph.graph.BasicMarqueeHandler mh, org.enhydra.shark.xpdl.XMLCollectionElement wpOrAs)
           
 void initGraphBehavior()
           
 void printOrderedAllSelectables()
          Only for debugging purpose.
 void refreshGraphConfiguration()
           
 WorkflowElement selectActivity(org.enhydra.shark.xpdl.elements.Activity act, boolean add)
           
 WorkflowElement selectBubble(org.enhydra.shark.xpdl.elements.ExtendedAttribute ea, boolean add)
           
 void selectElement(WorkflowElement we, boolean add, boolean toFront)
           
 void selectElements(java.lang.Object[] elements, boolean add, boolean toFront)
           
 WorkflowElement selectParticipant(org.enhydra.shark.xpdl.elements.Participant par)
           
 WorkflowElement selectTransition(org.enhydra.shark.xpdl.elements.Transition tra, boolean add)
           
protected  void setFontSize()
           
 java.lang.String toString()
           
 void updateUI()
          Notification from the UIManager that the L&F has changed.
 boolean validateAgainsXPDLSchema()
           
 
Methods inherited from class org.jgraph.JGraph
addGraphSelectionListener, addSelectionCell, addSelectionCells, cancelEditing, clearSelection, cloneCells, createBounds, fireValueChanged, fromScreen, fromScreen, getAttributes, getCellBounds, getCellBounds, getDefaultPortForCell, getDescendants, getEditClickCount, getEditingCell, getFirstCellForLocation, getGraphLayoutCache, getGridColor, getGridMode, getGridSize, getHandleColor, getHandleSize, getHighlightColor, getImage, getInvokesStopCellEditing, getLeafViewAt, getLockedHandleColor, getMarqueeColor, getMarqueeHandler, getMinimumMove, getModel, getNextCellForLocation, getNextSelectableViewAt, getNextViewAt, getNextViewAt, getPortForLocation, getPortViewAt, getPreferredScrollableViewportSize, getRoots, getRoots, getScale, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectionCell, getSelectionCells, getSelectionCells, getSelectionCount, getSelectionModel, getTolerance, getTopmostViewAt, getUI, getUIClassID, graphDidChange, isAntiAliased, isBendable, isCellEditable, isCellSelected, isCloneable, isConnectable, isDisconnectable, isDisconnectOnMove, isDragEnabled, isDropEnabled, isEditable, isEditing, isGridEnabled, isGridVisible, isJumpToDefaultPort, isMoveable, isMoveBelowZero, isMoveIntoGroups, isMoveOutOfGroups, isPortsScaled, isPortsVisible, isPreviewInvalidNullPorts, isSelectionEmpty, isSelectionEnabled, isSizeable, main, order, paramString, removeGraphSelectionListener, removeSelectionCell, scrollCellToVisible, scrollPointToVisible, setAntiAliased, setBendable, setCloneable, setConnectable, setDisconnectable, setDisconnectOnMove, setDragEnabled, setDropEnabled, setEditable, setEditClickCount, setGraphLayoutCache, setGridColor, setGridEnabled, setGridMode, setGridSize, setGridVisible, setHandleColor, setHandleSize, setHighlightColor, setInvokesStopCellEditing, setJumpToDefaultPort, setLockedHandleColor, setMarqueeColor, setMarqueeHandler, setMinimumMove, setModel, setMoveable, setMoveBelowZero, setMoveIntoGroups, setMoveOutOfGroups, setPortsScaled, setPortsVisible, setPreviewInvalidNullPorts, setScale, setSelectionCell, setSelectionCells, setSelectionEnabled, setSelectionModel, setSizeable, setTolerance, setUI, snap, snap, snap, startEditingAtCell, stopEditing, toScreen, toScreen, updateAutoSize
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.accessibility.Accessible
getAccessibleContext
 

Field Detail

wp

protected org.enhydra.shark.xpdl.elements.WorkflowProcess wp

as

protected org.enhydra.shark.xpdl.elements.ActivitySet as

graphManager

protected transient GraphManager graphManager
WorkflowManager that controls various things


graphController

protected GraphController graphController
Constructor Detail

Graph

public Graph(GraphController gc,
             org.jgraph.graph.GraphModel model,
             org.jgraph.graph.BasicMarqueeHandler mh,
             org.enhydra.shark.xpdl.elements.WorkflowProcess wp)
Constructs process graph based on a given model.


Graph

public Graph(GraphController gc,
             org.jgraph.graph.GraphModel model,
             org.jgraph.graph.BasicMarqueeHandler mh,
             org.enhydra.shark.xpdl.elements.ActivitySet as)

Graph

public Graph(org.jgraph.graph.GraphModel model,
             org.jgraph.graph.GraphLayoutCache view)

Graph

public Graph(Graph g)
Method Detail

getGraphController

public GraphController getGraphController()

init

protected void init(GraphController gc,
                    org.jgraph.graph.GraphModel model,
                    org.jgraph.graph.BasicMarqueeHandler mh,
                    org.enhydra.shark.xpdl.XMLCollectionElement wpOrAs)

createGraphManager

protected GraphManager createGraphManager()

getGraphManager

public GraphManager getGraphManager()

getWorkflowProcess

public org.enhydra.shark.xpdl.elements.WorkflowProcess getWorkflowProcess()

getActivitySet

public org.enhydra.shark.xpdl.elements.ActivitySet getActivitySet()

getXPDLObject

public org.enhydra.shark.xpdl.XMLCollectionElement getXPDLObject()

selectActivity

public WorkflowElement selectActivity(org.enhydra.shark.xpdl.elements.Activity act,
                                      boolean add)

selectTransition

public WorkflowElement selectTransition(org.enhydra.shark.xpdl.elements.Transition tra,
                                        boolean add)

selectParticipant

public WorkflowElement selectParticipant(org.enhydra.shark.xpdl.elements.Participant par)

selectBubble

public WorkflowElement selectBubble(org.enhydra.shark.xpdl.elements.ExtendedAttribute ea,
                                    boolean add)

selectElement

public void selectElement(WorkflowElement we,
                          boolean add,
                          boolean toFront)

getGraphInterface

public WorkflowElement getGraphInterface(org.enhydra.shark.xpdl.XMLElement el)

selectElements

public void selectElements(java.lang.Object[] elements,
                           boolean add,
                           boolean toFront)

convertValueToString

public java.lang.String convertValueToString(java.lang.Object value)
Overrides Superclass method.


getFirstParticipantForLocation

public java.lang.Object getFirstParticipantForLocation(int x,
                                                       int y)
Finds the topmost Participant at specified location.


getNextViewAt

public org.jgraph.graph.CellView getNextViewAt(org.jgraph.graph.CellView current,
                                               double x,
                                               double y)
Modified from original to support all views


getNextViewAt

public org.jgraph.graph.CellView getNextViewAt(org.jgraph.graph.CellView[] cells,
                                               org.jgraph.graph.CellView c,
                                               double x,
                                               double y)
Modified from original to suite our needs. This method makes a Participant to be selected only when it's name part is pressed, and to give it's tooltip only when you want to insert some cells in it.


getOrderedAllSelectableCells

private org.jgraph.graph.CellView[] getOrderedAllSelectableCells()
This method gets all selectable views and puts it in an order that suites to our needs (first comes activities and transitions(edges), and then Participants sorted by level - root Participants comes last)


printOrderedAllSelectables

public void printOrderedAllSelectables()
Only for debugging purpose.


getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Overrides JComponent's getToolTipText method in order to allow the graph controller to create a tooltip for the topmost cell under the mousepointer. This differs from JTree where the renderers tooltip is used.

NOTE: For JGraph to properly display tooltips of its renderers, JGraph must be a registered component with the ToolTipManager. This can be done by invoking ToolTipManager.sharedInstance().registerComponent(graph). This is not done automatically!

Parameters:
event - the MouseEvent that initiated the ToolTip display
Returns:
a string containing the tooltip or null if event is null

validateAgainsXPDLSchema

public boolean validateAgainsXPDLSchema()

initGraphBehavior

public void initGraphBehavior()

refreshGraphConfiguration

public void refreshGraphConfiguration()

setFontSize

protected void setFontSize()

addSampleData

public static void addSampleData(org.jgraph.graph.GraphModel model)
Overrides super method - don't need to waste a time for this.


updateUI

public void updateUI()
Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager. Subclassers can override this to support different GraphUIs.

See Also:
JComponent.updateUI()

toString

public java.lang.String toString()

checkConnections

public java.util.List checkConnections(boolean fullCheck)

getImproperlyConnectedStarts

public java.util.Set getImproperlyConnectedStarts(boolean fullCheck)

getImproperlyConnectedEnds

public java.util.Set getImproperlyConnectedEnds(boolean fullCheck)

clearXPDLObjectReferences

public void clearXPDLObjectReferences()

Together Workflow Editor 3.0-1 API