Class GraphDisplayOptionsBuilder

java.lang.Object
ghidra.service.graph.GraphDisplayOptionsBuilder

public class GraphDisplayOptionsBuilder extends Object
Builder for building GraphDisplayOptions
  • Constructor Details

    • GraphDisplayOptionsBuilder

      public GraphDisplayOptionsBuilder(GraphType graphType)
      Create a new GraphDisplayOptionsBuilder
      Parameters:
      graphType - the GraphType of graphs that this instance configures.
  • Method Details

    • defaultVertexColor

      public GraphDisplayOptionsBuilder defaultVertexColor(Color c)
      Sets the default vertex color for vertexes that don't have a registered vertex type
      Parameters:
      c - the default vertex color
      Returns:
      this GraphDisplayOptionsBuilder
    • defaultEdgeColor

      public GraphDisplayOptionsBuilder defaultEdgeColor(Color c)
      Sets the default edge color for edges that don't have a registered edge type
      Parameters:
      c - the default edge color
      Returns:
      this GraphDisplayOptionsBuilder
    • vertexSelectionColor

      public GraphDisplayOptionsBuilder vertexSelectionColor(Color color)
      Sets the vertex selection color
      Parameters:
      color - the vertex selection color
      Returns:
      this GraphDisplayOptionsBuilder
    • edgeSelectionColor

      public GraphDisplayOptionsBuilder edgeSelectionColor(Color color)
      Sets the edge selection color
      Parameters:
      color - the edge selection color
      Returns:
      this GraphDisplayOptionsBuilder
    • defaultVertexShape

      public GraphDisplayOptionsBuilder defaultVertexShape(VertexShape vertexShape)
      Sets the default vertex shape for vertices that don't have a registered vertex type
      Parameters:
      vertexShape - the VertexShape to use as a default
      Returns:
      this GraphDisplayOptionsBuilder
    • vertex

      public GraphDisplayOptionsBuilder vertex(String vertexType, VertexShape vertexShape, Color color)
      Sets the shape and color for vertices of the given type
      Parameters:
      vertexType - the vertex type to assign shape and color
      vertexShape - the shape to use for the named vertex type
      color - the color to use for the named vertex type
      Returns:
      this GraphDisplayOptionsBuilder
    • edge

      public GraphDisplayOptionsBuilder edge(String edgeType, Color color)
      Sets the color for edges of the given type
      Parameters:
      edgeType - the edge type to assign color
      color - the color to use for the named edge type
      Returns:
      this GraphDisplayOptionsBuilder
    • vertexColorOverrideAttribute

      public GraphDisplayOptionsBuilder vertexColorOverrideAttribute(String colorAttributeKey)
      Sets the attribute used to override the color for a vertex
      Parameters:
      colorAttributeKey - the attribute key to use for overriding a vertex color
      Returns:
      this GraphDisplayOptionsBuilder
    • edgeColorOverrideAttribute

      public GraphDisplayOptionsBuilder edgeColorOverrideAttribute(String colorAttributeKey)
      Sets the attribute used to override the color for a edge
      Parameters:
      colorAttributeKey - the attribute key to use for overriding an edge color
      Returns:
      this GraphDisplayOptionsBuilder
    • shapeOverrideAttribute

      public GraphDisplayOptionsBuilder shapeOverrideAttribute(String shapeAttributeKey)
      Sets the attribute used to override the shape for a vertex
      Parameters:
      shapeAttributeKey - the attribute key to use of shape override
      Returns:
      this GraphDisplayOptionsBuilder
    • defaultLayoutAlgorithm

      public GraphDisplayOptionsBuilder defaultLayoutAlgorithm(String string)
      Sets the name of the layout algorithm that will be used to initially layout the graph
      Parameters:
      string - the name of the layout algoritm to use to initially layout the graph
      Returns:
      this GraphDisplayOptionsBuilder
    • useIcons

      public GraphDisplayOptionsBuilder useIcons(boolean b)
      Sets drawing "mode" for the graph display. If true, vertices are drawn as scaled cached images with the label inside the shapes. If false, vertices are drawn as smaller shapes with labels drawn near the shapes.
      Parameters:
      b - true to use pre-rendered icon images
      Returns:
      this GraphDisplayOptionsBuilder
    • arrowLength

      public GraphDisplayOptionsBuilder arrowLength(int length)
      Sets the length of the arrows to display in the graph. The width will be sized proportionately.
      Parameters:
      length - the length the arrows to display in the graph
      Returns:
      this GraphDisplayOptionsBuilder
    • maxNodeCount

      public GraphDisplayOptionsBuilder maxNodeCount(int maxNodeCount)
      Sets the maximum number of nodes a graph can have and still be displayed.
      Parameters:
      maxNodeCount - the maximum number of nodes
      Returns:
      this GraphDisplayOptionsBuilder
    • labelPosition

      public GraphDisplayOptionsBuilder labelPosition(GraphLabelPosition labelPosition)
      Sets the vertex label position relative to vertex shape. This is only applicable if the useIcons(boolean) is set to false.
      Parameters:
      labelPosition - the relative position to place the vertex label
      Returns:
      this GraphDisplayOptionsBuilder
    • build

      public GraphDisplayOptions build()
      Returns a GraphTypeDisplayOptions as configured by this builder
      Returns:
      a GraphTypeDisplayOptions as configured by this builder