com.miginfocom.calendar.header
Class DefaultSubRowLevel

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

public class DefaultSubRowLevel
extends SubRowLevel

A subclass to SubRowLevel that can be initialized with a number of primities that creates the RootAShape used in the Base class.

See Also:
Serialized Form

Field Summary
static java.lang.String CONTAINER_SHAPE_NAME
           
static java.lang.String IMAGE_SHAPE_NAME
           
static java.lang.String KNOB_PRESSED_COMMAND
           
static java.lang.String KNOB_SHAPE_NAME
           
static java.lang.String LABEL_CONTAINER_SHAPE_NAME
           
static java.lang.String LABEL_PRESSED_COMMAND
           
static int MOUSE_OVER
          Index in the arrays.
static int NORMAL
          Index in the arrays.
static int PRESSED
          Index in the arrays.
static java.lang.String TEXT_SHAPE_NAME
           
 
Fields inherited from class com.miginfocom.calendar.header.SubRowLevel
APPLY_STRS, APPLY_TO_ALL, APPLY_TO_FOLDERS_ALL, APPLY_TO_FOLDERS_EXPANDED, APPLY_TO_FOLDERS_FOLDED, APPLY_TO_LEAFS
 
Constructor Summary
DefaultSubRowLevel(java.lang.String text, AtRefNumber size, java.awt.Font font)
          Constructor when there in no underline and centered labels.
DefaultSubRowLevel(java.lang.String text, AtRefNumber size, PlaceRect cellLabelBounds, java.awt.Paint[] cellBg, java.awt.Paint[] labelFg, DefaultRepetition labelRep, int expandLevels, java.awt.Font[] font, java.lang.Integer[] ulWidth, AtRefRangeNumber alignX, AtRefRangeNumber alignY, int textType, int appliesTo)
          Constructor.
DefaultSubRowLevel(java.lang.String text, AtRefNumber size, PlaceRect cellLabelBounds, java.awt.Paint cellBg, java.awt.Paint labelFg, DefaultRepetition labelRep, int expandLevels, java.awt.Font font, int appliesTo)
          Constructor when there in no underline and centered labels.
DefaultSubRowLevel(java.lang.String text, AtRefNumber size, PlaceRect cellLabelBounds, java.awt.Paint cellBg, java.awt.Paint labelFg, DefaultRepetition labelRep, int expandLevels, java.awt.Font font, java.lang.Integer underlineWidth, AtRefRangeNumber alignX, AtRefRangeNumber alignY, int textType, int appliesTo)
          Constructor when there in no difference for normal/mouseOver/Pressed.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 AtRefRangeNumber getAlignX()
          Returns the horizontal alignment (docking).
 AtRefRangeNumber getAlignY()
          Returns the vertical alignment (docking).
 java.awt.Paint[] getCellBackground()
          Returns the backgrounds for the cell.
 javax.swing.border.Border getCellBorder()
           
 java.awt.Cursor getCellCursor()
           
 PlaceRect getCellLabelBounds()
          How much of every cell that should be available for the label.
 int getExpandLevels()
          The number of levels (after the currently painted one) that should be included in the bounds that the shape will get.
 java.awt.Font[] getFont()
          Returns the fonts for the label.
 java.awt.Cursor getKnobCursor()
           
 XtdImage getKnobExpandedImage()
           
 XtdImage getKnobFoldedImage()
           
 boolean getKnobFoldOnPress()
           
 AtRefRangeNumber getKnobImageAlignX()
           
 AtRefRangeNumber getKnobImageAlignY()
           
 java.awt.Cursor getLabelCursor()
           
 boolean getLabelFoldOnPress()
           
 java.awt.Paint[] getLabelForeground()
          Returns forgrounds for the label.
 DefaultRepetition getLabelRepetition()
          Returns the specification for the repetition constraint for painting the labels.
 XtdImage getRowFolderImage()
           
 AtRefRangeNumber getRowImageAlignX()
           
 AtRefRangeNumber getRowImageAlignY()
           
 XtdImage getRowLeafImage()
           
 AtRefNumber getSize()
          The size for this row.
 java.lang.String getText()
          Returns The text that should be shown in the cell.
 int getTextAntiAlias()
          Property: The anti aliasing hint used when drawing the text for the shape.
 int getTextType()
          If the labels should be rotated, normal or multi line.
 java.lang.Integer[] getUnderlineWidth()
          Returns the underlines width or null for no underline.
 boolean hasMouseEffects()
          Returns if this row should have a different appearence be possible depending on mouse over/press.
 boolean isPaintLabel(int n, int count)
          Returns if the label at this row applies to the suggested index with count size.
 void setCellBorder(javax.swing.border.Border border)
           
 void setCellCursor(java.awt.Cursor cur)
           
 void setKnobCursor(java.awt.Cursor cur)
           
 void setKnobExpandedImage(XtdImage image)
           
 void setKnobFoldedImage(XtdImage image)
           
 void setKnobFoldOnPress(boolean b)
           
 void setKnobImageAlignX(AtRefRangeNumber align)
           
 void setKnobImageAlignY(AtRefRangeNumber align)
           
 void setLabelCursor(java.awt.Cursor cur)
           
 void setLabelFoldOnPress(boolean b)
           
 void setRowFolderImage(XtdImage image)
           
 void setRowImageAlignX(AtRefRangeNumber align)
           
 void setRowImageAlignY(AtRefRangeNumber align)
           
 void setRowLeafImage(XtdImage image)
           
 void setTextAntiAlias(int hint)
          Property: The anti aliasing hint used when drawing the text for the shape.
 java.lang.String toString()
           
 
