com.miginfocom.beans
Class DateHeaderBean

java.lang.Object
  extended by com.miginfocom.beans.AbstractBean
      extended by com.miginfocom.beans.AbstractHeaderBean
          extended by com.miginfocom.beans.DateHeaderBean
All Implemented Interfaces:
java.io.Serializable

public class DateHeaderBean
extends AbstractHeaderBean

A header object that wraps (aggregates) a real Header implementation.

This bean is for simplifying the usage of a header and to make the header more JavaBean-like.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.miginfocom.beans.AbstractHeaderBean
bgPaint
 
Constructor Summary
DateHeaderBean()
           
 
Method Summary
 void addDateChangeListener(DateChangeListener l)
          This call is transmitted to the DateGridHeader.addDateChangeListener(com.miginfocom.util.dates.DateChangeListener)
 void addDateChangeListener(DateChangeListener l, boolean asWeakRef)
          This call is transmitted to the DateGridHeader.addDateChangeListener(com.miginfocom.util.dates.DateChangeListener, boolean)
 java.awt.Color getGridColor()
          Property: The color of the grid lines.
 GridLineException[] getGridLineExceptions()
          Property: Grid line exceptions makes it very fleible to override the gridline size and color in a structured way.
 Header getHeader()
           
 CellDecorationRow[] getHeaderRows()
          Property: An array of rows that makes out the different rows or colums for the header (rows for north/south headers and colums for east/west headers).
 javax.swing.border.Border getInnerBorder()
          Property: The inner border around the header.
 int getLabelRotation()
          Property: If the labels for the header should be rotated and if so how.
 java.lang.String getLabelRotationRows()
          Property: A comma separated string with the rows that are to get the property getLabelRotation().
 boolean getMouseEffectsEnabled()
          Property: If mouse listeners should be installed on the header to make live effects enabled on the cell rows.
 javax.swing.border.Border getOuterBorder()
          Property: The outer border around the header.
 int getRowGap()
          The gap in pixels between the header rows.
 int getTextAntiAlias()
          Property: The text antialias hint that will be set on the header's renderer before any text is drawn.
 java.lang.String getTextAntiAliasRows()
          Property: A comma separated string with the rows that are to get the property getTextAntiAlias().
 java.lang.Boolean getUseStartDateTime()
          If the start or end date in the decorated cells' should be used.
protected  void recreateHeader()
          Set the header to null and revalidate the container
 void removeDateChangeListener(DateChangeListener l)
          This call is transmitted to the DateGridHeader.removeDateChangeListener(com.miginfocom.util.dates.DateChangeListener)
 void setGridColor(java.awt.Color c)
          Property: The color of the grid lines.
 void setGridLineExceptions(GridLineException[] exceptions)
          Property: Grid line exceptions makes it very fleible to override the gridline size and color in a structured way.
 void setHeaderRows(CellDecorationRow[] rows)
          Property: An array of rows that makes out the different rows or colums for the header (rows for north/south headers and colums for east/west headers).
 void setInnerBorder(javax.swing.border.Border border)
          Property: The inner border around the header.
 void setLabelRotation(int rot)
          Property: If the labels for the header should be rotated and if so how.
 void setLabelRotationRows(java.lang.String rows)
          Property: A comma separated string with the rows that are to get the property getLabelRotation().
 void setMouseEffectsEnabled(boolean b)
          Property: If mouse listeners should be installed on the header to make live effects enabled on the cell rows.
 void setOuterBorder(javax.swing.border.Border border)
          Property: The outer border around the header.
 void setRowGap(int rowGap)
          The gap in pixels between the header rows.
 void setTextAntiAlias(int hint)
          Property: The text antialias hint that will be set on the header's renderer before any text is drawn.
 void setTextAntiAliasRows(java.lang.String rows)
          Property: A comma separated string with the rows that are to get the property getTextAntiAlias().
 void setUseStartDateTime(java.lang.Boolean b)
          If the start or end date in the decorated cells' should be used.
 
Methods inherited from class com.miginfocom.beans.AbstractHeaderBean
getBackgroundPaint, getContainer, getEdge, getExpandToCorner, isVisible, revalidateRepaintContainer, setBackgroundPaint, setDateAreaContainer, setEdge, setExpandToCorner, setVisible
 
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
 

Constructor Detail

DateHeaderBean

public DateHeaderBean()
Method Detail

getHeader

public Header getHeader()

recreateHeader

protected void recreateHeader()
Description copied from class: AbstractHeaderBean
Set the header to null and revalidate the container

Specified by:
recreateHeader in class AbstractHeaderBean

getGridLineExceptions

public GridLineException[] getGridLineExceptions()
Property: Grid line exceptions makes it very fleible to override the gridline size and color in a structured way. Examples of exceptions is:
You can have several exceptions (as this property is an array) each capable of the above list and if the first exception is not a "hit" then the next one will be evaluated and so on until the array is finnished and the grid line used will be the default one.

To really understand how flexible and powerful this feature is see the "Repetitions" section in the FAQ document.

Returns:
The exceptions or zero length if no exteptions to the grid lines exist (default). Never null.

