com.miginfocom.calendar.grid
Class DefaultGridRowLayout

java.lang.Object
  extended by com.miginfocom.calendar.grid.DefaultGridRowLayout
All Implemented Interfaces:
GridRowLayout

public class DefaultGridRowLayout
extends java.lang.Object
implements GridRowLayout

Lays out all grid rows within a main grid rows so they get equal size.

Does not resize grid lines and does not check if a folder row is folded or not.


Constructor Summary
DefaultGridRowLayout(boolean expandToRow)
          Constructor
DefaultGridRowLayout(boolean expandToRow, AtNumber minSize, AtRefNumber prefSize, AtNumber maxSize)
          Constructor.
DefaultGridRowLayout(boolean expandToRow, AtRefNumber prefRowSize)
          Constructor.
DefaultGridRowLayout(boolean expandToRow, int defaultRowSize)
          Constructor.
DefaultGridRowLayout(boolean expandToRow, SizeSpec sizeSpec)
          Constructor.
DefaultGridRowLayout(boolean expandToRow, SizeSpec leafSizeSpec, SizeSpec expFolderSpec, SizeSpec foldedFolderSpec)
          Constructor.
 
Method Summary
 java.lang.Integer getMaximumSize(GridRow row)
          Return the maximum size for the grid in the laid out dimension.
 java.lang.Integer getMinimumSize(GridRow row)
          Return the minimum size, if any is specified.
 java.lang.Integer getPreferredSize(GridRow row)
          Return the preferred size, if any is specified.
 java.lang.Integer[] getSizes(GridRow row)
          Will return the values for min, preferred and max in one array.
 void layout(GridRow row)
          Should out the sub rows of the row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGridRowLayout

public DefaultGridRowLayout(boolean expandToRow)
Constructor

Parameters:
expandToRow - If true the sub rows will be expanded to fill the row, however it won't break any min/max constrains.

DefaultGridRowLayout

public DefaultGridRowLayout(boolean expandToRow,
                            int defaultRowSize)
Constructor.

Parameters:
expandToRow - If true the sub rows will be expanded to fill the row, however it won't break any min/max constrains.
defaultRowSize - The size that will be the default minimum, preferred and maximum size all rows. Will be wrapped in new AtFixed(rowSize). Only rows that have null for min/pref/max will get this value.

DefaultGridRowLayout

public DefaultGridRowLayout(boolean expandToRow,
                            AtRefNumber prefRowSize)
Constructor.

Parameters:
expandToRow - If true the sub rows will be expanded to fill the row, however it won't break any min/max constrains.
prefRowSize - The size that will be the default preferred size. Only rows that have null for min/pref/max will get this value.

DefaultGridRowLayout

public DefaultGridRowLayout(boolean expandToRow,
                            AtNumber minSize,
                            AtRefNumber prefSize,
                            AtNumber maxSize)
Constructor.

Parameters:
expandToRow - If true the sub rows will be expanded to fill the row, however it won't break any min/max constrains.
minSize - The minimum size that will be used if the row itself has a null value for min size.
prefSize - The minium size that will be used if the row itself has a null value for preferred size.
maxSize - The maximum size that will be used if the row itself has a null value for max size.

DefaultGridRowLayout

public DefaultGridRowLayout(boolean expandToRow,
                            SizeSpec sizeSpec)
Constructor.

Parameters:
expandToRow - If true the sub rows will be expanded to fill the row, however it won't break any min/max constrains.
sizeSpec - The size spec that will be used for all types of rows. Folders and leaves.

DefaultGridRowLayout

public DefaultGridRowLayout(boolean expandToRow,
                            SizeSpec leafSizeSpec,
                            SizeSpec expFolderSpec,
                            SizeSpec foldedFolderSpec)
Constructor.

Parameters:
expandToRow - If true the sub rows will be expanded to fill the row, however it won't break any min/max constrains.
leafSizeSpec - The size spec that will be used for leaf rows. May be null.
expFolderSpec - The size spec that will be used for folder rows that are folded. May be null.
foldedFolderSpec - The size spec that will be used for folder rows that are expanded (not folded). May be null.
Method Detail

layout

public void layout(GridRow row)
Description copied from interface: GridRowLayout
Should out the sub rows of the row.

Specified by:
layout in interface GridRowLayout
Parameters:
row - The grid riw which sub grid rows to layout to lay out. Not null.
See Also:
GridRow.getGridRows()

getMinimumSize

public java.lang.Integer getMinimumSize(GridRow row)
Description copied from interface: GridRowLayout
Return the minimum size, if any is specified.

Note that this value includes grid lines.

Specified by:
getMinimumSize in interface GridRowLayout
Parameters:
row - The row to return the the size constraint for.
Returns:
The minimum size, if any is specified. null if not specified.

getPreferredSize

public java.lang.Integer getPreferredSize(GridRow row)
Description copied from interface: GridRowLayout
Return the preferred size, if any is specified. If the preferred size is expressed as relative (see GridSegmentSpec) this method will return null since an absolute size can't be calculated.

Note that this value includes grid lines.

Specified by:
getPreferredSize in interface GridRowLayout
Parameters:
row - The row to return the the size constraint for.
Returns:
The preferred size, of any is specified. null if not specified.

getMaximumSize

public java.lang.Integer getMaximumSize(GridRow row)
Description copied from interface: GridRowLayout
Return the maximum size for the grid in the laid out dimension.

Note that this value includes grid lines.

Specified by:
getMaximumSize in interface GridRowLayout
Parameters:
row - The row to return the the size constraint for.
Returns:
The maximum size, if any is specified. null if not specified.

getSizes

public java.lang.Integer[] getSizes(GridRow row)
Description copied from interface: GridRowLayout
Will return the values for min, preferred and max in one array. This is faster than calling them separately since they basically have to do the same thing three times, where as this version just have to do most if it once. It will always return the same as would: new Integer[] {getMinimumSize(row), getPreferredSize(row), getMaximumSize(row)};

Note that these value includes grid lines.

Specified by:
getSizes in interface GridRowLayout
Parameters:
row - The row to return the the size constraint for.
Returns:
The min, preferred and max size, if any is specified. null elements if not specified. Array never null and always of length 3.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.