eu.beesoft.gantt.chart
Class TodayLayer

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

public class TodayLayer
extends Layer

Paints strong vertical line on chart component at given date (usually today).


Constructor Summary
TodayLayer()
          Default constructor.
 
Method Summary
 java.awt.Color getColor()
          Returns line color.
 java.util.Date getDate()
          Returns date for which is line painted.
protected  void paint(java.awt.Graphics g)
          Paints a vertical line for (today) date.
protected  void paintToday(TimeSpan timeSpan, java.awt.Graphics g)
          Paints a vertical line for given timeSpan.
 void setColor(java.awt.Color color)
          Sets line color.
 void setDate(java.util.Date date)
          Sets the date for which will be line painted.
 
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

TodayLayer

public TodayLayer()
Default constructor.

Method Detail

getColor

public java.awt.Color getColor()
Returns line color.

Returns:
line color

setColor

public void setColor(java.awt.Color color)
Sets line color.

Parameters:
color - new value for line color

getDate

public java.util.Date getDate()
Returns date for which is line painted.

Returns:
line date

setDate

public void setDate(java.util.Date date)
Sets the date for which will be line painted. Usually you don't need to call this method, because constructor of TodayLayer sets this property to the current date.

Parameters:
date - - new line date

paint

protected void paint(java.awt.Graphics g)
Paints a vertical line for (today) date. This methods find appropriate TimeSpan and then delegates painting to paintToday() method.

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

paintToday

protected void paintToday(TimeSpan timeSpan,
                          java.awt.Graphics g)
Paints a vertical line for given timeSpan.

Parameters:
timeSpan - - date transformed to x-coordinate where to paint line
g - - the graphics context to use for painting