com.miginfocom.calendar.header
Class SubRowLevel

java.lang.Object
  extended by com.miginfocom.calendar.header.SubRowLevel
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultSubRowLevel

public class SubRowLevel
extends java.lang.Object
implements java.io.Serializable

Contains information how a sub row level's (or several) header cell should look like and how big it should be.

The class is without logic and is just used as an information holder mostly to tell a decorator (e.g. SubRowHeaderDecorator how the different levels should be decorated.

See Also:
Serialized Form

Field Summary
static java.lang.String[] APPLY_STRS
           
static int APPLY_TO_ALL
          This row applies to both leaf and folder cells in the level.
static int APPLY_TO_FOLDERS_ALL
          This row applies only to folder cells in the level.
static int APPLY_TO_FOLDERS_EXPANDED
          This row applies only to folder cells in the level.
static int APPLY_TO_FOLDERS_FOLDED
          This row applies only to folder cells in the level.
static int APPLY_TO_LEAFS
          This row applies only to folder cells in the level.
 
Constructor Summary
SubRowLevel(RootAShape shape, Repetition levels, int expandLevels)
          Constructor that applies to both folders and leaves.
SubRowLevel(RootAShape shape, Repetition levels, int expandLevels, int appliesTo)
          Constructor.
 
Method Summary
 int getAppliesTo()
          Property: If this applies to both folder and leaf cells in the level or just one of them.
 int getExpandLevels()
          Property: The number of levels (after the currently painte one) that should be included in the bounds that the shape will get.
 Repetition getLevels()
          Property: The specification for which leves to decorate.
 RootAShape getShape()
          Property: The shape used to paint the header cell.
 void setAppliesTo(int appliesTo)
          Property: If this applies to both folder and leaf cells in the level or just one of them.
 void setExpandLevels(int expandLevels)
          Property: The number of levels (after the currently painte one) that should be included in the bounds that the shape will get.
 void setLevels(Repetition levels)
          Property: The specification for which leves to decorate.
protected  void setShape(RootAShape shape)
          Property: The shape used to paint the header cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLY_STRS

public static final java.lang.String[] APPLY_STRS

APPLY_TO_ALL

public static final int APPLY_TO_ALL
This row applies to both leaf and folder cells in the level.

See Also:
Constant Field Values

APPLY_TO_FOLDERS_ALL

public static final int APPLY_TO_FOLDERS_ALL
This row applies only to folder cells in the level. Both expanded and folded.

See Also:
Constant Field Values

APPLY_TO_FOLDERS_EXPANDED

public static final int APPLY_TO_FOLDERS_EXPANDED
This row applies only to folder cells in the level. Only expanded.

See Also:
Constant Field Values

APPLY_TO_FOLDERS_FOLDED

public static final int APPLY_TO_FOLDERS_FOLDED
This row applies only to folder cells in the level. Only folded.

See Also:
Constant Field Values

APPLY_TO_LEAFS

public static final int APPLY_TO_LEAFS
This row applies only to folder cells in the level.

See Also:
Constant Field Values
Constructor Detail

SubRowLevel

public SubRowLevel(RootAShape shape,
                   Repetition levels,
                   int expandLevels)
Constructor that applies to both folders and leaves. See corresponding getXXX methods for explanation of arguments.

Parameters:
shape - The shape used to paint the header cell. Might be null.
levels - The specification for which leves to decorate. null means all levels.
expandLevels - The number of levels (after the currently painted one) that should be included in the bounds that the shape will get. If set beyond the last level it will be corrected to only include the last one. So it is possible to set to a very high value to set the bound for the shape to inlcude all levels (in the secondary, short, dimension).

SubRowLevel

public SubRowLevel(RootAShape shape,
                   Repetition levels,
                   int expandLevels,
                   int appliesTo)
Constructor. See corresponding getXXX methods for explanation of arguments.

Parameters:
shape - The shape used to paint the header cell. Might be null.
levels - The specification for which leves to decorate. null means all levels.
expandLevels - The number of levels (after the currently painted one) that should be included in the bounds that the shape will get. If set beyond the last level it will be corrected to only include the last one. So it is possible to set to a very high value to set the bound for the shape to inlcude all levels (in the secondary, short, dimension).
appliesTo - If this applies to both folder and leaf cells in the level or just one of them. E.g. DefaultSubRowLevel.APPLIES_TO_BOTH
Method Detail

getShape

public RootAShape getShape()
Property: The shape used to paint the header cell. The user of this spec is responsible for setting the Interactors on the shape.

For instance in SubRowHeaderDecorator a GridRowInteractor will be set on it and since that interactor is a PropertyProvider working on behalf of the GridRow properties can be read on the GridRow but, for instance, using "$gridRowName$" in a TextAShape to print the grid row name.

Returns:
The shape used to paint the header cell. May be null.

setShape

protected void setShape(RootAShape shape)
Property: The shape used to paint the header cell. The user of this spec is responsible for setting the Interactors on the shape.

For instance in SubRowHeaderDecorator a GridRowInteractor will be set on it and since that interactor is a PropertyProvider working on behalf of the GridRow properties can be read on the GridRow but, for instance, using "$gridRowName$" in a TextAShape to print the grid row name.

Parameters:
shape - The new shape used to paint the header cell. May be null.

getLevels

public Repetition getLevels()
Property: The specification for which leves to decorate. for instance: Never null.

Returns:
The specification for which leves to decorate.

setLevels

public void setLevels(Repetition levels)
Property: The specification for which leves to decorate. for instance: Never null.

Parameters:
levels - The new specification for which leves to decorate.

getExpandLevels

public int getExpandLevels()
Property: The number of levels (after the currently painte one) that should be included in the bounds that the shape will get. If set beond the last level it will be corrected to only include the last one. So it is possible to set to a very high value to set the bound for the shape to inlcude all levels (in the secondary, short, dimension).

Returns:
The number of levels (after the currently painte one) that should be included in the bounds that the shape will get.

setExpandLevels

public void setExpandLevels(int expandLevels)
Property: The number of levels (after the currently painte one) that should be included in the bounds that the shape will get. If set beond the last level it will be corrected to only include the last one. So it is possible to set to a very high value to set the bound for the shape to inlcude all levels (in the secondary, short, dimension).

Parameters:
expandLevels - The new number of levels (after the currently painte one) that should be included in the bounds that the shape will get.

getAppliesTo

public int getAppliesTo()
Property: If this applies to both folder and leaf cells in the level or just one of them. E.g. DefaultSubRowLevel.APPLIES_TO_BOTH

Returns:
If this applies to both folder and leaf cells in the level or just one of them.

setAppliesTo

public void setAppliesTo(int appliesTo)
Property: If this applies to both folder and leaf cells in the level or just one of them. E.g. DefaultSubRowLevel.APPLIES_TO_BOTH

Parameters:
appliesTo - If this applies to both folder and leaf cells in the level or just one of them.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.