Package snap.view

Class GridView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable, ViewHost

public class GridView extends ChildView
A ViewHost to arrange child views in a grid.
  • Constructor Details

    • GridView

      public GridView()
  • Method Details

    • isUniform

      public boolean isUniform()
      Returns whether grid is uniform size.
    • getSpacingX

      public double getSpacingX()
      Returns the spacing between cells horizontal.
    • getSpacingY

      public double getSpacingY()
      Returns the spacing between cells vertical.
    • getColCountVisible

      public int getColCountVisible()
      Returns the number of columns that can be show for current width and children.
    • getColCountForWidth

      public int getColCountForWidth(double aWidth)
      Returns the number of columns that can be show for given width.
    • getRowCountForCols

      public int getRowCountForCols(int aColCount)
      Returns the number of rows for given column count.
    • getPrefWidth

      public double getPrefWidth(double aH)
      Override to use grid layout.
      Overrides:
      getPrefWidth in class View
    • getPrefHeight

      public double getPrefHeight(double aW)
      Override to use grid layout.
      Overrides:
      getPrefHeight in class View
    • layout

      public void layout()
      Override to use grid layout.
      Overrides:
      layout in class ParentView