org.openquark.gems.client.browser
Class BrowserTree
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
org.openquark.util.ui.UtilTree
org.openquark.gems.client.browser.BrowserTree
- All Implemented Interfaces:
- ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
public class BrowserTree
- extends org.openquark.util.ui.UtilTree
Extension of JTree adding drag source features.
Also added are pop up menus which enable sorting capabilities.
- Author:
- Luke Evans
- See Also:
- Serialized Form
| Fields inherited from class org.openquark.util.ui.UtilTree |
savedExpandedPaths, savedSelectionPath |
| 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 |
|
Constructor Summary |
BrowserTree()
Default BrowserTree constructor. |
| Methods inherited from class org.openquark.util.ui.UtilTree |
scrollPathIntoView, scrollPathToTop |
| Methods inherited from class javax.swing.JTree |
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, 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, 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, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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 |
DEFAULT_MODULE_NAME
public static final String DEFAULT_MODULE_NAME
- The display name given to modules with "" (no name) as their name.
- See Also:
- Constant Field Values
BrowserTree
public BrowserTree()
- Default BrowserTree constructor.
setNavigatorOwner
public void setNavigatorOwner(NavFrameOwner navigatorOwner)
- Set the navigator owner to use for editing/displaying gem metadata.
- Parameters:
navigatorOwner - the navigator owner to use
getNavigatorOwner
public NavFrameOwner getNavigatorOwner()
- Returns:
- the navigator owner being used to display/edit metadata. This may be
null if no navigator owner has been setup.
expandLevel
public void expandLevel(int depth)
- Expand all visible tree nodes at a given depth.
This should be run on the AWT event-handler thread.
- Parameters:
depth - 0-based level of the nodes to expand. Nodes with this depth will be expanded.
selectGemNode
public void selectGemNode(GemEntity newGemEntity)
- If there is a node in the tree for the given entity, this will select that
node and scroll it into view. If there is no such node, then this does nothing.
This should be run on the AWT event-handler thread.
- Parameters:
newGemEntity - the entity to select
selectDrawerNode
public void selectDrawerNode(ModuleName drawerName)
- If there is a drawer node with given name, this will select that
node and scroll it into view. If there is no such node, then this does nothing.
This should be run on the AWT event-handler thread.
- Parameters:
drawerName - the name of the drawer to select
selectNode
public void selectNode(String nodeTitle)
- If there is a node with the given title, this will select that node
and scroll it into view. If there is no such node, then this does nothing.
If there are several nodes with the given title, the first node will be selected.
This should be run on the AWT event-handler thread.
- Parameters:
nodeTitle - the title of the node to select
saveState
public void saveState()
-
Additionally saves the list of children that includes the selected node.
- Overrides:
saveState in class org.openquark.util.ui.UtilTree
restoreSavedState
public void restoreSavedState()
-
- Overrides:
restoreSavedState in class org.openquark.util.ui.UtilTree
setEnabledDragAndDrop
public void setEnabledDragAndDrop(boolean allowed)
- Sets whether or not the gems in the BrowserTree can be involved with Drag and Drop.
Creation date: (06/04/01 12:01:00 PM)
- Parameters:
allowed - boolean
setDisplayTypeExpr
public void setDisplayTypeExpr(boolean display)
- Sets whether or not type expressions are displayed next to gem names in the tree.
- Parameters:
display -
getDisplayTypeExpr
public boolean getDisplayTypeExpr()
- Gets whether or not type expressions are displayed next to gem names in the tree.
- Returns:
- true if type expressions are displayed
setHighlightCurrentModule
public void setHighlightCurrentModule(boolean highlightCurrentModule)
- Sets whether the current module should be highlighted in the tree.
- Parameters:
highlightCurrentModule -
setPopupMenuProvider
public void setPopupMenuProvider(BrowserTree.PopupMenuProvider newMenuProvider)
- Set the provider of popups to this tree.
- Parameters:
newMenuProvider - the new popup menu provider.
getBrowserTreeActions
public BrowserTreeActions getBrowserTreeActions()
- Return the BrowserTreeActions object associated with this tree
- Returns:
- BrowserTreeActions
getDragImage
public BufferedImage getDragImage()
- Return the current drag image if the gem browser is the source of the drag.
Creation date: (03/15/01 3:48:00 PM)
- Returns:
- BufferedImage the image to drag, or null if the browser is not the source of a drag.
getDragOffset
public Point getDragOffset()
- Return the current drag offset if the gem browser is the source of the drag.
Creation date: (03/15/01 3:51:00 PM)
- Returns:
- Point the current drag offset.
addLeafNodeTriggeredListener
public void addLeafNodeTriggeredListener(LeafNodeTriggeredListener listener)
- Add a LeafNodeTriggeredListener to the listener list.
Creation date: (04/17/2002 10:06:00 AM).
- Parameters:
listener - LeafNodeTriggeredListener - the listener to add
fireLeafNodeTriggeredEvent
protected void fireLeafNodeTriggeredEvent(List<Object> userObjects)
- Notify the appropriate registered listeners that a node has been triggered.
Creation date: (04/17/2002 10:08:00 AM).
- Parameters:
userObjects - the objects of the nodes that were triggered
getToolTipText
public String getToolTipText(MouseEvent mouseEvent)
- Overrides:
getToolTipText in class JTree
- See Also:
JComponent.getToolTipText(java.awt.event.MouseEvent)
getToolTipLocation
public Point getToolTipLocation(MouseEvent e)
- Overrides:
getToolTipLocation in class JComponent
- See Also:
JComponent.getToolTipLocation(java.awt.event.MouseEvent)