Documentation of 'org.jgraph.graph.EdgeRenderer' Java class
EdgeRenderer
org.jgraph.graph

Class EdgeRenderer

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, CellViewRenderer


    public class EdgeRenderer
    extends javax.swing.JComponent
    implements CellViewRenderer, java.io.Serializable
    This renderer displays entries that implement the CellView interface.
    See Also:
    Serialized Form
    • Nested Class Summary

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

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

        java.awt.Component.BaselineResizeBehavior
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.awt.Font extraLabelFont
      Override this if you want the extra labels to appear in a special fontJ
      static boolean HIT_LABEL_EXACT
      Switch for exact label hit detection on rotated labels.
      static double LABELWIDTHBUFFER
      When zooming a graph the font size jumps at certain zoom levels rather than scaling smoothly.
      boolean simpleExtraLabels
      A switch for painting the extra labels
      • Fields inherited from class javax.swing.JComponent

        TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      EdgeRenderer()
      Constructs a renderer that may be used to render edges.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
      Overridden for performance reasons.
      void firePropertyChange(java.lang.String propertyName, byte oldValue, byte newValue)
      Overridden for performance reasons.
      void firePropertyChange(java.lang.String propertyName, char oldValue, char newValue)
      Overridden for performance reasons.
      void firePropertyChange(java.lang.String propertyName, double oldValue, double newValue)
      Overridden for performance reasons.
      void firePropertyChange(java.lang.String propertyName, float oldValue, float newValue)
      Overridden for performance reasons.
      void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
      Overridden for performance reasons.
      void firePropertyChange(java.lang.String propertyName, long oldValue, long newValue)
      Overridden for performance reasons.
      void firePropertyChange(java.lang.String propertyName, short oldValue, short newValue)
      Overridden for performance reasons.
      java.awt.geom.Rectangle2D getBounds(CellView value)
      Returns the bounds of the edge shape.
      java.awt.geom.Rectangle2D getExtraLabelBounds(JGraph paintingContext, EdgeView view, int index)
      Returns the label bounds of the specified view in the given graph.
      java.awt.geom.Point2D getExtraLabelPosition(EdgeView view, int index)
      Returns the label position of the specified view in the given graph.
      java.awt.Dimension getExtraLabelSize(JGraph paintingContext, EdgeView view, int index)
      Returns the label size of the specified view in the given graph.
      java.awt.Color getGradientColor() 
      java.awt.geom.Rectangle2D getLabelBounds(JGraph paintingContext, EdgeView view)
      Returns the label bounds of the specified view in the given graph.
      java.awt.geom.Rectangle2D getLabelBounds(java.awt.geom.Point2D p, java.awt.Dimension d, java.lang.String label)
      Returns the label bounds of the specified view in the given graph.
      java.awt.geom.Point2D getLabelPosition(EdgeView view)
      Returns the label position of the specified view in the given graph.
      java.awt.Dimension getLabelSize(EdgeView view, java.lang.String label)
      Returns the label size of the specified view in the given graph.
      java.awt.geom.Rectangle2D getPaintBounds(EdgeView view)
      Returns the bounds of the edge shape without label
      java.awt.Component getRendererComponent(JGraph graph, CellView view, boolean sel, boolean focus, boolean preview)
      Configure and return the renderer based on the passed in components.
      boolean intersects(JGraph graph, CellView value, java.awt.Rectangle rect)
      Returns true if the edge shape intersects the given rectangle.
      void paint(java.awt.Graphics g)
      Paint the renderer.
      void repaint(long tm, int x, int y, int width, int height)
      Overridden for performance reasons.
      void repaint(java.awt.Rectangle r)
      Overridden for performance reasons.
      void revalidate()
      Overridden for performance reasons.
      void setGradientColor(java.awt.Color gradientColor) 
      void validate()
      Overridden for performance reasons.
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
      • Methods inherited from class java.awt.Container

        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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getAccessibleContext, 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, 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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • HIT_LABEL_EXACT

        public static boolean HIT_LABEL_EXACT
        Switch for exact label hit detection on rotated labels. Default is false.
      • LABELWIDTHBUFFER

        public static double LABELWIDTHBUFFER
        When zooming a graph the font size jumps at certain zoom levels rather than scaling smoothly. Sometimes the zoom on the font is more than the component zoom and cropping occurs. This buffer allows for the maximum occurance of this
      • simpleExtraLabels

        public boolean simpleExtraLabels
        A switch for painting the extra labels
      • extraLabelFont

        public java.awt.Font extraLabelFont
        Override this if you want the extra labels to appear in a special fontJ
    • Constructor Detail

      • EdgeRenderer

        public EdgeRenderer()
        Constructs a renderer that may be used to render edges.
    • Method Detail

      • getRendererComponent

        public java.awt.Component getRendererComponent(JGraph graph,
                                                       CellView view,
                                                       boolean sel,
                                                       boolean focus,
                                                       boolean preview)
        Configure and return the renderer based on the passed in components. The value is typically set from messaging the graph with convertValueToString.
        Specified by:
        getRendererComponent in interface CellViewRenderer
        Parameters:
        graph - the graph that that defines the rendering context.
        view - the cell view that should be rendered.
        sel - whether the object is selected.
        focus - whether the object has the focus.
        preview - whether we are drawing a preview.
        Returns:
        the component used to render the value.
      • intersects

        public boolean intersects(JGraph graph,
                                  CellView value,
                                  java.awt.Rectangle rect)
        Returns true if the edge shape intersects the given rectangle.
      • getBounds

        public java.awt.geom.Rectangle2D getBounds(CellView value)
        Returns the bounds of the edge shape.
      • getLabelBounds

        public java.awt.geom.Rectangle2D getLabelBounds(JGraph paintingContext,
                                                        EdgeView view)
        Returns the label bounds of the specified view in the given graph.
      • getExtraLabelBounds

        public java.awt.geom.Rectangle2D getExtraLabelBounds(JGraph paintingContext,
                                                             EdgeView view,
                                                             int index)
        Returns the label bounds of the specified view in the given graph. Note: The index is the position of the String object for the label in the extra labels array of the view.
      • getLabelBounds

        public java.awt.geom.Rectangle2D getLabelBounds(java.awt.geom.Point2D p,
                                                        java.awt.Dimension d,
                                                        java.lang.String label)
        Returns the label bounds of the specified view in the given graph.
      • getLabelPosition

        public java.awt.geom.Point2D getLabelPosition(EdgeView view)
        Returns the label position of the specified view in the given graph.
      • getExtraLabelPosition

        public java.awt.geom.Point2D getExtraLabelPosition(EdgeView view,
                                                           int index)
        Returns the label position of the specified view in the given graph.
      • getExtraLabelSize

        public java.awt.Dimension getExtraLabelSize(JGraph paintingContext,
                                                    EdgeView view,
                                                    int index)
        Returns the label size of the specified view in the given graph.
      • getLabelSize

        public java.awt.Dimension getLabelSize(EdgeView view,
                                               java.lang.String label)
        Returns the label size of the specified view in the given graph.
      • getPaintBounds

        public java.awt.geom.Rectangle2D getPaintBounds(EdgeView view)
        Returns the bounds of the edge shape without label
      • paint

        public void paint(java.awt.Graphics g)
        Paint the renderer.
        Overrides:
        paint in class javax.swing.JComponent
      • getGradientColor

        public java.awt.Color getGradientColor()
        Returns:
        Returns the gradientColor.
      • setGradientColor

        public void setGradientColor(java.awt.Color gradientColor)
        Parameters:
        gradientColor - The gradientColor to set.
      • validate

        public void validate()
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        validate in class java.awt.Container
      • revalidate

        public void revalidate()
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        revalidate in class javax.swing.JComponent
      • repaint

        public void repaint(long tm,
                            int x,
                            int y,
                            int width,
                            int height)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        repaint in class javax.swing.JComponent
      • repaint

        public void repaint(java.awt.Rectangle r)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        repaint in class javax.swing.JComponent
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       byte oldValue,
                                       byte newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class java.awt.Component
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       char oldValue,
                                       char newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class javax.swing.JComponent
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       short oldValue,
                                       short newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class java.awt.Component
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       int oldValue,
                                       int newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class javax.swing.JComponent
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       long oldValue,
                                       long newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class java.awt.Component
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       float oldValue,
                                       float newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class java.awt.Component
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       double oldValue,
                                       double newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class java.awt.Component
      • firePropertyChange

        public void firePropertyChange(java.lang.String propertyName,
                                       boolean oldValue,
                                       boolean newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class javax.swing.JComponent

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.