public class JIPipeGraphCanvasUI extends JLayeredPane implements JIPipeWorkbenchAccess, MouseMotionListener, MouseListener, MouseWheelListener, ZoomViewPort
JIPipeGraph
Modifier and Type | Class and Description |
---|---|
static class |
JIPipeGraphCanvasUI.AlgorithmSelectedEvent
Generated when an algorithm is selected
|
static class |
JIPipeGraphCanvasUI.AlgorithmSelectionChangedEvent
Triggered when An
JIPipeGraphCanvasUI selection was changed |
static class |
JIPipeGraphCanvasUI.DefaultAlgorithmUIActionRequestedEvent
Triggered when an
JIPipeNodeUI requests a default action (double click) |
static class |
JIPipeGraphCanvasUI.GraphCanvasUpdatedEvent
Triggered when a graph canvas was updated
|
static class |
JIPipeGraphCanvasUI.NodeUIActionRequestedEvent
An action that is requested by an
JIPipeNodeUI and passed down to a JIPipeGraphEditorUI |
JLayeredPane.AccessibleJLayeredPane
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
ZoomViewPort.ZoomChangedEvent
Modifier and Type | Field and Description |
---|---|
static DropShadowRenderer |
BOOKMARK_SHADOW_BORDER |
static DropShadowRenderer |
DROP_SHADOW_BORDER |
static Stroke |
STROKE_COMMENT |
static Stroke |
STROKE_COMMENT_HIGHLIGHT |
static Stroke |
STROKE_DEFAULT |
static Stroke |
STROKE_DEFAULT_BORDER |
static Stroke |
STROKE_HIGHLIGHT |
static Stroke |
STROKE_MARQUEE |
static Stroke |
STROKE_SELECTION |
static Stroke |
STROKE_UNIT |
static Stroke |
STROKE_UNIT_COMMENT |
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
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 |
---|
JIPipeGraphCanvasUI(JIPipeWorkbench workbench,
JIPipeGraphEditorUI graphEditorUI,
JIPipeGraph graph,
UUID compartment,
JIPipeHistoryJournal historyJournal)
Creates a new UI
|
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, 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, updateUI
add, add, add, add, add, addContainerListener, 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, 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 DropShadowRenderer DROP_SHADOW_BORDER
public static final DropShadowRenderer BOOKMARK_SHADOW_BORDER
public static final Stroke STROKE_UNIT
public static final Stroke STROKE_UNIT_COMMENT
public static final Stroke STROKE_DEFAULT
public static final Stroke STROKE_DEFAULT_BORDER
public static final Stroke STROKE_HIGHLIGHT
public static final Stroke STROKE_SELECTION
public static final Stroke STROKE_MARQUEE
public static final Stroke STROKE_COMMENT
public static final Stroke STROKE_COMMENT_HIGHLIGHT
public JIPipeGraphCanvasUI(JIPipeWorkbench workbench, JIPipeGraphEditorUI graphEditorUI, JIPipeGraph graph, UUID compartment, JIPipeHistoryJournal historyJournal)
workbench
- the workbenchgraphEditorUI
- the graph editor UI that contains this canvas. can be null.graph
- The algorithm graphcompartment
- The compartment to showhistoryJournal
- object that tracks the history of this graph. Set to null to disable the undo feature.public boolean isRenderOutsideEdges()
public void setRenderOutsideEdges(boolean renderOutsideEdges)
public JIPipeWorkbench getWorkbench()
getWorkbench
in interface JIPipeWorkbenchAccess
public JIPipeGraphEditorUI getGraphEditorUI()
public GraphEditorUISettings getSettings()
public JIPipeGraph getGraph()
public boolean isRenderCursor()
public void setRenderCursor(boolean renderCursor)
public void autoLayoutAll()
public void autoLayout()
public void onActionRequested(JIPipeGraphCanvasUI.NodeUIActionRequestedEvent event)
JIPipeNodeUI
requests an action.
Passes the action to its own event busevent
- eventpublic void autoPlaceCloseToLocation(JIPipeNodeUI ui, Point location)
ui
- the nodelocation
- a real locationpublic void autoPlaceCloseToCursor(JIPipeNodeUI ui, boolean force)
public Set<JIPipeNodeUI> getNodesAfter(int x, int y)
public void mouseDragged(MouseEvent mouseEvent)
mouseDragged
in interface MouseMotionListener
public void autoExpandLeftTop()
public void expandLeftTop(int gridLeft, int gridTop)
gridLeft
- expand left (in grid coordinates)gridTop
- expand top (in grid coordinates)public void expandRightBottom(int right, int bottom)
right
- expand rightbottom
- expand bottompublic void mouseMoved(MouseEvent mouseEvent)
mouseMoved
in interface MouseMotionListener
public void mouseClicked(MouseEvent mouseEvent)
mouseClicked
in interface MouseListener
public void openContextMenu(Point point)
point
- the locationpublic void mousePressed(MouseEvent mouseEvent)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent mouseEvent)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent mouseEvent)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent mouseEvent)
mouseExited
in interface MouseListener
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void onAlgorithmGraphChanged(JIPipeGraph.GraphChangedEvent event)
event
- The generated eventpublic void onAlgorithmConnected(JIPipeGraph.NodeConnectedEvent event)
event
- The generated eventpublic void onOpenAlgorithmSettings(JIPipeGraphCanvasUI.AlgorithmSelectedEvent event)
JIPipeNodeUI
requests that the algorithm settings should be openedevent
- The generated eventpublic EventBus getEventBus()
getEventBus
in interface ZoomViewPort
public void paintMiniMap(Graphics2D graphics2D, double scale, int viewX, int viewY)
graphics2D
- the graphicsscale
- the scaleviewX
- move the locations by this valueviewY
- move the locations by this valueprotected void paintComponent(Graphics graphics)
paintComponent
in class JComponent
public void paint(Graphics g)
paint
in class JLayeredPane
public Point getSlotLocation(JIPipeDataSlot slot)
slot
- the data slotpublic UUID getCompartment()
public BufferedImage createScreenshotPNG()
public org.jfree.graphics2d.svg.SVGGraphics2D createScreenshotSVG()
public JIPipeGraphViewMode getViewMode()
public void setViewMode(JIPipeGraphViewMode viewMode)
public BiMap<JIPipeGraphNode,JIPipeNodeUI> getNodeUIs()
public JIPipeGraphDragAndDropBehavior getDragAndDropBehavior()
public void setDragAndDropBehavior(JIPipeGraphDragAndDropBehavior dragAndDropBehavior)
public Set<JIPipeNodeUI> getSelection()
JIPipeNodeUI
public Set<JIPipeGraphNode> getSelectedNodes()
public void clearSelection()
public void selectOnly(JIPipeNodeUI ui)
ui
- The algorithm UIpublic void removeFromSelection(JIPipeNodeUI ui)
ui
- The algorithm UIpublic void addToSelection(JIPipeNodeUI ui)
ui
- The algorithm UIpublic void crop(boolean save)
save
- if the locations should be savedpublic Point getGraphEditorCursor()
public void fullRedraw()
public List<NodeUIContextAction> getContextActions()
public void setContextActions(List<NodeUIContextAction> contextActions)
public <T extends JIPipeGraphNode> Set<JIPipeNodeUI> getNodeUIsFor(Set<T> nodes)
public JIPipeDataSlotUI getCurrentConnectionDragSource()
public void setCurrentConnectionDragSource(JIPipeDataSlotUI currentConnectionDragSource)
public JIPipeDataSlotUI getCurrentConnectionDragTarget()
public void setCurrentConnectionDragTarget(JIPipeDataSlotUI currentConnectionDragTarget)
public JIPipeDataSlotUI getCurrentHighlightedForDisconnect()
public void setCurrentHighlightedForDisconnect(JIPipeDataSlotUI currentHighlightedForDisconnect, Set<JIPipeDataSlot> sourceSlots)
public void setGraphEditCursor(Point graphEditCursor)
public void selectAll()
public void invertSelection()
public double getZoom()
getZoom
in interface ZoomViewPort
public void setZoom(double zoom)
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
public void resetZoom()
public void zoomOut()
public void zoomIn()
public JScrollPane getScrollPane()
public NodeHotKeyStorage getNodeHotKeyStorage()
public Set<JIPipeGraphNode> getScheduledSelection()
public void setScheduledSelection(Set<JIPipeGraphNode> scheduledSelection)
public JIPipeHistoryJournal getHistoryJournal()
Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.