de.unihalle.informatik.Alida.grappa
Class ALDGrappaWorkbenchTab

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JScrollPane
                  extended by com.mxgraph.swing.mxGraphComponent
                      extended by de.unihalle.informatik.Alida.grappa.ALDGrappaWorkbenchTab
All Implemented Interfaces:
ALDWorkflowEventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.ScrollPaneConstants

public class ALDGrappaWorkbenchTab
extends com.mxgraph.swing.mxGraphComponent
implements ALDWorkflowEventListener

Grappa workflow graph component.

Author:
Birgit Moeller
See Also:
Serialized Form

Nested Class Summary
protected  class ALDGrappaWorkbenchTab.ContextMenuGraph
          Context menu for whole workbench.
protected  class ALDGrappaWorkbenchTab.ContextMenuNodeEdge
          Context menu of nodes.
protected  class ALDGrappaWorkbenchTab.GraphEventListener
          Event handler for mxGraph events.
protected  class ALDGrappaWorkbenchTab.GraphKeyListener
           
protected  class ALDGrappaWorkbenchTab.GraphMouseAdapter
          MouseListener for the workbench.
protected  class ALDGrappaWorkbenchTab.ParameterChangeListener
           
protected  class ALDGrappaWorkbenchTab.WorkflowModifyAction
           
 
Nested classes/interfaces inherited from class com.mxgraph.swing.mxGraphComponent
com.mxgraph.swing.mxGraphComponent.mxGraphControl, com.mxgraph.swing.mxGraphComponent.mxMouseRedirector
 
Nested classes/interfaces inherited from class javax.swing.JScrollPane
javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.util.HashMap<ALDWorkflowID,ALDGrappaWorkbenchTab.WorkflowModifyAction> actionsOnWorkflow
          List of actions performed on the Alida workflow object.
protected  ALDWorkflow alidaWorkflow
          Reference to the underlying Alida workflow object.
protected  java.util.HashMap<com.mxgraph.model.mxCell,ALDOperatorConfigurationFrame> configWindows
          Map of node cells and their corresponding configuration windows.
private  boolean debug
          for debug message to stdout
protected  java.util.HashMap<com.mxgraph.model.mxCell,ALDWorkflowEdgeID> graphEdgeIDs
          Map of edge cells and their corresponding Alida workflow IDs.
protected  java.util.HashMap<ALDWorkflowEdgeID,com.mxgraph.model.mxCell> graphEdges
          Map of Alida workflow IDs and their corresponding edge cells.
protected  java.util.HashMap<com.mxgraph.model.mxCell,ALDWorkflowNodeID> graphNodeIDs
          Map of node cells and their corresponding Alida workflow IDs.
protected  java.util.HashMap<ALDWorkflowNodeID,com.mxgraph.model.mxCell> graphNodes
          Map of Alida workflow IDs and their corresponding node cells.
protected  javax.swing.JFrame interruptWin
          Message window shown while workflow execution is aborted.
protected  ALDGrappaWorkbench workBench
          Reference to the surrounding work bench object.
protected  java.lang.String workflowTitle
          Title of this workflow as shown on the tab.
 
Fields inherited from class com.mxgraph.swing.mxGraphComponent
antiAlias, autoExtend, autoScroll, backgroundImage, canvas, cellEditor, centerPage, centerZoom, collapsedIcon, components, connectionHandler, DEFAULT_COLLAPSED_ICON, DEFAULT_EXPANDED_ICON, DEFAULT_PAGESCALE, DEFAULT_WARNING_ICON, dragEnabled, enterStopsCellEditing, escapeEnabled, eventSource, expandedIcon, exportEnabled, foldingEnabled, graph, graphControl, graphHandler, GRID_STYLE_CROSS, GRID_STYLE_DASHED, GRID_STYLE_DOT, GRID_STYLE_LINE, gridColor, gridStyle, gridVisible, horizontalPageCount, importEnabled, invokesStopCellEditing, keepSelectionVisibleOnZoom, overlays, pageBackgroundColor, pageBorderColor, pageBreakColor, pageBreaksVisible, pageFormat, pageScale, pageShadowColor, pageVisible, panningHandler, preferPageSize, previewAlpha, repaintHandler, scaleHandler, selectionCellsHandler, showDirtyRectangle, swimlaneSelectionEnabled, textAntiAlias, tolerance, transparentSwimlaneContent, tripleBuffer, tripleBuffered, tripleBufferGraphics, updateHandler, verticalPageCount, viewChangeHandler, warningIcon, ZOOM_POLICY_NONE, ZOOM_POLICY_PAGE, ZOOM_POLICY_WIDTH, zoomFactor, zoomPolicy
 
