Package ghidra.graph.viewer.layout
Class AbstractLayoutProvider<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>>
- java.lang.Object
-
- ghidra.graph.viewer.layout.AbstractLayoutProvider<V,E,G>
-
- Type Parameters:
V
- the vertex typeE
- the edge typeG
- the graph type
- All Implemented Interfaces:
LayoutProvider<V,E,G>
,LayoutProviderExtensionPoint<V,E,G>
,ExtensionPoint
- Direct Known Subclasses:
JungLayoutProvider
public abstract class AbstractLayoutProvider<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>> extends java.lang.Object implements LayoutProviderExtensionPoint<V,E,G>
A base implementation ofLayoutProvider
that stubs some default methods.Some clients extends this class and adapt their graph to use one of the provided Jung layouts. Other clients will implement the interface of this class to create a custom layout.
-
-
Constructor Summary
Constructors Constructor Description AbstractLayoutProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.Icon
getActionIcon()
Returns an icon that can be used to show the provider a menu or toolbar.int
getPriorityLevel()
Returns an arbitrary value that is relative to other LayoutProviders.protected void
initVertexLocations(G g, edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout)
Gives all vertices of the graph an initial, non-null location.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ghidra.graph.viewer.layout.LayoutProvider
getLayout, getLayoutName
-
-
-
-
Method Detail
-
getActionIcon
public javax.swing.Icon getActionIcon()
Description copied from interface:LayoutProvider
Returns an icon that can be used to show the provider a menu or toolbar. This may return null, as an icon is not a requirement.- Specified by:
getActionIcon
in interfaceLayoutProvider<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>>
- Returns:
- an icon that can be used to show the provider a menu or toolbar
-
getPriorityLevel
public int getPriorityLevel()
Description copied from interface:LayoutProvider
Returns an arbitrary value that is relative to other LayoutProviders. The higher the value the more preferred the provider will be over other providers.- Specified by:
getPriorityLevel
in interfaceLayoutProvider<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>>
- Returns:
- the priority
-
initVertexLocations
protected void initVertexLocations(G g, edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout)
Gives all vertices of the graph an initial, non-null location. This only works if the graph has been built before this method is called.Some graphs that have a layout will perform this same function as vertices are added.
- Parameters:
g
- the graphlayout
- the graph layout
-
-