com.miginfocom.beans
Class GridDimensionLayoutBean

java.lang.Object
  extended by com.miginfocom.beans.AbstractBean
      extended by com.miginfocom.beans.GridDimensionLayoutBean
All Implemented Interfaces:
GridLayoutProvider, java.io.Serializable

public class GridDimensionLayoutBean
extends AbstractBean
implements GridLayoutProvider

A bean that set the properties for how a dimension (horizontal or vertical) of a Grid should be laid out.

It set the size specs for the rows (cells) in the dimension it describes.

It has three major type of rows:

  1. Normal - Basically a row that isn't any of the other types.
  2. Compressed - A row designated to be compressed by the properties CompressRowsFormat and CompressRowsRanges
  3. Sub row - A row (only for the secondary dimension) that is a sub row of another sub row or one of the main rows. Main rows are the first level cells in the grid.
    1. See Also:
      Serialized Form

      Field Summary
      static int ABSOLUTE_CELLS
                 
      static int DATE
                 
      static int DAY_OF_WEEK
                 
      static int TIME_OF_DAY
                 
       
      Constructor Summary
      GridDimensionLayoutBean()
                Constructor.
       
      Method Summary
       GridDimensionLayout createLayout(Grid grid, int dimIx)
                Returns the layout that this bean represents.
       int getCompressRowsFormat()
                Property: The type (unit) for the CompressRowsRanges property.
       java.lang.String getCompressRowsRanges()
                Property: A string that describles what rows, or row intervals, that should be compressed.
       SizeSpec getRowSizeCompressed()
                Property: The minimum, maximum and preferred size for a compressed row.
       SizeSpec getRowSizeNormal()
                Property: The minimum, maximum and preferred size for a normal row (not compressed).
       SizeSpec getSubRowSizeExpandedFolder()
                Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered expanded.
       SizeSpec getSubRowSizeFoldedFolder()
                Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered folded.
       SizeSpec getSubRowSizeLeaf()
                Property: The minimum, maximum and preferred size for a sub row that has no sub rows itself (it's a leaf).
       boolean isExpandRowsToFit()
                Property: If the rows in the dimension that this object represents should be expanded to fit the available space.
       boolean isExpandSubRowsToFit()
                Property: If the sub-rows should be expanded to fit the available space.
       void setCompressRowsFormat(int format)
                Property: The type (unit) for the CompressRowsRanges property.
       void setCompressRowsRanges(java.lang.String s)
                Property: A string that describles what rows, or row intervals, that should be compressed.
       void setExpandRowsToFit(boolean b)
                Property: If the rows in the dimension that this object represents should be expanded to fit the available space.
       void setExpandSubRowsToFit(boolean b)
                Property: If the sub-rows should be expanded to fit the available space.
       void setRowSizeCompressed(SizeSpec size)
                Property: The minimum, maximum and preferred size for a compressed row.
       void setRowSizeNormal(SizeSpec size)
                Property: The minimum, maximum and preferred size for a normal row (not compressed).
       void setSubRowSizeExpandedFolder(SizeSpec size)
                Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered expanded.
       void setSubRowSizeFoldedFolder(SizeSpec size)
                Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered folded.
       void setSubRowSizeLeaf(SizeSpec size)
                Property: The minimum, maximum and preferred size for a sub row that has no sub rows itself (it's a leaf).
       
      Methods inherited from class com.miginfocom.beans.AbstractBean
      addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChangeEvent, removePropertyChangeListener, setIgnorePropertyChangeEvents
       
      Methods inherited from class java.lang.Object
      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
       

      Field Detail

      ABSOLUTE_CELLS

      public static final int ABSOLUTE_CELLS
      See Also:
      Constant Field Values

      TIME_OF_DAY

      public static final int TIME_OF_DAY
      See Also:
      Constant Field Values

      DAY_OF_WEEK

      public static final int DAY_OF_WEEK
      See Also:
      Constant Field Values

      DATE

      public static final int DATE
      See Also:
      Constant Field Values
      Constructor Detail

      GridDimensionLayoutBean

      public GridDimensionLayoutBean()
      Constructor.

      Method Detail

      createLayout

      public GridDimensionLayout createLayout(Grid grid,
                                              int dimIx)
      Returns the layout that this bean represents.

      Specified by:
      createLayout in interface GridLayoutProvider
      Parameters:
      grid - The grid used to get information.
      dimIx - The dimension. Either Grid.PRIMARY_DIMENSION or Grid.SECONDARY_DIMENSION
      Returns:
      The layout that this bean represents.

      isExpandRowsToFit

      public boolean isExpandRowsToFit()
      Property: If the rows in the dimension that this object represents should be expanded to fit the available space. Note that this is only used if the size properties for the rows themeselves doesn't specify anything else.

      Returns:
      The current value, true is default.

      setExpandRowsToFit

      public void setExpandRowsToFit(boolean b)
      Property: If the rows in the dimension that this object represents should be expanded to fit the available space. Note that this is only used if the size properties for the rows themeselves doesn't specify anything else.

      Parameters:
      b - The new value, true is default.

      isExpandSubRowsToFit

      public boolean isExpandSubRowsToFit()
      Property: If the sub-rows should be expanded to fit the available space. Note that this is only used if the size properties for the rows themeselves doesn't specify anything else. Also note that this value is only interesting if this bean represents the secondary dimension, since only the secondary dimension has sub rows.

      Returns:
      The current value, true is default.

      setExpandSubRowsToFit

      public void setExpandSubRowsToFit(boolean b)
      Property: If the sub-rows should be expanded to fit the available space. Note that this is only used if the size properties for the rows themeselves doesn't specify anything else. Also note that this value is only interesting if this bean represents the secondary dimension, since only the secondary dimension has sub rows.

      Parameters:
      b - The new value, true is default.

      getCompressRowsRanges

      public java.lang.String getCompressRowsRanges()
      Property: A string that describles what rows, or row intervals, that should be compressed. The unit used can be set with setCompressRowsFormat(int).

      The string is comma separated invervalls using english locale/words/formatting. For example:

      • "00.00-06.00,18.00-24.00" (time of day)
      • "0-10,14-17,30-40,42,44" (absolute cells)
      • "mon-wed,sat-sun" (week days)
      • "20041231-20050131,20060231-2007231" (dates, yyyyMMdd)

      Returns:
      The current range(s). Not null but can be empty.

      setCompressRowsRanges

      public void setCompressRowsRanges(java.lang.String s)
      Property: A string that describles what rows, or row intervals, that should be compressed. The unit used can be set with setCompressRowsFormat(int).

      The string is comma separated invervalls using english locale/words/formatting. For example:

      • "00.00-06.00,18.00-24.00" (time of day)
      • "0-10,14-17,30-40,42,44" (absolute cells)
      • "mon-wed,sat-sun" (week days)
      • "20041231-20050131,20060231-2007231" (dates, yyyyMMdd)

      Parameters:
      s - The new range(s). Not null but can be empty.

      getCompressRowsFormat

      public int getCompressRowsFormat()
      Property: The type (unit) for the CompressRowsRanges property.

      Valid formats are:

      • ABSOLUTE_CELLS - The cell numbers starting from 0.
      • TIME_OF_DAY - Time of day of the form: "HH.mm"
      • DAY_OF_WEEK - The day of week. It's enough to use the first two letters. E.g "mo" or "tue".
      • DATE - The date without any time on the form: "yyyyMMdd"

      Returns:
      The current format. ABSOLUTE_CELLS is default.

      setCompressRowsFormat

      public void setCompressRowsFormat(int format)
      Property: The type (unit) for the CompressRowsRanges property.

      Valid formats are:

      • ABSOLUTE_CELLS - The cell numbers starting from 0.
      • TIME_OF_DAY - Time of day of the form: "HH.mm"
      • DAY_OF_WEEK - The day of week. It's enough to use the first two letters. E.g "mo" or "tue".
      • DATE - The date without any time on the form: "yyyyMMdd"

      Parameters:
      format - The new format. ABSOLUTE_CELLS is default.

      getRowSizeNormal

      public SizeSpec getRowSizeNormal()
      Property: The minimum, maximum and preferred size for a normal row (not compressed).

      Returns:
      The current size spec. Not null but the minimum, maximum and preferred size in the spec can all be null.
      See Also:
      SizeSpec

      setRowSizeNormal

      public void setRowSizeNormal(SizeSpec size)
      Property: The minimum, maximum and preferred size for a normal row (not compressed).

      Parameters:
      size - The new size spec. Not null but the minimum, maximum and preferred size in the spec can all be null. The value will be stored and not cloned (it's final so this shouldn't matter though).
      See Also:
      SizeSpec

      getRowSizeCompressed

      public SizeSpec getRowSizeCompressed()
      Property: The minimum, maximum and preferred size for a compressed row. Which rows that are compressed are specified by the properties CompressRowsFormat and CompressRowsRanges.

      Returns:
      The current size spec. Not null but the minimum, maximum and preferred size in the spec can all be null.
      See Also:
      SizeSpec, setCompressRowsFormat(int), setCompressRowsRanges(String)

      setRowSizeCompressed

      public void setRowSizeCompressed(SizeSpec size)
      Property: The minimum, maximum and preferred size for a compressed row. Which rows that are compressed are specified by the properties CompressRowsFormat and CompressRowsRanges.

      Parameters:
      size - The new size spec. Not null but the minimum, maximum and preferred size in the spec can all be null. The value will be stored and not cloned (it's final so this shouldn't matter though).
      See Also:
      SizeSpec, setCompressRowsFormat(int), setCompressRowsRanges(String)

      getSubRowSizeLeaf

      public SizeSpec getSubRowSizeLeaf()
      Property: The minimum, maximum and preferred size for a sub row that has no sub rows itself (it's a leaf). This is only interesting (hence used) if this bean denotes the layout for the secondary dimension since only the secondary dimension can have sub rows.

      Returns:
      The current size spec. Not null but the minimum, maximum and preferred size in the spec can all be null.
      See Also:
      SizeSpec, setSubRowSizeExpandedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeFoldedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeLeaf(com.miginfocom.util.gfx.geometry.SizeSpec)

      setSubRowSizeLeaf

      public void setSubRowSizeLeaf(SizeSpec size)
      Property: The minimum, maximum and preferred size for a sub row that has no sub rows itself (it's a leaf). This is only interesting (hence used) if this bean denotes the layout for the secondary dimension since only the secondary dimension can have sub rows.

      Parameters:
      size - The new size spec. Not null but the minimum, maximum and preferred size in the spec can all be null. The value will be stored and not cloned (it's final so this shouldn't matter though).
      See Also:
      SizeSpec, setSubRowSizeExpandedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeFoldedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeLeaf(com.miginfocom.util.gfx.geometry.SizeSpec)

      getSubRowSizeExpandedFolder

      public SizeSpec getSubRowSizeExpandedFolder()
      Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered expanded. This is only interesting (hence used) if this bean denotes the layout for the secondary dimension since only the secondary dimension can have sub rows.

      Returns:
      The current size spec. Not null but the minimum, maximum and preferred size in the spec can all be null.
      See Also:
      SizeSpec, setSubRowSizeExpandedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeFoldedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeLeaf(com.miginfocom.util.gfx.geometry.SizeSpec)

      setSubRowSizeExpandedFolder

      public void setSubRowSizeExpandedFolder(SizeSpec size)
      Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered expanded. This is only interesting (hence used) if this bean denotes the layout for the secondary dimension since only the secondary dimension can have sub rows.

      Parameters:
      size - The new size spec. Not null but the minimum, maximum and preferred size in the spec can all be null. The value will be stored and not cloned (it's final so this shouldn't matter though).
      See Also:
      SizeSpec, setSubRowSizeExpandedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeFoldedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeLeaf(com.miginfocom.util.gfx.geometry.SizeSpec)

      getSubRowSizeFoldedFolder

      public SizeSpec getSubRowSizeFoldedFolder()
      Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered folded. This is only interesting (hence used) if this bean denotes the layout for the secondary dimension since only the secondary dimension can have sub rows.

      Returns:
      The current size spec. Not null but the minimum, maximum and preferred size in the spec can all be null.
      See Also:
      SizeSpec, setSubRowSizeExpandedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeFoldedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeLeaf(com.miginfocom.util.gfx.geometry.SizeSpec)

      setSubRowSizeFoldedFolder

      public void setSubRowSizeFoldedFolder(SizeSpec size)
      Property: The minimum, maximum and preferred size for a sub row that has sub rows itself and the row is considered folded. This is only interesting (hence used) if this bean denotes the layout for the secondary dimension since only the secondary dimension can have sub rows.

      Parameters:
      size - The new size spec. Not null but the minimum, maximum and preferred size in the spec can all be null. The value will be stored and not cloned (it's final so this shouldn't matter though).
      See Also:
      SizeSpec, setSubRowSizeExpandedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeFoldedFolder(com.miginfocom.util.gfx.geometry.SizeSpec), setSubRowSizeLeaf(com.miginfocom.util.gfx.geometry.SizeSpec)


      Copyright © 2009 MiG InfoCom AB. All Rights Reserved.