Fields inherited from class javax.swing.JScrollPane
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
 
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.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface javax.swing.ScrollPaneConstants
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ALDGrappaWorkbenchTab(ALDGrappaWorkbench bench, ALDGrappaWorkbenchGraph _graph)
          Default constructor.
ALDGrappaWorkbenchTab(ALDGrappaWorkbench bench, com.mxgraph.view.mxGraph _graph, ALDWorkflow _flow)
          Constructor to setup tab from given (reloaded) workflow.
 
Method Summary
protected  void copyWorkflowNodeLinksOnly(ALDOperator srcOp, com.mxgraph.model.mxCell srcNode, ALDOperator newOp, int posX, int posY)
          Copies only the links of a workflow node to a new node of same type.
protected  void createNewWorkflowEdge(com.mxgraph.model.mxCell edge, ALDWorkflowNodeID sourceNodeID, ALDGrappaNodePortInfo sourcePort, ALDWorkflowNodeID targetNodeID, ALDGrappaNodePortInfo targetPort)
          Adds a new edge object to the graph.
protected  void createNewWorkflowNode(ALDOperatorLocation loc, int posX, int posY)
          Creates a new workflow node.
protected  ALDOperatorConfigurationFrame getNewConfigWin(ALDOperator op)
          Generate a new configuration window.
protected static java.lang.String getNodeStyleString(java.lang.String color)
          Method to properly format node style string.
 java.lang.String getTooltipText(java.lang.Object cell)
          Function to return tooltip text for a cell.
 java.lang.String getWorkflowTitle()
          Returns the workflow title.
protected  void handleAddNodeEvent(ALDOperator op, ALDWorkflowNodeID id, int posX, int posY)
          Adds a node to the workflow graph.
 void handleALDWorkflowEvent(ALDWorkflowEvent event)
          Method which is called on event occurrence.
protected  void handleNodeParameterChangeEvent(java.util.Collection<ALDWorkflowNodeID> idList)
          Update node color according to node's state.
protected  void handleNodeStateChangeEvent(java.util.Collection<ALDWorkflowNodeID> idList)
          Update node color according to node's state.
protected  void handleSaveWorkflowEvent(java.lang.String file)
          Stores the workflow to the given file.
protected  void handleShowResultsEvent(ALDWorkflowNodeID nodeID)
          Displays result frame for given node.
protected  void initInterruptWin()
          Setup of the window for renaming workflows.
 void interruptExecution()
          Aborts running execution of the workflow.
protected  void processWorkflowEventQueue()
          Processes all events that were recently added to the queue.
 void quit()
          Does clean-up on termination, i.e. closes all open windows.
protected  void redirectWorkflowEdge(com.mxgraph.model.mxCell edge, ALDWorkflowEdgeID id, ALDWorkflowNodeID sourceNodeID, ALDWorkflowNodeID targetNodeID, ALDGrappaNodePortInfo sourcePort, ALDGrappaNodePortInfo targetPort)
          Redirects the workflow edge.
protected  void removeWorkflowEdge(com.mxgraph.model.mxCell edge)
          Removes the specified edge from the workflow.
protected  void removeWorkflowNode(com.mxgraph.model.mxCell node)
          Removes the specified cell from the graph.
protected  void restoreConfigWins()
          Instantiates for each node in the current workflow a configuration window.
protected  void restoreIDs()
          Restore maps of Alida workflow IDs and corresponding graph cells.
 void runWorkflow()
          Executes the complete workflow, i.e. all nodes currently present.
 void runWorkflowFromNode(ALDWorkflowNodeID nodeID)
          Executes the workflow from the specified node to the end.
 void runWorkflowNode(ALDWorkflowNodeID nodeID)
          Executes the workflow up to the specified node.
 void saveWorkflow(java.io.File file)
          Saves the workflow to the given file.
protected  void setWorkflowNodeViewMode(com.mxgraph.model.mxCell cell, Parameter.ExpertMode mode)
          Switches the mode for displaying parameters of a node.
 void setWorkflowTitle(java.lang.String newTitle)
          Changes the workflow title.
protected  void updateWorkflowNodeStates()
          Checks the states of all nodes and updates their color.
 
Methods inherited from class com.mxgraph.swing.mxGraphComponent
addCellOverlay, addListener, canExportCell, canImportCell, checkTripleBuffer, clearCellOverlays, clearCellOverlays, createCanvas, createCellEditor, createComponents, createConnectionHandler, createGraphControl, createGraphHandler, createHandler, createHandlers, createPanningHandler, createSelectionCellsHandler, createTransferHandler, createTripleBuffer, destroyTripleBuffer, escape, getBackgroundImage, getCanvas, getCellAt, getCellAt, getCellAt, getCellEditor, getCellOverlays, getCells, getCells, getConnectionHandler, getEditingValue, getExportableCells, getFoldingIcon, getFoldingIconBounds, getGraph, getGraphControl, getGraphHandler, getGridColor, getGridStyle, getHorizontalPageBorder, getHorizontalPageCount, getImportableCells, getLayoutAreaSize, getPageBackgroundColor, getPageBorderColor, getPageBreakColor, getPageFormat, getPageScale, getPageShadowColor, getPageTranslate, getPanningHandler, getPointForEvent, getPointForEvent, getPreferredSizeForPage, getPreviewAlpha, getScaledPreferredSizeForGraph, getSelectionCellsHandler, getTolerance, getTripleBuffer, getVerticalPageBorder, getVerticalPageCount, getZoomFactor, getZoomPolicy, hitFoldingIcon, importCells, insertComponent, installDoubleClickHandler, installFocusHandler, installKeyHandler, installResizeHandler, isAntiAlias, isAutoExtend, isAutoScroll, isCenterPage, isCenterZoom, isCloneEvent, isConnectable, isConstrainedEvent, isDragEnabled, isEditEvent, isEditing, isEnterStopsCellEditing, isEscapeEnabled, isEventsEnabled, isExportEnabled, isFoldingEnabled, isForceMarqueeEvent, isForceTripleBuffered, isGridEnabledEvent, isGridVisible, isImportEnabled, isInvokesStopCellEditing, isKeepSelectionVisibleOnZoom, isPageBreaksVisible, isPageVisible, isPanning, isPanningEvent, isPreferPageSize, isSignificant, isSwimlaneSelectionEnabled, isTextAntiAlias, isToggleEvent, isTripleBuffered, labelChanged, maintainScrollBar, paintBackground, paintBackgroundImage, paintBackgroundPage, paintGrid, print, redraw, refresh, removeAllComponents, removeAllOverlays, removeCellOverlay, removeCellOverlayComponent, removeCellOverlays, removeComponent, removeListener, removeListener, repaintTripleBuffer, scrollCellToVisible, scrollCellToVisible, scrollToCenter, selectCellForEvent, selectCellsForEvent, selectRegion, setAntiAlias, setAutoExtend, setAutoScroll, setBackgroundImage, setCellEditor, setCellWarning, setCellWarning, setCellWarning, setCenterPage, setCenterZoom, setConnectable, setDragEnabled, setEnterStopsCellEditing, setEscapeEnabled, setEventsEnabled, setExportEnabled, setFoldingEnabled, setGraph, setGridColor, setGridStyle, setGridVisible, setHorizontalPageCount, setImportEnabled, setInvokesStopCellEditing, setKeepSelectionVisibleOnZoom, setPageBackgroundColor, setPageBorderColor, setPageBreakColor, setPageBreaksVisible, setPageFormat, setPageScale, setPageShadowColor, setPageVisible, setPanning, setPreferPageSize, setPreviewAlpha, setSwimlaneSelectionEnabled, setTextAntiAlias, setTolerance, setToolTips, setTripleBuffered, setVerticalPageCount, setZoomFactor, setZoomPolicy, snapScaledPoint, snapScaledPoint, startEditing, startEditingAtCell, startEditingAtCell, stopEditing, updateCellOverlayComponent, updateCellOverlays, updateComponent, updateComponents, updateComponents, validateGraph, validateGraph, zoom, zoom, zoomActual, zoomAndCenter, zoomIn, zoomOut, zoomTo
 
Methods inherited from class javax.swing.JScrollPane
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI
 
Methods inherited from class javax.swing.JComponent
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, 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, 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, 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, hide, 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, 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, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

actionsOnWorkflow

protected java.util.HashMap<ALDWorkflowID,ALDGrappaWorkbenchTab.WorkflowModifyAction> actionsOnWorkflow
List of actions performed on the Alida workflow object.


alidaWorkflow

