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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJungWrappingVisualGraphLayoutAdapter(edu.uci.ics.jung.algorithms.layout.Layout<V, E> jungLayout) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutListener(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.voiddispose()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 layoutvoidbooleanvoidvoidremoveLayoutListener(LayoutListener<V, E> listener) Removes a layout listenervoidreset()voidvoidsetInitializer(com.google.common.base.Function<V, Point2D> t) voidsetLocation(V v, Point2D location) voidsetLocation(V v, Point2D location, LayoutListener.ChangeType changeType) Allows the client to change the location while specifying the type of changevoidbooleanReturns true if this layout uses articulated edges.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
initializein interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
reset
public void reset()- Specified by:
resetin interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
calculateLocations
Description copied from interface:VisualGraphLayoutSignals 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:
calculateLocationsin 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:VisualGraphLayoutCreates 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:
cloneLayoutin 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:VisualGraphLayoutReturns true if this layout uses articulated edges. AllVisualEdges 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:
usesEdgeArticulationsin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Returns:
- true if this layout uses articulated edges.
-
dispose
public void dispose()Description copied from interface:VisualGraphLayoutCleanup any resource being managed by this layout.- Specified by:
disposein interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>>
-
getGraph
- Specified by:
getGraphin interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
getSize
- Specified by:
getSizein interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
isLocked
- Specified by:
isLockedin interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
lock
- Specified by:
lockin interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
setGraph
- Specified by:
setGraphin interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
setInitializer
- Specified by:
setInitializerin interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
setSize
- Specified by:
setSizein interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
apply
- Specified by:
applyin interfacecom.google.common.base.Function<V extends VisualVertex,E extends VisualEdge<V>> - Specified by:
applyin interfaceFunction<V extends VisualVertex,E extends VisualEdge<V>>
-
getEdgeRenderer
Description copied from interface:VisualGraphLayoutReturns an optional edge renderer. This is used to render each edge.- Specified by:
getEdgeRendererin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Returns:
- an optional edge renderer
-
getEdgeShapeTransformer
Description copied from interface:VisualGraphLayoutReturns an optional edge shape transformer. This is used to create shapes for each edge.- Specified by:
getEdgeShapeTransformerin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Returns:
- an optional edge shape transformer
-
getEdgeLabelRenderer
Description copied from interface:VisualGraphLayoutReturns an optional custom edge label renderer. This is used to add labels to the edges.- Specified by:
getEdgeLabelRendererin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Returns:
- an optional renderer
-
addLayoutListener
Description copied from interface:VisualGraphLayoutAdds a layout listener- Specified by:
addLayoutListenerin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
listener- the listener
-
removeLayoutListener
Description copied from interface:VisualGraphLayoutRemoves a layout listener- Specified by:
removeLayoutListenerin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
listener- the listener
-
setLocation
- Specified by:
setLocationin interfaceedu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,E extends VisualEdge<V>>
-
setLocation
Description copied from interface:VisualGraphLayoutAllows the client to change the location while specifying the type of change- Specified by:
setLocationin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
v- the vertexlocation- the new locationchangeType- the type of change
-
getVisualGraph
Description copied from interface:VisualGraphLayoutReturns the graph of this layout- Specified by:
getVisualGraphin interfaceVisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> - Returns:
- the graph of this layout
-