|
JavaGantt 2011.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.beesoft.gantt.chart.Layer
eu.beesoft.gantt.chart.GanttNodeLayer
public class GanttNodeLayer
Paints gantt nodes as time-line objects on chart component. Also supports the mouse cursor changes in dependency on the pointed gantt node and moving or dragging of that node.
Constructor Summary | |
---|---|
GanttNodeLayer()
Default constructor. |
Method Summary | |
---|---|
protected boolean |
canMove(GanttNode node)
Returns true if given node can be moved by mouse dragging. |
protected boolean |
canResize(GanttNode node)
Returns true if given node can be resized by mouse dragging. |
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. |
protected java.util.List<javax.swing.Action> |
getPopupActions(GanttNode node)
Returns a list of (popup) actions for given node . |
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 |
mouseDragged(java.awt.event.MouseEvent e)
Overrides mouseDragged() method in Layer to drag (move
or resize) the pointed node. |
protected void |
mouseMoved(java.awt.event.MouseEvent e)
Overrides mouseMoved() method in Layer to change mouse
cursor depending on the pointed node. |
protected void |
mousePressed(java.awt.event.MouseEvent e)
Overrides mousePressed() method in Layer to catch
click on node in chart component. |
protected void |
mouseReleased(java.awt.event.MouseEvent e)
Overrides mouseReleased() method in Layer to process
changes in GanttNodes invoked by mouse dragging and to transfer them to the model. |
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, mouseEntered, mouseExited, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GanttNodeLayer()
Method Detail |
---|
public java.awt.Color getSummaryColor()
summary
object.
public void setSummaryColor(java.awt.Color summaryColor)
summary
object.
summaryColor
- the summary color to setpublic java.awt.Color getMilestoneBorderColor()
milestone
object.
public void setMilestoneBorderColor(java.awt.Color milestoneBorderColor)
milestone
object.
milestoneBorderColor
- the milestone border color to setpublic java.awt.Color getMilestoneInteriorColor()
milestone
object.
public void setMilestoneInteriorColor(java.awt.Color milestoneInteriorColor)
milestone
object.
milestoneInteriorColor
- the milestone interior color to setpublic java.awt.Color getTaskBorderColor()
task
(non-summary, non-milestone)
object.
public void setTaskBorderColor(java.awt.Color taskBorderColor)
task
(non-summary, non-milestone)
object.
taskBorderColor
- the task border color to setpublic java.awt.Color getTaskInteriorColor()
task
(non-summary, non-milestone)
object.
public void setTaskInteriorColor(java.awt.Color taskInteriorColor)
task
(non-summary, non-milestone)
object.
taskInteriorColor
- the task interior color to setprotected void paint(java.awt.Graphics g)
getPaintedNodes()
. Then it checks type of
TimelineObject
stored as user-object in gantt node and calls one of these methods to
paint node:
Note, you can obtain the node position and size by method node.getBounds()
.
paint
in class Layer
g
- - the graphics context to use for paintingprotected void paintMilestone(GanttNode node, java.awt.Graphics g)
milestone
node.
node
- - the node to paintg
- - the graphics context to use for paintingprotected void paintSummary(GanttNode node, java.awt.Graphics g)
summary
node.
node
- - the node to paintg
- - the graphics context to use for paintingprotected void paintTask(GanttNode node, java.awt.Graphics g)
task
(non-summary, non-milestone) node.
node
- - the node to paintg
- - the graphics context to use for paintingprotected void mousePressed(java.awt.event.MouseEvent e)
mousePressed()
method in Layer to catch
click on node in chart component.
If a node is double-clicked, it calls
doubleClicked()
on
JavaGantt
.
Simple pressing the left mouse button starts pointed GanttNode moving or resizing.
Right click invokes method getPopupActions(GanttNode)
. If that method returns
non-null list of actions, it displays popup menu for pointed node.
mousePressed
in class Layer
e
- - mouse eventprotected void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased()
method in Layer to process
changes in GanttNodes invoked by mouse dragging and to transfer them to the model.
mouseReleased
in class Layer
e
- - mouse eventprotected java.util.List<javax.swing.Action> getPopupActions(GanttNode node)
node
. It invokes
JavaGantt.getPopupActions()
in this
implementation. Override it if you want display different popup for node in treetable and in
the chart.
node
- - gantt node for which are actions requested
protected boolean canResize(GanttNode node)
node
can be resized by mouse dragging. In this
implementation it returns true for non-milestone non-summary timeline object only.
node
- - checked gantt node
protected boolean canMove(GanttNode node)
node
can be moved by mouse dragging. In this
implementation it returns true for non-summary timeline object only.
node
- - checked gantt node
protected void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved()
method in Layer to change mouse
cursor depending on the pointed node.
mouseMoved
in class Layer
e
- - mouse eventprotected void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged()
method in Layer to drag (move
or resize) the pointed node.
mouseDragged
in class Layer
e
- - mouse event
|
JavaGantt 2011.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |