com.miginfocom.calendar.decorators
Class OddRowFillDecorator

java.lang.Object
  extended by com.miginfocom.calendar.decorators.AbstractGridDecorator
      extended by com.miginfocom.calendar.decorators.AbstractDateGridDecorator
          extended by com.miginfocom.calendar.decorators.OddRowFillDecorator
All Implemented Interfaces:
Decorator, GridDecorator, java.lang.Comparable

public class OddRowFillDecorator
extends AbstractDateGridDecorator

Paints even rows and/or columns with a paint.


Constructor Summary
OddRowFillDecorator(DateGridContainer gridContainer, int layerIndex, java.awt.Paint rowPaint, java.awt.Paint colPaint)
          Constructor.
 
Method Summary
 void doPaint(java.awt.Graphics2D g2, java.awt.Rectangle bounds)
          Paint what should be painted.
 java.awt.Paint getColumnPaint()
          Property: The paint to paint for all odd columns.
 java.awt.Paint getRowPaint()
          Property: The paint to paint for all odd rows.
 void gridChanged(java.beans.PropertyChangeEvent e)
          Called when the grid changes.
 void setColumnPaint(java.awt.Paint p)
          Property: The paint to paint for all odd columns.
 void setRowPaint(java.awt.Paint p)
          Property: The paint to paint for all odd rows.
 
Methods inherited from class com.miginfocom.calendar.decorators.AbstractDateGridDecorator
getDateGrid, getDateGridContainer
 
Methods inherited from class com.miginfocom.calendar.decorators.AbstractGridDecorator
compareTo, dispose, getGrid, getGridContainer, getInvalidEnd, getInvalidStart, getLayerIndex, hasInvalidCells, invalidateCells, processEvent, setCellsValid, setLayerIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OddRowFillDecorator

public OddRowFillDecorator(DateGridContainer gridContainer,
                           int layerIndex,
                           java.awt.Paint rowPaint,
                           java.awt.Paint colPaint)
Constructor. Note that the grid has to be set before any painting can occur.

Parameters:
gridContainer - The grid container to decorate. Not null.
layerIndex - The order in which this decoration is painted. Should probably be pretty high since it has to be shown above the grid lines.
rowPaint - The paint to paint for all odd rows. May be null.
colPaint - The paint to paint for all odd columns. May be null.
Method Detail

doPaint

public void doPaint(java.awt.Graphics2D g2,
                    java.awt.Rectangle bounds)
Description copied from interface: Decorator
Paint what should be painted. Color, paints, fonts, hints and similar should be same as when called.

Parameters:
g2 - The graphics object to paint in
bounds - The bounds to stay within (a must). If width and/or height is 0 that dimension is not scaled to fit and should be ignored.

getRowPaint

public java.awt.Paint getRowPaint()
Property: The paint to paint for all odd rows. May be null.

Returns:
The current value.

setRowPaint

public void setRowPaint(java.awt.Paint p)
Property: The paint to paint for all odd rows. May be null.

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

getColumnPaint

public java.awt.Paint getColumnPaint()
Property: The paint to paint for all odd columns. May be null.

Returns:
The current value.

setColumnPaint

public void setColumnPaint(java.awt.Paint p)
Property: The paint to paint for all odd columns. May be null.

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

gridChanged

public void gridChanged(java.beans.PropertyChangeEvent e)
Description copied from class: AbstractGridDecorator
Called when the grid changes.

Specified by:
gridChanged in class AbstractGridDecorator
Parameters:
e - The event.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.