Class GridLocationMap<V,E>

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

public class GridLocationMap<V,E> extends Object
An object that maps vertices to rows and columns and edges to their articulation points. This class is essentially a container that allows layout algorithms to store results, which can later be turned into layout positioning points. The integer point values in this class are row, column grid values, starting at 0,0.

Note: the Point2D values for the edge articulations use x,y values that are row and column index values, the same values as calling row(V) and col(V).

After building the grid using this class, clients can call rows() to get high-order object that represent rows.

  • Constructor Details

    • GridLocationMap

      public GridLocationMap()
  • Method Details

    • setArticulations

      public void setArticulations(E edge, List<Point> articulations)
    • getArticulations

      public List<Point> getArticulations(E edge)
    • row

      public void row(V vertex, int row)
    • col

      public void col(V vertex, int col)
    • set

      public void set(V v, int row, int col)
    • row

      public int row(V vertex)
    • col

      public int col(V vertex)
    • rows

      public List<Row<V>> rows()
      Returns the rows in this grid, sorted by index (index can be negative)
      Returns:
      the rows in this grid
    • centerRows

      public void centerRows()
      Updates each row within the grid such that it's x values are set to center the row in the grid. Each row will be updated so that all its columns start at zero. After that, each column will be centered in the grid.
    • dispose

      public void dispose()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringGrid

      public String toStringGrid()
      Creates a string representation of this grid
      Returns:
      a string representation of this grid