Class DotPanel

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible

    public class DotPanel
    extends NavigableSVGPanel
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Constructor Summary

      Constructors 
      Constructor Description
      DotPanel​(Dot dot)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGraphChangedListener​(GraphChangedListener listener)  
      void addMouseInElementsChangedListener​(MouseInElementsChangedListener<DotElement> listener)  
      void addSelectionChangedListener​(SelectionChangedListener<DotElement> listener)  
      void changeDot​(Dot dot, boolean resetView)
      Sets a new image
      void changeDot​(Dot dot, com.kitfox.svg.SVGDiagram diagram, boolean resetView)
      Sets a new precomputed image.
      static com.kitfox.svg.SVGDiagram dot2svg​(Dot dot)  
      static java.lang.String getAttributeOf​(com.kitfox.svg.SVGElement element, java.lang.String attribute)  
      Dot getDot()  
      java.util.List<DotEdge> getEdges()  
      java.util.List<Exporter> getExporters()  
      java.util.Set<DotElement> getMouseInElements()  
      java.util.List<DotNode> getNodes()  
      java.util.Set<DotElement> getSelectedElements()  
      com.kitfox.svg.SVGDiagram getSVG()  
      static com.kitfox.svg.Group getSVGElementOf​(com.kitfox.svg.SVGDiagram image, DotElement element)  
      DotPanelUserSettings getUserSettings()  
      protected boolean processMouseClick​(java.awt.event.MouseEvent e)
      Process a mouse click
      protected boolean processMouseDrag​(java.awt.event.MouseEvent e)
      Process a mouse drag;
      protected boolean processMouseExit​(java.awt.event.MouseEvent e)
      Process a mouse exit
      protected boolean processMouseMove​(java.awt.event.MouseEvent e)
      Process a mouse move.
      protected boolean processMouseRelease​(java.awt.event.MouseEvent e)
      Process a mouse release
      void select​(DotElement element)  
      static java.lang.String setCSSAttributeOf​(com.kitfox.svg.SVGDiagram image, DotElement element, java.lang.String attribute, java.lang.String value)
      Set a css-property of a DotElement; returns the old value or null.
      static java.lang.String setCSSAttributeOf​(com.kitfox.svg.SVGElement element, java.lang.String attribute, java.awt.Color colour)  
      static java.lang.String setCSSAttributeOf​(com.kitfox.svg.SVGElement element, java.lang.String attribute, java.lang.String value)
      Set a css-property of an SVG element; returns the old value or null providing null as value removes the attribute
      void setDirection​(Dot.GraphDirection direction)
      Public method to change the graph direction.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        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, 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
      • Methods inherited from class java.awt.Container

        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
      • Methods inherited from class java.awt.Component

        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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DotPanel

        public DotPanel​(Dot dot)
    • Method Detail

      • processMouseClick

        protected boolean processMouseClick​(java.awt.event.MouseEvent e)
        Description copied from class: NavigableSVGPanel
        Process a mouse click
        Overrides:
        processMouseClick in class NavigableSVGPanel
        Returns:
        whether the click was handled and did something.
      • processMouseRelease

        protected boolean processMouseRelease​(java.awt.event.MouseEvent e)
        Description copied from class: NavigableSVGPanel
        Process a mouse release
        Overrides:
        processMouseRelease in class NavigableSVGPanel
        Returns:
        whether the hover was handled and did something.
      • processMouseDrag

        protected boolean processMouseDrag​(java.awt.event.MouseEvent e)
        Description copied from class: NavigableSVGPanel
        Process a mouse drag;
        Overrides:
        processMouseDrag in class NavigableSVGPanel
        Returns:
        whether the drag was handled and did something.
      • processMouseMove

        protected boolean processMouseMove​(java.awt.event.MouseEvent e)
        Description copied from class: NavigableSVGPanel
        Process a mouse move. Captured = true implies that the hover was already processed (and we should hide everything related to hovering).
        Overrides:
        processMouseMove in class NavigableSVGPanel
        Returns:
        whether the move is hovering something.
      • processMouseExit

        protected boolean processMouseExit​(java.awt.event.MouseEvent e)
        Description copied from class: NavigableSVGPanel
        Process a mouse exit
        Overrides:
        processMouseExit in class NavigableSVGPanel
        Returns:
        whether the exit was handled and did something.
      • getExporters

        public java.util.List<Exporter> getExporters()
        Overrides:
        getExporters in class NavigableSVGPanel
        Returns:
        The list of exporters. Subclasses can override this to a relevant list. Called everytime the user attempts to export the image.
      • changeDot

        public void changeDot​(Dot dot,
                              boolean resetView)
        Sets a new image
        Parameters:
        dot - ; set dot to this
        resetView - ; whether reset the view to centered+fitting
      • changeDot

        public void changeDot​(Dot dot,
                              com.kitfox.svg.SVGDiagram diagram,
                              boolean resetView)
        Sets a new precomputed image. Assumptions are made about the dot & the diagram, so do not provide arbitrary ones.
        Parameters:
        dot - ; set dot to this
        diagram - ; use this SVG image
        resetView - ; whether reset the view to centered+fitting
      • dot2svg

        public static com.kitfox.svg.SVGDiagram dot2svg​(Dot dot)
      • select

        public void select​(DotElement element)
      • getSVGElementOf

        public static com.kitfox.svg.Group getSVGElementOf​(com.kitfox.svg.SVGDiagram image,
                                                           DotElement element)
        Parameters:
        image -
        element -
        Returns:
        the svg element of a DotElement
      • setCSSAttributeOf

        public static java.lang.String setCSSAttributeOf​(com.kitfox.svg.SVGDiagram image,
                                                         DotElement element,
                                                         java.lang.String attribute,
                                                         java.lang.String value)
        Set a css-property of a DotElement; returns the old value or null.
        Parameters:
        image -
        element -
        attribute -
        value -
        Returns:
      • getAttributeOf

        public static java.lang.String getAttributeOf​(com.kitfox.svg.SVGElement element,
                                                      java.lang.String attribute)
      • setCSSAttributeOf

        public static java.lang.String setCSSAttributeOf​(com.kitfox.svg.SVGElement element,
                                                         java.lang.String attribute,
                                                         java.awt.Color colour)
      • setCSSAttributeOf

        public static java.lang.String setCSSAttributeOf​(com.kitfox.svg.SVGElement element,
                                                         java.lang.String attribute,
                                                         java.lang.String value)
        Set a css-property of an SVG element; returns the old value or null providing null as value removes the attribute
        Parameters:
        element -
        attribute -
        value -
        Returns:
      • getSelectedElements

        public java.util.Set<DotElement> getSelectedElements()
      • getMouseInElements

        public java.util.Set<DotElement> getMouseInElements()
      • getEdges

        public java.util.List<DotEdge> getEdges()
      • getNodes

        public java.util.List<DotNode> getNodes()
      • getSVG

        public com.kitfox.svg.SVGDiagram getSVG()
      • getDot

        public Dot getDot()
      • setDirection

        public void setDirection​(Dot.GraphDirection direction)
        Public method to change the graph direction. No listeners are called; that's your responsibility.
        Parameters:
        topdown -