com.miginfocom.calendar.decorators
Class GridLineDecorator

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

public class GridLineDecorator
extends AbstractGridDecorator

Draws the grid lines for the Grid that is returned by the GridContainer sent into the constructor.


Constructor Summary
GridLineDecorator(GridContainer gridContainer, int layerIndex)
          Contructor
GridLineDecorator(GridContainer gridContainer, int layerIndex, int maxLineWidth)
          Contructor
 
Method Summary
 void doPaint(java.awt.Graphics2D g2, java.awt.Rectangle bounds)
          Paint what should be painted.
 void gridChanged(java.beans.PropertyChangeEvent e)
          Called when the grid changes.
 
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

GridLineDecorator

public GridLineDecorator(GridContainer gridContainer,
                         int layerIndex)
Contructor

Parameters:
gridContainer - The container of the grid. Can be null in which case nothing should be painted.
layerIndex - A number to indicate the order in which to paint something. Lower if painted before. I.e. under.

GridLineDecorator

public GridLineDecorator(GridContainer gridContainer,
                         int layerIndex,
                         int maxLineWidth)
Contructor

Parameters:
gridContainer - The container of the grid. Can be null in which case nothing should be painted.
layerIndex - A number to indicate the order in which to paint something. Lower if painted before. I.e. under.
maxLineWidth - The maximum width of the grid line. If less than the grid line secified in the grid it will be aligned towards top/left.
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.

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.