Package ghidra.graph.viewer
Class GraphComponent<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>>
- java.lang.Object
-
- ghidra.graph.viewer.GraphComponent<V,E,G>
-
- Type Parameters:
V- the vertex typeE- the edge typeG- the graph type
public class GraphComponent<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>> extends java.lang.ObjectA component that contains primary and satellite graph views. This viewer provides methods for manipulating the graph using the mouse.To gain the full functionality offered by this class, clients will need to subclass this class and override
createPrimaryGraphViewer(VisualGraphLayout, Dimension)andcreateSatelliteGraphViewer(GraphViewer, Dimension)as needed. This allows them to customize renderers and other viewer attributes. To use the subclass, see theVisualGraphViewand itsinstallGraphViewer()method.- See Also:
GraphViewer
-
-
Field Summary
Fields Change Modifier and Type Field Description NEW protected GPickedState<V>gPickedStateNEW protected GgraphNEW protected GraphViewer<V,E>primaryViewerNEW protected SatelliteGraphViewer<V,E>satelliteViewer
-
Constructor Summary
Constructors Change Modifier Constructor Description protectedGraphComponent()GraphComponent(G graph)
-
Method Summary
All Methods Instance Methods Concrete Methods Change Modifier and Type Method Description NEW protected voidbuild()protected GraphViewer<V,E>createPrimaryGraphViewer(VisualGraphLayout<V,E> layout, java.awt.Dimension viewerSize)protected SatelliteGraphViewer<V,E>createSatelliteGraphViewer(GraphViewer<V,E> masterViewer, java.awt.Dimension viewerSize)protected voiddecoratePrimaryViewer(GraphViewer<V,E> viewer, VisualGraphLayout<V,E> layout)This is called to configure the primary viewer's rendering settings.protected voiddecorateSatelliteViewer(SatelliteGraphViewer<V,E> viewer, VisualGraphLayout<V,E> layout)This is called to configure the satellite viewer's rendering settings.voiddispose()javax.swing.JComponentgetComponent()GgetGraph()NEW protected VgetInitialVertex()VisualGraphPathHighlighter<V,E>getPathHighlighter()GraphViewer<V,E>getPrimaryViewer()edu.uci.ics.jung.visualization.RenderContext<V,E>getRenderContext()java.awt.RectanglegetSatelliteBounds()Returns an empty rectangle if the satellite is not visibleNEW protected javax.swing.JComponentgetSatelliteContentComponent()SatelliteGraphViewer<V,E>getSatelliteViewer()PathHighlightModegetVertexFocusPathHighlightMode()PathHighlightModegetVertexHoverPathHighlightMode()NEW protected VisualGraphViewUpdater<V,E>getViewUpdater()booleanisGraphViewStale()NEW protected booleanisReallyBigData()This method is used to determine caching strategy.booleanisSatelliteComponent(java.awt.Component c)booleanisSatelliteDocked()booleanisSatelliteShowing()booleanisSatelliteUnDocked()booleanisUninitialized()NEW protected voidrefreshCurrentLayout()voidrepaint()NEW protected voidsetGraph(G g)voidsetGraphOptions(VisualGraphOptions options)voidsetGraphPerspective(GraphPerspectiveInfo<V,E> info)voidsetGraphViewStale(boolean isStale)voidsetPopupsVisible(boolean visible)voidsetSatelliteDocked(boolean docked)voidsetSatelliteVisible(boolean visible)voidsetStatusMessage(java.lang.String message)Sets a message to be painted on the viewer.voidsetVertexClickListener(VertexClickListener<V,E> l)voidsetVertexFocused(V vertex)Sets the given vertex to be the focused vertex.voidsetVertexFocusListener(VertexFocusListener<V> l)voidsetVertexFocusPathHighlightMode(PathHighlightMode mode)voidsetVertexHoverPathHighlightMode(PathHighlightMode mode)voidsetVerticesSelected(java.util.Collection<V> vertices)voidtwinkleVertex(V twinkleVertex)NEW protected voidzoomInCompletely(V v)
-
-
-
Field Detail
-
gPickedState NEW
protected GPickedState<V extends VisualVertex> gPickedState
-
graph NEW
protected G extends VisualGraph<V,E> graph
-
primaryViewer NEW
protected GraphViewer<V extends VisualVertex,E extends VisualEdge<V>> primaryViewer
-
satelliteViewer NEW
protected SatelliteGraphViewer<V extends VisualVertex,E extends VisualEdge<V>> satelliteViewer
Constructor Detail
-
GraphComponent
public GraphComponent(G graph)
-
GraphComponent
protected GraphComponent()
-
-
Method Detail
-
setGraph NEW
protected void setGraph(G g)
-
createPrimaryGraphViewer
protected GraphViewer<V,E> createPrimaryGraphViewer(VisualGraphLayout<V,E> layout, java.awt.Dimension viewerSize)
-
decoratePrimaryViewer
protected void decoratePrimaryViewer(GraphViewer<V,E> viewer, VisualGraphLayout<V,E> layout)
This is called to configure the primary viewer's rendering settings. Subclasses can override this method to change, as needed.- Parameters:
viewer- the new satellite viewerlayout- the viewer's layout
-
createSatelliteGraphViewer
protected SatelliteGraphViewer<V,E> createSatelliteGraphViewer(GraphViewer<V,E> masterViewer, java.awt.Dimension viewerSize)
-
decorateSatelliteViewer
protected void decorateSatelliteViewer(SatelliteGraphViewer<V,E> viewer, VisualGraphLayout<V,E> layout)
This is called to configure the satellite viewer's rendering settings. Subclasses can override this method to change, as needed.- Parameters:
viewer- the new satellite viewerlayout- the viewer's layout
-
isReallyBigData NEW
protected boolean isReallyBigData()
This method is used to determine caching strategy. For example, large graph will trigger the us of a cached satellite view, for performance reasons.- Returns:
- true if the data is considered 'really big'
-
setVertexFocusListener
public void setVertexFocusListener(VertexFocusListener<V> l)
-
setVertexClickListener
public void setVertexClickListener(VertexClickListener<V,E> l)
-
setGraphOptions
public void setGraphOptions(VisualGraphOptions options)
-
isUninitialized
public boolean isUninitialized()
-
setGraphViewStale
public void setGraphViewStale(boolean isStale)
-
isGraphViewStale
public boolean isGraphViewStale()
-
setStatusMessage
public void setStatusMessage(java.lang.String message)
Sets a message to be painted on the viewer. This is useful to show a text message to the user. Passing null will clear the message.- Parameters:
message- the message
-
getComponent
public javax.swing.JComponent getComponent()
-
repaint
public void repaint()
-
getPrimaryViewer
public GraphViewer<V,E> getPrimaryViewer()
-
getSatelliteViewer
public SatelliteGraphViewer<V,E> getSatelliteViewer()
-
getViewUpdater NEW
protected VisualGraphViewUpdater<V,E> getViewUpdater()
-
getSatelliteBounds
public java.awt.Rectangle getSatelliteBounds()
Returns an empty rectangle if the satellite is not visible- Returns:
- the bounds
-
getInitialVertex NEW
protected V getInitialVertex()
-
zoomInCompletely NEW
protected void zoomInCompletely(V v)
-
setGraphPerspective
public void setGraphPerspective(GraphPerspectiveInfo<V,E> info)
-
setVertexFocused
public void setVertexFocused(V vertex)
Sets the given vertex to be the focused vertex. This will be the only focused vertex.- Parameters:
vertex- the vertex
-
setVerticesSelected
public void setVerticesSelected(java.util.Collection<V> vertices)
-
twinkleVertex
public void twinkleVertex(V twinkleVertex)
-
isSatelliteComponent
public boolean isSatelliteComponent(java.awt.Component c)
-
setSatelliteDocked
public void setSatelliteDocked(boolean docked)
-
setSatelliteVisible
public void setSatelliteVisible(boolean visible)
-
isSatelliteShowing
public boolean isSatelliteShowing()
-
isSatelliteDocked
public boolean isSatelliteDocked()
-
isSatelliteUnDocked
public boolean isSatelliteUnDocked()
-
setPopupsVisible
public void setPopupsVisible(boolean visible)
-
getVertexHoverPathHighlightMode
public PathHighlightMode getVertexHoverPathHighlightMode()
-
setVertexHoverPathHighlightMode
public void setVertexHoverPathHighlightMode(PathHighlightMode mode)
-
getVertexFocusPathHighlightMode
public PathHighlightMode getVertexFocusPathHighlightMode()
-
setVertexFocusPathHighlightMode
public void setVertexFocusPathHighlightMode(PathHighlightMode mode)
-
getGraph
public G getGraph()
-
getPathHighlighter
public VisualGraphPathHighlighter<V,E> getPathHighlighter()
-
dispose
public void dispose()
-
-