LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingInterval

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingInterval
All Implemented Interfaces:
LyGraphicalComponent, LyGraphicalInterval, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetFontInterface, LySetLabelInterface, LySwingComponent

public class LySwingInterval
extends LySwingObject
implements LyGraphicalInterval

This class implements the Interval object (as described in the dtd) for swing viewer.

An interval is defined by a begin date and an end date. If the end date is not specified, the interval is replaced by a point (an image representing a date). An interval has a label and a color. It may be resizable (it is possible to change its begin and end dates), movable on its parent line and may have vertical lines on its extremities. It may also have dependencies to other intervals represented by arrows linking this interval with the pointed intervals. An interval may also contain periods allowing to split it into several sub-intervals. These periods are described by a begin date and an end date.

See Also:
LyInterval

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingInterval(LyInterval interval)
          Class constructor of an Interval object for the Swing target.
 
Method Summary
 void addPeriod(LyPeriod period, int i)
          Recomputes all the periods of this Gantt element.
 java.util.Date getBeginDate()
          Returns the begin date of the interval using the date format.
 java.awt.Component getComponent()
          This interval component belongs to a Gantt planning.
 java.util.Date getEndDate()
          Returns the end date of the interval using the date format.
 LyGanttElement getGanttElement()
          Accessor to the gantt element.
 void initialize()
          Initializes the component by creating a new Gantt element associated with this interval.
 java.util.Date parseDate(java.lang.String value)
          Parses a date value using date time format and date format.
 void removePeriod(LyPeriod period)
          Recomputes all the periods of this Gantt element.
 void resetDates()
          Resets the dates of the Gantt element with those of the interval then sets the type of this element: LyGanttElement.REAL_INTERVAL if it has an end date or LyGanttElement.POINT_INTERVAL if not.
 void setBeginDate(java.lang.String beginDate)
          (non-Javadoc).
 void setCenterLabel(java.lang.String label)
          (non-Javadoc).
 void setColor(java.lang.String color)
          (non-Javadoc).
 void setContent()
          Sets the Gantt element default properties.
 void setDependencies(java.lang.String dependencies)
          Resets the dependencies of this Gantt element's parent component.
 void setDrawVerticalLines(boolean drawVerticalLines)
          (non-Javadoc).
 void setEndDate(java.lang.String endDate)
          (non-Javadoc).
 void setFont(java.lang.String font)
          (non-Javadoc).
 void setForegroundColor(java.lang.String color)
          (non-Javadoc).
 void setLabel(java.lang.String label)
          (non-Javadoc).
 void setLeftResizable(boolean leftResizable)
          (non-Javadoc).
 void setMovable(boolean movable)
          (non-Javadoc).
 void setRightResizable(boolean rightResizable)
          (non-Javadoc).
 void setTooltip(java.lang.String tooltip)
          (non-Javadoc).
 void setVerticalLinesColor(java.lang.String color)
          (non-Javadoc).
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getDefaultFrame
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, free, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
free, getViewComponent
 

Field Detail

__VERSION

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

LySwingInterval

public LySwingInterval(LyInterval interval)
Class constructor of an Interval object for the Swing target.

Parameters:
interval - an INTERVAL component defined for every type of view targets. This interval is initialized for the Swing view specificaly and filled with the default values.
Method Detail

initialize

public void initialize()
Initializes the component by creating a new Gantt element associated with this interval.


setContent

public void setContent()
Sets the Gantt element default properties.


setLabel

public void setLabel(java.lang.String label)
(non-Javadoc).

Specified by:
setLabel in interface LyGraphicalInterval
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - New value of label.
See Also:
LySetLabelInterface.setLabel(java.lang.String)

setCenterLabel

public void setCenterLabel(java.lang.String label)
(non-Javadoc).

Specified by:
setCenterLabel in interface LyGraphicalInterval
Parameters:
label - New value of centerLabel.
See Also:
LyGraphicalInterval.setCenterLabel(java.lang.String)

setTooltip

public void setTooltip(java.lang.String tooltip)
(non-Javadoc).

Specified by:
setTooltip in interface LyGraphicalInterval
Parameters:
tooltip - New value of tooltip.
See Also:
LyGraphicalInterval.setTooltip(java.lang.String)

setColor

public void setColor(java.lang.String color)
(non-Javadoc).

Specified by:
setColor in interface LyGraphicalInterval
Specified by:
setColor in interface LySetColorInterface
Parameters:
color - New value of color.
See Also:
LySetColorInterface.setColor(java.lang.String)

setFont

public void setFont(java.lang.String font)
(non-Javadoc).

Specified by:
setFont in interface LyGraphicalInterval
Specified by:
setFont in interface LySetFontInterface
Parameters:
font - New value of font.
See Also:
LySetFontInterface.setFont(java.lang.String)

setForegroundColor

