Class PortRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, CellViewRenderer

public class PortRenderer extends JComponent implements CellViewRenderer, Serializable
This renderer displays entries that implement the CellView interface and supports the following attributes:
  • GraphConstants.OFFSET GraphConstants.ABSOLUTE </li
  • See Also:
    • Field Details

      • view

        protected transient PortView view
        Cache the current edgeview for drawing.
      • graphBackground

        protected Color graphBackground
        Cache the current graph background.
      • hasFocus

        protected transient boolean hasFocus
        Cached hasFocus and selected value.
      • selected

        protected transient boolean selected
        Cached hasFocus and selected value.
      • preview

        protected transient boolean preview
        Cached hasFocus and selected value.
      • xorEnabled

        protected transient boolean xorEnabled
        Cached hasFocus and selected value.
    • Constructor Details

      • PortRenderer

        public PortRenderer()
        Constructs a renderer that may be used to render ports.
    • Method Details

      • getRendererComponent

        public 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.
      • paint

        public void paint(Graphics g)
        Paint the renderer. Overrides superclass paint to add specific painting. Note: The preview flag is interpreted as "highlight" in this context. (This is used to highlight the port if the mouse is over it.)
        Overrides:
        paint in class JComponent
      • validate

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

        public void revalidate()
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        revalidate in class 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 JComponent
      • repaint

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

        protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        firePropertyChange in class Component
      • firePropertyChange

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

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

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

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

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

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

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

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