public abstract class TrianaTool extends javax.swing.JPanel implements TrianaColorConstants
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NAME_LENGTH
the width of the graphical component in terms of the number of letters displayed by default
|
static int |
STRIPE_ANGLE_OFFSET |
static java.lang.String |
SUB_NAME |
static java.lang.String |
SUB_NAME_VALUE |
static int |
THICK_STRIPE_OFFSET |
static int |
THICK_STRIPE_WIDTH |
static int |
THIN_STRIPE_OFFSET |
static int |
THIN_STRIPE_WIDTH |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BACKGROUND_COLOR, CABLE_COLOR, CONTROL_CABLE_COLOR, DEFAULT_ERROR_COLOR, ERROR_NODE_COLOR, ERROR_TOOL_COLOR, GROUP_TOOL_COLOR, NAME_COLOR, NAME_ELEMENT, NODE_COLOR, PROGRESS_COLOR, PROGRESS_ELEMENT, SHOW_TOOL_CONNECTED_COLOR, SHOW_TOOL_CONNECTED_ELEMENT, SHOW_TOOL_UNCONNECTED_COLOR, SHOW_TOOL_UNCONNECTED_ELEMENT, STRIPE_ELEMENT, TOOL_COLOR, TOOL_ELEMENT, TRIGGER_NODE_COLOR
Constructor and Description |
---|
TrianaTool(Tool tool) |
TrianaTool(Tool tool,
java.awt.LayoutManager layout) |
Modifier and Type | Method and Description |
---|---|
void |
addNotify() |
void |
clearError()
Clears the current error state
|
void |
dispose()
Disposes of the tool and its associated windows
|
protected void |
drawRectangle(java.awt.Graphics graphs,
java.awt.Color color,
java.awt.Color orig)
Paints the main tool rectangle
|
protected void |
drawStripes(java.awt.Graphics graphs,
java.awt.Color col,
int width,
int offset)
Paints stripes on the main tool rectangle of a certain color, width and slant (offset)
|
java.lang.String |
getErrorMessage() |
protected java.awt.Component |
getMainComponent()
Initialises the main icon
|
NodeComponent |
getNodeComponent(Node node) |
java.awt.Color |
getStripeColor() |
int |
getStripeOffset() |
int |
getStripeWidth() |
Tool |
getTool() |
java.awt.Color |
getToolColor() |
java.lang.String |
getToolName()
Gets the name of the task
|
void |
invalidateSize()
Notifies that the size of the tool should be changed when the tool is repainted
|
boolean |
isErrorState() |
boolean |
isSelected()
Returns true if the particular tool is selected
|
void |
paintComponent(java.awt.Graphics graphs)
Paints the Triana Tool by rendering its name in the middle of the icon.
|
protected void |
removeNodeComponent(Node node)
Removes the input node at the specified index
|
void |
removeNotify() |
void |
setError(java.lang.String message)
Sets the tool into an error state with the specified message
|
protected void |
setMainComponent(java.awt.Component comp)
Initialises the main icon
|
protected void |
setNodeComponent(Node node,
NodeComponent comp)
Inserts an input node component at the specified index
|
void |
setSelected(boolean state)
Sets the triana tool as selected (i.e.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, 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 static int DEFAULT_NAME_LENGTH
public static int THICK_STRIPE_WIDTH
public static int THICK_STRIPE_OFFSET
public static int THIN_STRIPE_WIDTH
public static int THIN_STRIPE_OFFSET
public static int STRIPE_ANGLE_OFFSET
public static final java.lang.String SUB_NAME
public static final java.lang.String SUB_NAME_VALUE
public TrianaTool(Tool tool)
public TrianaTool(Tool tool, java.awt.LayoutManager layout)
public void addNotify()
addNotify
in class javax.swing.JComponent
public void removeNotify()
removeNotify
in class javax.swing.JComponent
public Tool getTool()
protected void setMainComponent(java.awt.Component comp)
protected java.awt.Component getMainComponent()
protected void setNodeComponent(Node node, NodeComponent comp)
protected void removeNodeComponent(Node node)
public NodeComponent getNodeComponent(Node node)
public java.lang.String getToolName()
public void setError(java.lang.String message)
public void clearError()
public boolean isErrorState()
public java.lang.String getErrorMessage()
public void invalidateSize()
public java.awt.Color getToolColor()
public java.awt.Color getStripeColor()
public int getStripeWidth()
public int getStripeOffset()
public void setSelected(boolean state)
public boolean isSelected()
public void paintComponent(java.awt.Graphics graphs)
paintComponent
in class javax.swing.JComponent
protected void drawRectangle(java.awt.Graphics graphs, java.awt.Color color, java.awt.Color orig)
protected void drawStripes(java.awt.Graphics graphs, java.awt.Color col, int width, int offset)
public void dispose()