Package ghidra.graph.viewer

# Interface VisualVertex

All Superinterfaces:
  `GVertex`

All Known Implementing Classes:
  `AbstractVisualVertex`, `CircleWithLabelVertex`, `DockingVisualVertex`

public interface VisualVertex extends GVertex
A vertex that contains properties and state related to a user interface.

equals() and hashCode() - The graph API allows for cloning of layouts. For this to correctly copy layout locations, each edge must override `equals` and `hashCode` in order to properly find edges across graphs.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dispose()`
  A dispose method that should be called when a vertex is reclaimed, never again to be used in a graph or display
  `double`
  `getAlpha()`
  Get the alpha, which determines how much of the vertex is visible/see through.
  `JComponent`
  `getComponent()`
  Returns the component of this vertex.
  `double`
  `getEmphasis()`
  Returns the emphasis value of this vertex.
  `Point2D`
  `getLocation()`
  Returns the location of this vertex in the view
  `boolean`
  `isFocused()`
  Returns true if this vertex is focused (see `setFocused(boolean)`
  `boolean`
  `isGrabbable(Component c)`
  Returns true if the given component of this vertex is grabbable, which means that mouse drags on that component will move the vertex.
  `boolean`
  `isHovered()`
  Returns true if this vertex is being hovered by the mouse
  `boolean`
  `isSelected()`
  Returns true if this vertex is selected
  `void`
  `setAlpha(double alpha)`
  Set the alpha, which determines how much of the vertex is visible/see through.
  `void`
  `setEmphasis(double emphasisLevel)`
  Sets the emphasis value for this vertex.
  `void`
  `setFocused(boolean focused)`
  Sets this vertex to be focused.
  `void`
  `setHovered(boolean hovered)`
  Sets this vertex to be hovered
  `void`
  `setLocation(Point2D p)`
  Sets the location of this vertex in the view
  `void`
  `setSelected(boolean selected)`
  Sets this vertex selected

- ## Method Details

  - ### getComponent

    JComponent getComponent()
    Returns the component of this vertex. This is used for rendering and interaction with the user.
    Returns:
      the component of this vertex

  - ### setFocused

    void setFocused(boolean focused)
    Sets this vertex to be focused. This differs from being selected in that multiple vertices in a graph can be selected, but only one can be the focused vertex.
    Parameters:
      `focused` - true to focus; false to be marked as not focused

  - ### isFocused

    boolean isFocused()
    Returns true if this vertex is focused (see `setFocused(boolean)`
    Returns:
      true if focused

  - ### setSelected

    void setSelected(boolean selected)
    Sets this vertex selected
    Parameters:
      `selected` - true to select this vertex; false to de-select this vertex

  - ### isSelected

    boolean isSelected()
    Returns true if this vertex is selected
    Returns:
      true if this vertex is selected

  - ### setHovered

    void setHovered(boolean hovered)
    Sets this vertex to be hovered
    Parameters:
      `hovered` - true to be marked as hovered; false to be marked as not hovered

  - ### isHovered

    boolean isHovered()
    Returns true if this vertex is being hovered by the mouse
    Returns:
      true if this vertex is being hovered by the mouse

  - ### setLocation

    void setLocation(Point2D p)
    Sets the location of this vertex in the view
    Parameters:
      `p` - the location of this vertex in the view

  - ### getLocation

    Point2D getLocation()
    Returns the location of this vertex in the view
    Returns:
      the location of this vertex in the view

  - ### isGrabbable

    boolean isGrabbable(Component c)
    Returns true if the given component of this vertex is grabbable, which means that mouse drags on that component will move the vertex.

    This is used to differentiate components within a vertex that should receive mouse events versus those components that will not be given mouse events.

    Parameters:
      `c` - the component
    Returns:
      true if the component is grabbable

  - ### dispose

    void dispose()
    A dispose method that should be called when a vertex is reclaimed, never again to be used in a graph or display

  - ### setEmphasis

    void setEmphasis(double emphasisLevel)
    Sets the emphasis value for this vertex. A value of 0 indicates no emphasis.
    Parameters:
      `emphasisLevel` - the emphasis

  - ### getEmphasis

    double getEmphasis()
    Returns the emphasis value of this vertex. 0 if not emphasized.
    Returns:
      the emphasis value of this vertex.

  - ### setAlpha

    void setAlpha(double alpha)
    Set the alpha, which determines how much of the vertex is visible/see through. 0 is completely transparent. This attribute allows transitional for animations.
    Parameters:
      `alpha` - the alpha value

  - ### getAlpha

    double getAlpha()
    Get the alpha, which determines how much of the vertex is visible/see through. 0 is completely transparent. This attribute allows transitional for animations.
    Returns:
      the alpha value