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 Object
A 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)
and createSatelliteGraphViewer(GraphViewer, Dimension)
as needed. This allows
them to customize renderers and other viewer attributes. To use the subclass, see the
VisualGraphView
and its installGraphViewer()
method.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected GPickedState
<V> protected G
protected GraphViewer
<V, E> protected SatelliteGraphViewer
<V, E> protected VisualGraphOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
build()
protected GraphViewer
<V, E> createPrimaryGraphViewer
(VisualGraphLayout<V, E> layout, Dimension viewerSize) protected SatelliteGraphViewer
<V, E> createSatelliteGraphViewer
(GraphViewer<V, E> masterViewer, Dimension viewerSize) protected void
decoratePrimaryViewer
(GraphViewer<V, E> viewer, VisualGraphLayout<V, E> layout) This is called to configure the primary viewer's rendering settings.protected void
decorateSatelliteViewer
(SatelliteGraphViewer<V, E> viewer, VisualGraphLayout<V, E> layout) This is called to configure the satellite viewer's rendering settings.void
dispose()
getGraph()
protected V
Returns an empty rectangle if the satellite is not visibleprotected JComponent
protected VisualGraphViewUpdater
<V, E> boolean
protected boolean
This method is used to determine caching strategy.boolean
boolean
boolean
boolean
boolean
void
protected void
void
repaint()
protected void
void
setGraphOptions
(VisualGraphOptions options) void
void
setGraphViewStale
(boolean isStale) void
setPopupsVisible
(boolean visible) void
setSatelliteDocked
(boolean docked) void
setSatelliteVisible
(boolean visible) void
setStatusMessage
(String message) Sets a message to be painted on the viewer.void
void
setVertexFocused
(V vertex) Sets the given vertex to be the focused vertex.void
void
void
void
setVerticesSelected
(Collection<V> vertices) void
twinkleVertex
(V twinkleVertex) protected void
-
Field Details
-
gPickedState
-
graph
-
-
satelliteViewer
-
vgOptions
-
-
Constructor Details
-
GraphComponent
-
GraphComponent
protected GraphComponent()
-
-
Method Details
-
setGraph
-
build
protected void build() -
createPrimaryGraphViewer
protected GraphViewer<V,E> createPrimaryGraphViewer(VisualGraphLayout<V, E> layout, Dimension viewerSize) -
decoratePrimaryViewer
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, 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
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
-
setVertexClickListener
-
setGraphOptions
-
getGraphOptions
-
isUninitialized
public boolean isUninitialized() -
setGraphViewStale
public void setGraphViewStale(boolean isStale) -
isGraphViewStale
public boolean isGraphViewStale() -
setStatusMessage
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
-
optionsChanged
public void optionsChanged() -
repaint
public void repaint() -
getPrimaryViewer
-
getSatelliteViewer
-
getViewUpdater
-
getSatelliteBounds
Returns an empty rectangle if the satellite is not visible- Returns:
- the bounds
-
getInitialVertex
-
zoomInCompletely
-
setGraphPerspective
-
setVertexFocused
Sets the given vertex to be the focused vertex. This will be the only focused vertex.- Parameters:
vertex
- the vertex
-
setVerticesSelected
-
twinkleVertex
-
isSatelliteComponent
-
getSatelliteContentComponent
-
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
-
setVertexHoverPathHighlightMode
-
getVertexFocusPathHighlightMode
-
setVertexFocusPathHighlightMode
-
getRenderContext
-
getGraph
-
getPathHighlighter
-
refreshCurrentLayout
protected void refreshCurrentLayout() -
dispose
public void dispose()
-