TreeGridPanel

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openswing.swing.tree.client
Class TreeGridPanel

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      org.openswing.swing.tree.client.TreeGridPanel

All Implemented Interfaces:
  javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class TreeGridPanel
extends javax.swing.JPanel

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

See Also:
  Serialized Form

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.lang.String` | `getFolderIconName()`
`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` | `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` | `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, setBackground, 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, getBackground, 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

### TreeGridPanel

    public TreeGridPanel()

  Constructor.

Method Detail

### addNotify

    public final void addNotify()

### setRootVisible

    public final void setRootVisible(boolean rootVisible)

  Determines whether or not the root node from the `TreeModel` is visible.

  Parameters:
    `rootVisible` - true if the root node of the tree is to be displayed
  See Also:
    `#rootVisible`

### isRootVisible

    public final boolean isRootVisible()

  Returns:
    determines whether or not the root node from the `TreeModel` is visible

### reloadTree

    public final void reloadTree()

  Force tree reloading.

### expandNode

    public final void expandNode(int index)

  Expand a tree node.

  Parameters:
    `index` - index of node to expand

### collapseNode

    public final void collapseNode(int index)

  Collapse a tree node.

  Parameters:
    `index` - index of node to collapse

### repaintTree

    public final void repaintTree()

  Redraw the tree. Used when the tree model has been modified.

### clearTree

    public final void clearTree()

  Remove all nodes (expept the root node) from the tree.

### getSelectedNode

    public final javax.swing.tree.DefaultMutableTreeNode getSelectedNode()

  Returns:
    selected node or null if no node is selected

### treeDoubleClick

    public final void treeDoubleClick(java.awt.event.MouseEvent e,
                                      javax.swing.JTree tree)

  Method called when user has double clicked.

  Parameters:
    `e` - double click event
    `tree` - tree

### treeLeftClick

    public final void treeLeftClick(java.awt.event.MouseEvent e,
                                    javax.swing.JTree tree)

  Method called when user has clicked on the left mouse button.

  Parameters:
    `e` - left mouse button click event
    `tree` - tree

### setEnabled

    public void setEnabled(boolean enabled)

### treeRightClick

    public final void treeRightClick(java.awt.event.MouseEvent e,
                                     javax.swing.JTree tree)

  Method called when user has clicked on the right mouse button.

  Parameters:
    `e` - right mouse button click event
    `tree` - tree

### addPopupMenuItem

    public final void addPopupMenuItem(java.lang.String menuName,
                                       int mnemonic,
                                       boolean enabled,
                                       java.awt.event.ActionListener menuListener)

  Add a pop-up menu item.

  Parameters:
    `menuName` - menu item description (not yet translated)
    `mnemonic` - mnemonic value
    `enabled` - flag used to set menu item abilitation
    `menuListener` - listener used to capture menu item selection

### addPopupMenuItem

    public final 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.

  Parameters:
    `menuName` - menu item description (not yet translated)
    `parentMenuName` -
    `mnemonic` - mnemonic value
    `enabled` - flag used to set menu item abilitation
    `menuListener` - listener used to capture menu item selection

### setMenuItemEnabled

    public final void setMenuItemEnabled(java.lang.String menuName,
                                         boolean enabled)

  Set menu item abilitation.

  Parameters:
    `menuName` - menu item description (not yet translated)
    `enabled` - flag used to enable the menu item

### getTreeController

    public final TreeController getTreeController()

  Returns:
    tree controller: it manages tree events

### getTreeDataLocator

    public final TreeDataLocator getTreeDataLocator()

  Returns:
    data source used to fill in the tree

### setTreeDataLocator

    public final void setTreeDataLocator(TreeDataLocator treeDataLocator)

  Set the data source used to fill in the tree

  Parameters:
    `treeDataLocator` - data source used to fill in the tree

### setTreeController

    public final void setTreeController(TreeController treeController)

  Set the tree controller: it manages tree events.

  Parameters:
    `treeController` - tree controller: it manages tree events.

### getLeavesImageName

    public final java.lang.String getLeavesImageName()

  Returns:
    image icon used for leaves

### setLeavesImageName

    public final void setLeavesImageName(java.lang.String leavesImageName)

  Set image icon used for leaves.

  Parameters:
    `leavesImageName` - image icon used for leaves

### isLoadWhenVisibile

    public final boolean isLoadWhenVisibile()

  Returns:
    define if tree will be filled on viewing this panel

### setLoadWhenVisibile

    public final void setLoadWhenVisibile(boolean loadWhenVisibile)

  Define if tree will be filled on viewing this panel.

  Parameters:
    `loadWhenVisibile` - define if tree will be filled on viewing this panel

### isExpandAllNodes

    public final boolean isExpandAllNodes()

  Returns:
    boolean define if all tree nodes must be expanded after loading

### setExpandAllNodes

    public final void setExpandAllNodes(boolean expandAllNodes)

  Define if all tree nodes must be expanded after loading.

  Parameters:
    `expandAllNodes` - boolean define if all tree nodes must be expanded after loading

### getFolderIconName

    public final java.lang.String getFolderIconName()

  Returns:
    folder icon name

### setFolderIconName

    public final void setFolderIconName(java.lang.String folderIconName)

  Set the folder icon name.

### addGridColumn

    public final void addGridColumn(java.lang.String attributeName,
                                    int colSize)

  Add a column to tree+grid component and specifies attribute to map and column size.

  Parameters:
    `attributeName` - attribute name to map to this column
    `colSize` - column size

### setColumnFormatter

    public void setColumnFormatter(java.lang.String attributeName,
                                   java.text.Format formatter)

  Set the column format for the column identified by the specified attribute name.

  Parameters:
    `attributeName` - column identifier
    `formatter` - Format object to used for data showed inside the specified column

### setColumnHeader

    public final void setColumnHeader(java.lang.String attributeName,
                                      java.lang.String description)

  Set the column header for the column identified by the specified attribute name.

  Parameters:
    `attributeName` - column identifier
    `description` - description to translate and set as column header

### setColumnAlignment

    public final void setColumnAlignment(java.lang.String attributeName,
                                         int alignment)

  Set the column alingment for the column identified by the specified attribute name.

  Parameters:
    `attributeName` - column identifier
    `alignment` - 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`.

### isExpandRoot

    public final boolean isExpandRoot()

  Returns:
    define if root node must be automatically expanded when "expandAllNodes" property is set to `false`

### setExpandRoot

    public final void setExpandRoot(boolean expandRoot)

  Define if root node must be automatically expanded when "expandAllNodes" property is set to `false`; default value: `true`.

  Parameters:
    `expandRoot` - define if root node must be automatically expanded when "expandAllNodes" property is set to `false`

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD