LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingLine

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingLine
All Implemented Interfaces:
LyGetIdInterface, LyGraphicalComponent, LyGraphicalLine, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetFontInterface, LySetHiddenInterface, LySetImageInterface, LySetLabelInterface, LySetSelectedInterface, LyJTreeElement, LySwingComponent

public class LySwingLine
extends LySwingObject
implements LySwingComponent, LyJTreeElement, LyGetIdInterface, LyGraphicalLine

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

See Also:
LyLine

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingLine(LyLine line)
          Class constructor of a Line object for the Swing target.
 
Method Summary
 void addComponent(LyComponent component, int pos)
          (non-Javadoc).
 void changeValidity()
          Don't do anything.
 java.util.Vector<java.awt.Image> getAdditionalImages()
          Returns null as the current line don't have an additional images.
 java.awt.Color getColor()
          Returns the color of this line.
 java.awt.Component getComponent()
          (non-Javadoc).
 LyJTreeElementImpl._LyNodeContent getContent()
          Gets the content of this node.
 java.awt.Image getEmptyCheckboxImage()
          Returns null as the current line don't have an empty checkbox image.
 java.awt.Font getFont()
          Returns the font for this line.
 java.awt.Color getFontColor()
          Returns the font color of this line.
 java.util.Vector<LyGanttElement> getGanttElements()
          Accessor to the gantt element list.
 int getHeightFactor()
          Returns the height factor for this node.
 java.lang.String getId()
          (non-Javadoc).
 java.lang.String getLabel()
          (non-Javadoc).
 java.util.Date getLimitDate(boolean max)
          Returns the limit date for this line (minimum or maximum).
 javax.swing.tree.DefaultMutableTreeNode getMutableTreeNode()
          Accessor to the internal mutable tree node.
 java.awt.Image getSelectedCheckboxImage()
          Returns null as the current line don't have a selected checkbox image.
 java.awt.Color getSelectedColor()
          Returns the color of this line when selected.
 java.awt.Color getSelectedFontColor()
          Returns the font color of this line when selected.
 LyJTreeComponent getTree()
          Gets the tree component that display this node.
 javax.swing.tree.TreePath getTreePath()
          Returns a TreePath for this node.
 int getValidityImageIndex()
          Returns -1 as the current line don't have validity mechanisms.
 java.awt.Rectangle getValidityRectangle()
          Returns null as this line don't implement validity mechanisms.
 boolean hasSuperLineChildren()
          Indicates if this line has at least one super line as a child.
 void initialize()
          Initializes this line component.
 boolean isMovable()
          Indicates if the element is movable.
 boolean isOpen()
          (non-Javadoc).
 boolean isSelected()
          (non-Javadoc).
 boolean isSuperLine()
          Indicates if this line is a super line (for example, a line that contains sub-lines).
 void removeComponent(LyComponent component)
          (non-Javadoc).
 void resetDates()
          Resets the dates of the line and updates the Gantt component.
 void resetDependencies()
          Resets the dependencies for the entire Gantt component.
 void setColor(java.lang.String color)
          The specified color is already set for this line when this method is called and is only used here to refresh the Swing tree component.
 void setContent()
          Fills the line.
 void setFont(java.lang.String font)
          The specified font is already set for this line when this method is called and is only used here to refresh the Swing tree component.
 void setForegroundColor(java.lang.String color)
          The specified color is already set for this line when this method is called and is only used here to refresh the Swing tree component.
 void setHeightFactor(int factor)
          Sets the height factor for this node.
 void setHidden(boolean hidden)
          (non-Javadoc).
 void setImage(java.lang.String image)
          (non-Javadoc).
 void setLabel(java.lang.String label)
          (non-Javadoc).
 void setMovable(boolean movable)
          Sets the movable state of the Gantt element.
 void setOpen(boolean status)
          (non-Javadoc).
 void setSelected(boolean status)
          (non-Javadoc).
 void setSuperLineColor(java.lang.String color)
          (non-Javadoc).
 void setSuperLineHidden(boolean hidden)
          (non-Javadoc).
 void setSuperLineLabel(java.lang.String label)
          (non-Javadoc).
 void setTooltip(java.lang.String tooltip)
          (non-Javadoc).
 void setTree(LyJTreeComponent tree)
          Sets the treeComponent that display this node.
 void setValidityRectangle(java.awt.Rectangle rect)
          Don't do anything.
 void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
          Refreshes the tree component when it is collapsed, no matter what event is triggered.
 void treeExpanded(javax.swing.event.TreeExpansionEvent event)
          Refreshes the tree component when it is expanded, no matter what event is triggered.
 
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.win.swing.component.LyJTreeElement
getEnvironment
 
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

