Package ghidra.graph.viewer.layout
Interface VisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>>
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Superinterfaces:
com.google.common.base.Function<V,
,Point2D> Function<V,
,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 of
Layout
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayoutListener
(LayoutListener<V, E> listener) Adds a layout listenercalculateLocations
(VisualGraph<V, E> graph, TaskMonitor monitor) Signals to again layout the current graph.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.Returns an optional custom edge label renderer.Returns an optional edge renderer.Returns an optional edge shape transformer.Returns the graph of this layoutvoid
removeLayoutListener
(LayoutListener<V, E> listener) Removes a layout listenervoid
setLocation
(V v, Point2D location, LayoutListener.ChangeType changeType) Allows the client to change the location while specifying the type of changeboolean
Returns true if this layout uses articulated edges.Methods inherited from interface com.google.common.base.Function
apply, equals
Methods inherited from interface edu.uci.ics.jung.algorithms.layout.Layout
getGraph, getSize, initialize, isLocked, lock, reset, setGraph, setInitializer, setLocation, setSize
-
Method Details
-
addLayoutListener
Adds a layout listener- Parameters:
listener
- the listener
-
removeLayoutListener
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.)- Returns:
- true if this layout uses articulated edges.
-
calculateLocations
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- Returns:
- the layout locations
-
cloneLayout
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
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
Returns an optional edge renderer. This is used to render each edge.- Returns:
- an optional edge renderer
-
getEdgeShapeTransformer
Returns an optional edge shape transformer. This is used to create shapes for each edge.- Returns:
- an optional edge shape transformer
-
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.
-