Methods inherited from class com.miginfocom.calendar.header.SubRowLevel
getAppliesTo, getLevels, getShape, setAppliesTo, setExpandLevels, setLevels, setShape
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
Index in the arrays.

See Also:
Constant Field Values

MOUSE_OVER

public static final int MOUSE_OVER
Index in the arrays.

See Also:
Constant Field Values

PRESSED

public static final int PRESSED
Index in the arrays.

See Also:
Constant Field Values

CONTAINER_SHAPE_NAME

public static final java.lang.String CONTAINER_SHAPE_NAME
See Also:
Constant Field Values

LABEL_CONTAINER_SHAPE_NAME

public static final java.lang.String LABEL_CONTAINER_SHAPE_NAME
See Also:
Constant Field Values

TEXT_SHAPE_NAME

public static final java.lang.String TEXT_SHAPE_NAME
See Also:
Constant Field Values

KNOB_SHAPE_NAME

public static final java.lang.String KNOB_SHAPE_NAME
See Also:
Constant Field Values

IMAGE_SHAPE_NAME

public static final java.lang.String IMAGE_SHAPE_NAME
See Also:
Constant Field Values

KNOB_PRESSED_COMMAND

public static final java.lang.String KNOB_PRESSED_COMMAND
See Also:
Constant Field Values

LABEL_PRESSED_COMMAND

public static final java.lang.String LABEL_PRESSED_COMMAND
See Also:
Constant Field Values
Constructor Detail

DefaultSubRowLevel

public DefaultSubRowLevel(java.lang.String text,
                          AtRefNumber size,
                          java.awt.Font font)
Constructor when there in no underline and centered labels.

Parameters:
text - The text that should be shown in the cell. May contain templates that can be interpreted by the interactors installed for the created RootAShape. E.g. "$gridRowName$".
size - The size for this row.
font - The format for the labels. Indexed by [normal, mouseOver, pressed]. Can be null.
See Also:
AtStart, AtEnd, AtFraction

DefaultSubRowLevel

public DefaultSubRowLevel(java.lang.String text,
                          AtRefNumber size,
                          PlaceRect cellLabelBounds,
                          java.awt.Paint cellBg,
                          java.awt.Paint labelFg,
                          DefaultRepetition labelRep,
                          int expandLevels,
                          java.awt.Font font,
                          int appliesTo)