setGridLineExceptions

public void setGridLineExceptions(GridLineException[] exceptions)
Property: Grid line exceptions makes it very fleible to override the gridline size and color in a structured way. Examples of exceptions is:
You can have several exceptions (as this property is an array) each capable of the above list and if the first exception is not a "hit" then the next one will be evaluated and so on until the array is finnished and the grid line used will be the default one.

To really understand how flexible and powerful this feature is see the "Repetitions" section in the FAQ document.

Parameters:
exceptions - The exceptions or zero length if no exteptions to the grid lines exist (default). Never null.

getLabelRotation

public int getLabelRotation()
Property: If the labels for the header should be rotated and if so how. The rotaton can be either:
  1. TextAShape.TYPE_SINGLE_LINE_ROT_CW (right 90 degrees)
  2. TextAShape.TYPE_SINGLE_LINE_ROT_CCW (left 90 degrees)
  3. TextAShape.TYPE_SINGLE_LINE (normal text)

Returns:
The rotation. Default is TextAShape.TYPE_SINGLE_LINE which means no rotation.

setLabelRotation

public void setLabelRotation(int rot)
Property: If the labels for the header should be rotated and if so how. The rotaton can be either:
  1. TextAShape.TYPE_SINGLE_LINE_ROT_CW (right 90 degrees)
  2. TextAShape.TYPE_SINGLE_LINE_ROT_CCW (left 90 degrees)
  3. TextAShape.TYPE_SINGLE_LINE (normal text)

This method will reinitialize the header if the value is changed but do nothing if it's the same.

Parameters:
rot - The rotation. Default is TextAShape.TYPE_SINGLE_LINE which means no rotation.

getLabelRotationRows

public java.lang.String getLabelRotationRows()
Property: A comma separated string with the rows that are to get the property getLabelRotation(). E.g. "1,2,4". A value of null, "" and any illegal value means "all rows".

Returns:
The current value.

setLabelRotationRows

public void setLabelRotationRows(java.lang.String rows)
Property: A comma separated string with the rows that are to get the property getLabelRotation(). E.g. "1,2,4". A value of null, "" and any illegal value means "all rows".

This method will reinitialize the header if the value is changed but do nothing if it's the same.

Parameters:
rows - The new value.

getTextAntiAlias

public int getTextAntiAlias()
Property: The text antialias hint that will be set on the header's renderer before any text is drawn. If the value is GfxUtil.AA_HINT_INHERIT the value will not be changed and thus the default value for the graphics environment will be used.

Normal values are (but other values may apply at a later time, for instance to set sub pixel anti aliasing):

  1. GfxUtil.AA_HINT_ON
  2. GfxUtil.AA_HINT_OFF
  3. GfxUtil.AA_HINT_LCD_GASP

Returns:
The current value.

setTextAntiAlias

public void setTextAntiAlias(int hint)
Property: The text antialias hint that will be set on the header's renderer before any text is drawn. If the value is GfxUtil.AA_HINT_INHERIT the value will not be changed and thus the default value for the graphics environment will be used.

Normal values are (but other values may apply at a later time, for instance to set sub pixel anti aliasing):

  1. GfxUtil.AA_HINT_ON
  2. GfxUtil.AA_HINT_OFF
  3. GfxUtil.AA_HINT_LCD_GASP

This method will reinitialize the header if the value is changed but do nothing if it's the same.

Parameters:
hint - The new value.

getTextAntiAliasRows

public java.lang.String getTextAntiAliasRows()
Property: A comma separated string with the rows that are to get the property getTextAntiAlias(). E.g. "1,2,4". A value of null, "" and any illegal value means "all rows".

Returns:
The current value.

setTextAntiAliasRows

public void setTextAntiAliasRows(java.lang.String rows)
Property: A comma separated string with the rows that are to get the property getTextAntiAlias(). E.g. "1,2,4". A value of null, "" and any illegal value means "all rows".

This method will reinitialize the header if the value is changed but do nothing if it's the same.

Parameters:
rows - The new value.

getGridColor

public java.awt.Color getGridColor()
Property: The color of the grid lines. If null no lines will be drawn.

Note! The grid color if set will show over everything so that no cells will look merged. To show a grid where cell rows can have cells that span more that one row/column use the background paint of the whole header to set the grid color and leave this grid color to null. This will make it possible to create headers like in getHeaderRows() JavDoc. Also see AbstractHeaderBean.setBackgroundPaint(java.awt.Paint)

Returns:
The current grid line color. May be null.

setGridColor

public void setGridColor(java.awt.Color c)
Property: The color of the grid lines. If null no lines will be drawn.

Note! The grid color if set will show over everything so that no cells will look merged. To show a grid where cell rows can have cells that span more that one row/column use the background paint of the whole header to set the grid color and leave this grid color to null. This will make it possible to create headers like in getHeaderRows() JavDoc. Also see AbstractHeaderBean.setBackgroundPaint(java.awt.Paint)

Parameters:
c - The new grid line color. May be null.

getRowGap

public int getRowGap()
The gap in pixels between the header rows.

