de.jsystems.framework.tree
Class BusinessTree.Tree

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTree
                  extended byde.jsystems.framework.controls.FTree
                      extended byde.jsystems.framework.tree.BusinessTree.Tree
All Implemented Interfaces:
Accessible, IActionInterface, IAncestor, IComponent, IContainer, IFocus, IHierarchy, IHierarchyBounds, IInputMethod, IKey, ImageObserver, IMouse, IMouseInput, IMouseMotion, IPropertyChange, ITreeExpansion, ITreeSelection, ITreeWillExpand, IVetoableChange, MenuContainer, Scrollable, Serializable
Enclosing class:
BusinessTree

private class BusinessTree.Tree
extends FTree

Klasse f�r den Baum. Noch ist das einfach ein {javax.swing.JTree JTree} ohne groessere Modifikation.

Version:
1.0
Copyright by Jens Homm 2001 - 2003
Author:
Jens Homm JSYSTEMS

Nested Class Summary
 
Nested classes inherited from class javax.swing.JTree
JTree.AccessibleJTree, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  org.apache.log4j.Logger logger
           
private  IBusinessTreeModel model
          Model mit den Daten des Trees.
 
Fields inherited from class de.jsystems.framework.controls.FTree
 
Fields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
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
BusinessTree.Tree(IBusinessTreeModel model)
          Erzeugt den Tree.
 
Method Summary
 String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          Wird vom Renderer f�r diesen Tree aufgerufen.
 IBusinessTreeModel getBusinessTreeModel()
          Gibt das aktuelle Model des Trees zur�ck.
 TreeItem getSelectedNode()
          Gibt den aktuell selektierten Knoten zur�ck.
 void selectNodeAtPoint(Point p)
          Selektiert den Knoten im Baum, der sich an der Position des uebergebenen Punktes befindet.
 void setBusinessTreeModel(IBusinessTreeModel model)
          Setzt das Model f�r den Tree.
 void setSelectedNode(TreeItem node)
          Markiert den �bergebenen Knoten als selektiert.
 
Methods inherited from class de.jsystems.framework.controls.FTree
addMouseInputListener, getActionClassForAncestor, getActionClassForComponent, getActionClassForContainer, getActionClassForFocus, getActionClassForHierarchy, getActionClassForHierarchyBounds, getActionClassForInputMethod, getActionClassForKey, getActionClassForMouse, getActionClassForMouseInput, getActionClassForMouseMotion, getActionClassForPropertyChange, getActionClassForTreeExpansion, getActionClassForTreeSelection, getActionClassForTreeWillExpand, getActionClassForVetoableChange, removeMouseInputListener, setActionClassForAncestor, setActionClassForComponent, setActionClassForContainer, setActionClassForFocus, setActionClassForHierarchy, setActionClassForHierarchyBounds, setActionClassForInputMethod, setActionClassForKey, setActionClassForMouse, setActionClassForMouseInput, setActionClassForMouseMotion, setActionClassForPropertyChange, setActionClassForTreeExpansion, setActionClassForTreeSelection, setActionClassForTreeWillExpand, setActionClassForVetoableChange
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.jsystems.framework.common.action.IActionInterface
isEnabled, setEnabled
 
Methods inherited from interface de.jsystems.framework.common.action.swing.ITreeExpansion
addTreeExpansionListener, removeTreeExpansionListener
 
Methods inherited from interface de.jsystems.framework.common.action.swing.ITreeSelection
addTreeSelectionListener, removeTreeSelectionListener
 
Methods inherited from interface de.jsystems.framework.common.action.swing.ITreeWillExpand
addTreeWillExpandListener, removeTreeWillExpandListener
 
Methods inherited from interface de.jsystems.framework.common.action.swing.IAncestor
addAncestorListener, removeAncestorListener
 
Methods inherited from interface de.jsystems.framework.common.action.beans.IPropertyChange
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface de.jsystems.framework.common.action.beans.IVetoableChange
addVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IContainer
addContainerListener, removeContainerListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IComponent
addComponentListener, removeComponentListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IFocus
addFocusListener, removeFocusListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IHierarchy
addHierarchyListener, removeHierarchyListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IHierarchyBounds
addHierarchyBoundsListener, removeHierarchyBoundsListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IInputMethod
addInputMethodListener, removeInputMethodListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IKey
addKeyListener, removeKeyListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IMouse
addMouseListener, removeMouseListener
 
Methods inherited from interface de.jsystems.framework.common.action.awt.IMouseMotion
addMouseMotionListener, removeMouseMotionListener
 

Field Detail

logger

private org.apache.log4j.Logger logger

model

private IBusinessTreeModel model
Model mit den Daten des Trees.

Constructor Detail

BusinessTree.Tree

public BusinessTree.Tree(IBusinessTreeModel model)
Erzeugt den Tree. Die Selektion f�r diesen Tree ist eingestellt auf SINGLE_TREE_SELECTION.

Parameters:
model - Das Model fuer den Baum.
Method Detail

setBusinessTreeModel

public void setBusinessTreeModel(IBusinessTreeModel model)
Setzt das Model f�r den Tree.

Parameters:
model - Das Model fuer den Tree.

getBusinessTreeModel

public IBusinessTreeModel getBusinessTreeModel()
Gibt das aktuelle Model des Trees zur�ck.

Returns:
Das aktuelle Model des Trees.

convertValueToText

public String convertValueToText(Object value,
                                 boolean selected,
                                 boolean expanded,
                                 boolean leaf,
                                 int row,
                                 boolean hasFocus)
Wird vom Renderer f�r diesen Tree aufgerufen. Zur�ckgegeben wird der Name des aktuellen Knotens im Baum. Wird hier �berschrieben, da die TreeItems ein Attribut name haben und nicht das UserObject f�r den Namen benutzt wird.

Parameters:
value - Das Objekt, dessen Namen angezeigt werden soll. Hierbei handelt es sich um Objekte vom Typ TreeItem
selected - true, wenn der Knoten selektiert ist, ansonsten false.
expanded - true, wenn der Knoten expandiert ist.
leaf - true, wenn es sich bei diesem Knoten um ein Blatt handelt.
row - Die Zeile des angezeigten Knotens. 0 ist die erste angezeigte Zeile.
hasFocus - true, wenn der Knoten den Focus hat.
Returns:
Der Name des angezeigten Knotens.
See Also:
Item.getName()

getSelectedNode

public TreeItem getSelectedNode()
Gibt den aktuell selektierten Knoten zur�ck. Wenn nichts selektiert ist, wird NULL zur�ckgegeben.

Returns:
Denn aktuell selektierten Knoten oder NULL.

setSelectedNode

public void setSelectedNode(TreeItem node)
Markiert den �bergebenen Knoten als selektiert.

Parameters:
node - Der Knoten, der im Baum selektiert erscheinen soll.

selectNodeAtPoint

public void selectNodeAtPoint(Point p)
Selektiert den Knoten im Baum, der sich an der Position des uebergebenen Punktes befindet. Falls sich hier kein Knoten befindet, so passiert nichts weiter.

Parameters:
p - Der Punkt an dem ein Knoten selektiert werden soll.