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

java.lang.Object
edu.uci.ics.jung.visualization.renderers.BasicVertexRenderer<V,E>
ghidra.graph.viewer.vertex.AbstractVisualVertexRenderer<V,E>
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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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 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.
    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)
     
    com.google.common.base.Function<? super V,Paint>
     
    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, 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, Rectangle bounds)
     
    void
    setVertexFillPaintTransformer(com.google.common.base.Function<? super V,Paint> transformer)
    Sets the optional transformer used to convert a vertex into a color
    protected Shape
    transformFromLayoutToView(edu.uci.ics.jung.visualization.RenderContext<V,E> rc, edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout, V vertex, 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 Details

    • AbstractVisualVertexRenderer

      public AbstractVisualVertexRenderer()
  • Method Details

    • setVertexFillPaintTransformer

      public void setVertexFillPaintTransformer(com.google.common.base.Function<? super V,Paint> transformer)
      Sets the optional transformer used to convert a vertex into a color
      Parameters:
      transformer - the transformer
    • getVertexFillPaintTransformer

      public com.google.common.base.Function<? super V,Paint> getVertexFillPaintTransformer()
    • 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.
      Parameters:
      g - the graphics
      vertex - the vertex
      rc - the render context
      layout - the graph layout
      Returns:
      the new graphics
    • paintHighlight

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

      protected void paintDropShadow(edu.uci.ics.jung.visualization.RenderContext<V,E> rc, edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g, 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
      Parameters:
      rc - the render context
      Returns:
      true if the vertex is scaled past the interaction threshold
    • getCompactShape

      protected 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:
    • getFullShape

      public 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:
    • transformFromLayoutToView

      protected Shape transformFromLayoutToView(edu.uci.ics.jung.visualization.RenderContext<V,E> rc, edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout, V vertex, 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)