LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts.gantt
Class LyStrutsGanttElement

java.lang.Object
  extended by leon.view.web.struts.gantt.LyStrutsGanttElement
All Implemented Interfaces:
LySetLabelInterface

public class LyStrutsGanttElement
extends java.lang.Object
implements LySetLabelInterface

This class represents an element on a Gantt planning.


Nested Class Summary
static class LyStrutsGanttElement._LyPeriod
          This class implements the common behavior for Period objects for the struts viewer.
 
Field Summary
static java.lang.String __VERSION
           
static int DEFAULT_INTERVAL_HEIGHT
          Default height of the interval.
static int DEPENDENCIES_DELTA
          Dependencies delta.
static short TYPE_POINT_INTERVAL
          Point interval type (interval with no end date).
static short TYPE_REAL_INTERVAL
          Real interval type (interval with both begin and end date).
static short TYPE_SUPER_LINE
          Super line type.
 
Constructor Summary
LyStrutsGanttElement(short type)
          Constructor.
 
Method Summary
 void draw(java.awt.Graphics g, LyStrutsGanttCanvas ganttCanvas, int beginX, int endX, int beginY, int endY)
          Draws the Gantt Element.
 void drawTube(java.awt.Graphics g, int beginX, int beginY, int endX, int endY, java.awt.Color color)
          Draws a tube-style line.
 java.awt.Point getGanttImageSize()
          Gets the size of the image used to draw the Gantt element (only for TYPE_POINT_INTERVAL).
 java.awt.Color getLighterColor(java.awt.Color color, int value)
          Calculates a color that is value% lighter than the current color.
 short getType()
          Gets the element type.
 void setCenterLabel(java.lang.String label)
          Sets the center label of the Gantt element.
 void setColor(java.awt.Color color)
          Sets the element color.
 void setDependencies(java.util.Vector<LyInterval> dependencies)
          Sets the element dependencies.
 void setDependencyColor(java.awt.Color color)
          Sets the dependencies color.
 void setDrawVerticalLines(boolean draw)
          Sets the draw vertical lines parameter of the Gantt element.
 void setFont(java.awt.Font font)
          Sets the element font.
 void setId(java.lang.String id)
          Sets the element id.
 void setLabel(java.lang.String label)
          Sets the element label.
 void setLabelColor(java.awt.Color color)
          Sets the color of the label.
 void setPeriods(java.util.Vector<LyStrutsGanttElement._LyPeriod> periods)
          Sets the periods of the Gantt element.
 void setTooltip(java.lang.String tooltip)
          Sets the element tooltip.
 void setVerticalLinesColor(java.awt.Color color)
          Sets the vertical lines color.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

TYPE_SUPER_LINE

public static final short TYPE_SUPER_LINE
Super line type.

See Also:
Constant Field Values

TYPE_REAL_INTERVAL

public static final short TYPE_REAL_INTERVAL
Real interval type (interval with both begin and end date).

See Also:
Constant Field Values

TYPE_POINT_INTERVAL

public static final short TYPE_POINT_INTERVAL
Point interval type (interval with no end date).

See Also:
Constant Field Values

DEFAULT_INTERVAL_HEIGHT

public static final int DEFAULT_INTERVAL_HEIGHT
Default height of the interval.

See Also:
Constant Field Values

DEPENDENCIES_DELTA

public static final int DEPENDENCIES_DELTA
Dependencies delta.

See Also:
Constant Field Values
Constructor Detail

LyStrutsGanttElement

public LyStrutsGanttElement(short type)
Constructor.

Parameters:
type - the element type
Method Detail

getType

public short getType()
Gets the element type.

Returns:
the element type

setId

public void setId(java.lang.String id)
Sets the element id.

Parameters:
id - new element id

setLabel

public void setLabel(java.lang.String label)
Sets the element label.

Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - new element label

setTooltip

public void setTooltip(java.lang.String tooltip)
Sets the element tooltip.

Parameters:
tooltip - new element tooltip

setCenterLabel

public void setCenterLabel(java.lang.String label)
Sets the center label of the Gantt element.

Parameters:
label - new element center label

setDrawVerticalLines

public void setDrawVerticalLines(boolean draw)
Sets the draw vertical lines parameter of the Gantt element.

Parameters:
draw - indicates if vertical lines must be drawn or not

setFont

public void setFont(java.awt.Font font)
Sets the element font.

Parameters:
font - new element font

setColor

public void setColor(java.awt.Color color)
Sets the element color.

Parameters:
color - new element color

setLabelColor

public void setLabelColor(java.awt.Color color)
Sets the color of the label.

Parameters:
color - new color of the label

setVerticalLinesColor

public void setVerticalLinesColor(java.awt.Color color)
Sets the vertical lines color.

Parameters:
color - new vertical lines color

setDependencyColor

public void setDependencyColor(java.awt.Color color)
Sets the dependencies color.

Parameters:
color - new dependencies color

setDependencies

public void setDependencies(java.util.Vector<LyInterval> dependencies)
Sets the element dependencies.

Parameters:
dependencies - the list of dependencies

setPeriods

public void setPeriods(java.util.Vector<LyStrutsGanttElement._LyPeriod> periods)
Sets the periods of the Gantt element.

Parameters:
periods - the list of periods

getGanttImageSize

public java.awt.Point getGanttImageSize()
Gets the size of the image used to draw the Gantt element (only for TYPE_POINT_INTERVAL).

Returns:
the image size

draw

public void draw(java.awt.Graphics g,
                 LyStrutsGanttCanvas ganttCanvas,
                 int beginX,
                 int endX,
                 int beginY,
                 int endY)
Draws the Gantt Element.

Parameters:
g - the graphic context
ganttCanvas - the canvas containing the element
beginX - the begin x coordonate of the element
endX - the end x coordonate of the element
beginY - the begin y coordonate of the element
endY - the end y coordonate of the element

drawTube

public void drawTube(java.awt.Graphics g,
                     int beginX,
                     int beginY,
                     int endX,
                     int endY,
                     java.awt.Color color)
Draws a tube-style line.

Parameters:
g - the graphic context
beginX - the begin x position
beginY - the begin y position
endX - the end x position
endY - the end y position
color - the color used for the border of the line

getLighterColor

public java.awt.Color getLighterColor(java.awt.Color color,
                                      int value)
Calculates a color that is value% lighter than the current color.

Parameters:
color - the current color
value - the lightness percentage
Returns:
the lighter color

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com