LySwingLine

public LySwingLine(LyLine line)
Class constructor of a Line object for the Swing target.

Parameters:
line - a LINE component defined for every type of view targets. This line is initialized with the default values.
Method Detail

initialize

public void initialize()
Initializes this line component.


setContent

public void setContent()
Fills the line. Adds the lines to the _ganttElements list if they are intervals or creates the super lines if not. Then update the Gantt tree elements swing component with the new content that just have been set.

See Also:
getContent()

setMovable

public void setMovable(boolean movable)
Sets the movable state of the Gantt element.

Parameters:
movable - true if movable, false otherwise

isSuperLine

public boolean isSuperLine()
Indicates if this line is a super line (for example, a line that contains sub-lines).

Returns:
true if this line is a super line, false otherwise

hasSuperLineChildren

public boolean hasSuperLineChildren()
Indicates if this line has at least one super line as a child.

Returns:
true if this line has at least one super line as a child, false otherwise

resetDates

public void resetDates()
Resets the dates of the line and updates the Gantt component.


resetDependencies

public void resetDependencies()
Resets the dependencies for the entire Gantt component.


getLimitDate

public java.util.Date getLimitDate(boolean max)
Returns the limit date for this line (minimum or maximum). Browses all the sub-components of the line and retrieves their minimum (or maximum) dates.

Parameters:
max - Indicates if maximum or minimum date must be returned. If end date is null, begin date is considered instead.
Returns:
the minimum date if max is true, the maximum date otherwise

getComponent

public java.awt.Component getComponent()
(non-Javadoc).

Specified by:
getComponent in interface LySwingComponent
Overrides:
getComponent in class LySwingObject
Returns:
this Swing view component
See Also:
LySwingComponent.getComponent()

getGanttElements

public java.util.Vector<LyGanttElement> getGanttElements()
Accessor to the gantt element list.

Returns:
the gantt element

isMovable

public boolean isMovable()
Indicates if the element is movable.

Returns:
true if the element is movable, false otherwise

setLabel

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

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

setTooltip

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

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

setSelected

public void setSelected(boolean status)
(non-Javadoc).

Specified by:
setSelected in interface LyGraphicalLine
Specified by:
setSelected in interface LySetSelectedInterface
Parameters:
status - Boolean indicating if attribute selected is set or unset.
See Also:
LySetSelectedInterface.setSelected(boolean)

setOpen

public void setOpen(boolean status)
(non-Javadoc).

Specified by:
setOpen in interface LyGraphicalLine
Parameters:
status - Boolean indicating if attribute open is set or unset.
See Also:
LyGraphicalLine.setOpen(boolean)

treeExpanded

public void treeExpanded(javax.swing.event.TreeExpansionEvent event)
Refreshes the tree component when it is expanded, no matter what event is triggered.

Specified by:
treeExpanded in interface LyJTreeElement
Parameters:
event - Not used in this implementation.
See Also:
LyJTreeElement.treeExpanded(javax.swing.event.TreeExpansionEvent)

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
Refreshes the tree component when it is collapsed, no matter what event is triggered.

Specified by:
treeCollapsed in interface LyJTreeElement
Parameters:
event - Not used in this implementation.
See Also:
LyJTreeElement.treeCollapsed(javax.swing.event.TreeExpansionEvent)

getId

public java.lang.String getId()
(non-Javadoc).

Specified by:
getId in interface LyGetIdInterface
Specified by:
getId in interface LyJTreeElement
Returns:
the id of this tree node
See Also:
LyGetIdInterface.getId()

getLabel

public java.lang.String getLabel()
(non-Javadoc).

Specified by:
getLabel in interface LyJTreeElement
Returns:
the label of this tree node
See Also:
LyJTreeElement.getLabel()

isSelected

public boolean isSelected()
(non-Javadoc).

