Class VisualGraphView<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>>

java.lang.Object
ghidra.graph.viewer.VisualGraphView<V,E,G>
Type Parameters:
V - the vertex type
E - the edge type
G - the graph type

public class VisualGraphView<V extends VisualVertex,E extends VisualEdge<V>,G extends VisualGraph<V,E>> extends Object
A view object, where 'view' is used in the sense of the Model-View-Controller (MVC) pattern. This class will contain all UI widgets need to display and interact with a graph.

Implementation Note:

  1. The graph of this component can be null, changing to non-null values over the lifetime of this view. This allows this view to be installed in a UI component, with the contents changing as needed.
  2. When the graph is set, the view portion of the class is recreated.
  3. At any given point in time there may not be a graphComponent. This means that this class must maintain settings state that it will apply when the component is created. This state is atypical and makes this class a bit harder to understand.
  • Field Details Link icon

  • Constructor Details Link icon

    • VisualGraphView Link icon

      public VisualGraphView()
  • Method Details Link icon

    • getViewComponent Link icon

      public JComponent getViewComponent()
    • setSouthComponent Link icon

      protected void setSouthComponent(JComponent component)
    • removeSatellite Link icon

      protected void removeSatellite()
    • optionsChanged Link icon

      public void optionsChanged()
      Called when the options used by this graph view have changed
    • setLayoutProvider Link icon

      public void setLayoutProvider(LayoutProvider<V,E,G> newLayoutProvider)
      Sets the given layout provider, but does not actually perform a layout.
      Parameters:
      newLayoutProvider - the new provider
    • setGraph Link icon

      public void setGraph(G graph)
    • setSatelliteListener Link icon

      public void setSatelliteListener(GraphSatelliteListener l)
    • setVertexFocusListener Link icon

      public void setVertexFocusListener(VertexFocusListener<V> l)
    • setVertexClickListener Link icon

      public void setVertexClickListener(VertexClickListener<V,E> l)
      Sets a listener that allows clients to be notified of vertex double-clicks. Normal mouse processing is handled by the VisualGraphMousePlugin class. This is a convenience method so that clients do not have to deal with the mouse plugin.
      Parameters:
      l - the listener
    • installGraphViewer Link icon

      protected void installGraphViewer()
    • setGraphComponent Link icon

      protected void setGraphComponent(GraphComponent<V,E,G> newComponent)
    • setContent Link icon

      protected void setContent(Component c)
    • getWithBusyCursor Link icon

      protected <T> T getWithBusyCursor(Supplier<T> s)
    • getVisualGraph Link icon

      public G getVisualGraph()
    • getPrimaryGraphViewer Link icon

      public GraphViewer<V,E> getPrimaryGraphViewer()
      Returns the primary viewer of the graph (as opposed to the satellite viewer). The viewer returned is responsible for maintaining view information for a given graph.
      Returns:
      the primary viewer
    • getSatelliteViewer Link icon

      public SatelliteGraphViewer<V,E> getSatelliteViewer()
    • setGraphPerspective Link icon

      public void setGraphPerspective(GraphPerspectiveInfo<V,E> newPerspective)
      Sets the perspective for this view
      Parameters:
      newPerspective - the new perspective
    • generateGraphPerspective Link icon

      public GraphPerspectiveInfo<V,E> generateGraphPerspective()
    • showErrorView Link icon

      public void showErrorView(String errorMessage)
    • setStatusMessage Link icon

      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 status message
    • getGraphComponent Link icon

      public GraphComponent<V,E,G> getGraphComponent()
    • isSatelliteVisible Link icon

      public boolean isSatelliteVisible()
      Returns whether the satellite intended to be visible. If this component is built, then a result of true means that the satellite is showing. If the component is not yet built, then a result of true means that the satellite will be made visible when the component is built.
      Returns:
      true if visible
    • setSatelliteVisible Link icon

      public void setSatelliteVisible(boolean visible)
    • setSatelliteDocked Link icon

      public void setSatelliteDocked(boolean docked)
    • setSatellitePosition Link icon

      public void setSatellitePosition(GraphComponent.SatellitePosition position)
    • getSatellitePosition Link icon

      public GraphComponent.SatellitePosition getSatellitePosition()
    • isSatelliteDocked Link icon

      public boolean isSatelliteDocked()
      Returns whether the satellite intended to be docked. If this component is built, then a result of true means that the satellite is docked. If the component is not yet built, then a result of true means that the satellite will be made docked when the component is built.
      Returns:
      true if visible
    • setPopupsVisible Link icon

      public void setPopupsVisible(boolean visible)
    • arePopupsEnabled Link icon

      public boolean arePopupsEnabled()
    • getUndockedSatelliteComponent Link icon

      public JComponent getUndockedSatelliteComponent()
    • isSatelliteComponent Link icon

      public boolean isSatelliteComponent(Component c)
    • setVertexHoverPathHighlightMode Link icon

      public void setVertexHoverPathHighlightMode(PathHighlightMode mode)
    • setVertexFocusPathHighlightMode Link icon

      public void setVertexFocusPathHighlightMode(PathHighlightMode mode)
    • getVertexFocusPathHighlightMode Link icon

      public PathHighlightMode getVertexFocusPathHighlightMode()
    • getVertexHoverPathHighlightMode Link icon

      public PathHighlightMode getVertexHoverPathHighlightMode()
    • setTooltipProvider Link icon

      public void setTooltipProvider(VertexTooltipProvider<V,E> provider)
    • zoomOutGraph Link icon

      public void zoomOutGraph()
    • zoomInGraph Link icon

      public void zoomInGraph()
    • zoomToVertex Link icon

      public void zoomToVertex(V v)
    • zoomToWindow Link icon

      public void zoomToWindow()
    • getViewUpdater Link icon

      public VisualGraphViewUpdater<V,E> getViewUpdater()
    • getVertexPointInViewSpace Link icon

      public Point getVertexPointInViewSpace(V v)
    • translatePointFromVertexToViewSpace Link icon

      public Point translatePointFromVertexToViewSpace(V v, Point p)
    • translateRectangleFromVertexToViewSpace Link icon

      public Rectangle translateRectangleFromVertexToViewSpace(V v, Rectangle r)
    • translateMouseEventFromVertexToViewSpace Link icon

      public MouseEvent translateMouseEventFromVertexToViewSpace(V v, MouseEvent e)
    • isScaledPastInteractionThreshold Link icon

      public boolean isScaledPastInteractionThreshold()
    • maybeTwinkleVertex Link icon

      protected void maybeTwinkleVertex(V twinkleVertex, boolean doTwinkle)
    • requestFocus Link icon

      public void requestFocus()
    • repaint Link icon

      public void repaint()
    • getFocusedVertex Link icon

      public V getFocusedVertex()
    • getSelectedVertices Link icon

      public Set<V> getSelectedVertices()
    • getLayoutProvider Link icon

      public LayoutProvider<V,E,G> getLayoutProvider()
    • cleanup Link icon

      public void cleanup()
      Effectively clears this display. This method is not called dispose, as that implies the end of an object's lifecycle. This object can be re-used after this method is called.
    • disposeViewer Link icon

      protected void disposeViewer()