public class JIPipeGraphCanvasUI extends JLayeredPane implements JIPipeWorkbenchAccess, MouseMotionListener, MouseListener, MouseWheelListener, ZoomViewPort, Disposable, JIPipeGraph.GraphChangedEventListener, JIPipeGraph.NodeConnectedEventListener, JIPipeGraphNodeUI.NodeUIActionRequestedEventListener
JIPipeGraph
Modifier and Type | Class and Description |
---|---|
static class |
JIPipeGraphCanvasUI.ConnectHighlight |
static class |
JIPipeGraphCanvasUI.DisconnectHighlight |
static class |
JIPipeGraphCanvasUI.DisplayedSlotEdge |
static class |
JIPipeGraphCanvasUI.GraphCanvasUpdatedEvent
Triggered when a graph canvas was updated
|
static class |
JIPipeGraphCanvasUI.GraphCanvasUpdatedEventEmitter |
static interface |
JIPipeGraphCanvasUI.GraphCanvasUpdatedEventListener |
static class |
JIPipeGraphCanvasUI.NodeSelectionChangedEvent
Triggered when An
JIPipeGraphCanvasUI selection was changed |
static class |
JIPipeGraphCanvasUI.NodeSelectionChangedEventEmitter |
static interface |
JIPipeGraphCanvasUI.NodeSelectionChangedEventListener |
static class |
JIPipeGraphCanvasUI.NodeUISelectedEvent
Generated when an algorithm is selected
|
static class |
JIPipeGraphCanvasUI.NodeUISelectedEventEmitter |
static interface |
JIPipeGraphCanvasUI.NodeUISelectedEventListener |
JLayeredPane.AccessibleJLayeredPane
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
ZoomViewPort.ZoomChangedEvent, ZoomViewPort.ZoomChangedEventEmitter, ZoomViewPort.ZoomChangedEventListener
Modifier and Type | Field and Description |
---|---|
static DropShadowRenderer |
BOOKMARK_SHADOW_BORDER |
static Color |
COLOR_HIGHLIGHT_GREEN |
static Color |
COLOR_RESIZE_HANDLE_BORDER |
static Color |
COLOR_RESIZE_HANDLE_FILL |
static DropShadowRenderer |
DROP_SHADOW_BORDER |
static Font |
GRAPH_TOOL_CURSOR_FONT |
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_SMART_EDGE |
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 Font GRAPH_TOOL_CURSOR_FONT
public static final Color COLOR_HIGHLIGHT_GREEN
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 static final Stroke STROKE_SMART_EDGE
public static final Color COLOR_RESIZE_HANDLE_FILL
public static final Color COLOR_RESIZE_HANDLE_BORDER
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 Color getImprovedStrokeBackgroundColor()
public Color getSmartEdgeSlotBackground()
public Color getSmartEdgeSlotForeground()
public boolean isMouseIsEntered()
public Point getLastMousePosition()
public JIPipeGraphCanvasUI.NodeSelectionChangedEventEmitter getNodeSelectionChangedEventEmitter()
public JIPipeGraphCanvasUI.NodeUISelectedEventEmitter getNodeUISelectedEventEmitter()
public JIPipeGraphNodeUI.DefaultNodeUIActionRequestedEventEmitter getDefaultAlgorithmUIActionRequestedEventEmitter()
public JIPipeGraphNodeUI.NodeUIActionRequestedEventEmitter getNodeUIActionRequestedEventEmitter()
public void dispose()
dispose
in interface Disposable
public ZoomViewPort.ZoomChangedEventEmitter getZoomChangedEventEmitter()
getZoomChangedEventEmitter
in interface ZoomViewPort
public boolean isAutoHideEdges()
public void setAutoHideEdges(boolean autoHideEdges)
public boolean isAutoHideDrawLabels()
public void setAutoHideDrawLabels(boolean autoHideDrawLabels)
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 autoPlaceCloseToLocation(JIPipeGraphNodeUI ui, Point location)
ui
- the nodelocation
- a real locationpublic void autoPlaceCloseToCursor(JIPipeGraphNodeUI ui, boolean force)
public Set<JIPipeGraphNodeUI> getNodesAfter(int x, int y)
public void mouseDragged(MouseEvent mouseEvent)
mouseDragged
in interface MouseMotionListener
public void repaintLowLag()
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 JIPipeGraphNodeUI pickNodeUI(MouseEvent mouseEvent)
public void mouseReleased(MouseEvent mouseEvent)
mouseReleased
in interface MouseListener
public void connectSlot(JIPipeDataSlot source, JIPipeDataSlot target)
source
- source slottarget
- target slotpublic void disconnectSlot(JIPipeDataSlot source, JIPipeDataSlot target)
source
- the sourcetarget
- the targetpublic void disconnectAll(JIPipeDataSlot slot, Set<JIPipeDataSlot> otherSlots)
public boolean isCurrentlyDraggingNode()
public boolean isCurrentlyDraggingConnection()
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 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 Map<?,?> getDesktopRenderingHints()
public void paint(Graphics g)
paint
in class JLayeredPane
public JIPipeToggleableGraphEditorTool getCurrentTool()
public void setCurrentTool(JIPipeToggleableGraphEditorTool currentTool)
public boolean currentToolAllowsNodeDragging()
public boolean currentToolAllowsConnectionDragging()
public Point getSlotLocation(JIPipeDataSlot slot)
slot
- the data slotpublic void paintEdge(Graphics2D g, Point sourcePoint, Rectangle sourceBounds, Point targetPoint, JIPipeGraphEdge.Shape shape, double scale, int viewX, int viewY, boolean enableArrows)
g
- the graphicssourcePoint
- the source pointsourceBounds
- bounds of the sourcetargetPoint
- the target pointshape
- the line shapescale
- the scaleviewX
- the view xviewY
- the view yenableArrows
- enable arrowspublic UUID getCompartment()
public BufferedImage createScreenshotPNG()
public org.jfree.graphics2d.svg.SVGGraphics2D createScreenshotSVG()
public JIPipeGraphViewMode getViewMode()
public BiMap<JIPipeGraphNode,JIPipeGraphNodeUI> getNodeUIs()
public JIPipeGraphDragAndDropBehavior getDragAndDropBehavior()
public void setDragAndDropBehavior(JIPipeGraphDragAndDropBehavior dragAndDropBehavior)
public Set<JIPipeGraphNodeUI> getSelection()
JIPipeGraphNodeUI
public Set<JIPipeGraphNode> getSelectedNodes()
public void clearSelection()
public void selectOnly(JIPipeGraphNodeUI ui)
ui
- The algorithm UIpublic void removeFromSelection(JIPipeGraphNodeUI ui)
ui
- The algorithm UIpublic void addToSelection(JIPipeGraphNodeUI 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<JIPipeGraphNodeUI> getNodeUIsFor(Set<T> nodes)
public JIPipeNodeUIActiveArea getCurrentConnectionDragSource()
public void setCurrentConnectionDragSource(JIPipeNodeUIActiveArea currentConnectionDragSource)
public JIPipeNodeUIActiveArea getCurrentConnectionDragTarget()
public void setCurrentConnectionDragTarget(JIPipeNodeUIActiveArea currentConnectionDragTarget)
public JIPipeGraphCanvasUI.DisconnectHighlight getDisconnectHighlight()
public void setDisconnectHighlight(JIPipeGraphCanvasUI.DisconnectHighlight disconnectHighlight)
public JIPipeGraphCanvasUI.ConnectHighlight getConnectHighlight()
public void setConnectHighlight(JIPipeGraphCanvasUI.ConnectHighlight connectHighlight)
public void setGraphEditCursor(Point graphEditCursor)
public void selectAll()
public void invertSelection()
public double getZoom()
getZoom
in interface ZoomViewPort
public void setZoom(double zoom)
public JIPipeGraphCanvasUI.GraphCanvasUpdatedEventEmitter getGraphCanvasUpdatedEventEmitter()
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()
public void onGraphChanged(JIPipeGraph.GraphChangedEvent event)
onGraphChanged
in interface JIPipeGraph.GraphChangedEventListener
public void onNodeConnected(JIPipeGraph.NodeConnectedEvent event)
onNodeConnected
in interface JIPipeGraph.NodeConnectedEventListener
public void onNodeUIActionRequested(JIPipeGraphNodeUI.NodeUIActionRequestedEvent event)
onNodeUIActionRequested
in interface JIPipeGraphNodeUI.NodeUIActionRequestedEventListener
public void moveSelection(int gridDx, int gridDy, boolean force)
Copyright © 2020–2023 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.