Returns:
The gap in pixels between the header rows.
Since:
6.0

setRowGap

public void setRowGap(int rowGap)
The gap in pixels between the header rows.

Parameters:
rowGap - The gap in pixels between the header rows.
Since:
6.0

getUseStartDateTime

public java.lang.Boolean getUseStartDateTime()
If the start or end date in the decorated cells' should be used. If null the start date is used if the header is top/left and end date if bottom/right. You can use this property to force either way.

Returns:
The current state. May be null.

setUseStartDateTime

public void setUseStartDateTime(java.lang.Boolean b)
If the start or end date in the decorated cells' should be used. If null the start date if used if the header is top/left and end date if bottom/right. You can use this property to force either way.

Parameters:
b - The new state. null is default.

getInnerBorder

public javax.swing.border.Border getInnerBorder()
Property: The inner border around the header. The border vill be set on the view so that parts of it will be covered if there is scrolling.

Returns:
The current border. May be null.
See Also:
getOuterBorder()

setInnerBorder

public void setInnerBorder(javax.swing.border.Border border)
Property: The inner border around the header. The border vill be set on the view so that parts of it will be covered if there is scrolling.

Parameters:
border - The new border. May be null.
See Also:
setOuterBorder(javax.swing.border.Border)

getOuterBorder

public javax.swing.border.Border getOuterBorder()
Property: The outer border around the header. The border will be installed on the scroll pane so that it will normally always be shown fully even if the view is partly scrolled away (invisible).

Returns:
The current border. May be null.
See Also:
getInnerBorder()

setOuterBorder

public void setOuterBorder(javax.swing.border.Border border)
Property: The outer border around the header. The border will be installed on the scroll pane so that it will normally always be shown fully even if the view is partly scrolled away (invisible).

Parameters:
border - The new border. May be null.
See Also:
setInnerBorder(javax.swing.border.Border)

getHeaderRows

public CellDecorationRow[] getHeaderRows()
Property: An array of rows that makes out the different rows or colums for the header (rows for north/south headers and colums for east/west headers). One row normally represents a date range type, such as weeks.

If the date area shows day cells the cells in the header can be merged. This will look like seven cells in the header will look like one.

Example for three rows: Month, week and days:

 -----------------------------------------------------------------
 |              January           |            February          |
 -----------------------------------------------------------------
 |   w01  |  w02  |  w03  |  w04  |  w05  |  w06   |  w07   |w08 |
 -----------------------------------------------------------------
 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
 -----------------------------------------------------------------
 

Returns:
The current rows. Never null.

setHeaderRows

public void setHeaderRows(CellDecorationRow[] rows)
Property: An array of rows that makes out the different rows or colums for the header (rows for north/south headers and colums for east/west headers). One row normally represents a date range type, such as weeks.

If the date area shows day cells the cells in the header can be merged. This will look like seven cells in the header will look like one.

Example for three rows: Month, week and days:

 -----------------------------------------------------------------
 |              January           |            February          |
 -----------------------------------------------------------------
 |   w01  |  w02  |  w03  |  w04  |  w05  |  w06   |  w07   |w08 |
 -----------------------------------------------------------------
 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
 -----------------------------------------------------------------
 

Parameters:
rows - The new rows. Should noramlly be at least one element and thus not null.

getMouseEffectsEnabled

public boolean getMouseEffectsEnabled()
Property: If mouse listeners should be installed on the header to make live effects enabled on the cell rows. This must be enabled for any effects to be visible. The actual effects must also be set on the CellDecorationRows of course.

If date selection in the header is to be listened for this must be enabled.

Returns:
If currently enabled.
See Also:
addDateChangeListener(com.miginfocom.util.dates.DateChangeListener, boolean)

setMouseEffectsEnabled

public void setMouseEffectsEnabled(boolean b)
Property: If mouse listeners should be installed on the header to make live effects enabled on the cell rows. This must be enabled for any effects to be visible. The actual effects must also be set on the CellDecorationRows of course.

If date selection in the header is to be listened for this must be enabled.

Parameters:
b - If enabled.
See Also:
addDateChangeListener(com.miginfocom.util.dates.DateChangeListener, boolean)

addDateChangeListener

public void addDateChangeListener(DateChangeListener l)
This call is transmitted to the DateGridHeader.addDateChangeListener(com.miginfocom.util.dates.DateChangeListener)

Note that mouse effects must be enabled. See setMouseEffectsEnabled(boolean)

See Also:
addDateChangeListener(com.miginfocom.util.dates.DateChangeListener, boolean)

addDateChangeListener

public void addDateChangeListener(DateChangeListener l,
                                  boolean asWeakRef)
This call is transmitted to the DateGridHeader.addDateChangeListener(com.miginfocom.util.dates.DateChangeListener, boolean)

Note that mouse effects must be enabled. See setMouseEffectsEnabled(boolean)


removeDateChangeListener

public void removeDateChangeListener(DateChangeListener l)
This call is transmitted to the DateGridHeader.removeDateChangeListener(com.miginfocom.util.dates.DateChangeListener)



Copyright © 2009 MiG InfoCom AB. All Rights Reserved.