Constructor when there in no underline and centered labels.

Parameters:
text - The text that should be shown in the cell. May contain templates that can be interpreted by the interactors installed for the created RootAShape. E.g. "$gridRowName$".
size - The size for this row.
cellLabelBounds - How much of every cell that should be available for the label. Can be used for very advanced placing and margin handling. If null AbsRect.FILL will be used.
cellBg - The backgrounds for the individual cells, it is beeing painted over the row background. Setting elements to null will make the rowBg shine through. Note though that merged cells will not look merged if null since it is the cellBg paint that is used to paint over the grid lines that shoule be hidden when cells are merged. Indexed by [normal, mouseOver, pressed].
labelFg - The paint to paint the labels with. Indexed by [normal, mouseOver, pressed].
labelRep - Optional repetition spec for label paints. If null all rows are considered a "hit".
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).
font - The format for the labels. Indexed by [normal, mouseOver, pressed]. Can be null.
appliesTo - If this applies to both folder and leaf cells in the level or just one of them. E.g. DefaultSubRowLevel.APPLY_TO_ALL
See Also:
AtStart, AtEnd, AtFraction

DefaultSubRowLevel

public DefaultSubRowLevel(java.lang.String text,
                          AtRefNumber size,
                          PlaceRect cellLabelBounds,
                          java.awt.Paint cellBg,
                          java.awt.Paint labelFg,
                          DefaultRepetition labelRep,
                          int expandLevels,
                          java.awt.Font font,
                          java.lang.Integer underlineWidth,
                          AtRefRangeNumber alignX,
                          AtRefRangeNumber alignY,
                          int textType,
                          int appliesTo)
Constructor when there in no difference for normal/mouseOver/Pressed.

Parameters:
text - The text that should be shown in the cell. May contain templates that can be interpreted by the interactors installed for the created RootAShape. E.g. "$gridRowName$".
size - The size for this row.
cellLabelBounds - How much of every cell that should be available for the label. Can be used for very advanced placing and margin handling. If null AbsRect.FILL will be used.
cellBg - The backgrounds for the individual cells, it is beeing painted over the row background. Setting elements to null will make the rowBg shine through. Note though that merged cells will not look merged if null since it is the cellBg paint that is used to paint over the grid lines that shoule be hidden when cells are merged. Indexed by [normal, mouseOver, pressed].
labelFg - The paint to paint the labels with. Indexed by [normal, mouseOver, pressed].
labelRep - Optional repetition spec for label paints. If null all rows are considered a "hit".
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).
font - The format for the labels. Indexed by [normal, mouseOver, pressed]. Can be null.
underlineWidth - The width of the underlines. If null no underline is used. Indexed by [normal, mouseOver, pressed].
alignX - The horizontal alignment within the cell. Can be absolute or relative and anchored to left or right edge.
alignY - The vertical alignment within the cell. Can be absolute or relative and anchored to top or bottom edge.
textType - If the labels should be rotated, normal or multi line. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW
appliesTo - If this applies to both folder and leaf cells in the level or just one of them. E.g. DefaultSubRowLevel.APPLY_TO_ALL
See Also:
AtStart, AtEnd, AtFraction

DefaultSubRowLevel

public DefaultSubRowLevel(java.lang.String text,
                          AtRefNumber size,
                          PlaceRect cellLabelBounds,
                          java.awt.Paint[] cellBg,
                          java.awt.Paint[] labelFg,
                          DefaultRepetition labelRep,
                          int expandLevels,
                          java.awt.Font[] font,
                          java.lang.Integer[] ulWidth,
                          AtRefRangeNumber alignX,
                          AtRefRangeNumber alignY,
                          int textType,
                          int appliesTo)
Constructor.

