|
NextApp Echo3 Extras v3.0.b4 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo.app.Component
nextapp.echo.extras.app.Tree
public class Tree
A control that displays a set of hierarchical data as an outline. Each row in the tree can have a number of columns, so this tree implementation is in fact a tree table.
| Fields inherited from class nextapp.echo.app.Component |
|---|
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY |
| Constructor Summary | |
|---|---|
Tree()
Constructs a new Tree with a default tree model. |
|
Tree(TreeModel model)
Constructs a new Tree with the specified model. |
|
Tree(TreeModel model,
TreeColumnModel columnModel)
Constructs a new Tree with the specified model. |
|
| Method Summary | |
|---|---|
void |
addActionListener(nextapp.echo.app.event.ActionListener l)
Adds an ActionListener to the Tree. |
void |
addTreeExpansionListener(TreeExpansionListener l)
Adds a TreeExpansionListener to the Tree. |
void |
collapse(TreePath path)
Collapse the node identified by the given path. |
void |
collapseAll()
Collapse all nodes in the tree. |
protected void |
collapseAll(TreePath path)
Collapse the node identified by the given path and all nodes below it. |
void |
createDefaultColumnsFromModel()
Creates a TableColumnModel based on the
TableModel. |
void |
dispose()
|
void |
expand(TreePath path)
Expand the node identified by the given path. |
void |
expandAll()
Expand all nodes in the tree. |
protected void |
expandAll(TreePath path)
Expand the node identified by the given path, and all nodes below it. |
protected void |
fireExpansionStateUpdate(TreePath treePath,
boolean newState)
Notifies all TreeExpansionListeners that the expansion
state has changed. |
java.lang.String |
getActionCommand()
Returns the action command which will be provided in ActionEvents fired by this
Tree. |
nextapp.echo.app.Border |
getBorder()
Returns the Border. |
TreeCellRenderer |
getCellRenderer()
Retrieves the TreeCellRenderer used to render values
contained in the tree. |
TreeColumnModel |
getColumnModel()
Returns the TreeColumnModel describing this tree's
columns. |
nextapp.echo.app.Component |
getComponent(int row,
int column)
Returns the component that is rendered at the given location. |
nextapp.echo.app.Component |
getComponent(TreePath path,
int column)
Returns the component that is rendered for the tree column of the given path. |
TreeCellRenderer |
getDefaultHeaderRenderer()
Returns the default TreeCellRenderer used to render
header cells. |
TreeCellRenderer |
getDefaultRenderer(java.lang.Class columnClass)
Returns the default TreeCellRenderer for the specified
column class. |
nextapp.echo.app.Insets |
getInsets()
Returns the default cell insets. |
int |
getLineStyle()
Retrieves the line style that is used to render the lines that connect the nodes. |
TreeModel |
getModel()
Returns the TreeModel being visualized by this
Tree. |
nextapp.echo.app.ImageReference |
getNodeClosedBottomIcon()
Retrieves the icon that is rendered for closed bottom nodes. |
nextapp.echo.app.ImageReference |
getNodeClosedIcon()
Retrieves the icon that is rendered for closed nodes. |
nextapp.echo.app.ImageReference |
getNodeOpenBottomIcon()
Retrieves the icon that is rendered for opened bottom nodes. |
nextapp.echo.app.ImageReference |
getNodeOpenIcon()
Retrieves the icon that is rendered for opened nodes. |
TreePath |
getPathForRow(int row)
|
nextapp.echo.app.Color |
getRolloverBackground()
Return the rollover background color displayed when the mouse is within the bounds of a row. |
nextapp.echo.app.FillImage |
getRolloverBackgroundImage()
Return the rollover background image displayed when the mouse is within the bounds of a row. |
nextapp.echo.app.Border |
getRolloverBorder()
Return the rollover border displayed when the mouse is within the bounds of a row. |
nextapp.echo.app.Font |
getRolloverFont()
Return the rollover font displayed when the mouse is within the bounds of a row. |
nextapp.echo.app.Color |
getRolloverForeground()
Return the rollover foreground color displayed when the mouse is within the bounds of a row. |
int |
getRowForPath(TreePath path)
Returns the index of the row the path is currently rendered to. |
nextapp.echo.app.Color |
getSelectionBackground()
Returns the row selection background color. |
nextapp.echo.app.FillImage |
getSelectionBackgroundImage()
Returns the row selection background image. |
nextapp.echo.app.Border |
getSelectionBorder()
Returns the row selection border. |
nextapp.echo.app.Font |
getSelectionFont()
Returns the row selection font. |
nextapp.echo.app.Color |
getSelectionForeground()
Returns the row selection foreground color. |
TreeSelectionModel |
getSelectionModel()
Returns the row selection model. |
nextapp.echo.app.Extent |
getWidth()
Returns the overall width of the tree. |
void |
init()
|
boolean |
isAutoCreateColumnsFromModel()
Determines whether the TableColumnModel will be created
automatically from the TreeModel. |
boolean |
isExpanded(int row)
|
boolean |
isExpanded(TreePath treePath)
|
boolean |
isHeaderVisible()
Determines if the tree header is visible. |
boolean |
isRolloverEnabled()
Determines if rollover effects are enabled. |
boolean |
isRootVisible()
Returns true if the root node of the tree is displayed. |
boolean |
isSelectionEnabled()
Determines if selection is enabled. |
boolean |
isShowsRootHandle()
Determines whether the handle of the root node should be shown. |
void |
processInput(java.lang.String inputName,
java.lang.Object inputValue)
|
void |
removeActionListener(nextapp.echo.app.event.ActionListener l)
Removes an ActionListener from the Tree. |
void |
removeTreeExpansionListener(TreeExpansionListener l)
Removes a TreeExpansionListener from the Tree. |
void |
setActionCommand(java.lang.String newValue)
Sets the action command which will be provided in ActionEvents fired by this
Tree. |
void |
setAutoCreateColumnsFromModel(boolean newValue)
Sets whether the TableColumnModel will be created
automatically from the TableModel. |
void |
setBorder(nextapp.echo.app.Border newValue)
Sets the Border. |
void |
setCellRenderer(TreeCellRenderer newValue)
Sets the TreeCellRenderer used to render values contained
in the tree. |
void |
setColumnModel(TreeColumnModel newValue)
Sets the TreeColumnModel describing this tree's
columns. |
void |
setDefaultHeaderRenderer(TreeCellRenderer newValue)
Sets the default TreeCellRenderer used to render
header cells. |
void |
setDefaultRenderer(java.lang.Class columnClass,
TreeCellRenderer newValue)
Sets the default TreeCellRenderer for the specified
column class. |
void |
setExpandedState(TreePath treePath,
boolean state)
Set the expansion state for the given tree path. |
void |
setHeaderVisible(boolean newValue)
Sets the visibility state of the tree header. |
void |
setInsets(nextapp.echo.app.Insets newValue)
Sets the default cell insets. |
void |
setLineStyle(int newValue)
Sets the line style that is used to render the lines that connect the nodes. |
void |
setModel(TreeModel newValue)
Sets the TreeModel being visualized. |
void |
setNodeClosedBottomIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for closed bottom nodes. |
void |
setNodeClosedIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for closed nodes. |
void |
setNodeOpenBottomIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for opened bottom nodes. |
void |
setNodeOpenIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for opened nodes. |
void |
setRolloverBackground(nextapp.echo.app.Color newValue)
Sets the rollover background color displayed when the mouse is within the bounds of a row. |
void |
setRolloverBackgroundImage(nextapp.echo.app.FillImage newValue)
Sets the rollover background image displayed when the mouse is within the bounds of a row. |
void |
setRolloverBorder(nextapp.echo.app.Border newValue)
Sets the rollover border displayed when the mouse is within the bounds of a row. |
void |
setRolloverEnabled(boolean newValue)
Sets whether rollover effects are enabled when the mouse cursor is within the bounds of a row. |
void |
setRolloverFont(nextapp.echo.app.Font newValue)
Sets the rollover font displayed when the mouse is within the bounds of a row. |
void |
setRolloverForeground(nextapp.echo.app.Color newValue)
Sets the rollover foreground color displayed when the mouse is within the bounds of a row. |
void |
setRootVisible(boolean newValue)
Determines whether or not the root node from the TreeModel
is visible. |
void |
setSelectionBackground(nextapp.echo.app.Color newValue)
Sets the row selection background color. |
void |
setSelectionBackgroundImage(nextapp.echo.app.FillImage newValue)
Sets the row selection background image. |
void |
setSelectionBorder(nextapp.echo.app.Border newValue)
Sets the row selection border. |
void |
setSelectionEnabled(boolean newValue)
Sets whether selection is enabled. |
void |
setSelectionFont(nextapp.echo.app.Font newValue)
Sets the row selection font. |
void |
setSelectionForeground(nextapp.echo.app.Color newValue)
Sets the row selection foreground color. |
void |
setSelectionModel(TreeSelectionModel newValue)
Sets the row selection model. |
void |
setShowsRootHandle(boolean newValue)
Determines whether the handle of the root node should be shown. |
void |
setWidth(nextapp.echo.app.Extent newValue)
Sets the overall width of the tree. |
void |
validate()
|
| Methods inherited from class nextapp.echo.app.Component |
|---|
add, add, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, verifyInput, visibleIndexOf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTY_ACTION_COMMAND
public static final java.lang.String PROPERTY_BORDER
public static final java.lang.String PROPERTY_HEADER_VISIBLE
public static final java.lang.String PROPERTY_INSETS
public static final java.lang.String PROPERTY_LINE_STYLE
public static final java.lang.String PROPERTY_NODE_CLOSED_ICON
public static final java.lang.String PROPERTY_NODE_CLOSED_BOTTOM_ICON
public static final java.lang.String PROPERTY_NODE_OPEN_ICON
public static final java.lang.String PROPERTY_NODE_OPEN_BOTTOM_ICON
public static final java.lang.String PROPERTY_ROLLOVER_BACKGROUND
public static final java.lang.String PROPERTY_ROLLOVER_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_ROLLOVER_BORDER
public static final java.lang.String PROPERTY_ROLLOVER_ENABLED
public static final java.lang.String PROPERTY_ROLLOVER_FONT
public static final java.lang.String PROPERTY_ROLLOVER_FOREGROUND
public static final java.lang.String PROPERTY_ROOT_VISIBLE
public static final java.lang.String PROPERTY_SELECTION_BACKGROUND
public static final java.lang.String PROPERTY_SELECTION_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_SELECTION_BORDER
public static final java.lang.String PROPERTY_SELECTION_ENABLED
public static final java.lang.String PROPERTY_SELECTION_FONT
public static final java.lang.String PROPERTY_SELECTION_FOREGROUND
public static final java.lang.String PROPERTY_SHOWS_ROOT_HANDLE
public static final java.lang.String PROPERTY_WIDTH
public static final java.lang.String EXPAND_ACTION
public static final java.lang.String INPUT_ACTION
public static final java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
public static final java.lang.String AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY
public static final java.lang.String CELL_RENDERER_CHANGED_PROPERTY
public static final java.lang.String COLUMN_MODEL_CHANGED_PROPERTY
public static final java.lang.String COLUMN_WIDTH_CHANGED_PROPERTY
public static final java.lang.String DEFAULT_HEADER_RENDERER_CHANGED_PROPERTY
public static final java.lang.String DEFAULT_RENDERER_CHANGED_PROPERTY
public static final java.lang.String EXPANSION_STATE_CHANGED_PROPERTY
public static final java.lang.String MODEL_CHANGED_PROPERTY
public static final java.lang.String SELECTION_CHANGED_PROPERTY
public static final java.lang.String SELECTION_MODEL_CHANGED_PROPERTY
public static final java.lang.String SELECTION_MODE_CHANGED_PROPERTY
public static final int LINE_STYLE_NONE
public static final int LINE_STYLE_SOLID
public static final int LINE_STYLE_DOTTED
public static final int HEADER_ROW
| Constructor Detail |
|---|
public Tree()
Tree with a default tree model.
public Tree(TreeModel model)
Tree with the specified model.
If the model has a root node, it will be expanded by default.
model - the model
public Tree(TreeModel model,
TreeColumnModel columnModel)
Tree with the specified model.
If the model has a root node, it will be expanded by default.
model - the model| Method Detail |
|---|
public void addActionListener(nextapp.echo.app.event.ActionListener l)
ActionListener to the Tree.
ActionListeners will be invoked when the user
selects a row.
l - the ActionListener to addpublic void collapse(TreePath path)
path - the path to collapsepublic void collapseAll()
protected void collapseAll(TreePath path)
path - the path to collapsepublic void createDefaultColumnsFromModel()
TableColumnModel based on the
TableModel. This method is invoked automatically when the
TableModel's structure changes if the
autoCreateColumnsFromModel flag is set.
public void expand(TreePath path)
path - the path to expandpublic void expandAll()
protected void expandAll(TreePath path)
path - the path to expandpublic java.lang.String getActionCommand()
ActionEvents fired by this
Tree.
public nextapp.echo.app.Border getBorder()
Border.
public TreeCellRenderer getCellRenderer()
TreeCellRenderer used to render values
contained in the tree. The value of this property may be null, in which
case the tree should revert to using its default cell renderer.
public TreeColumnModel getColumnModel()
TreeColumnModel describing this tree's
columns.
public TreeCellRenderer getDefaultHeaderRenderer()
TreeCellRenderer used to render
header cells. The default header renderer will be used in the event
that a TreeColumn does not provide a specific header
renderer.
TreeCellRendererpublic TreeCellRenderer getDefaultRenderer(java.lang.Class columnClass)
TreeCellRenderer for the specified
column class. The default renderer will be used in the event that
a TreeColumn does not provide a specific renderer.
columnClass - the column Class
TreeCellRendererpublic nextapp.echo.app.Insets getInsets()
public void dispose()
dispose in class nextapp.echo.app.ComponentComponent.dispose()public void init()
init in class nextapp.echo.app.ComponentComponent.init()public TreeModel getModel()
TreeModel being visualized by this
Tree.
public void processInput(java.lang.String inputName,
java.lang.Object inputValue)
processInput in class nextapp.echo.app.ComponentComponent.processInput(java.lang.String,
java.lang.Object)public void setAutoCreateColumnsFromModel(boolean newValue)
TableColumnModel will be created
automatically from the TableModel.
newValue - true if the TableColumnModel should be
created automatically from the TableModelisAutoCreateColumnsFromModel()public void setActionCommand(java.lang.String newValue)
ActionEvents fired by this
Tree.
newValue - the new action commandpublic void setBorder(nextapp.echo.app.Border newValue)
Border.
newValue - the new borderpublic void setCellRenderer(TreeCellRenderer newValue)
TreeCellRenderer used to render values contained
in the tree. The value of this property may be null, in which case the
tree should revert to using its default cell renderer.
newValue - the new cell rendererpublic void setColumnModel(TreeColumnModel newValue)
TreeColumnModel describing this tree's
columns.
newValue - the new column modelpublic void setDefaultHeaderRenderer(TreeCellRenderer newValue)
TreeCellRenderer used to render
header cells. The default header renderer will be used in the event
that a TreeColumn does not provide a specific header
renderer.
newValue - the TreeCellRenderer
public void setDefaultRenderer(java.lang.Class columnClass,
TreeCellRenderer newValue)
TreeCellRenderer for the specified
column class. The default renderer will be used in the event that
a TreeColumn does not provide a specific renderer.
columnClass - the column ClassnewValue - the TreeCellRenderer
public void setExpandedState(TreePath treePath,
boolean state)
treePath - the path to expand or collapsestate - the new expansion statepublic void setHeaderVisible(boolean newValue)
newValue - true if the header should be displayedpublic void setInsets(nextapp.echo.app.Insets newValue)
newValue - the new default cell insets
protected void fireExpansionStateUpdate(TreePath treePath,
boolean newState)
TreeExpansionListeners that the expansion
state has changed.
Fires a PropertyChangeEvent for the
EXPANSION_STATE_CHANGED_PROPERTY with value null
for old and new value.
treePath - the path to fire the expansion event fornewState - the new expansion state for the given pathpublic boolean isAutoCreateColumnsFromModel()
TableColumnModel will be created
automatically from the TreeModel. If this flag is set,
changes to the TreeModel will automatically cause the
TableColumnModel to be re-created. This flag is true
by default unless a TableColumnModel is specified in the
constructor.
TableColumnModel will be created
automatically from the TreeModelpublic boolean isExpanded(int row)
row - the row to get the expanded state for
true if the tree path on the given row is
expanded, false if not
java.lang.IndexOutOfBoundsException - when the given row is invalidpublic boolean isExpanded(TreePath treePath)
treePath - the tree path to get the expanded state for
true if the given tree path is expanded,
false if notpublic boolean isHeaderVisible()
public boolean isRolloverEnabled()
setRolloverEnabled(boolean)public boolean isRootVisible()
setRootVisible(boolean)public boolean isSelectionEnabled()
setSelectionEnabled(boolean)public boolean isShowsRootHandle()
true if the root handle should be visible.setShowsRootHandle(boolean)public TreePath getPathForRow(int row)
row - the row to get the path for
TreePath that is rendered on the given row.
java.lang.IndexOutOfBoundsException - when row is invalid.public int getRowForPath(TreePath path)
path - the path
public nextapp.echo.app.Color getRolloverBackground()
public nextapp.echo.app.FillImage getRolloverBackgroundImage()
public nextapp.echo.app.Border getRolloverBorder()
public nextapp.echo.app.Font getRolloverFont()
public nextapp.echo.app.Color getRolloverForeground()
public nextapp.echo.app.Color getSelectionBackground()
public nextapp.echo.app.FillImage getSelectionBackgroundImage()
public nextapp.echo.app.Border getSelectionBorder()
public nextapp.echo.app.Font getSelectionFont()
public nextapp.echo.app.Color getSelectionForeground()
public TreeSelectionModel getSelectionModel()
public nextapp.echo.app.Extent getWidth()
Extents with
fixed or percentile units.
public nextapp.echo.app.Component getComponent(int row,
int column)
row - the row the component is rendered incolumn - the column the component is rendered in
null if the location does not
exist, or the component for the location is not yet rendered.
public nextapp.echo.app.Component getComponent(TreePath path,
int column)
path - the path the component is rendered forcolumn - the column the component is rendered in
null if the location does not
exist, or the component for the location is not yet rendered.public int getLineStyle()
LINE_STYLE_SOLIDLINE_STYLE_DOTTEDpublic nextapp.echo.app.ImageReference getNodeClosedIcon()
public nextapp.echo.app.ImageReference getNodeClosedBottomIcon()
public nextapp.echo.app.ImageReference getNodeOpenIcon()
public nextapp.echo.app.ImageReference getNodeOpenBottomIcon()
public void removeActionListener(nextapp.echo.app.event.ActionListener l)
ActionListener from the Tree.
ActionListeners will be invoked when the user
selects a row.
l - the ActionListener to removepublic void setModel(TreeModel newValue)
TreeModel being visualized.
If the root node is not null, it will be expanded automatically.
newValue - the new model (may not be null)public void setLineStyle(int newValue)
newValue - the line style, one of the following values:
LINE_STYLE_NONELINE_STYLE_SOLIDLINE_STYLE_DOTTEDpublic void setNodeClosedIcon(nextapp.echo.app.ImageReference newValue)
newValue - the iconpublic void setNodeClosedBottomIcon(nextapp.echo.app.ImageReference newValue)
newValue - the iconpublic void setNodeOpenIcon(nextapp.echo.app.ImageReference newValue)
newValue - the iconpublic void setNodeOpenBottomIcon(nextapp.echo.app.ImageReference newValue)
newValue - the iconpublic void setRolloverBackground(nextapp.echo.app.Color newValue)
newValue - the new Colorpublic void setRolloverBackgroundImage(nextapp.echo.app.FillImage newValue)
newValue - the new background imagepublic void setRolloverBorder(nextapp.echo.app.Border newValue)
newValue - the new background imagepublic void setRolloverEnabled(boolean newValue)
newValue - true if rollover effects should be enabledpublic void setRolloverFont(nextapp.echo.app.Font newValue)
newValue - the new Fontpublic void setRolloverForeground(nextapp.echo.app.Color newValue)
newValue - the new Colorpublic void setRootVisible(boolean newValue)
TreeModel
is visible.
newValue - true if the root node of the tree is
to be displayed.isRootVisible()public void setSelectionBackground(nextapp.echo.app.Color newValue)
newValue - the new background colorpublic void setSelectionBackgroundImage(nextapp.echo.app.FillImage newValue)
newValue - the new background imagepublic void setSelectionBorder(nextapp.echo.app.Border newValue)
newValue - the new borderpublic void setSelectionEnabled(boolean newValue)
newValue - true to enable selectionpublic void setSelectionForeground(nextapp.echo.app.Color newValue)
newValue - the new foreground colorpublic void setSelectionFont(nextapp.echo.app.Font newValue)
newValue - the new fontpublic void setSelectionModel(TreeSelectionModel newValue)
newValue - the new selection modelpublic void setShowsRootHandle(boolean newValue)
newValue - true if the root handle should be visible.isShowsRootHandle()public void setWidth(nextapp.echo.app.Extent newValue)
Extents with
fixed or percentile units.
newValue - the new widthpublic void validate()
validate in class nextapp.echo.app.ComponentComponent.validate()public void addTreeExpansionListener(TreeExpansionListener l)
TreeExpansionListener to the Tree.
TreeExpansionListeners will be invoked when the expansion
state of a node changes.
l - the TreeExpansionListener to addpublic void removeTreeExpansionListener(TreeExpansionListener l)
TreeExpansionListener from the Tree.
TreeExpansionListeners will be invoked when the expansion
state of a node changes.
l - the TreeExpansionListener to remove
|
NextApp Echo3 Extras v3.0.b4 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||