Package ghidra.graph.viewer.vertex
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 typeE- 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
-
-
Constructor Summary
Constructors Constructor Description AbstractVisualVertexRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doubleadjustValueForCurrentScale(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.ShapegetCompactShape(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 vertexprotected edu.uci.ics.jung.visualization.transform.shape.GraphicsDecoratorgetEmphasisGraphics(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 givenGraphicsDecoratorthat may have scaling tweaked to handleVisualVertex.getEmphasis()emphasized vertices.java.awt.ShapegetFullShape(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 vertexprotected doublegetScale(edu.uci.ics.jung.visualization.RenderContext<V,E> rc)protected booleanisScaledPastVertexInteractionThreshold(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 widgetsprotected voidpaintDropShadow(edu.uci.ics.jung.visualization.RenderContext<V,E> rc, edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator g, java.awt.Shape shape)protected voidpaintHighlight(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.ShapetransformFromLayoutToView(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
-
-
-
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 givenGraphicsDecoratorthat may have scaling tweaked to handleVisualVertex.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 contextlayout- the layoutvertex- 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 contextlayout- the layoutvertex- 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 contextlayout- the model space layoutvertex- the vertexshape- 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 contextvalue- the value to scaleratioToScale- the ratio to scale to- Returns:
- the scaled value
-
-