com.miginfocom.beans
Class AbstractHeaderBean

java.lang.Object
  extended by com.miginfocom.beans.AbstractBean
      extended by com.miginfocom.beans.AbstractHeaderBean
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CategoryHeaderBean, DateHeaderBean

public abstract class AbstractHeaderBean
extends AbstractBean

Some basic functionality for header JavaBeans in the MiG Calendar component.

See Also:
Serialized Form

Field Summary
protected  java.awt.Paint bgPaint
           
 
Constructor Summary
protected AbstractHeaderBean()
           
 
Method Summary
 java.awt.Paint getBackgroundPaint()
          Property: The background paint in the date area.
 DateAreaBean getContainer()
          Returns the container that this header is decorating.
 int getEdge()
          Property: The edge (top, left, bottom, right) that this header should be placed at.
 int getExpandToCorner()
          Property: What corner, if any, the header should expand into if (if it exist, or rather has any space).
 boolean isVisible()
          Property: If this header should be visible or not.
protected abstract  void recreateHeader()
          Set the header to null and revalidate the container
 void revalidateRepaintContainer()
          If there is a connected container, revaidate and repaint it
 void setBackgroundPaint(java.awt.Paint p)
          Property: The background paint in the date area.
 boolean setDateAreaContainer(DateAreaBean container)
          Sets the DateAreaContainer that this header should decorate.
 void setEdge(int edge)
          Property: The edge (top, left, bottom, right) that this header should be placed at.
 void setExpandToCorner(int corner)
          Property: What corner, if any, the header should expand into if (if it exist, or rather has any space).
 void setVisible(boolean b)
          Property: If this header should be visible or not.
 
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
 

Field Detail

bgPaint

protected transient java.awt.Paint bgPaint
Constructor Detail

AbstractHeaderBean

protected AbstractHeaderBean()
Method Detail

getContainer

public DateAreaBean getContainer()
Returns the container that this header is decorating.

Returns:
The container that this header is decorating. Can be null.

revalidateRepaintContainer

public void revalidateRepaintContainer()
If there is a connected container, revaidate and repaint it


setDateAreaContainer

public boolean setDateAreaContainer(DateAreaBean container)
Sets the DateAreaContainer that this header should decorate. This will be called by the controller that handles them both and the header will not work unless this property has been set.

Parameters:
container - The container that this header should decorate. null resets the header.
Returns:
If the container was changed. false if the same container was set again.

recreateHeader

protected abstract void recreateHeader()
Set the header to null and revalidate the container


getExpandToCorner

public int getExpandToCorner()
Property: What corner, if any, the header should expand into if (if it exist, or rather has any space). Values are:
  1. DateAreaContainer.CORNER_EXPAND_NONE - The header will not expand into any corner.
  2. DateAreaContainer.CORNER_EXPAND_BOTH - The header will expand into both adjacent corners.
  3. DateAreaContainer.CORNER_EXPAND_BOTTOM_OR_RIGHT - The header will expand into the bottom corner if this is a vertical (standing) header and to the right corner if it's a horizontal header.
  4. DateAreaContainer.CORNER_EXPAND_TOP_OR_LEFT - The header will expand into the top corner if this is a vertical (standing) header and to the left corner if it's a horizontal header.

Returns:
The current value. DateAreaContainer.CORNER_EXPAND_NONE is default.

setExpandToCorner

public void setExpandToCorner(int corner)
Property: What corner, if any, the header should expand into if (if it exist, or rather has any space). Values are:
  1. DateAreaContainer.CORNER_EXPAND_NONE - The header will not expand into any corner.
  2. DateAreaContainer.CORNER_EXPAND_BOTH - The header will expand into both adjacent corners.
  3. DateAreaContainer.CORNER_EXPAND_BOTTOM_OR_RIGHT - The header will expand into the bottom corner if this is a vertical (standing) header and to the right corner if it's a horizontal header.
  4. DateAreaContainer.CORNER_EXPAND_TOP_OR_LEFT - The header will expand into the top corner if this is a vertical (standing) header and to the left corner if it's a horizontal header.

This method will recreate the header if the value changes.

Parameters:
corner - The new value.

getEdge

public int getEdge()
Property: The edge (top, left, bottom, right) that this header should be placed at.
  1. SwingConstants.TOP - The header will be above the date area.
  2. SwingConstants.LEFT - The header will be to the left of the date area.
  3. SwingConstants.BOTTOM - The header will be to the right of the date area.
  4. SwingConstants.RIGHT - The header will be below the date area.

Returns:
The current value. SwingConstants.TOP is default.

setEdge

public void setEdge(int edge)
Property: The edge (top, left, bottom, right) that this header should be placed at.
  1. SwingConstants.TOP - The header will be above the date area.
  2. SwingConstants.LEFT - The header will be to the left of the date area.
  3. SwingConstants.BOTTOM - The header will be to the right of the date area.
  4. SwingConstants.RIGHT - The header will be below the date area.

This method will recreate the header if the value changes.

Parameters:
edge - The new edge.

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()
Property: The background paint in the date area. Will override the normal background Color so that Paint objects can be used instead.

Note! This might be shown as the grid color. It really isn't but if the grid color is set to null and the cells have a background paint this background color will show through as the grid color. This is the way if some cells should span more than one cell.

Returns:
The current background paint. May be null.

setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint p)
Property: The background paint in the date area. Will override the normal background Color so that Paint objects can be used instead.

Note! This might be shown as the grid color. It really isn't but if the grid color is set to null and the cells have a background paint this background color will show through as the grid color. This is the way if some cells should span more than one cell.

Parameters:
p - The new background paint. May be null.

isVisible

public boolean isVisible()
Property: If this header should be visible or not.

Returns:
If the header is corrently visible.

setVisible

public void setVisible(boolean b)
Property: If this header should be visible or not.

Parameters:
b - If the header should be visible.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.