Class GridCoordinates

java.lang.Object
ghidra.graph.viewer.layout.GridCoordinates

public class GridCoordinates extends Object
Tracks the mapping of grid coordinates (rows, columns) to space coordinates (x, y)
  • Constructor Details

    • GridCoordinates

      public GridCoordinates(int[] rowCoordinates, int[] columnCoordinates)
      Constructor
      Parameters:
      rowCoordinates - an array containing the y locations for all rows in a grid
      columnCoordinates - an array containing the x locations for all columns in a grid
  • Method Details

    • x

      public int x(int col)
      Returns the x value for a given column.
      Parameters:
      col - the column index in the grid
      Returns:
      the x coordinate assigned to the given column index
    • y

      public int y(int row)
      Returns the y value for a given row.
      Parameters:
      row - the row index in the grid
      Returns:
      the y coordinate assigned to the given row index
    • getBounds

      public Rectangle getBounds()
      Returns the total bounds for the grid
      Returns:
      the total bounds for the grid
    • rowCount

      public int rowCount()
      returns the number of rows in the grid.
      Returns:
      the number of rows in the grid
    • columnCount

      public int columnCount()
      returns the number of columns in the grid.
      Returns:
      the number of columns in the grid