Parameters:
text - The text that should be shown in the cell. May contain templates that can be interpreted by the interactors installed for the created RootAShape. E.g. "$gridRowName$".
size - The size for this row.
cellLabelBounds - How much of every cell that should be available for the label. Can be used for very advanced placing and margin handling. If null AbsRect.FILL will be used.
cellBg - The backgrounds for the individual cells, it is beeing painted over the row background. Setting elements to null will make the rowBg shine through. Note though that merged cells will not look merged if null since it is the cellBg paint that is used to paint over the grid lines that shoule be hidden when cells are merged. Indexed by [normal, mouseOver, pressed]. Can be null or of length 0. May be of lesser length indicating that the missing effect is not applicable.
labelFg - The paint to paint the labels with. Indexed by [normal, mouseOver, pressed]. Can be null or of length 0. May be of lesser length indicating that the missing effect is not applicable.
labelRep - Optional repetition spec for label paints. If null all rows are considered a "hit".
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).
font - The formt for the labels. Indexed by [normal, mouseOver, pressed]. Can be null or of length 0. May be of lesser length indicating that the missing effect is not applicable.
ulWidth - The width of the underlines. If null no underline is used. Indexed by [normal, mouseOver, pressed]. Can be null or of length 0. May be of lesser length indicating that the missing effect is not applicable.
alignX - The horizontal alignment within the cell. Can be absolute or relative and anchored to left or right edge.
alignY - The vertical alignment within the cell. Can be absolute or relative and anchored to top or bottom edge.
textType - If the labels should be rotated, normal or multi line. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW
appliesTo - If this applies to both folder and leaf cells in the level or just one of them. E.g. DefaultSubRowLevel.APPLY_TO_ALL
See Also:
AtStart, AtEnd, AtFraction
Method Detail

getCellBorder

public javax.swing.border.Border getCellBorder()

setCellBorder

public void setCellBorder(javax.swing.border.Border border)

getKnobImageAlignX

public AtRefRangeNumber getKnobImageAlignX()

setKnobImageAlignX

public void setKnobImageAlignX(AtRefRangeNumber align)

getKnobImageAlignY

public AtRefRangeNumber getKnobImageAlignY()

setKnobImageAlignY

public void setKnobImageAlignY(AtRefRangeNumber align)

getRowImageAlignX

public AtRefRangeNumber getRowImageAlignX()

setRowImageAlignX

public void setRowImageAlignX(AtRefRangeNumber align)

getRowImageAlignY

public AtRefRangeNumber getRowImageAlignY()

setRowImageAlignY

public void setRowImageAlignY(AtRefRangeNumber align)

getTextAntiAlias

public int getTextAntiAlias()
Property: The anti aliasing hint used when drawing the text for the shape. For instance GfxUtil.AA_HINT_ON.

Returns:
The current hint. May be null.
See Also:
GfxUtil.confAntiAliasingHint(java.awt.Graphics2D, boolean, int)

setTextAntiAlias

public void setTextAntiAlias(int hint)
Property: The anti aliasing hint used when drawing the text for the shape. For instance GfxUtil.AA_HINT_PLATFORM.

Parameters:
hint - The new hint.
See Also:
GfxUtil.confAntiAliasingHint(java.awt.Graphics2D, boolean, int)

getLabelCursor

public java.awt.Cursor getLabelCursor()

setLabelCursor

public void setLabelCursor(java.awt.Cursor cur)

getCellCursor

public java.awt.Cursor getCellCursor()

setCellCursor

public void setCellCursor(java.awt.Cursor cur)

getKnobCursor

public java.awt.Cursor getKnobCursor()

setKnobCursor

public void setKnobCursor(java.awt.Cursor cur)

getKnobExpandedImage

public XtdImage getKnobExpandedImage()

setKnobExpandedImage

public void setKnobExpandedImage(XtdImage image)

getKnobFoldedImage

public XtdImage getKnobFoldedImage()

setKnobFoldedImage

public void setKnobFoldedImage(XtdImage image)

getRowFolderImage

