Class GridLocationMap<V,​E>

  • Type Parameters:
    V - the vertex type
    E - the edge type

    public class GridLocationMap<V,​E>
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      GridLocationMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void centerRows()
      Updates each row within the grid such that it's x values are set to center the row in the grid.
      int col​(V vertex)  
      void col​(V vertex, int col)  
      void dispose()  
      java.util.List<java.awt.Point> getArticulations​(E edge)  
      int row​(V vertex)  
      void row​(V vertex, int row)  
      java.util.List<Row<V>> rows()
      Returns the rows in this grid, sorted by index (index can be negative)
      void set​(V v, int row, int col)  
      void setArticulations​(E edge, java.util.List<java.awt.Point> articulations)  
      java.lang.String toString()  
      java.lang.String toStringGrid()
      Creates a string representation of this grid
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GridLocationMap

        public GridLocationMap()
    • Method Detail

      • setArticulations

        public void setArticulations​(E edge,
                                     java.util.List<java.awt.Point> articulations)
      • getArticulations

        public java.util.List<java.awt.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 java.util.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringGrid

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