LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJTreeElementImpl

java.lang.Object
  extended by leon.view.win.swing.component.LyJTreeElementImpl
All Implemented Interfaces:
LyJTreeElement
Direct Known Subclasses:
LyJTreeElementEntryImpl

public class LyJTreeElementImpl
extends java.lang.Object
implements LyJTreeElement

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

See Also:
LyTreeNode

Nested Class Summary
static class LyJTreeElementImpl._LyMutableTreeNode
          Defines a mutable tree node for this tree element.
static class LyJTreeElementImpl._LyNodeContent
          This class implements the informations that are useful to correctly display a node.
 
Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyJTreeElementImpl(LyTreeNode node)
          Creates a tree element from the specified tree node.
 
Method Summary
 void addAdditionalImage(java.awt.Image image)
          Adds the specified image to the list of additional images.
 void backupChildrenValidity(LyTreeNode treeNode)
          Backups the children validity status of the specified node.
 void changeValidity()
          (non-Javadoc).
 void clearValidityBackupInfos()
          Clears subtree validity backup infos.
 void computeTreeNodeValidity(LyComponent node)
          Computes the subtree validity.
 java.util.Vector<java.awt.Image> getAdditionalImages()
          (non-Javadoc).
 java.awt.Color getColor()
          (non-Javadoc).
 LyJTreeElementImpl._LyNodeContent getContent()
          (non-Javadoc).
 java.awt.Image getEmptyCheckboxImage()
          (non-Javadoc).
 LyEnvironment getEnvironment()
          (non-Javadoc).
 java.awt.Font getFont()
          (non-Javadoc).
 java.awt.Color getFontColor()
          (non-Javadoc).
 int getHeightFactor()
          (non-Javadoc).
 java.lang.String getId()
          (non-Javadoc).
 java.lang.String getLabel()
          (non-Javadoc).
 javax.swing.tree.DefaultMutableTreeNode getMutableTreeNode()
          (non-Javadoc).
 LyTreeNode getRootTreeNode(LyTreeNode treeNode)
          Gets the top level tree node of the specified tree element.
 java.awt.Image getSelectedCheckboxImage()
          (non-Javadoc).
 java.awt.Color getSelectedColor()
          (non-Javadoc).
 java.awt.Color getSelectedFontColor()
          (non-Javadoc).
 LyJTreeComponent getTree()
          (non-Javadoc).
 javax.swing.tree.TreePath getTreePath()
          (non-Javadoc).
 int getValidityImageIndex()
          (non-Javadoc).
 java.awt.Rectangle getValidityRectangle()
          (non-Javadoc).
 boolean isOpen()
          (non-Javadoc).
 boolean isSelected()
          (non-Javadoc).
 void removeAdditionalImage(java.awt.Image image)
          Removes the specified image from the additional images list.
 void setEmptyCheckboxImage(java.awt.Image image)
          Sets the empty checkbox image.
 void setExpandable(boolean expandable)
          Sets the expandable state of the tree element.
 void setHeightFactor(int factor)
          Set the height factor.
 void setMutableTreeNode(LyJTreeElementImpl._LyMutableTreeNode mutableTreeNode)
          Sets the mutable tree node of this tree element.
 void setSelectedCheckboxImage(java.awt.Image image)
          Sets the selected checkbox image.
 void setTree(LyJTreeComponent tree)
          (non-Javadoc).
 void setValidityImage(java.awt.Image image)
          Sets the validity image.
 void setValidityRectangle(java.awt.Rectangle rect)
          (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.
 void updateValidityFromView()
          Updates the validity from the view component.
 
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
Constructor Detail

LyJTreeElementImpl

public LyJTreeElementImpl(LyTreeNode node)
Creates a tree element from the specified tree node.

Parameters:
node - the data source
Method Detail

getMutableTreeNode

public javax.swing.tree.DefaultMutableTreeNode getMutableTreeNode()
(non-Javadoc).

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

getContent

public LyJTreeElementImpl._LyNodeContent getContent()
(non-Javadoc).

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

setHeightFactor

public void setHeightFactor(int factor)
Set the height factor.

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

getHeightFactor

public int getHeightFactor()
(non-Javadoc).

Specified by:
getHeightFactor in interface LyJTreeElement
Returns:
the height factor
See Also:
LyJTreeElement.getHeightFactor()

setEmptyCheckboxImage

public void setEmptyCheckboxImage(java.awt.Image image)
Sets the empty checkbox image.

Parameters:
image - the new empty checkbox image
See Also:
getEmptyCheckboxImage()

setSelectedCheckboxImage

public void setSelectedCheckboxImage(java.awt.Image image)
Sets the selected checkbox image.

Parameters:
image - the new selected checkbox image
See Also:
getSelectedCheckboxImage()

getSelectedCheckboxImage

public java.awt.Image getSelectedCheckboxImage()
(non-Javadoc).

Specified by:
getSelectedCheckboxImage in interface LyJTreeElement
Returns:
the selected checkbox image
See Also:
LyJTreeElement.getSelectedCheckboxImage()

getEmptyCheckboxImage

public java.awt.Image getEmptyCheckboxImage()
(non-Javadoc).

Specified by:
getEmptyCheckboxImage in interface LyJTreeElement
Returns:
the empty checkbox image
See Also:
LyJTreeElement.getEmptyCheckboxImage()

addAdditionalImage

public void addAdditionalImage(java.awt.Image image)
Adds the specified image to the list of additional images.

Parameters:
image - the new image to add
See Also:
removeAdditionalImage(Image)

removeAdditionalImage

public void removeAdditionalImage(java.awt.Image image)
Removes the specified image from the additional images list.

Parameters:
image - the image to remove
See Also:
addAdditionalImage(Image)

getAdditionalImages

public java.util.Vector<java.awt.Image> getAdditionalImages()
(non-Javadoc).

Specified by:
getAdditionalImages in interface LyJTreeElement
Returns:
the list of the additional images
See Also:
LyJTreeElement.getAdditionalImages()

setValidityImage

public void setValidityImage(java.awt.Image image)
Sets the validity image.

Parameters:
image - the new validity image

getValidityImageIndex

public int getValidityImageIndex()
(non-Javadoc).

Specified by:
getValidityImageIndex in interface LyJTreeElement
Returns:
the index of the validity image, or -1 if there is none
See Also:
LyJTreeElement.getValidityImageIndex()

setValidityRectangle

public void setValidityRectangle(java.awt.Rectangle rect)
(non-Javadoc).

Specified by:
setValidityRectangle in interface LyJTreeElement
Parameters:
rect - the rectangle where this tree node is valid
See Also:
LyJTreeElement.setValidityRectangle(java.awt.Rectangle)

getValidityRectangle

public java.awt.Rectangle getValidityRectangle()
(non-Javadoc).

Specified by:
getValidityRectangle in interface LyJTreeElement
Returns:
the rectangle where this tree node is valid
See Also:
LyJTreeElement.getValidityRectangle()

updateValidityFromView

public void updateValidityFromView()
Updates the validity from the view component.


changeValidity

public void changeValidity()
(non-Javadoc).

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

setExpandable

public void setExpandable(boolean expandable)
Sets the expandable state of the tree element.


getColor

public java.awt.Color getColor()
(non-Javadoc).

Specified by:
getColor in interface LyJTreeElement
Returns:
the background color
See Also:
LyJTreeElement.getColor()

getSelectedColor

public java.awt.Color getSelectedColor()
(non-Javadoc).

Specified by:
getSelectedColor in interface LyJTreeElement
Returns:
the background color when selected
See Also:
LyJTreeElement.getSelectedColor()

getFontColor

public java.awt.Color getFontColor()
(non-Javadoc).

Specified by:
getFontColor in interface LyJTreeElement
Returns:
the foreground color
See Also:
LyJTreeElement.getFontColor()

getSelectedFontColor

public java.awt.Color getSelectedFontColor()
(non-Javadoc).

Specified by:
getSelectedFontColor in interface LyJTreeElement
Returns:
the font color when selected
See Also:
LyJTreeElement.getSelectedFontColor()

getFont

public java.awt.Font getFont()
(non-Javadoc).

Specified by:
getFont in interface LyJTreeElement
Returns:
the font
See Also:
LyJTreeElement.getFont()

getRootTreeNode

public LyTreeNode getRootTreeNode(LyTreeNode treeNode)
Gets the top level tree node of the specified tree element.

Parameters:
treeNode - the tree element to find its root tree node
Returns:
the top level root tree node

backupChildrenValidity

public void backupChildrenValidity(LyTreeNode treeNode)
Backups the children validity status of the specified node.

Parameters:
treeNode - the node to backup

clearValidityBackupInfos

public void clearValidityBackupInfos()
Clears subtree validity backup infos.


computeTreeNodeValidity

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

Parameters:
node - the current node which may be a LySwingTreeNode or a LySwingEntry (dictionnary).

getEnvironment

public LyEnvironment getEnvironment()
(non-Javadoc).

Specified by:
getEnvironment in interface LyJTreeElement
Returns:
the tree node environment
See Also:
LyJTreeElement.getEnvironment()

getId

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

Specified by:
getId in interface LyJTreeElement
Returns:
the id of this tree node
See Also:
LyJTreeElement.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()

getTreePath

public javax.swing.tree.TreePath getTreePath()
(non-Javadoc).

Specified by:
getTreePath in interface LyJTreeElement
Returns:
the tree path of this tree element
See Also:
LyJTreeElement.getTreePath()

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()

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()

setTree

public void setTree(LyJTreeComponent tree)
(non-Javadoc).

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

getTree

public LyJTreeComponent getTree()
(non-Javadoc).

Specified by:
getTree in interface LyJTreeElement
Returns:
this tree component
See Also:
LyJTreeElement.getTree()

setMutableTreeNode

public void setMutableTreeNode(LyJTreeElementImpl._LyMutableTreeNode mutableTreeNode)
Sets the mutable tree node of this tree element.

Parameters:
mutableTreeNode - the new mutable tree node
See Also:
getMutableTreeNode()

treeExpanded

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

Specified by:
treeExpanded in interface LyJTreeElement
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 LyJTreeElement
Parameters:
event - the TreeExpansionEvent, not used in this implementation
See Also:
TreeExpansionListener.treeCollapsed(javax.swing.event.TreeExpansionEvent)

(c) January 2013 - W4 S.A.

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