public abstract class JIPipeNodeUI extends JIPipeWorkbenchPanel
JIPipeGraphNode
instanceModifier and Type | Class and Description |
---|---|
static class |
JIPipeNodeUI.AlgorithmEvent
An event around
JIPipeNodeUI |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static NodeUIContextAction[] |
RUN_NODE_CONTEXT_MENU_ENTRIES |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JIPipeNodeUI(JIPipeWorkbench workbench,
JIPipeGraphCanvasUI graphUI,
JIPipeGraphNode node,
JIPipeGraphViewMode viewMode)
Creates a new UI
|
Modifier and Type | Method and Description |
---|---|
abstract Dimension |
calculateGridSize()
Calculates the size in grid coordinates
|
protected JButton |
createAddSlotButton(JIPipeSlotType slotType)
Function that creates the "Add slot" button
|
Color |
getBorderColor() |
int |
getBottomY()
Get the Y location of the bottom part
|
EventBus |
getEventBus() |
Color |
getFillColor() |
JIPipeGraphCanvasUI |
getGraphUI() |
abstract Map<String,JIPipeDataSlotUI> |
getInputSlotUIs() |
JIPipeGraphNode |
getNode() |
abstract Map<String,JIPipeDataSlotUI> |
getOutputSlotUIs() |
int |
getRightX() |
abstract PointRange |
getSlotLocation(JIPipeDataSlot slot)
Returns the location of a slot in relative coordinates
|
Point |
getStoredGridLocation() |
boolean |
isNodeRunnable() |
boolean |
isOverlapping()
Returns true if this component overlaps with another component
|
boolean |
moveToClosestGridPoint(Point location,
boolean force,
boolean save)
Moves the node to the next grid location, given a real location
|
boolean |
moveToGridLocation(Point gridLocation,
boolean force,
boolean save)
Moves the node to a grid location
|
boolean |
moveToStoredGridLocation(boolean force)
Moves the UI back to the stored grid location
|
abstract boolean |
needsRecalculateGridSize() |
void |
onAlgorithmParametersChanged(JIPipeParameterCollection.ParameterChangedEvent event)
Should be triggered when an algorithm's name parameter is changed
|
void |
onAlgorithmSlotsChanged(JIPipeGraph.NodeSlotsChangedEvent event)
Should be triggered when the algorithm's slots are changed.
|
void |
paint(Graphics g) |
protected void |
paintComponent(Graphics g) |
JIPipeDataSlotUI |
pickSlotComponent(MouseEvent mouseEvent) |
abstract void |
refreshSlots()
Updates the UIs for slots
|
protected abstract void |
updateActivationStatus()
Called when the algorithm was enabled/disabled
|
abstract void |
updateAlgorithmSlotUIs()
Updates the slots
|
abstract void |
updateHotkeyInfo() |
protected abstract void |
updateName()
Called when the algorithm name was updated
|
abstract void |
updateSize()
Recalculates the UI size
|
getWorkbench
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, 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, 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 final NodeUIContextAction[] RUN_NODE_CONTEXT_MENU_ENTRIES
public JIPipeNodeUI(JIPipeWorkbench workbench, JIPipeGraphCanvasUI graphUI, JIPipeGraphNode node, JIPipeGraphViewMode viewMode)
workbench
- thr workbenchgraphUI
- The graph UI that contains this UInode
- The algorithmviewMode
- Directionality of the canvas UIpublic boolean isNodeRunnable()
public JIPipeGraphNode getNode()
protected JButton createAddSlotButton(JIPipeSlotType slotType)
slotType
- slot typepublic abstract void updateHotkeyInfo()
public abstract void updateAlgorithmSlotUIs()
public boolean isOverlapping()
public void paint(Graphics g)
paint
in class JComponent
public int getBottomY()
public void onAlgorithmSlotsChanged(JIPipeGraph.NodeSlotsChangedEvent event)
event
- Generated eventpublic void onAlgorithmParametersChanged(JIPipeParameterCollection.ParameterChangedEvent event)
event
- The generated eventpublic abstract boolean needsRecalculateGridSize()
public abstract Dimension calculateGridSize()
protected abstract void updateName()
protected abstract void updateActivationStatus()
public abstract void updateSize()
public boolean moveToGridLocation(Point gridLocation, boolean force, boolean save)
gridLocation
- the grid locationforce
- if false, no overlap check is appliedsave
- save the grid location to the nodepublic Point getStoredGridLocation()
public boolean moveToStoredGridLocation(boolean force)
force
- if false, no overlap check is appliedpublic EventBus getEventBus()
public abstract PointRange getSlotLocation(JIPipeDataSlot slot)
slot
- the slotpublic Color getFillColor()
public Color getBorderColor()
public JIPipeGraphCanvasUI getGraphUI()
public int getRightX()
public abstract Map<String,JIPipeDataSlotUI> getInputSlotUIs()
public abstract Map<String,JIPipeDataSlotUI> getOutputSlotUIs()
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
public boolean moveToClosestGridPoint(Point location, boolean force, boolean save)
location
- a real locationforce
- whether to disable checking for overlapssave
- store the location in the nodepublic abstract void refreshSlots()
public JIPipeDataSlotUI pickSlotComponent(MouseEvent mouseEvent)
Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.