edu.princeton.swing
public class PTree extends javax.swing.JTree implements ClipboardTarget
Modifier and Type | Class and Description |
---|---|
protected class |
PTree.Listener
The Listener listenes to the selection model of this list to capture PropertyChangeEvents.
|
javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DropLocation, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector
javax.swing.JComponent.AccessibleJComponent
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
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
PTree()
Constructs a new PTree.
|
PTree(java.util.Hashtable value)
Constructs a new PTree.
|
PTree(java.lang.Object[] value)
Constructs a new PTree.
|
PTree(javax.swing.tree.TreeModel newModel)
Constructs a new PTree.
|
PTree(javax.swing.tree.TreeNode root)
Constructs a new PTree.
|
PTree(javax.swing.tree.TreeNode root,
boolean asksAllowsChildren)
Constructs a new PTree.
|
PTree(java.util.Vector value)
Constructs a new PTree.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds a listener to monitor action events (enter key events) on the PTextField.
|
boolean |
canCopy()
Returns wheter or not the copy operation can be performed on this ClipboardTarget.
|
boolean |
canCut()
Returns wheter or not the cut operation can be performed on this ClipboardTarget.
|
boolean |
canPaste()
Returns wheter or not the paste operation can be performed on this ClipboardTarget.
|
boolean |
canSelectAll()
Returns wheter or not the selectAll operation can be performed on this ClipboardTarget.
|
void |
copy()
Copies the selection to the clipboard.
|
void |
cut()
Copies the selection to the clipboard and remove it from the object.
|
java.lang.String |
getActionCommand()
Returns the action command associated with the enter key being pressed.
|
javax.swing.JPopupMenu |
getPopupMenu()
Gets the popup menu for this component.
|
void |
paste()
Inserts the contents of the clipbaord into the object.
|
protected void |
processFocusEvent(java.awt.event.FocusEvent e)
Intercept FocusEvents to notify the ClipboardTargetManager of the event.
|
protected void |
processMouseEvent(java.awt.event.MouseEvent e)
Intercept MouseEvents to activate the popupMenu at the right time.
|
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes a listener from this component.
|
void |
selectAll()
Selects everything in the object.
|
void |
setActionCommand(java.lang.String actionCommand)
Sets the action command associated with the enter key being pressed.
|
void |
setEnabled(boolean enabled)
Override the setEnabled() method to intercept any changes concerning the enabled status of
the component.
|
void |
setPopupMenu(javax.swing.JPopupMenu popupMenu)
Sets the popup menu for this component.
|
void |
setSelectionModel(javax.swing.tree.TreeSelectionModel selectionModel)
Override the setSelectionModel method to keep our listener on the correct model.
|
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, getDropLocation, getDropMode, 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, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public PTree()
public PTree(java.util.Hashtable value)
public PTree(java.lang.Object[] value)
public PTree(javax.swing.tree.TreeModel newModel)
public PTree(javax.swing.tree.TreeNode root)
public PTree(javax.swing.tree.TreeNode root, boolean asksAllowsChildren)
public PTree(java.util.Vector value)
public void addActionListener(java.awt.event.ActionListener listener)
listener
- The listener to add to this document. A null value will cause a
NullPointerException.public void removeActionListener(java.awt.event.ActionListener listener)
listener
- The listener to remove from this document. A null value will cause a
NullPointerException.public java.lang.String getActionCommand()
public void setActionCommand(java.lang.String actionCommand)
actionCommand
- The action command to be associated with the enter key. If null is
passed, the text of the text field at the time of the event will be used.public boolean canCut()
canCut
in interface ClipboardTarget
public void cut()
cut
in interface ClipboardTarget
public boolean canCopy()
canCopy
in interface ClipboardTarget
public void copy()
copy
in interface ClipboardTarget
public boolean canPaste()
canPaste
in interface ClipboardTarget
public void paste()
paste
in interface ClipboardTarget
public boolean canSelectAll()
canSelectAll
in interface ClipboardTarget
public void selectAll()
selectAll
in interface ClipboardTarget
protected void processFocusEvent(java.awt.event.FocusEvent e)
processFocusEvent
in class java.awt.Component
protected void processMouseEvent(java.awt.event.MouseEvent e)
processMouseEvent
in class javax.swing.JComponent
public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
public void setSelectionModel(javax.swing.tree.TreeSelectionModel selectionModel)
setSelectionModel
in class javax.swing.JTree
public javax.swing.JPopupMenu getPopupMenu()
public void setPopupMenu(javax.swing.JPopupMenu popupMenu)
popupMenu
- The popup menu for the component. A null value indicates that this
component should not have a popup menu.