protected ALDWorkflow alidaWorkflow
Reference to the underlying Alida workflow object.


configWindows

protected java.util.HashMap<com.mxgraph.model.mxCell,ALDOperatorConfigurationFrame> configWindows
Map of node cells and their corresponding configuration windows.


debug

private boolean debug
for debug message to stdout


graphEdgeIDs

protected java.util.HashMap<com.mxgraph.model.mxCell,ALDWorkflowEdgeID> graphEdgeIDs
Map of edge cells and their corresponding Alida workflow IDs.


graphEdges

protected java.util.HashMap<ALDWorkflowEdgeID,com.mxgraph.model.mxCell> graphEdges
Map of Alida workflow IDs and their corresponding edge cells.


graphNodeIDs

protected java.util.HashMap<com.mxgraph.model.mxCell,ALDWorkflowNodeID> graphNodeIDs
Map of node cells and their corresponding Alida workflow IDs.


graphNodes

protected java.util.HashMap<ALDWorkflowNodeID,com.mxgraph.model.mxCell> graphNodes
Map of Alida workflow IDs and their corresponding node cells.


interruptWin

protected javax.swing.JFrame interruptWin
Message window shown while workflow execution is aborted.


workBench

protected ALDGrappaWorkbench workBench
Reference to the surrounding work bench object.


workflowTitle

protected java.lang.String workflowTitle
Title of this workflow as shown on the tab.

Constructor Detail

ALDGrappaWorkbenchTab

public ALDGrappaWorkbenchTab(ALDGrappaWorkbench bench,
                             ALDGrappaWorkbenchGraph _graph)
Default constructor.


ALDGrappaWorkbenchTab

public ALDGrappaWorkbenchTab(ALDGrappaWorkbench bench,
                             com.mxgraph.view.mxGraph _graph,
                             ALDWorkflow _flow)
Constructor to setup tab from given (reloaded) workflow.

Method Detail

copyWorkflowNodeLinksOnly

protected void copyWorkflowNodeLinksOnly(ALDOperator srcOp,
                                         com.mxgraph.model.mxCell srcNode,
                                         ALDOperator newOp,
                                         int posX,
                                         int posY)
Copies only the links of a workflow node to a new node of same type.

Parameters:
srcOp - Source node operator which is to be copied.
srcNode - Source node to be copied.
newOp - New operator instantiated from source operator.
posX - x position where to place the new node.
posY - y position where to place the new node.

createNewWorkflowEdge

protected void createNewWorkflowEdge(com.mxgraph.model.mxCell edge,
                                     ALDWorkflowNodeID sourceNodeID,
                                     ALDGrappaNodePortInfo sourcePort,
                                     ALDWorkflowNodeID targetNodeID,
                                     ALDGrappaNodePortInfo targetPort)
Adds a new edge object to the graph.

Note that according to the event handling of the GUI the edge object has already been inserted into the graph data structure when this function is called. Accordingly this function mainly checks if the insertion was correct, and if not, removes the formerly inserted edge.

Parameters:
edge - Edge object recently inserted.
sourceNodeID - ID of source node.
sourceParameter - Name of source port.
targetNodeID - ID of target node.
targetParameter - Name of target port.

createNewWorkflowNode

protected void createNewWorkflowNode(ALDOperatorLocation loc,
                                     int posX,
                                     int posY)
Creates a new workflow node.

Parameters:
opNamePath - Full path of the underlying operator.
posX - x position where to place the new node.
posY - y position where to place the new node.

getNewConfigWin

protected ALDOperatorConfigurationFrame getNewConfigWin(ALDOperator op)
                                                 throws ALDOperatorException
Generate a new configuration window.

Is to be overwritten by subclasses.

Parameters:
op - Operator for which window is requested.
Returns:
New configuration window.
Throws:
ALDOperatorException

getNodeStyleString

protected static java.lang.String getNodeStyleString(java.lang.String color)
Method to properly format node style string.

Parameters:
color - Color of node boundary.
Returns:
Format string.

getTooltipText

public java.lang.String getTooltipText(java.lang.Object cell)
Function to return tooltip text for a cell.

Parameters:
cell - Cell for which tooltip is requested.
Returns:
Tooltip text.

getWorkflowTitle

public java.lang.String getWorkflowTitle()
Returns the workflow title.

Returns:
Current title of the workflow.

handleAddNodeEvent

protected void handleAddNodeEvent(ALDOperator op,
                                  ALDWorkflowNodeID id,
                                  int posX,
                                  int posY)
