Package ghidra.graph.viewer.layout
Class JungWrappingVisualGraphLayoutAdapter<V extends VisualVertex,E extends VisualEdge<V>>
java.lang.Object
ghidra.graph.viewer.layout.JungWrappingVisualGraphLayoutAdapter<V,E>
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
com.google.common.base.Function<V,
,Point2D> edu.uci.ics.jung.algorithms.layout.Layout<V,
,E> VisualGraphLayout<V,
,E> Function<V,
Point2D>
- Direct Known Subclasses:
JungLayout
public class JungWrappingVisualGraphLayoutAdapter<V extends VisualVertex,E extends VisualEdge<V>>
extends Object
implements VisualGraphLayout<V,E>
A wrapper that allows for existing Jung layouts to be used inside of the Visual Graph system.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJungWrappingVisualGraphLayoutAdapter
(edu.uci.ics.jung.algorithms.layout.Layout<V, E> jungLayout) -
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.cloneJungLayout
(VisualGraph<V, E> newGraph) 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.getGraph()
getSize()
Returns the graph of this layoutvoid
boolean
void
void
removeLayoutListener
(LayoutListener<V, E> listener) Removes a layout listenervoid
reset()
void
void
setInitializer
(com.google.common.base.Function<V, Point2D> t) void
setLocation
(V v, Point2D location) void
setLocation
(V v, Point2D location, LayoutListener.ChangeType changeType) Allows the client to change the location while specifying the type of changevoid
boolean
Returns true if this layout uses articulated edges.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
delegate
protected edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>> delegate
-
-
Constructor Details
-
JungWrappingVisualGraphLayoutAdapter
-
-
Method Details
-
initialize
public void initialize()- Specified by:
initialize
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
reset
public void reset()- Specified by:
reset
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
calculateLocations
Description copied from interface:VisualGraphLayout
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.- Specified by:
calculateLocations
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - 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
Description copied from interface:VisualGraphLayout
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)).- Specified by:
cloneLayout
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Parameters:
newGraph
- the new graph for the new layout- Returns:
- the new layout
-
cloneJungLayout
-
usesEdgeArticulations
public boolean usesEdgeArticulations()Description copied from interface:VisualGraphLayout
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.)- Specified by:
usesEdgeArticulations
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Returns:
- true if this layout uses articulated edges.
-
dispose
public void dispose()Description copied from interface:VisualGraphLayout
Cleanup any resource being managed by this layout.- Specified by:
dispose
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>>
-
getGraph
- Specified by:
getGraph
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
getSize
- Specified by:
getSize
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
isLocked
- Specified by:
isLocked
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
lock
- Specified by:
lock
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
setGraph
- Specified by:
setGraph
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
setInitializer
- Specified by:
setInitializer
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
setSize
- Specified by:
setSize
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
apply
- Specified by:
apply
in interfacecom.google.common.base.Function<V extends VisualVertex,
E extends VisualEdge<V>> - Specified by:
apply
in interfaceFunction<V extends VisualVertex,
E extends VisualEdge<V>>
-
getEdgeRenderer
Description copied from interface:VisualGraphLayout
Returns an optional edge renderer. This is used to render each edge.- Specified by:
getEdgeRenderer
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Returns:
- an optional edge renderer
-
getEdgeShapeTransformer
Description copied from interface:VisualGraphLayout
Returns an optional edge shape transformer. This is used to create shapes for each edge.- Specified by:
getEdgeShapeTransformer
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Returns:
- an optional edge shape transformer
-
getEdgeLabelRenderer
Description copied from interface:VisualGraphLayout
Returns an optional custom edge label renderer. This is used to add labels to the edges.- Specified by:
getEdgeLabelRenderer
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Returns:
- an optional renderer
-
addLayoutListener
Description copied from interface:VisualGraphLayout
Adds a layout listener- Specified by:
addLayoutListener
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Parameters:
listener
- the listener
-
removeLayoutListener
Description copied from interface:VisualGraphLayout
Removes a layout listener- Specified by:
removeLayoutListener
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Parameters:
listener
- the listener
-
setLocation
- Specified by:
setLocation
in interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,
E extends VisualEdge<V>>
-
setLocation
Description copied from interface:VisualGraphLayout
Allows the client to change the location while specifying the type of change- Specified by:
setLocation
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Parameters:
v
- the vertexlocation
- the new locationchangeType
- the type of change
-
getVisualGraph
Description copied from interface:VisualGraphLayout
Returns the graph of this layout- Specified by:
getVisualGraph
in interfaceVisualGraphLayout<V extends VisualVertex,
E extends VisualEdge<V>> - Returns:
- the graph of this layout
-