Class AbstractVisualVertexRenderer<V extends VisualVertex,​E extends VisualEdge<V>>

  • Type Parameters:
    V - the vertex type
    E - the edge type
    All Implemented Interfaces:
    edu.uci.ics.jung.visualization.renderers.Renderer.Vertex<V,​E>
    Direct Known Subclasses:
    VisualVertexRenderer, VisualVertexSatelliteRenderer

    public class AbstractVisualVertexRenderer<V extends VisualVertex,​E extends VisualEdge<V>>
    extends edu.uci.ics.jung.visualization.renderers.BasicVertexRenderer<V,​E>
    A base renderer class to define shared logic needed to render a vertex
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface edu.uci.ics.jung.visualization.renderers.Renderer.Vertex

        edu.uci.ics.jung.visualization.renderers.Renderer.Vertex.NOOP
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected double adjustValueForCurrentScale​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc, double value, double ratioToScale)
      Adjusts the given value based upon the current scale applied the the view.
      protected java.awt.Shape getCompactShape​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc, edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout, V vertex)
      Uses the render context to create a compact shape for the given vertex
      protected edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator getEmphasisGraphics​(edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g, V vertex, edu.uci.ics.jung.visualization.RenderContext<V,​E> rc, edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout)
      Creates a copy of the given GraphicsDecorator that may have scaling tweaked to handle VisualVertex.getEmphasis() emphasized vertices.
      java.awt.Shape getFullShape​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc, edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout, V vertex)
      Uses the render context to create a compact shape for the given vertex
      protected double getScale​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc)  
      protected boolean isScaledPastVertexInteractionThreshold​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc)
      Returns true if the view is zoomed far enough out that the user cannot interact with its internal UI widgets
      protected void paintDropShadow​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc, edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g, java.awt.Shape shape)  
      protected void paintHighlight​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc, V vertex, edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g, java.awt.Rectangle bounds)  
      protected java.awt.Shape transformFromLayoutToView​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc, edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout, V vertex, java.awt.Shape shape)
      Takes the given shape and translates its coordinates to the view space
      • Methods inherited from class edu.uci.ics.jung.visualization.renderers.BasicVertexRenderer

        paintIconForVertex, paintShapeForVertex, paintVertex, prepareFinalVertexShape, vertexHit
      • Methods inherited from class java.lang.Object

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

      • AbstractVisualVertexRenderer

        public AbstractVisualVertexRenderer()
    • Method Detail

      • getEmphasisGraphics

        protected edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator getEmphasisGraphics​(edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g,
                                                                                                       V vertex,
                                                                                                       edu.uci.ics.jung.visualization.RenderContext<V,​E> rc,
                                                                                                       edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout)
        Creates a copy of the given GraphicsDecorator that may have scaling tweaked to handle VisualVertex.getEmphasis() emphasized vertices.
      • paintHighlight

        protected void paintHighlight​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc,
                                      V vertex,
                                      edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g,
                                      java.awt.Rectangle bounds)
      • paintDropShadow

        protected void paintDropShadow​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc,
                                       edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g,
                                       java.awt.Shape shape)
      • isScaledPastVertexInteractionThreshold

        protected boolean isScaledPastVertexInteractionThreshold​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc)
        Returns true if the view is zoomed far enough out that the user cannot interact with its internal UI widgets
        Returns:
        true if the vertex is scaled past the interaction threshold
      • getCompactShape

        protected java.awt.Shape getCompactShape​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc,
                                                 edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout,
                                                 V vertex)
        Uses the render context to create a compact shape for the given vertex
        Parameters:
        rc - the render context
        layout - the layout
        vertex - the vertex
        Returns:
        the vertex shape
        See Also:
        VertexShapeProvider.getCompactShape()
      • getFullShape

        public java.awt.Shape getFullShape​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc,
                                           edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout,
                                           V vertex)
        Uses the render context to create a compact shape for the given vertex
        Parameters:
        rc - the render context
        layout - the layout
        vertex - the vertex
        Returns:
        the vertex shape
        See Also:
        VertexShapeProvider.getFullShape()
      • transformFromLayoutToView

        protected java.awt.Shape transformFromLayoutToView​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc,
                                                           edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout,
                                                           V vertex,
                                                           java.awt.Shape shape)
        Takes the given shape and translates its coordinates to the view space
        Parameters:
        rc - the render context
        layout - the model space layout
        vertex - the vertex
        shape - the shape to translate
        Returns:
        the new shape
      • adjustValueForCurrentScale

        protected double adjustValueForCurrentScale​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc,
                                                    double value,
                                                    double ratioToScale)
        Adjusts the given value based upon the current scale applied the the view. The more scaled out the view, the larger the value returned. This allows view effects to be discernable at scale.
        Parameters:
        rc - the render context
        value - the value to scale
        ratioToScale - the ratio to scale to
        Returns:
        the scaled value
      • getScale

        protected double getScale​(edu.uci.ics.jung.visualization.RenderContext<V,​E> rc)