LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingTreeNode

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingTreeNode
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.TreeExpansionListener, LyGraphicalComponent, LyGraphicalTreeNode, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetFontInterface, LySetHiddenInterface, LySetImageInterface, LySetLabelInterface, LySetSelectedInterface, LySetValidityInterface, LySwingComponent

public class LySwingTreeNode
extends LySwingObject
implements LySetLabelInterface, LySetSelectedInterface, LySetImageInterface, LyGraphicalTreeNode, javax.swing.event.TreeExpansionListener

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

A tree node can contain a set of nodes (this node is then called parent node of these last ones). It is possible to assign a label and several images to a tree node, and to indicate if it is selected, valid or open. It is also possible to indicate the font and the different colors of the node.

See Also:
LyTreeNode

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingTreeNode(LyTreeNode node)
          Class constructor of a Tree node object for the Swing target.
 
Method Summary
 void addImage(LyImage image, int pos)
          (non-Javadoc).
 void addTreeNode(LyTreeNode treeNode, int pos)
          Adds the specified node at the specified index.
 void computeTreeNodeValidity(LyComponent node)
          Computes the subtree validity.
 LyJTreeElementImpl._LyNodeContent getContent()
          Gets the content of this tree node tree element.
 int getHeightFactor()
          Returns the height factor.
 java.lang.String getId()
          Gets the identifier of this tree node.
 java.lang.String getLabel()
          Gets this tree node label.
 javax.swing.tree.DefaultMutableTreeNode getMutableTreeNode()
          Accessor to the internal mutable tree node.
 LyTreeNode getRootTreeNode(LyTreeNode treeNode)
          Accesses to the top level tree node.
 LyJTreeElement getTreeElement()
          Gets the tree element of this tree node.
 LyTreeNode getTreeNode()
          Gets this tree node description.
 javax.swing.tree.TreePath getTreePath()
          Returns a TreePath for this node.
 void initialize()
          Initializes the content of this node.
 boolean isOpen()
          Indicates if this tree node is opened or not.
 boolean isSelected()
          Indicates if this tree node is selected or not.
 void removeImage(LyImage image)
          (non-Javadoc).
 void removeTreeNode(LyTreeNode treeNode)
          Removes the specified node.
 void setColor(java.lang.String color)
          Nothing is done in this method.
 void setContent()
          Builds the links to children nodes.
 void setExpandable(boolean expandable)
          Sets the expandable attribute.
 void setFont(java.lang.String font)
          Nothing is done in this method.
 void setForegroundColor(java.lang.String color)
          Nothing is done in this method.
 void setHeightFactor(int factor)
          Sets the height factor of this current node.
 void setHidden(boolean hidden)
          (non-Javadoc).
 void setImage(java.lang.String key)
          (non-Javadoc).
 void setLabel(java.lang.String label)
          Sets the label of the title bar.
 void setOpen(boolean status)
          (non-Javadoc).
 void setSelected(boolean status)
          (non-Javadoc).
 void setTooltip(java.lang.String tooltip)
          Updates attribute tooltip to the given value.
 void setTree(LyJTreeComponent tree)
          Sets the treeComponent that display this node.
 void setValidity(LyTreeNode.Validity validity)
          (non-Javadoc).
 void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
          Nothing is done when the tree is collapsed.
 void treeExpanded(javax.swing.event.TreeExpansionEvent event)
          Nothing is done when the tree is expanded.
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getComponent, 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

LySwingTreeNode

public LySwingTreeNode(LyTreeNode node)
Class constructor of a Tree node object for the Swing target.

Parameters:
node - a TREE_NODE component defined for every type of view targets. This tree node is initialized for the swing view and filled with its default values.
Method Detail

initialize

public void initialize()
Initializes the content of this node.


setContent

public void setContent()
Builds the links to children nodes.

See Also:
getContent()

getTreeElement

public LyJTreeElement getTreeElement()
Gets the tree element of this tree node.

Returns:
the tree element

addTreeNode

public void addTreeNode(LyTreeNode treeNode,
                        int pos)
Adds the specified node at the specified index.

Specified by:
addTreeNode in interface LyGraphicalTreeNode
Parameters:
treeNode - the node to add
pos - the position of the insertion
See Also:
LyGraphicalTreeNode.addTreeNode(LyTreeNode, int)

removeTreeNode

public void removeTreeNode(LyTreeNode treeNode)
Removes the specified node.

Specified by:
removeTreeNode in interface LyGraphicalTreeNode
Parameters:
treeNode - the node to remove
See Also:
LyGraphicalTreeNode.removeTreeNode(LyTreeNode)

setTree

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

Parameters:
tree - the value of the tree component

setLabel

public void setLabel(java.lang.String label)
Sets the label of the title bar.

Specified by:
setLabel in interface LyGraphicalTreeNode
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - new label
See Also:
getLabel(), LySetLabelInterface.setLabel(String)

setSelected

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

