|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.openswing.swing.tree.client.TreeGridPanel
Title: OpenSwing Framework
Description: Panel that contains an expandable tree+grid.
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TreeGridPanel()
Constructor. |
Method Summary | |
void |
addGridColumn(java.lang.String attributeName,
int colSize)
Add a column to tree+grid component and specifies attribute to map and column size. |
void |
addNotify()
|
void |
addPopupMenuItem(java.lang.String menuName,
int mnemonic,
boolean enabled,
java.awt.event.ActionListener menuListener)
Add a pop-up menu item. |
void |
addPopupMenuItem(java.lang.String menuName,
java.lang.String parentMenuName,
char mnemonic,
boolean enabled,
java.awt.event.ActionListener menuListener)
Add a pop-up menu item to a parent menu item. |
void |
clearTree()
Remove all nodes (expept the root node) from the tree. |
void |
collapseNode(int index)
Collapse a tree node. |
void |
expandNode(int index)
Expand a tree node. |
java.awt.Color |
getBackground()
|
java.lang.String |
getFolderIconName()
|
java.lang.String |
getIconAttributeName()
|
java.lang.String |
getLeavesImageName()
|
javax.swing.tree.DefaultMutableTreeNode |
getSelectedNode()
|
TreeController |
getTreeController()
|
TreeDataLocator |
getTreeDataLocator()
|
boolean |
isExpandAllNodes()
|
boolean |
isExpandRoot()
|
boolean |
isLoadWhenVisibile()
|
boolean |
isRootVisible()
|
void |
reloadTree()
Force tree reloading. |
void |
repaintTree()
Redraw the tree. |
void |
setBackground(java.awt.Color backgroundColor)
Sets the background color of this component. |
void |
setColumnAlignment(java.lang.String attributeName,
int alignment)
Set the column alingment for the column identified by the specified attribute name. |
void |
setColumnFormatter(java.lang.String attributeName,
java.text.Format formatter)
Set the column format for the column identified by the specified attribute name. |
void |
setColumnHeader(java.lang.String attributeName,
java.lang.String description)
Set the column header for the column identified by the specified attribute name. |
void |
setEnabled(boolean enabled)
|
void |
setExpandAllNodes(boolean expandAllNodes)
Define if all tree nodes must be expanded after loading. |
void |
setExpandRoot(boolean expandRoot)
Define if root node must be automatically expanded when "expandAllNodes" property is set to false ; default value: true . |
void |
setFolderIconName(java.lang.String folderIconName)
Set the folder icon name. |
void |
setIconAttributeName(java.lang.String iconAttributeName)
Optional attribute name that identifies the name of the image to show as tree node. |
void |
setLeavesImageName(java.lang.String leavesImageName)
Set image icon used for leaves. |
void |
setLoadWhenVisibile(boolean loadWhenVisibile)
Define if tree will be filled on viewing this panel. |
void |
setMenuItemEnabled(java.lang.String menuName,
boolean enabled)
Set menu item abilitation. |
void |
setRootVisible(boolean rootVisible)
Determines whether or not the root node from the TreeModel is visible. |
void |
setTreeController(TreeController treeController)
Set the tree controller: it manages tree events. |
void |
setTreeDataLocator(TreeDataLocator treeDataLocator)
Set the data source used to fill in the tree |
void |
treeDoubleClick(java.awt.event.MouseEvent e,
javax.swing.JTree tree)
Method called when user has double clicked. |
void |
treeLeftClick(java.awt.event.MouseEvent e,
javax.swing.JTree tree)
Method called when user has clicked on the left mouse button. |
void |
treeRightClick(java.awt.event.MouseEvent e,
javax.swing.JTree tree)
Method called when user has clicked on the right mouse button. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TreeGridPanel()
Method Detail |
public final void addNotify()
public final void setRootVisible(boolean rootVisible)
TreeModel
is visible.
rootVisible
- true if the root node of the tree is to be displayed#rootVisible
public final boolean isRootVisible()
TreeModel
is visiblepublic final void reloadTree()
public final void expandNode(int index)
index
- index of node to expandpublic final void collapseNode(int index)
index
- index of node to collapsepublic final void repaintTree()
public final void clearTree()
public final javax.swing.tree.DefaultMutableTreeNode getSelectedNode()
public final void treeDoubleClick(java.awt.event.MouseEvent e, javax.swing.JTree tree)
e
- double click eventtree
- treepublic final void treeLeftClick(java.awt.event.MouseEvent e, javax.swing.JTree tree)
e
- left mouse button click eventtree
- treepublic void setEnabled(boolean enabled)
public final void treeRightClick(java.awt.event.MouseEvent e, javax.swing.JTree tree)
e
- right mouse button click eventtree
- treepublic final void addPopupMenuItem(java.lang.String menuName, int mnemonic, boolean enabled, java.awt.event.ActionListener menuListener)
menuName
- menu item description (not yet translated)mnemonic
- mnemonic valueenabled
- flag used to set menu item abilitationmenuListener
- listener used to capture menu item selectionpublic final void addPopupMenuItem(java.lang.String menuName, java.lang.String parentMenuName, char mnemonic, boolean enabled, java.awt.event.ActionListener menuListener)
menuName
- menu item description (not yet translated)parentMenuName
- mnemonic
- mnemonic valueenabled
- flag used to set menu item abilitationmenuListener
- listener used to capture menu item selectionpublic final void setMenuItemEnabled(java.lang.String menuName, boolean enabled)
menuName
- menu item description (not yet translated)enabled
- flag used to enable the menu itempublic final TreeController getTreeController()
public final TreeDataLocator getTreeDataLocator()
public final void setTreeDataLocator(TreeDataLocator treeDataLocator)
treeDataLocator
- data source used to fill in the treepublic final void setTreeController(TreeController treeController)
treeController
- tree controller: it manages tree events.public final java.lang.String getLeavesImageName()
public final void setLeavesImageName(java.lang.String leavesImageName)
leavesImageName
- image icon used for leavespublic final void setBackground(java.awt.Color backgroundColor)
Component.getBackground()
public final java.awt.Color getBackground()
public final boolean isLoadWhenVisibile()
public final void setLoadWhenVisibile(boolean loadWhenVisibile)
loadWhenVisibile
- define if tree will be filled on viewing this panelpublic final boolean isExpandAllNodes()
public final void setExpandAllNodes(boolean expandAllNodes)
expandAllNodes
- boolean define if all tree nodes must be expanded after loadingpublic final java.lang.String getIconAttributeName()
public final void setIconAttributeName(java.lang.String iconAttributeName)
public final java.lang.String getFolderIconName()
public final void setFolderIconName(java.lang.String folderIconName)
public final void addGridColumn(java.lang.String attributeName, int colSize)
attributeName
- attribute name to map to this columncolSize
- column sizepublic void setColumnFormatter(java.lang.String attributeName, java.text.Format formatter)
attributeName
- column identifierformatter
- Format object to used for data showed inside the specified columnpublic final void setColumnHeader(java.lang.String attributeName, java.lang.String description)
attributeName
- column identifierdescription
- description to translate and set as column headerpublic final void setColumnAlignment(java.lang.String attributeName, int alignment)
attributeName
- column identifieralignment
- One of the following constants
defined in SwingConstants
:
LEFT
,
CENTER
(the default for image-only labels),
RIGHT
,
LEADING
(the default for text-only labels) or
TRAILING
.public final boolean isExpandRoot()
false
public final void setExpandRoot(boolean expandRoot)
false
; default value: true
.
expandRoot
- define if root node must be automatically expanded when "expandAllNodes" property is set to false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |