eu.beesoft.gantt.chart
Class GanttNodeLayer

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

public class GanttNodeLayer
extends Layer

Paints gantt nodes as time-line objects on chart component.


Constructor Summary
GanttNodeLayer()
          Default constructor.
 
Method Summary
 java.awt.Color getMilestoneBorderColor()
          Returns color used to paint border of a milestone object.
 java.awt.Color getMilestoneInteriorColor()
          Returns color used to paint the interior of a milestone object.
 java.awt.Color getSummaryColor()
          Returns color used to paint summary object.
 java.awt.Color getTaskBorderColor()
          Returns color used to paint the border of a task (non-summary, non-milestone) object.
 java.awt.Color getTaskInteriorColor()
          Returns color used to paint the interior of a task (non-summary, non-milestone) object.
protected  void mousePressed(java.awt.event.MouseEvent e)
          Overrides mousePressed() method in Layer to catch double click on node in chart component.
protected  void paint(java.awt.Graphics g)
          Paints all on-screen visible nodes.
protected  void paintMilestone(GanttNode node, java.awt.Graphics g)
          Paints milestone node.
protected  void paintSummary(GanttNode node, java.awt.Graphics g)
          Paints summary node.
protected  void paintTask(GanttNode node, java.awt.Graphics g)
          Paints task (non-summary, non-milestone) node.
 void setMilestoneBorderColor(java.awt.Color milestoneBorderColor)
          Sets the color used to paint border of a milestone object.
 void setMilestoneInteriorColor(java.awt.Color milestoneInteriorColor)
          Sets the color used to paint the interior of a milestone object.
 void setSummaryColor(java.awt.Color summaryColor)
          Sets the color used to paint summary object.
 void setTaskBorderColor(java.awt.Color taskBorderColor)
          Sets the color used to paint the border of a task (non-summary, non-milestone) object.
 void setTaskInteriorColor(java.awt.Color taskInteriorColor)
          Sets the color used to paint the interior of a task (non-summary, non-milestone) object.
 
Methods inherited from class eu.beesoft.gantt.chart.Layer
getGantt, getGanttModel, getHeaderHeight, getChartComponent, getNodeAt, getPaintedNodes, getPosition, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GanttNodeLayer

public GanttNodeLayer()
Default constructor.

Method Detail

getSummaryColor

public java.awt.Color getSummaryColor()
Returns color used to paint summary object.

Returns:
the summary color

setSummaryColor

public void setSummaryColor(java.awt.Color summaryColor)
Sets the color used to paint summary object.

Parameters:
summaryColor - the summary color to set

getMilestoneBorderColor

public java.awt.Color getMilestoneBorderColor()
Returns color used to paint border of a milestone object.

Returns:
the milestone border color

setMilestoneBorderColor

public void setMilestoneBorderColor(java.awt.Color milestoneBorderColor)
Sets the color used to paint border of a milestone object.

Parameters:
milestoneBorderColor - the milestone border color to set

getMilestoneInteriorColor

public java.awt.Color getMilestoneInteriorColor()
Returns color used to paint the interior of a milestone object.

Returns:
the milestone interior color

setMilestoneInteriorColor

public void setMilestoneInteriorColor(java.awt.Color milestoneInteriorColor)
Sets the color used to paint the interior of a milestone object.

Parameters:
milestoneInteriorColor - the milestone interior color to set

getTaskBorderColor

public java.awt.Color getTaskBorderColor()
Returns color used to paint the border of a task (non-summary, non-milestone) object.

Returns:
the task border color

setTaskBorderColor

public void setTaskBorderColor(java.awt.Color taskBorderColor)
Sets the color used to paint the border of a task (non-summary, non-milestone) object.

Parameters:
taskBorderColor - the task border color to set

getTaskInteriorColor

public java.awt.Color getTaskInteriorColor()
Returns color used to paint the interior of a task (non-summary, non-milestone) object.

Returns:
the task interior color

setTaskInteriorColor

public void setTaskInteriorColor(java.awt.Color taskInteriorColor)
Sets the color used to paint the interior of a task (non-summary, non-milestone) object.

Parameters:
taskInteriorColor - the task interior color to set

paint

protected void paint(java.awt.Graphics g)
Paints all on-screen visible nodes. It obtains nodes from method getPaintedNodes(). Then it checks type of TimelineObject stored as user-object in gantt node and calls one of these methods to paint node:

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

paintMilestone

protected void paintMilestone(GanttNode node,
                              java.awt.Graphics g)
Paints milestone node.

Parameters:
node - - the node to paint
g - - the graphics context to use for painting

paintSummary

protected void paintSummary(GanttNode node,
                            java.awt.Graphics g)
Paints summary node.

Parameters:
node - - the node to paint
g - - the graphics context to use for painting

paintTask

protected void paintTask(GanttNode node,
                         java.awt.Graphics g)
Paints task (non-summary, non-milestone) node.

Parameters:
node - - the node to paint
g - - the graphics context to use for painting

mousePressed

protected void mousePressed(java.awt.event.MouseEvent e)
Overrides mousePressed() method in Layer to catch double click on node in chart component. If a node is double-clicked, it calls doubleClicked() on JGantt.

Overrides:
mousePressed in class Layer
Parameters:
e - - mouse event