Specified by:
isSelected in interface LyJTreeElement
Returns:
true if this tree node is selected, false otherwise
See Also:
LyJTreeElement.isSelected()

isOpen

public boolean isOpen()
(non-Javadoc).

Specified by:
isOpen in interface LyJTreeElement
Returns:
true if this tree node is opened, false otherwise
See Also:
LyJTreeElement.isOpen()

getTreePath

public javax.swing.tree.TreePath getTreePath()
Returns a TreePath for this node.

Specified by:
getTreePath in interface LyJTreeElement
Returns:
this node's tree path
See Also:
LyJTreeElement.getTreePath()

getMutableTreeNode

public javax.swing.tree.DefaultMutableTreeNode getMutableTreeNode()
Accessor to the internal mutable tree node.

Specified by:
getMutableTreeNode in interface LyJTreeElement
Returns:
the mutable tree node of this tree element
See Also:
LyJTreeElement.getMutableTreeNode()

getContent

public LyJTreeElementImpl._LyNodeContent getContent()
Gets the content of this node.

Specified by:
getContent in interface LyJTreeElement
Returns:
the content of the node
See Also:
LyJTreeElement.getContent(), setContent()

setTree

public void setTree(LyJTreeComponent tree)
Sets the treeComponent that display this node.

Specified by:
setTree in interface LyJTreeElement
Parameters:
tree - the new tree component
See Also:
getTree(), LyJTreeElement.setTree(leon.view.win.swing.component.LyJTreeComponent)

getTree

public LyJTreeComponent getTree()
Gets the tree component that display this node.

Specified by:
getTree in interface LyJTreeElement
Returns:
the current tree component
See Also:
setTree(LyJTreeComponent), LyJTreeElement.getTree()

setImage

public void setImage(java.lang.String image)
(non-Javadoc).

Specified by:
setImage in interface LyGraphicalLine
Specified by:
setImage in interface LySetImageInterface
Parameters:
image - New value of image.
See Also:
LySetImageInterface.setImage(java.lang.String)

setColor

public void setColor(java.lang.String color)
The specified color is already set for this line when this method is called and is only used here to refresh the Swing tree component.

Specified by:
setColor in interface LyGraphicalLine
Specified by:
setColor in interface LySetColorInterface
Parameters:
color - Not used in this implementation.
See Also:
getColor(), LySetColorInterface.setColor(java.lang.String)

getColor

public java.awt.Color getColor()
Returns the color of this line.

Specified by:
getColor in interface LyJTreeElement
Returns:
the color of this line, or null if _line is null
See Also:
setColor(String), LyJTreeElement.getColor()

getSelectedColor

public java.awt.Color getSelectedColor()
Returns the color of this line when selected.

Specified by:
getSelectedColor in interface LyJTreeElement
Returns:
the color of this line when selected, or null if _line is null
See Also:
getColor(), LyJTreeElement.getSelectedColor()

getFontColor

public java.awt.Color getFontColor()
Returns the font color of this line.

Specified by:
getFontColor in interface LyJTreeElement
Returns:
the font color of this line, or null if _line is null
See Also:
#setFontColor(String), LyJTreeElement.getFontColor()

getSelectedFontColor

public java.awt.Color getSelectedFontColor()
Returns the font color of this line when selected.

Specified by:
getSelectedFontColor in interface LyJTreeElement
Returns:
the font color of this line when selected, or null if _line is null
See Also:
getFontColor(), LyJTreeElement.getSelectedFontColor()

getFont

public java.awt.Font getFont()
Returns the font for this line.

Specified by:
getFont in interface LyJTreeElement
Returns:
the font for this line, or null if _line is null
See Also:
setFont(String), LyJTreeElement.getFont()

setFont

public void setFont(java.lang.String font)
The specified font is already set for this line when this method is called and is only used here to refresh the Swing tree component.

Specified by:
setFont in interface LyGraphicalLine
Specified by:
setFont in interface LySetFontInterface
Parameters:
font - Not used in this implementation.
See Also:
getFont(), LySetFontInterface.setFont(java.lang.String)

setForegroundColor

public void setForegroundColor(java.lang.String color)
The specified color is already set for this line when this method is called and is only used here to refresh the Swing tree component.

