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
-
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 vertexprotected 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 givenGraphicsDecorator
that may have scaling tweaked to handleVisualVertex.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 vertexprotected double
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 widgetsprotected 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 colorprotected 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 spaceMethods inherited from class edu.uci.ics.jung.visualization.renderers.BasicVertexRenderer
paintIconForVertex, paintShapeForVertex, paintVertex, prepareFinalVertexShape, vertexHit
-
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
-
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 givenGraphicsDecorator
that may have scaling tweaked to handleVisualVertex.getEmphasis()
emphasized vertices.- Parameters:
g
- the graphicsvertex
- the vertexrc
- the render contextlayout
- the graph layout- Returns:
- the new graphics
-
paintHighlight
-
paintDropShadow
-
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 contextlayout
- the layoutvertex
- 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 contextlayout
- the layoutvertex
- 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 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
-
getScale
-