com.miginfocom.calendar.header
Class HeaderDecorationSpec

java.lang.Object
  extended by com.miginfocom.calendar.header.HeaderDecorationSpec

public class HeaderDecorationSpec
extends java.lang.Object

A simple data holder class for the specification to a HeaderAShapeGridDecorator. Even though the elements of the fields can be changed they should not.

The class is to be considered immutable.

In short it's a collection of CellDecorationRows that defines all indexes of a given range. It also contains some information that are common for all rows, such as if they should be anti-aliased when painted.


Constructor Summary
HeaderDecorationSpec(CellDecorationRow[] rows, int[] labelRots, int[] antiAliasHints)
          Constructor for when the decorator should paint multiple rows.
HeaderDecorationSpec(CellDecorationRow[] rows, int labelRot, boolean antiAlias)
          Deprecated. Use the version that takes an int anti alias hint instead.
HeaderDecorationSpec(CellDecorationRow[] rows, int labelRot, int antiAliasHint)
          Constructor for when the decorator should paint multiple rows.
HeaderDecorationSpec(CellDecorationRow row, int labelRot, boolean antiAlias)
          Deprecated. Use the version that takes an int anti alias hint instead.
HeaderDecorationSpec(CellDecorationRow row, int labelRot, int antiAliasHint)
          Constructor for when the decorator should paint one row.
 
Method Summary
 int getAntiAliasHint()
          Returns the anti-aliasing hint the labes should be used.
 int getAntiAliasHint(int row)
          Returns the anti-aliasing hint the labes should be used.
 int getLabelRot()
          Returns how the labels should rotated.
 int getLabelRot(int row)
          Returns how the labels should rotated.
 int[] getRangeTypes()
          Returns the size of all the rows added together,
 CellDecorationRow getRow(int r)
          Return the row a row.
 AtRefNumber[] getSizes()
          Returns the sizes for the rows.
 boolean hasMouseEffects()
          Returns if this spec has any rows that should have a different appearence be possible depending on mouse over/press.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderDecorationSpec

public HeaderDecorationSpec(CellDecorationRow row,
                            int labelRot,
                            boolean antiAlias)
Deprecated. Use the version that takes an int anti alias hint instead.

Constructor for when the decorator should paint one row.

Parameters:
row - The row decorations.
labelRot - How the labels should be rotated. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW}.
antiAlias - If anti-aliasing of the labels should be used.

HeaderDecorationSpec

public HeaderDecorationSpec(CellDecorationRow[] rows,
                            int labelRot,
                            boolean antiAlias)
Deprecated. Use the version that takes an int anti alias hint instead.

Constructor for when the decorator should paint multiple rows.

Parameters:
rows - The row decorations for every rows.
labelRot - How the labels should be rotated. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW}.
antiAlias - If anti-aliasing of the labels should be used.

HeaderDecorationSpec

public HeaderDecorationSpec(CellDecorationRow row,
                            int labelRot,
                            int antiAliasHint)
Constructor for when the decorator should paint one row.

Parameters:
row - The row decorations.
labelRot - How the labels should be rotated. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW}.
antiAliasHint - The anti alias hint to set. E.g. RenderingHints.VALUE_TEXT_ANTIALIAS_ON. If null the defalt value (i.e. it will not be change on the Graphics object) will be used.

HeaderDecorationSpec

public HeaderDecorationSpec(CellDecorationRow[] rows,
                            int labelRot,
                            int antiAliasHint)
Constructor for when the decorator should paint multiple rows.

Parameters:
rows - The row decorations for every rows.
labelRot - How the labels should be rotated. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW}.
antiAliasHint - The anti alias hint to set. E.g. RenderingHints.VALUE_TEXT_ANTIALIAS_ON. If null the defalt value (i.e. it will not be change on the Graphics object) will be used.

HeaderDecorationSpec

public HeaderDecorationSpec(CellDecorationRow[] rows,
                            int[] labelRots,
                            int[] antiAliasHints)
Constructor for when the decorator should paint multiple rows.

Parameters:
rows - The row decorations for every rows.
labelRots - How the labels should be rotated, indexed by row. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW}.

There must be at least one element and if less than rows count the last value in the array will be used for the missing elements.

antiAliasHints - The anti alias hint to set, indexed by row. E.g. RenderingHints.VALUE_TEXT_ANTIALIAS_ON. If null the defalt value (i.e. it will not be change on the Graphics object) will be used.

There must be at least one element and if less than rows count the last value in the array will be used for the missing elements.

Method Detail

getSizes

public AtRefNumber[] getSizes()
Returns the sizes for the rows.

Returns:
The size of all the rows added together,

getRangeTypes

public int[] getRangeTypes()
Returns the size of all the rows added together,

Returns:
The size of all the rows added together,

getRow

public CellDecorationRow getRow(int r)
Return the row a row. The method is leneint so if row is more than the number of rows the last one is returned.

Returns:
The row a row or the last one.

getLabelRot

public int getLabelRot()
Returns how the labels should rotated. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW}.

Returns:
How the labels should rotated.

getAntiAliasHint

public int getAntiAliasHint()
Returns the anti-aliasing hint the labes should be used.

Returns:
The anti aliasing hint used. E.g. GfxUtil.AA_HINT_ON.

getLabelRot

public int getLabelRot(int row)
Returns how the labels should rotated. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW}.

Parameters:
row - The row for which to return the value. If > than the number of rows or set anti alias hints the value of the last element will be used.
Returns:
How the labels should rotated.

getAntiAliasHint

public int getAntiAliasHint(int row)
Returns the anti-aliasing hint the labes should be used.

Parameters:
row - The row for which to return the value. If > than the number of rows or set anti alias hints the value of the last element will be used.
Returns:
The anti aliasing hint used. E.g. GfxUtil.AA_HINT_ON.

hasMouseEffects

public boolean hasMouseEffects()
Returns if this spec has any rows that should have a different appearence be possible depending on mouse over/press.

Returns:
true if mouse effects exists.
See Also:
CellDecorationRow.hasMouseEffects()


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.