Adds a node to the workflow graph.

Parameters:
op - Operator associated with the node.
posX - X-Position of the new node.
posY - Y-Position of the new node.
Throws:
ALDOperatorException

handleALDWorkflowEvent

public void handleALDWorkflowEvent(ALDWorkflowEvent event)
Description copied from interface: ALDWorkflowEventListener
Method which is called on event occurrence.

Specified by:
handleALDWorkflowEvent in interface ALDWorkflowEventListener
Parameters:
event - Event to be handled.

handleNodeParameterChangeEvent

protected void handleNodeParameterChangeEvent(java.util.Collection<ALDWorkflowNodeID> idList)
Update node color according to node's state.

Parameters:
idList - List of nodes that are to be updated.

handleNodeStateChangeEvent

protected void handleNodeStateChangeEvent(java.util.Collection<ALDWorkflowNodeID> idList)
Update node color according to node's state.

Parameters:
idList - List of nodes that are to be updated.

handleSaveWorkflowEvent

protected void handleSaveWorkflowEvent(java.lang.String file)
Stores the workflow to the given file.

Parameters:
file - File where to save the workflow.

handleShowResultsEvent

protected void handleShowResultsEvent(ALDWorkflowNodeID nodeID)
Displays result frame for given node.

Parameters:
nodeID - Node for which results are to be displayed.

initInterruptWin

protected void initInterruptWin()
Setup of the window for renaming workflows.


interruptExecution

public void interruptExecution()
Aborts running execution of the workflow.


processWorkflowEventQueue

protected void processWorkflowEventQueue()
Processes all events that were recently added to the queue.

Note that this function needs to be called after all actions on the Alida workflow except calls to 'run' methods.


quit

public void quit()
Does clean-up on termination, i.e. closes all open windows.


redirectWorkflowEdge

protected void redirectWorkflowEdge(com.mxgraph.model.mxCell edge,
                                    ALDWorkflowEdgeID id,
                                    ALDWorkflowNodeID sourceNodeID,
                                    ALDWorkflowNodeID targetNodeID,
                                    ALDGrappaNodePortInfo sourcePort,
                                    ALDGrappaNodePortInfo targetPort)
Redirects the workflow edge.

Note that due to the event handling of the GUI the edge redirect was already done when this function is called. Thus, this function mainly verifies the redirect and restores the old edge in case of failure.

Parameters:
edge - Edge cell that was redirected.
id - Workflow ID of edge.
sourceNodeID - Current ID of edge source node.
targetNodeID - Current ID of edge target node.
sourceParameter - Current source parameter name.
targetParameter - Current target parameter name.

removeWorkflowEdge

protected void removeWorkflowEdge(com.mxgraph.model.mxCell edge)
Removes the specified edge from the workflow.

Parameters:
edge - Edge cell to remove.

removeWorkflowNode

protected void removeWorkflowNode(com.mxgraph.model.mxCell node)
Removes the specified cell from the graph.

Parameters:
node - Node cell to remove.

restoreConfigWins

protected void restoreConfigWins()
Instantiates for each node in the current workflow a configuration window.


restoreIDs

protected void restoreIDs()
Restore maps of Alida workflow IDs and corresponding graph cells.


runWorkflow

public void runWorkflow()
Executes the complete workflow, i.e. all nodes currently present.


runWorkflowFromNode

public void runWorkflowFromNode(ALDWorkflowNodeID nodeID)
Executes the workflow from the specified node to the end.

Parameters:
nodeID - ID of node where to start execution.

runWorkflowNode

public void runWorkflowNode(ALDWorkflowNodeID nodeID)
Executes the workflow up to the specified node.

Parameters:
nodeID - ID of node where to stop execution.

saveWorkflow

public void saveWorkflow(java.io.File file)
Saves the workflow to the given file.

Parameters:
file - File where to save the workflow.

setWorkflowNodeViewMode

protected void setWorkflowNodeViewMode(com.mxgraph.model.mxCell cell,
                                       Parameter.ExpertMode mode)
Switches the mode for displaying parameters of a node.

Parameters:
mode - Mode to set.

setWorkflowTitle

public void setWorkflowTitle(java.lang.String newTitle)
Changes the workflow title.

Parameters:
newTitle - New title of the workflow.

updateWorkflowNodeStates

protected void updateWorkflowNodeStates()
Checks the states of all nodes and updates their color.