org.xulux.guilayer.swing.widgets
Class Tree

java.lang.Object
  extended by org.xulux.gui.XuluxWidget
      extended by org.xulux.gui.ContainerWidget
          extended by org.xulux.guilayer.swing.widgets.Tree
All Implemented Interfaces:
java.io.Serializable, org.xulux.api.gui.IContainerWidgetHandler, org.xulux.api.gui.IContentWidget, org.xulux.api.gui.IWidget

public class Tree
extends org.xulux.gui.ContainerWidget
implements org.xulux.api.gui.IContentWidget

Version:
$Id: Tree.java,v 1.1 2005/12/18 12:58:18 mvdb Exp $
Author:
Martin van den Bemt
See Also:
Serialized Form

Field Summary
protected  NyxTreeCellRenderer cellRenderer
          the cell renderer
protected  java.lang.Object content
          the content
protected  boolean contentChanged
          the content has changed
protected  SwingTreeModel contentHandler
          the contenthandler
protected  boolean hasChildPopups
          has childpopups
protected  ImmidiateTreeSelectionListener immidiateListener
          the immidiatelistener
protected  XuluxJTree jtree
          The native jtree
protected  MouseDoubleClickTreeListener mdcListener
           
protected  org.xulux.api.gui.IWidget menu
          the menu
protected  javax.swing.JScrollPane scrollPane
          the native scrollpane
protected  NewSelectionListener selectionListener
          the selectionlistener
 
Fields inherited from class org.xulux.gui.ContainerWidget
widgets
 
Fields inherited from class org.xulux.gui.XuluxWidget
initialized, initializing, isRefreshing, log, previousValue, properties, value, visible
 
Constructor Summary
Tree(java.lang.String name)
           
 
Method Summary
 void addToParent(org.xulux.api.gui.IWidget widget)
           
 boolean canContainValue()
           
 void contentChanged()
           
 void destroy()
           
protected  void expand(java.lang.Object root, boolean leaf)
           
protected  void expandDefault(java.lang.Object root)
          The default method to expand.
protected  void expandFrom(java.lang.Object root, java.lang.Class untill)
           
protected  void expandToLevel(java.lang.Object root)
          Does not do anything atm.
protected  void expandToLevel(java.lang.Object root, int level)
          Expands the tree to the specified level.
protected  void expandTree(java.lang.String untill)
          Expands the tree.
 void focus()
           
 java.lang.Object getContent()
           
 java.lang.Object getGuiValue()
           
 java.lang.Object getNativeWidget()
           
 SwingTreeModel getSwingModel()
           
 java.lang.Object getValue()
           
 void initialize()
          We need to set the model on initialization and replace the root node on refresh.
protected  void initializePopupMenu()
          Initializes the popupmenus of the tree.
 boolean isValueEmpty()
           
 void refresh()
           
 void setContent(java.lang.Object object)
           
 void setValue(java.lang.Object value)
          Set the currently selected value in the tree.
 
Methods inherited from class org.xulux.gui.ContainerWidget
addChildWidget, canBeRootWidget, canContainChildren, destroyChildren, getChildWidgets, getWidgetInitializer, initializeChildren
 
Methods inherited from class org.xulux.gui.XuluxWidget
addDependency, addPropertyHandler, addPropertyHandler, addXuluxListener, clear, equals, getDependencies, getField, getName, getParent, getPart, getPrefix, getPreviousValue, getProperties, getProperty, getPropertyHandler, getPropertyHandlers, getProvider, getRealProperty, getRealValue, getRectangle, getRules, getWidgetType, handleProperties, handleProperty, hasDependencies, ignoreLayout, ignoreUse, isEnabled, isImmidiate, isInitializing, isRefreshing, isRequired, isRootWidget, isSkip, isUseIgnored, isValidValue, isVisible, notifyListeners, processDestroy, processInit, processNativeWidget, registerRule, removeAllRules, setAutoRefresh, setContainerWidgetHandler, setEnabled, setField, setImmidiate, setLazyProperty, setName, setParent, setPart, setPosition, setPrefix, setProperty, setProvider, setRequired, setRootWidget, setSize, setSkip, setValidValue, setVisible, setWidgetInitializer, setWidgetType, toString, updateWidget
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jtree

protected XuluxJTree jtree
The native jtree


scrollPane

protected javax.swing.JScrollPane scrollPane
the native scrollpane


content

protected java.lang.Object content
the content


contentChanged

protected boolean contentChanged
the content has changed


contentHandler

protected SwingTreeModel contentHandler
the contenthandler


hasChildPopups

protected boolean hasChildPopups
has childpopups