Parameters:
color - Not used in this implementation.
See Also:
#getForegroundColor(), leon.view.graphic.LyGraphicalLine#setForegroundColor(java.lang.String)

setSuperLineColor

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

Specified by:
setSuperLineColor in interface LyGraphicalLine
Parameters:
color - New value of superLineColor.
See Also:
LyGraphicalLine.setSuperLineColor(java.lang.String)

setSuperLineLabel

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

Specified by:
setSuperLineLabel in interface LyGraphicalLine
Parameters:
label - New value of superLineLabel.
See Also:
LyGraphicalLine.setSuperLineLabel(java.lang.String)

setSuperLineHidden

public void setSuperLineHidden(boolean hidden)
(non-Javadoc).

Specified by:
setSuperLineHidden in interface LyGraphicalLine
Parameters:
hidden - Boolean indicating if attribute superLineHidden is set or unset.
See Also:
LyGraphicalLine.setSuperLineHidden(boolean)

addComponent

public void addComponent(LyComponent component,
                         int pos)
(non-Javadoc).

Specified by:
addComponent in interface LyGraphicalLine
Parameters:
component - The components to add to components list.
pos - Position where the sub-component is inserted.
See Also:
LyGraphicalLine.addComponent(leon.view.LyComponent, int)

removeComponent

public void removeComponent(LyComponent component)
(non-Javadoc).

Specified by:
removeComponent in interface LyGraphicalLine
Parameters:
component - The components to remove to components list.
See Also:
LyGraphicalLine.removeComponent(leon.view.LyComponent)

setHidden

public void setHidden(boolean hidden)
(non-Javadoc).

Specified by:
setHidden in interface LyGraphicalLine
Specified by:
setHidden in interface LySetHiddenInterface
Parameters:
hidden - Boolean indicating if attribute hidden is set or unset.
See Also:
LySetHiddenInterface.setHidden(boolean)

setHeightFactor

public void setHeightFactor(int factor)
Sets the height factor for this node.

Parameters:
factor - the new height factor
See Also:
getHeightFactor()

getHeightFactor

public int getHeightFactor()
Returns the height factor for this node.

Specified by:
getHeightFactor in interface LyJTreeElement
Returns:
the current height factor
See Also:
setHeightFactor(int)

getSelectedCheckboxImage

public java.awt.Image getSelectedCheckboxImage()
Returns null as the current line don't have a selected checkbox image.

Specified by:
getSelectedCheckboxImage in interface LyJTreeElement
Returns:
null
See Also:
LyJTreeElement.getSelectedCheckboxImage()

getEmptyCheckboxImage

public java.awt.Image getEmptyCheckboxImage()
Returns null as the current line don't have an empty checkbox image.

Specified by:
getEmptyCheckboxImage in interface LyJTreeElement
Returns:
null
See Also:
LyJTreeElement.getEmptyCheckboxImage()

getAdditionalImages

public java.util.Vector<java.awt.Image> getAdditionalImages()
Returns null as the current line don't have an additional images.

Specified by:
getAdditionalImages in interface LyJTreeElement
Returns:
null
See Also:
LyJTreeElement.getAdditionalImages()

getValidityImageIndex

public int getValidityImageIndex()
Returns -1 as the current line don't have validity mechanisms.

Specified by:
getValidityImageIndex in interface LyJTreeElement
Returns:
-1
See Also:
LyJTreeElement.getValidityImageIndex()

setValidityRectangle

public void setValidityRectangle(java.awt.Rectangle rect)
Don't do anything. This current line don't have validity mechanisms.

Specified by:
setValidityRectangle in interface LyJTreeElement
Parameters:
rect - Not used in this implementation.
See Also:
getValidityRectangle(), LyJTreeElement.setValidityRectangle(java.awt.Rectangle)

getValidityRectangle

public java.awt.Rectangle getValidityRectangle()
Returns null as this line don't implement validity mechanisms.

Specified by:
getValidityRectangle in interface LyJTreeElement
Returns:
null
See Also:
setValidityRectangle(Rectangle), LyJTreeElement.getValidityRectangle()

changeValidity

public void changeValidity()
Don't do anything. This current line don't implement validity mechanisms.

Specified by:
changeValidity in interface LyJTreeElement
See Also:
LyJTreeElement.changeValidity()

(c) January 2013 - W4 S.A.

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