public XtdImage getRowFolderImage()

setRowFolderImage

public void setRowFolderImage(XtdImage image)

getRowLeafImage

public XtdImage getRowLeafImage()

setRowLeafImage

public void setRowLeafImage(XtdImage image)

getKnobFoldOnPress

public boolean getKnobFoldOnPress()

setKnobFoldOnPress

public void setKnobFoldOnPress(boolean b)

getLabelFoldOnPress

public boolean getLabelFoldOnPress()

setLabelFoldOnPress

public void setLabelFoldOnPress(boolean b)

isPaintLabel

public boolean isPaintLabel(int n,
                            int count)
Returns if the label at this row applies to the suggested index with count size.

Parameters:
n - The index of this row/label.
count - The total number of rows. Used for knowing when the "last" row is asked for.
Returns:
If this row applies to the suggested index with count size.
See Also:
DefaultRepetition.INTERVAL_ONCE, DefaultRepetition.OFFSET_LAST

getText

public java.lang.String getText()
Returns The text that should be shown in the cell. May contain templates that can be interpreted by the interactors installed for the created RootAShape. E.g. "$gridRowName$".

Returns:
The text that should be shown in the cell. May be null.

getSize

public AtRefNumber getSize()
The size for this row. Float for relative (0..1) or Integer for absolute.

Returns:
The size for this row.

getCellLabelBounds

public PlaceRect getCellLabelBounds()
How much of every cell that should be available for the label.

Returns:
How much of every cell that should be available for the label. Not null.

getCellBackground

public java.awt.Paint[] getCellBackground()
Returns the backgrounds for the cell. Indexed by [Normal, MouseOver, Pressed] but may be of lesser length indicating that the missing effect is not applicable.

Returns:
The background for the cell. Can be null but not of length 0.

getLabelForeground

public java.awt.Paint[] getLabelForeground()
Returns forgrounds for the label. Indexed by [Normal, MouseOver, Pressed] but may be of lesser length indicating that the missing effect is not applicable.

Returns:
Forground for the label. Can be null but not of length 0.

getLabelRepetition

public DefaultRepetition getLabelRepetition()
Returns the specification for the repetition constraint for painting the labels. May be null and all labels should be painted if so.

Returns:
The specification for the repetition constraint for painting the labels.
See Also:
isPaintLabel(int, int)

getExpandLevels

public int getExpandLevels()
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).

Overrides:
getExpandLevels in class SubRowLevel
Returns:
The number of levels (after the currently painted one) that should be included in the bounds that the shape will get.

getFont

public java.awt.Font[] getFont()
Returns the fonts for the label. Indexed by [Normal, MouseOver, Pressed] but may be of lesser length indicating that the missing effect is not applicable.

Returns:
The font for the label. Can be null but not of length 0.

getUnderlineWidth

public java.lang.Integer[] getUnderlineWidth()
Returns the underlines width or null for no underline. Indexed by [Normal, MouseOver, Pressed] but may be of lesser length indicating that the missing effect is not applicable.

Returns:
The underlines width or null for no underline. Not of length 0.

getAlignX

public AtRefRangeNumber getAlignX()
Returns the horizontal alignment (docking).

Returns:
The horizontal alignment (docking).
See Also:
AtRefRangeNumber, AtStart, AtEnd, AtFraction

getAlignY

public AtRefRangeNumber getAlignY()
Returns the vertical alignment (docking).

Returns:
The vertical alignment (docking).
See Also:
AtStart, AtEnd, AtFraction

getTextType

public int getTextType()
If the labels should be rotated, normal or multi line. E.g. TextAShape.TYPE_SINGE_LINE_ROT_CW

Returns:
If the labels should be rotated.

hasMouseEffects

public boolean hasMouseEffects()
Returns if this row should have a different appearence be possible depending on mouse over/press. Currently checks index 1 and 2 of the cellBg, labelFg and font for != null.

Returns:
true if mouse effects exists.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.