public void setForegroundColor(java.lang.String color)
(non-Javadoc).

See Also:
leon.view.graphic.LyGraphicalInterval#setForegroundColor(java.lang.String)

setVerticalLinesColor

public void setVerticalLinesColor(java.lang.String color)
(non-Javadoc).

Specified by:
setVerticalLinesColor in interface LyGraphicalInterval
Parameters:
color - New value of verticalLinesColor.
See Also:
LyGraphicalInterval.setVerticalLinesColor(java.lang.String)

resetDates

public void resetDates()
Resets the dates of the Gantt element with those of the interval then sets the type of this element: LyGanttElement.REAL_INTERVAL if it has an end date or LyGanttElement.POINT_INTERVAL if not.


getBeginDate

public java.util.Date getBeginDate()
Returns the begin date of the interval using the date format.

Returns:
the begin date
See Also:
setBeginDate(String)

getEndDate

public java.util.Date getEndDate()
Returns the end date of the interval using the date format.

Returns:
the end date
See Also:
setEndDate(String)

parseDate

public java.util.Date parseDate(java.lang.String value)
Parses a date value using date time format and date format. If the date value cannot be parsed, the returned date is null.

Parameters:
value - the date value
Returns:
the parsed date

setBeginDate

public void setBeginDate(java.lang.String beginDate)
(non-Javadoc).

Specified by:
setBeginDate in interface LyGraphicalInterval
Parameters:
beginDate - New value of beginDate.
See Also:
LyGraphicalInterval.setBeginDate(java.lang.String)

setEndDate

public void setEndDate(java.lang.String endDate)
(non-Javadoc).

Specified by:
setEndDate in interface LyGraphicalInterval
Parameters:
endDate - New value of endDate.
See Also:
LyGraphicalInterval.setEndDate(java.lang.String)

setDrawVerticalLines

public void setDrawVerticalLines(boolean drawVerticalLines)
(non-Javadoc).

Specified by:
setDrawVerticalLines in interface LyGraphicalInterval
Parameters:
drawVerticalLines - Boolean indicating if attribute drawVerticalLines is set or unset.
See Also:
LyGraphicalInterval.setDrawVerticalLines(boolean)

setLeftResizable

public void setLeftResizable(boolean leftResizable)
(non-Javadoc).

Specified by:
setLeftResizable in interface LyGraphicalInterval
Parameters:
leftResizable - Boolean indicating if attribute leftResizable is set or unset.
See Also:
LyGraphicalInterval.setLeftResizable(boolean)

setRightResizable

public void setRightResizable(boolean rightResizable)
(non-Javadoc).

Specified by:
setRightResizable in interface LyGraphicalInterval
Parameters:
rightResizable - Boolean indicating if attribute rightResizable is set or unset.
See Also:
LyGraphicalInterval.setRightResizable(boolean)

setMovable

public void setMovable(boolean movable)
(non-Javadoc).

Specified by:
setMovable in interface LyGraphicalInterval
Parameters:
movable - Boolean indicating if attribute movable is set or unset.
See Also:
LyGraphicalInterval.setMovable(boolean)

setDependencies

public void setDependencies(java.lang.String dependencies)
Resets the dependencies of this Gantt element's parent component. The specified dependency is already set when this method is called and is only used here to refresh the parent Swing component.

Specified by:
setDependencies in interface LyGraphicalInterval
Parameters:
dependencies - value of dependencies, not used in this implementation
See Also:
LyGraphicalInterval.setDependencies(java.lang.String)

addPeriod

public void addPeriod(LyPeriod period,
                      int i)
Recomputes all the periods of this Gantt element. The specified period is already added when this method is called and is only used here to refresh the Swing component.

Specified by:
addPeriod in interface LyGraphicalInterval
Parameters:
period - a period to add to this Gantt element, not used in this implementation
i - the position to add the specified period, not used in this implementation
See Also:
resetPeriods(LyPeriod), LyGraphicalInterval.addPeriod(LyPeriod, int)

removePeriod

public void removePeriod(LyPeriod period)
Recomputes all the periods of this Gantt element. The specified period is already removed when this method is called and is only used here to refresh the Swing component.

Specified by:
removePeriod in interface LyGraphicalInterval
Parameters:
period - a period to remove to this Gantt element, not used in this implementation
See Also:
resetPeriods(LyPeriod), LyGraphicalInterval.removePeriod(LyPeriod)

getComponent

public java.awt.Component getComponent()
This interval component belongs to a Gantt planning. It is not meant to be accessed directly.

Specified by:
getComponent in interface LySwingComponent
Overrides:
getComponent in class LySwingObject
Returns:
null
See Also:
LySwingComponent.getComponent()

getGanttElement

public LyGanttElement getGanttElement()
Accessor to the gantt element.

Returns:
the gantt element

(c) January 2013 - W4 S.A.

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