Specified by:
setSelected in interface LyGraphicalTreeNode
Specified by:
setSelected in interface LySetSelectedInterface
Parameters:
status - true to indactes that the component is selected, false otherwise
See Also:
LySetSelectedInterface.setSelected(boolean)

setOpen

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

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

setHidden

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

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

setImage

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

Specified by:
setImage in interface LyGraphicalTreeNode
Specified by:
setImage in interface LySetImageInterface
Parameters:
key - of the image in the properties or image path
See Also:
LySetImageInterface.setImage(java.lang.String)

setColor

public void setColor(java.lang.String color)
Nothing is done in this method. The color setting is not implemented yet.

Specified by:
setColor in interface LyGraphicalTreeNode
Specified by:
setColor in interface LySetColorInterface
Parameters:
color - value of background color, not used here

setFont

public void setFont(java.lang.String font)
Nothing is done in this method. The font setting is not implemented yet.

Specified by:
setFont in interface LyGraphicalTreeNode
Specified by:
setFont in interface LySetFontInterface
Parameters:
font - value of label font

setForegroundColor

public void setForegroundColor(java.lang.String color)
Nothing is done in this method. The foreground color setting is not implemented yet.

Parameters:
color - value of foreground color

getTreeNode

public LyTreeNode getTreeNode()
Gets this tree node description.

Returns:
the decription of the node

getTreePath

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

Returns:
the tree path for this node

getMutableTreeNode

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

Returns:
the mutable tree node of this tree element

getContent

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

Returns:
the content of the node
See Also:
setContent()

getId

public java.lang.String getId()
Gets the identifier of this tree node.

Returns:
the tree node Id

getLabel

public java.lang.String getLabel()
Gets this tree node label.

Returns:
the tree node label
See Also:
setLabel(String)

isSelected

public boolean isSelected()
Indicates if this tree node is selected or not.

Returns:
true if the tree node is selected, false if not

isOpen

public boolean isOpen()
Indicates if this tree node is opened or not.

Returns:
true if the tree node is opened, false if not

setHeightFactor

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

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

getHeightFactor

public int getHeightFactor()
Returns the height factor.

Returns:
the height factor of the node
See Also:
setHeightFactor(int)

addImage

public void addImage(LyImage image,
                     int pos)
(non-Javadoc).

Specified by:
addImage in interface LyGraphicalTreeNode
Parameters:
image - The images to add to images list.
pos - Position where the sub-component is inserted.
See Also:
LyGraphicalTreeNode.addImage(leon.view.LyImage, int)

removeImage

public void removeImage(LyImage image)
(non-Javadoc).

Specified by:
removeImage in interface LyGraphicalTreeNode
Parameters:
image - The images to remove to images list.
See Also:
LyGraphicalTreeNode.removeImage(leon.view.LyImage)

setValidity

public void setValidity(LyTreeNode.Validity validity)
(non-Javadoc).

Specified by:
setValidity in interface LyGraphicalTreeNode
Specified by:
setValidity in interface LySetValidityInterface
Parameters:
validity - New value of validity.
See Also:
leon.view.setinterface.LySetValidityInterface#setValidity(java.lang.String)

computeTreeNodeValidity

public void computeTreeNodeValidity(LyComponent node)
Computes the subtree validity.

Parameters:
node - the current node
See Also:
leon.view.swt.widgets.LyTreeElement#computeTreeNodeValidity(leon.view.LyComponent)

getRootTreeNode

public LyTreeNode getRootTreeNode(LyTreeNode treeNode)
Accesses to the top level tree node.

Parameters:
treeNode - the tree node
Returns:
the top level root tree node

treeExpanded

public void treeExpanded(javax.swing.event.TreeExpansionEvent event)
Nothing is done when the tree is expanded.

Specified by:
treeExpanded in interface javax.swing.event.TreeExpansionListener
Parameters:
event - the TreeExpansionEvent, not used in this implementation
See Also:
TreeExpansionListener.treeExpanded(javax.swing.event.TreeExpansionEvent)

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
Nothing is done when the tree is collapsed.

Specified by:
treeCollapsed in interface javax.swing.event.TreeExpansionListener
Parameters:
event - the TreeExpansionEvent, not used in this implementation
See Also:
TreeExpansionListener.treeCollapsed(javax.swing.event.TreeExpansionEvent)

setExpandable

public void setExpandable(boolean expandable)
Sets the expandable attribute. This method is not implemented yet.

Specified by:
setExpandable in interface LyGraphicalTreeNode
Parameters:
expandable - not used in this implementation yet
See Also:
LyGraphicalTreeNode.setExpandable(boolean)

setTooltip

public void setTooltip(java.lang.String tooltip)
Description copied from interface: LyGraphicalTreeNode
Updates attribute tooltip to the given value.

Specified by:
setTooltip in interface LyGraphicalTreeNode
Parameters:
tooltip - New value of tooltip.

(c) January 2013 - W4 S.A.

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