Package ghidra.graph.viewer.layout
Interface VisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>>
-
- Type Parameters:
V
- the vertex typeE
- the edge typeG
- the graph type
- All Superinterfaces:
com.google.common.base.Function<V,java.awt.geom.Point2D>
,edu.uci.ics.jung.algorithms.layout.Layout<V,E>
- All Known Implementing Classes:
AbstractVisualGraphLayout
,JungLayout
,JungWrappingVisualGraphLayoutAdapter
public interface VisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> extends edu.uci.ics.jung.algorithms.layout.Layout<V,E>
The interface for defining functions provided that are additional to that ofLayout
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addLayoutListener(LayoutListener<V,E> listener)
Adds a layout listenerLayoutPositions<V,E>
calculateLocations(VisualGraph<V,E> graph, TaskMonitor monitor)
Signals to again layout the current graph.VisualGraphLayout<V,E>
cloneLayout(VisualGraph<V,E> newGraph)
Creates a new version of this layout using the given graph.void
dispose()
Cleanup any resource being managed by this layout.edu.uci.ics.jung.visualization.renderers.Renderer.EdgeLabel<V,E>
getEdgeLabelRenderer()
Returns an optional custom edge label renderer.edu.uci.ics.jung.visualization.renderers.BasicEdgeRenderer<V,E>
getEdgeRenderer()
Returns an optional edge renderer.com.google.common.base.Function<E,java.awt.Shape>
getEdgeShapeTransformer()
Returns an optional edge shape transformer.VisualGraph<V,E>
getVisualGraph()
Returns the graph of this layoutvoid
removeLayoutListener(LayoutListener<V,E> listener)
Removes a layout listenervoid
setLocation(V v, java.awt.geom.Point2D location, LayoutListener.ChangeType changeType)
Allows the client to change the location while specifying the type of changeboolean
usesEdgeArticulations()
Returns true if this layout uses articulated edges.
-
-
-
Method Detail
-
addLayoutListener
void addLayoutListener(LayoutListener<V,E> listener)
Adds a layout listener- Parameters:
listener
- the listener
-
removeLayoutListener
void removeLayoutListener(LayoutListener<V,E> listener)
Removes a layout listener- Parameters:
listener
- the listener
-
usesEdgeArticulations
boolean usesEdgeArticulations()
Returns true if this layout uses articulated edges. AllVisualEdge
s have the ability to articulate. This method servers as a shortcut for algorithms so that they need not loop over all edges to determine if they have articulations. (Looping over large graphs is time intensive.)What are articulations?
- Returns:
- true if this layout uses articulated edges.
- See Also:
ArticulatedEdge
-
calculateLocations
LayoutPositions<V,E> calculateLocations(VisualGraph<V,E> graph, TaskMonitor monitor)
Signals to again layout the current graph. The locations generated by the layout will be returned, but not actually applied to the graph. This allows clients to generate new locations and then apply them in a delayed fashion, like for animation.- Parameters:
graph
- the graph that contains the vertices to layoutmonitor
- the task monitor used to report progress or to cancel
-
cloneLayout
VisualGraphLayout<V,E> cloneLayout(VisualGraph<V,E> newGraph)
Creates a new version of this layout using the given graph. Also, the new layout will have the same state as this layout (i.e., vertex positions (and edge articulations, if applicable)).- Parameters:
newGraph
- the new graph for the new layout- Returns:
- the new layout
-
setLocation
void setLocation(V v, java.awt.geom.Point2D location, LayoutListener.ChangeType changeType)
Allows the client to change the location while specifying the type of change- Parameters:
v
- the vertexlocation
- the new locationchangeType
- the type of change
-
getVisualGraph
VisualGraph<V,E> getVisualGraph()
Returns the graph of this layout- Returns:
- the graph of this layout
-
getEdgeRenderer
edu.uci.ics.jung.visualization.renderers.BasicEdgeRenderer<V,E> getEdgeRenderer()
Returns an optional edge renderer. This is used to render each edge.- Returns:
- an optional edge renderer
-
getEdgeShapeTransformer
com.google.common.base.Function<E,java.awt.Shape> getEdgeShapeTransformer()
Returns an optional edge shape transformer. This is used to create shapes for each edge.- Returns:
- an optional edge shape transformer
-
getEdgeLabelRenderer
edu.uci.ics.jung.visualization.renderers.Renderer.EdgeLabel<V,E> getEdgeLabelRenderer()
Returns an optional custom edge label renderer. This is used to add labels to the edges.- Returns:
- an optional renderer
-
dispose
void dispose()
Cleanup any resource being managed by this layout.
-
-