eu.beesoft.gantt.chart
Class CalendarLayer

java.lang.Object
  extended by eu.beesoft.gantt.chart.Layer
      extended by eu.beesoft.gantt.chart.CalendarLayer

public class CalendarLayer
extends Layer

Paints background for weekend days.


Constructor Summary
CalendarLayer()
          Default constructor.
 
Method Summary
 java.awt.Color getColor()
          Returns color used to paint background for weekend days.
protected  void paint(java.awt.Graphics g)
          Paints a calendar background in gantt chart.
protected  void paintCalendarItem(TimeSpan timeSpan, java.awt.Graphics g)
          For given timeSpan paints calendar background.
 void setColor(java.awt.Color color)
          Sets the color used to paint background for weekend days.
 
Methods inherited from class eu.beesoft.gantt.chart.Layer
getGantt, getGanttModel, getHeaderHeight, getChartComponent, getNodeAt, getPaintedNodes, getPosition, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarLayer

public CalendarLayer()
Default constructor.

Method Detail

getColor

public java.awt.Color getColor()
Returns color used to paint background for weekend days.

Returns:
the color

setColor

public void setColor(java.awt.Color color)
Sets the color used to paint background for weekend days.

Parameters:
color - the color to set

paint

protected void paint(java.awt.Graphics g)
Paints a calendar background in gantt chart. This method simply checks for each TimeSpan if it is visible on screen and if so, it delegates the painting to the method paintCalendarItem()

Specified by:
paint in class Layer
Parameters:
g - - the graphics context to use for painting

paintCalendarItem

protected void paintCalendarItem(TimeSpan timeSpan,
                                 java.awt.Graphics g)
For given timeSpan paints calendar background. Calls method isWeekend() on GanttModel to find out the date from timeSpan is a weekend day and then paints a background. If timeSpan is not a weekend day, it does nothing.

Parameters:
timeSpan - - dates range to paint
g - - the graphics context to use for painting