public class MainTriana extends javax.swing.JPanel implements TaskGraphPanel, ShowToolPanel, SelectionBoxInterface, IndicationCableInterface, TaskGraphListener, TaskListener, NodeListener, ClipboardActionInterface, ClipboardPasteInterface, ToolSelectionHandler
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MainTriana(TaskGraph taskgraph,
TrianaClient client)
Creates a MainTriana for an OCL session.
|
Modifier and Type | Method and Description |
---|---|
void |
addShowTool(ForShowComponent showtool,
DrawCable cable)
Add a show tool and the cable connecting that showtool
|
void |
addToolSelectionListener(ToolSelectionListener listener)
Adds a listener to be notified when the tool selection changes
|
void |
cableConnected(TaskGraphCableEvent event)
Called when a new connection is made between two tasks.
|
void |
cableDisconnected(TaskGraphCableEvent event)
Called before a connection between two tasks is removed.
|
void |
cableReconnected(TaskGraphCableEvent event)
Called when a connection is reconnected to a different task.
|
void |
clearIndicationCableInterface()
Clears the indication cable
|
void |
clearSelectionBox()
Clears the selection box
|
void |
controlTaskStateChanged(ControlTaskStateEvent event)
Called when the control task is connected/disconnected or unstable
|
void |
copySelected()
Puts the currently selected tasks in the clipboard.
|
void |
copyToClipboard()
Copy selected Tools to the Clipboard.
|
void |
cutSelected()
Puts the currently selected tasks in the clipboard and removes them from the taskgraph
|
void |
cutToClipboard()
Copy selected Tools to the Clipboard and delete them from the Container they are located in.
|
void |
deleteSelected()
Deletes highlighted MainTrianaTools.
|
void |
deleteTools(boolean files)
Delete the selected Tool.
|
void |
dispose()
Dispose and clean-up the taskgraph container
|
void |
drawIndicationCableInterface(java.awt.Component start,
java.awt.Point end)
Sets the start component and endpoint of the indication cable
|
java.awt.Color |
getBackgroundColor() |
java.awt.Color |
getCableColor(Cable cable) |
java.awt.Container |
getContainer() |
NodeComponent |
getIndicationNode() |
TaskLayoutDetails |
getLayoutDetails() |
TaskComponent[] |
getSelectedComponents() |
TaskGraph |
getSelectedTaskgraph() |
Tool |
getSelectedTool() |
Tool[] |
getSelectedTools() |
TrianaClient |
getSelectedTrianaClient() |
java.awt.Dimension |
getSelectionDimension() |
java.awt.Point |
getSelectionOrigin() |
TaskComponent |
getTaskComponent(Task task) |
int |
getTaskComponentCount() |
TaskComponent[] |
getTaskComponents() |
TaskGraph |
getTaskGraph() |
TrianaClient |
getTrianaClient() |
void |
init()
Called by application frame immediately after the Main Triana has been added to a frame, used to initialise the
gui and populate the main triana.
|
boolean |
isSelectionBox() |
boolean |
isSingleSelectedTool() |
void |
nodeAdded(TaskNodeEvent event)
Called when a data input node is added.
|
void |
nodeChildChanged(NodeEvent event)
Called when one of a group node's child changes
|
void |
nodeConnected(NodeEvent event)
Called when a node is connected to a cable.
|
void |
nodeDisconnected(NodeEvent event)
Called before a node is diconnected from a cable.
|
void |
nodeParentChanged(NodeEvent event)
Called when one of a group node's parents changes
|
void |
nodeRemoved(TaskNodeEvent event)
Called before a data input node is removed.
|
void |
paintComponent(java.awt.Graphics graphs)
Overrides the default paint() method and just calls the update method.
|
void |
parameterNameSet(NodeEvent event)
Called when the name of the parameter the node is inputting/outputting is set.
|
void |
parameterUpdated(ParameterUpdateEvent event)
Called when the value of a parameter is changed, including when a parameter is removed.
|
void |
paste()
Adds the tasks stored in the clipboard to the taskgraph
|
void |
pasteFromClipboard()
Paste Tools from the Clipboard to this container.
|
void |
removeShowTool(java.awt.Component showtool)
Remove a show tool and the cable connecting that showtool
|
void |
removeToolSelectionListener(ToolSelectionListener listener)
Removes a listener from being notified when the tool selection changes
|
void |
renameTool()
Rename the selected Tool or Group.
|
void |
setSelectionBox(java.awt.Point origin,
java.awt.Dimension size)
Sets the origin and dimensions of the selection box
|
void |
taskCreated(TaskGraphTaskEvent event)
Called when a new task is created in a taskgraph.
|
void |
taskDisposed(TaskDisposedEvent event)
Called before the task is disposed
|
void |
taskPropertyUpdate(TaskPropertyEvent event)
Called when the core properties of a task change i.e.
|
void |
taskRemoved(TaskGraphTaskEvent event)
Called when a task is removed from a taskgraph.
|
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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
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, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public MainTriana(TaskGraph taskgraph, TrianaClient client)
public void init()
init
in interface TaskGraphPanel
public void addToolSelectionListener(ToolSelectionListener listener)
addToolSelectionListener
in interface ToolSelectionHandler
public void removeToolSelectionListener(ToolSelectionListener listener)
removeToolSelectionListener
in interface ToolSelectionHandler
public java.awt.Container getContainer()
getContainer
in interface TaskGraphPanel
public TaskGraph getTaskGraph()
getTaskGraph
in interface TaskGraphPanel
public TaskLayoutDetails getLayoutDetails()
getLayoutDetails
in interface TaskGraphPanel
public TrianaClient getTrianaClient()
getTrianaClient
in interface TaskGraphPanel
public void addShowTool(ForShowComponent showtool, DrawCable cable)
addShowTool
in interface ShowToolPanel
public void removeShowTool(java.awt.Component showtool)
removeShowTool
in interface ShowToolPanel
public java.awt.Point getSelectionOrigin()
getSelectionOrigin
in interface SelectionBoxInterface
public java.awt.Dimension getSelectionDimension()
getSelectionDimension
in interface SelectionBoxInterface
public boolean isSelectionBox()
isSelectionBox
in interface SelectionBoxInterface
public void setSelectionBox(java.awt.Point origin, java.awt.Dimension size)
setSelectionBox
in interface SelectionBoxInterface
public void clearSelectionBox()
clearSelectionBox
in interface SelectionBoxInterface
public void drawIndicationCableInterface(java.awt.Component start, java.awt.Point end)
drawIndicationCableInterface
in interface IndicationCableInterface
public void clearIndicationCableInterface()
clearIndicationCableInterface
in interface IndicationCableInterface
public NodeComponent getIndicationNode()
getIndicationNode
in interface IndicationCableInterface
public void paintComponent(java.awt.Graphics graphs)
paintComponent
in class javax.swing.JComponent
public TaskComponent[] getSelectedComponents()
public void copySelected() throws TaskGraphException
TaskGraphException
public void cutSelected() throws TaskGraphException
TaskGraphException
public void paste() throws TaskGraphException
TaskGraphException
public void deleteSelected()
public void copyToClipboard() throws TaskGraphException
copyToClipboard
in interface ClipboardActionInterface
TaskGraphException
public void cutToClipboard() throws TaskGraphException
cutToClipboard
in interface ClipboardActionInterface
TaskGraphException
public void deleteTools(boolean files)
deleteTools
in interface ClipboardActionInterface
public void renameTool()
renameTool
in interface ClipboardActionInterface
public void pasteFromClipboard() throws TaskGraphException
pasteFromClipboard
in interface ClipboardPasteInterface
TaskGraphException
public boolean isSingleSelectedTool()
isSingleSelectedTool
in interface ToolSelectionHandler
public Tool getSelectedTool()
getSelectedTool
in interface ToolSelectionHandler
public Tool[] getSelectedTools()
getSelectedTools
in interface ToolSelectionHandler
public TrianaClient getSelectedTrianaClient()
getSelectedTrianaClient
in interface ToolSelectionHandler
public TaskGraph getSelectedTaskgraph()
getSelectedTaskgraph
in interface ToolSelectionHandler
public TaskComponent getTaskComponent(Task task)
getTaskComponent
in interface TaskGraphPanel
public TaskComponent[] getTaskComponents()
getTaskComponents
in interface TaskGraphPanel
public int getTaskComponentCount()
getTaskComponentCount
in interface TaskGraphPanel
public java.awt.Color getCableColor(Cable cable)
public java.awt.Color getBackgroundColor()
public void taskCreated(TaskGraphTaskEvent event)
taskCreated
in interface TaskGraphListener
public void taskRemoved(TaskGraphTaskEvent event)
taskRemoved
in interface TaskGraphListener
public void cableConnected(TaskGraphCableEvent event)
cableConnected
in interface TaskGraphListener
public void cableDisconnected(TaskGraphCableEvent event)
cableDisconnected
in interface TaskGraphListener
public void cableReconnected(TaskGraphCableEvent event)
cableReconnected
in interface TaskGraphListener
public void controlTaskStateChanged(ControlTaskStateEvent event)
controlTaskStateChanged
in interface TaskGraphListener
public void taskPropertyUpdate(TaskPropertyEvent event)
taskPropertyUpdate
in interface TaskListener
public void parameterUpdated(ParameterUpdateEvent event)
parameterUpdated
in interface TaskListener
public void nodeAdded(TaskNodeEvent event)
nodeAdded
in interface TaskListener
public void nodeRemoved(TaskNodeEvent event)
nodeRemoved
in interface TaskListener
public void taskDisposed(TaskDisposedEvent event)
taskDisposed
in interface TaskListener
public void nodeConnected(NodeEvent event)
nodeConnected
in interface NodeListener
public void nodeDisconnected(NodeEvent event)
nodeDisconnected
in interface NodeListener
public void parameterNameSet(NodeEvent event)
parameterNameSet
in interface NodeListener
public void nodeParentChanged(NodeEvent event)
nodeParentChanged
in interface NodeListener
public void nodeChildChanged(NodeEvent event)
nodeChildChanged
in interface NodeListener
public void dispose()
TaskGraphPanel
dispose
in interface TaskGraphPanel