menu

protected org.xulux.api.gui.IWidget menu
the menu


cellRenderer

protected NyxTreeCellRenderer cellRenderer
the cell renderer


selectionListener

protected NewSelectionListener selectionListener
the selectionlistener


immidiateListener

protected ImmidiateTreeSelectionListener immidiateListener
the immidiatelistener


mdcListener

protected MouseDoubleClickTreeListener mdcListener
Constructor Detail

Tree

public Tree(java.lang.String name)
Parameters:
name - the name of the tree
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface org.xulux.api.gui.IContainerWidgetHandler
Specified by:
destroy in interface org.xulux.api.gui.IWidget
Overrides:
destroy in class org.xulux.gui.ContainerWidget
See Also:
IWidget.destroy()

getNativeWidget

public java.lang.Object getNativeWidget()
Specified by:
getNativeWidget in interface org.xulux.api.gui.IWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#getNativeWidget()

initialize

public void initialize()
We need to set the model on initialization and replace the root node on refresh. A setmodel doesn't use the new model (???) Weird..

Specified by:
initialize in interface org.xulux.api.gui.IWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#initialize()

refresh

public void refresh()
Specified by:
refresh in interface org.xulux.api.gui.IWidget
Overrides:
refresh in class org.xulux.gui.XuluxWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#refresh()

expandToLevel

protected void expandToLevel(java.lang.Object root,
                             int level)
Expands the tree to the specified level. Level 0 is the root of the tree. If level is higher than the levels present, it will just collapse all.

Parameters:
root - the root level
level - the level

expandToLevel

protected void expandToLevel(java.lang.Object root)
Does not do anything atm.

Parameters:
root - the root object

expandTree

protected void expandTree(java.lang.String untill)
Expands the tree.

Parameters:
untill - - a string representation untill wath kind of object the tree should be expanded.

expand

protected void expand(java.lang.Object root,
                      boolean leaf)
Parameters:
root - the root object
leaf - true or false. If true it will NOT show the leaf, otherwise it will

expandFrom

protected void expandFrom(java.lang.Object root,
                          java.lang.Class untill)
Parameters:
root - - the root to expand from
untill - - the class to expand untill.

expandDefault

protected void expandDefault(java.lang.Object root)
The default method to expand.

Parameters:
root - the root object

getGuiValue

public java.lang.Object getGuiValue()
Specified by:
getGuiValue in interface org.xulux.api.gui.IWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#getGuiValue()

focus

public void focus()
Specified by:
focus in interface org.xulux.api.gui.IWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#focus()

isValueEmpty

public boolean isValueEmpty()
Specified by:
isValueEmpty in interface org.xulux.api.gui.IWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#isValueEmpty()

canContainValue

public boolean canContainValue()
Specified by:
canContainValue in interface org.xulux.api.gui.IWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#canContainValue()

setContent

public void setContent(java.lang.Object object)
Specified by:
setContent in interface org.xulux.api.gui.IContentWidget
See Also:
org.xulux.nyx.gui.IContentWidget#setContent(java.lang.Object)

getContent

public java.lang.Object getContent()
Specified by:
getContent in interface org.xulux.api.gui.IContentWidget
See Also:
org.xulux.nyx.gui.IContentWidget#getContent()

contentChanged

public void contentChanged()
Specified by:
contentChanged in interface org.xulux.api.gui.IContentWidget
See Also:
org.xulux.nyx.gui.IContentWidget#contentChanged()

addToParent

public void addToParent(org.xulux.api.gui.IWidget widget)
Specified by:
addToParent in interface org.xulux.api.gui.IContainerWidgetHandler
See Also:
org.xulux.nyx.gui.ContainerWidget#addToParent(org.xulux.nyx.gui.XuluxWidget)

initializePopupMenu

protected void initializePopupMenu()
Initializes the popupmenus of the tree.


getValue

public java.lang.Object getValue()
Specified by:
getValue in interface org.xulux.api.gui.IWidget
Overrides:
getValue in class org.xulux.gui.XuluxWidget
See Also:
org.xulux.nyx.gui.XuluxWidget#getValue()

setValue

public void setValue(java.lang.Object value)
Set the currently selected value in the tree.

Specified by:
setValue in interface org.xulux.api.gui.IWidget
Overrides:
setValue in class org.xulux.gui.XuluxWidget
See Also:
XuluxWidget.setValue(java.lang.Object)

getSwingModel

public SwingTreeModel getSwingModel()
Returns:
the tree model. It is a convenience method for internal use only.


Copyright © 2002-2007 Martin van den Bemt. All Rights Reserved.