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 type
  `E` - the edge type
  `G` - 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:
  - `GraphViewer`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected GPickedState<V>`
  `gPickedState`
  `protected G`
  `graph`
  `protected GraphViewer<V,E>`
  `primaryViewer`
  `protected SatelliteGraphViewer<V,E>`
  `satelliteViewer`
  `protected VisualGraphOptions`
  `vgOptions`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `GraphComponent()`
  ``
  `GraphComponent(G graph)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected 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()`
  `JComponent`
  `getComponent()`
  `G`
  `getGraph()`
  `VisualGraphOptions`
  `getGraphOptions()`
  `protected V`
  `getInitialVertex()`
  `VisualGraphPathHighlighter<V,E>`
  `getPathHighlighter()`
  `GraphViewer<V,E>`
  `getPrimaryViewer()`
  `edu.uci.ics.jung.visualization.RenderContext<V,E>`
  `getRenderContext()`
  `Rectangle`
  `getSatelliteBounds()`
  Returns an empty rectangle if the satellite is not visible
  `protected JComponent`
  `getSatelliteContentComponent()`
  `SatelliteGraphViewer<V,E>`
  `getSatelliteViewer()`
  `PathHighlightMode`
  `getVertexFocusPathHighlightMode()`
  `PathHighlightMode`
  `getVertexHoverPathHighlightMode()`
  `protected VisualGraphViewUpdater<V,E>`
  `getViewUpdater()`
  `boolean`
  `isGraphViewStale()`
  `protected boolean`
  `isReallyBigData()`
  This method is used to determine caching strategy.
  `boolean`
  `isSatelliteComponent(Component c)`
  `boolean`
  `isSatelliteDocked()`
  `boolean`
  `isSatelliteShowing()`
  `boolean`
  `isSatelliteUnDocked()`
  `boolean`
  `isUninitialized()`
  `void`
  `optionsChanged()`
  `protected void`
  `refreshCurrentLayout()`
  `void`
  `repaint()`
  `protected void`
  `setGraph(G g)`
  `void`
  `setGraphOptions(VisualGraphOptions options)`
  `void`
  `setGraphPerspective(GraphPerspectiveInfo<V,E> info)`
  `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`
  `setVertexClickListener(VertexClickListener<V,E> l)`
  `void`
  `setVertexFocused(V vertex)`
  Sets the given vertex to be the focused vertex.
  `void`
  `setVertexFocusListener(VertexFocusListener<V> l)`
  `void`
  `setVertexFocusPathHighlightMode(PathHighlightMode mode)`
  `void`
  `setVertexHoverPathHighlightMode(PathHighlightMode mode)`
  `void`
  `setVerticesSelected(Collection<V> vertices)`
  `void`
  `twinkleVertex(V twinkleVertex)`
  `protected void`
  `zoomInCompletely(V v)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### gPickedState

    protected GPickedState<V extends VisualVertex> gPickedState

  - ### graph

    protected G extends VisualGraph<V,E> graph

  - ### primaryViewer

    protected GraphViewer<V extends VisualVertex,E extends VisualEdge<V>> primaryViewer

  - ### satelliteViewer

    protected SatelliteGraphViewer<V extends VisualVertex,E extends VisualEdge<V>> satelliteViewer

  - ### vgOptions

    protected VisualGraphOptions vgOptions

- ## Constructor Details

  - ### GraphComponent

    public GraphComponent(G graph)

  - ### GraphComponent

    protected GraphComponent()

- ## Method Details

  - ### setGraph

    protected void setGraph(G g)

  - ### build

    protected void build()

  - ### createPrimaryGraphViewer

    protected GraphViewer<V,E> createPrimaryGraphViewer(VisualGraphLayout<V,E> layout, 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 viewer
      `layout` - 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 viewer
      `layout` - 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

    public void setVertexFocusListener(VertexFocusListener<V> l)

  - ### setVertexClickListener

    public void setVertexClickListener(VertexClickListener<V,E> l)

  - ### setGraphOptions

    public void setGraphOptions(VisualGraphOptions options)

  - ### getGraphOptions

    public VisualGraphOptions getGraphOptions()

  - ### isUninitialized

    public boolean isUninitialized()

  - ### setGraphViewStale

    public void setGraphViewStale(boolean isStale)

  - ### isGraphViewStale

    public boolean isGraphViewStale()

  - ### setStatusMessage

    public void setStatusMessage(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 JComponent getComponent()

  - ### optionsChanged

    public void optionsChanged()

  - ### repaint

    public void repaint()

  - ### getPrimaryViewer

    public GraphViewer<V,E> getPrimaryViewer()

  - ### getSatelliteViewer

    public SatelliteGraphViewer<V,E> getSatelliteViewer()

  - ### getViewUpdater

    protected VisualGraphViewUpdater<V,E> getViewUpdater()

  - ### getSatelliteBounds

    public Rectangle getSatelliteBounds()
    Returns an empty rectangle if the satellite is not visible
    Returns:
      the bounds

  - ### getInitialVertex

    protected V getInitialVertex()

  - ### zoomInCompletely

    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(Collection<V> vertices)

  - ### twinkleVertex

    public void twinkleVertex(V twinkleVertex)

  - ### isSatelliteComponent

    public boolean isSatelliteComponent(Component c)

  - ### getSatelliteContentComponent

    protected JComponent 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

    public PathHighlightMode getVertexHoverPathHighlightMode()

  - ### setVertexHoverPathHighlightMode

    public void setVertexHoverPathHighlightMode(PathHighlightMode mode)

  - ### getVertexFocusPathHighlightMode

    public PathHighlightMode getVertexFocusPathHighlightMode()

  - ### setVertexFocusPathHighlightMode

    public void setVertexFocusPathHighlightMode(PathHighlightMode mode)

  - ### getRenderContext

    public edu.uci.ics.jung.visualization.RenderContext<V,E> getRenderContext()

  - ### getGraph

    public G getGraph()

  - ### getPathHighlighter

    public VisualGraphPathHighlighter<V,E> getPathHighlighter()

  - ### refreshCurrentLayout

    protected void refreshCurrentLayout()

  - ### dispose

    public void dispose()