|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.annotation.wordfreak.chooser.EntityTreeNode org.annotation.wordfreak.chooser.EntityTreeCellEditor
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected boolean |
canEdit
|
protected javax.swing.event.ChangeEvent |
changeEvent
the event to fire |
protected javax.swing.Icon |
collapsedIcon
the icon for collapsed nodes |
protected java.awt.Color |
colSelBg
the differnet colors |
protected java.awt.Color |
colSelFg
the differnet colors |
protected javax.swing.tree.TreeCellEditor |
defaultEditor
the default editor used, if the node isn't a MyCheckMutableTreeNode |
protected javax.swing.tree.DefaultTreeCellRenderer |
defaultRenderer
|
protected java.lang.Object |
editingValue
saves the actual editing value |
protected EntityTreeCellRenderer |
entityRenderer
|
protected javax.swing.Icon |
expandedIcon
the icon for expanded nodes |
protected boolean |
isCheckBox
defines if a checkbox is used |
protected boolean |
isDefaultEditorUsed
flag defines, if the default editor is used or this one |
protected javax.swing.tree.TreePath |
lastPath
last path that was selected. |
protected int |
lastRow
Row that was last passed into getTreeCellEditorComponent. |
protected javax.swing.Icon |
leafIcon
the icon for leafs |
protected javax.swing.event.EventListenerList |
listenerList
Event listeners |
protected javax.swing.border.Border |
normBorder
the borders for focus |
protected int |
offset
Used in editing. |
protected java.lang.Object |
oldRealValue
saves the old user object to return |
protected javax.swing.border.Border |
selBorder
the borders for focus |
protected javax.swing.Timer |
timer
Used before starting the editing session. |
protected javax.swing.JTree |
tree
JTree instance listening too. |
Fields inherited from class javax.swing.JComponent |
accessibleContext, TOOL_TIP_TEXT_KEY, ui, 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 | |
EntityTreeCellEditor(javax.swing.JTree tree)
The constructor. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Messaged when the timer fires, this will start the editing session. |
void |
addCellEditorListener(javax.swing.event.CellEditorListener l)
Add a listener to the list that's notified when the editor starts, stops, or cancels editing. |
void |
cancelCellEditing()
Tell the editor to cancel editing and not accept any partially edited value. |
protected boolean |
canEditImmediately(java.util.EventObject event)
Returns true if event is null, or it is a MouseEvent
with a click count > 2. |
protected void |
fireEditingCanceled()
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireEditingStopped()
Notify all listeners that have registered interest for notification on this event type. |
java.lang.Object |
getCellEditorValue()
Returns the value contained in the editor |
javax.swing.Icon |
getCollapsedIcon()
|
javax.swing.Icon |
getExpandedIcon()
|
javax.swing.Icon |
getLeafIcon()
|
java.awt.Component |
getTreeCellEditorComponent(javax.swing.JTree tree,
java.lang.Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
Configures the editor. |
protected boolean |
inHitRegion(int x,
int y)
Returns true if x is inside the text region of
the renderer, not the icon part. |
boolean |
isCellEditable(java.util.EventObject anEvent)
Ask the editor if it can start editing using anEvent. |
void |
mouseClicked(java.awt.event.MouseEvent me)
From mouse listener, not used yet |
void |
mouseEntered(java.awt.event.MouseEvent me)
From mouse listener, not used |
void |
mouseExited(java.awt.event.MouseEvent me)
From mouse listener, not used |
void |
mousePressed(java.awt.event.MouseEvent me)
From mouse listener, not used |
void |
mouseReleased(java.awt.event.MouseEvent me)
From mouse listener, not used |
void |
removeCellEditorListener(javax.swing.event.CellEditorListener l)
Remove a listener from the list that's notified |
void |
setCollapsedIcon(javax.swing.Icon icon)
Method to set the collapsed icon (for next use) It is not updated by changed LnF |
void |
setExpandedIcon(javax.swing.Icon icon)
Method to set the expanded icon (for next use) It is not updated by changed LnF |
void |
setLeafIcon(javax.swing.Icon icon)
Method to set the leaf icon (for next use) It is not updated by changed LnF |
protected void |
setTree(javax.swing.JTree newTree)
Sets the tree currently editing for. |
boolean |
shouldSelectCell(java.util.EventObject anEvent)
The return value of shouldSelectCell() is a boolean indicating whether the editing cell should be selected or not. |
protected boolean |
shouldStartEditingTimer(java.util.EventObject event)
Returns true if event is a MouseEvent and the click
count is 1. |
protected void |
startEditingTimer()
Starts the editing timer. |
boolean |
stopCellEditing()
Tell the editor to stop editing and accept any partially edited value as the value of the editor. |
void |
valueChanged(javax.swing.event.TreeSelectionEvent e)
Resets lastPath. |
Methods inherited from class org.annotation.wordfreak.chooser.EntityTreeNode |
add, add, addActionListener, getCodes, getDivider, getEntities, getID, getText, isActionClick, isSelected, main, remove, setDisplay, setDivider, setEntities, setForeground, setID, setSelected, updateText |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, 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, 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 |
Field Detail |
protected javax.swing.event.EventListenerList listenerList
protected transient javax.swing.event.ChangeEvent changeEvent
protected transient javax.swing.Timer timer
protected boolean canEdit
protected transient javax.swing.tree.TreePath lastPath
protected transient int offset
protected transient int lastRow
protected javax.swing.tree.TreeCellEditor defaultEditor
protected boolean isDefaultEditorUsed
protected transient javax.swing.JTree tree
protected boolean isCheckBox
protected java.lang.Object oldRealValue
protected java.lang.Object editingValue
protected javax.swing.Icon expandedIcon
protected javax.swing.Icon collapsedIcon
protected javax.swing.Icon leafIcon
protected javax.swing.border.Border selBorder
protected javax.swing.border.Border normBorder
protected java.awt.Color colSelFg
protected java.awt.Color colSelBg
protected EntityTreeCellRenderer entityRenderer
protected javax.swing.tree.DefaultTreeCellRenderer defaultRenderer
Constructor Detail |
public EntityTreeCellEditor(javax.swing.JTree tree)
tree
- is the tree listenening tooMethod Detail |
public java.awt.Component getTreeCellEditorComponent(javax.swing.JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
getTreeCellEditorComponent
in interface javax.swing.tree.TreeCellEditor
tree
- the JTree that is asking the editor to edit This parameter can be null.value
- the value of the cell to be edited.isSelected
- true is the cell is to be renderer with selection highlightingexpanded
- true if the node is expandedleaf
- true if the node is a leaf noderow
- the row index of the node being edited
public java.lang.Object getCellEditorValue()
getCellEditorValue
in interface javax.swing.CellEditor
public boolean isCellEditable(java.util.EventObject anEvent)
isCellEditable
in interface javax.swing.CellEditor
anEvent
- the event the editor should use to consider whether to begin editing or not.
shouldSelectCell(java.util.EventObject)
public boolean shouldSelectCell(java.util.EventObject anEvent)
shouldSelectCell
in interface javax.swing.CellEditor
anEvent
- the event the editor should use to start editing.
isCellEditable(java.util.EventObject)
public boolean stopCellEditing()
stopCellEditing
in interface javax.swing.CellEditor
public void cancelCellEditing()
cancelCellEditing
in interface javax.swing.CellEditor
public void addCellEditorListener(javax.swing.event.CellEditorListener l)
addCellEditorListener
in interface javax.swing.CellEditor
l
- the CellEditorListenerpublic void removeCellEditorListener(javax.swing.event.CellEditorListener l)
removeCellEditorListener
in interface javax.swing.CellEditor
l
- the CellEditorListenerprotected void fireEditingStopped()
EventListenerList
protected void fireEditingCanceled()
EventListenerList
public void valueChanged(javax.swing.event.TreeSelectionEvent e)
valueChanged
in interface javax.swing.event.TreeSelectionListener
protected void startEditingTimer()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
protected boolean shouldStartEditingTimer(java.util.EventObject event)
event
is a MouseEvent and the click
count is 1.
protected boolean inHitRegion(int x, int y)
x
is inside the text region of
the renderer, not the icon part.
protected boolean canEditImmediately(java.util.EventObject event)
event
is null, or it is a MouseEvent
with a click count > 2.
protected void setTree(javax.swing.JTree newTree)
public void mouseClicked(java.awt.event.MouseEvent me)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent me)
mouseReleased
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent me)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent me)
mouseExited
in interface java.awt.event.MouseListener
public javax.swing.Icon getLeafIcon()
public void setLeafIcon(javax.swing.Icon icon)
icon
- is the new icon used for leafpublic javax.swing.Icon getExpandedIcon()
public void setExpandedIcon(javax.swing.Icon icon)
icon
- is the new icon used for expanded nodespublic javax.swing.Icon getCollapsedIcon()
public void setCollapsedIcon(javax.swing.Icon icon)
icon
- is the new icon used for collapsed nodes
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |