|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
dsto.dfc.swing.tree.DfcTree
public class DfcTree
DFC'ified JTree, adding support for operations based on the
extended DfcTreeModel. Includes support for:
Iconic and
IconicFolder item display.
SelectionEventSource support.
DfcTreeModel,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
DfcTree.MyTreeCellEditor
Extension of DefaultTreeCellEditor to support value-based icons used in MyTreeCellRenderer |
protected class |
DfcTree.MyTreeCellRenderer
Extends default tree cell renderer to add support for Iconic values. |
| Nested classes/interfaces inherited from class javax.swing.JTree |
|---|
JTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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.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 | |
|---|---|
DfcTree()
|
|
DfcTree(TreeModel model)
|
|
| Method Summary | |
|---|---|
void |
addSelectedEntry(Object entry)
|
void |
addSelectionListener(SelectionListener l)
|
Transferable |
cnpCopy()
Perform copy operation. |
Transferable |
cnpCut()
Perform cut operation. |
boolean |
cnpPaste(Transferable transferable)
Perform paste operation. |
int[] |
deleteRows(int[] rows)
Delete a number of rows from the model, ensuring correct deletion order. |
void |
disableEditCommands()
|
void |
dispose()
Dispose of the object (unregister listeners, close open resources etc). |
protected void |
doExpandAll(TreePath path,
int levelCount,
Selector selector)
|
void |
enableDragAndDrop()
|
void |
enableEditCommands()
|
void |
endDrag(DragSourceDropEvent e,
boolean moveData)
|
void |
executeDrop(DropTargetDropEvent e)
Execute a drop action. |
void |
expandAll()
Expand all nodes in the tree. |
void |
expandAll(int maxLevel)
Expand all nodes in the tree up to a given level (eg level == 1 would expand only the root node). |
void |
expandAll(TreePath path)
Expand all nodes in the tree starting from a given entry. |
void |
expandAll(TreePath path,
int maxLevel)
Expand all nodes in the tree from a given path up to a given level (eg level == 1 would expand only the entry itself, level == 2 would expand the entry and its children etc). |
void |
expandAll(TreePath path,
int maxLevel,
Selector selector)
Expand all nodes in the tree from a given path up to a given level. |
void |
expandChildren(TreePath parentPath,
Object[] children)
|
boolean |
getCnpCommandsEnabled()
|
CommandView |
getCommandView(String viewName)
Get the command view instance for a given view name. |
DfcTreeModel |
getDfcTreeModel()
If the current model is a DfcTreeModel return it, otherwise return null. |
static Object[] |
getPathForEntry(TreeModel model,
Object entry)
|
List |
getSelectedEntries()
|
Object |
getSelectedEntry()
|
int |
getSupportedDragActions()
Return a mask of possible drag actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE. |
int |
getSupportedDropActions()
Return a mask of actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE. |
void |
hideDragUnderFeedback()
Remove any drag under feedback displayed by showDragUnderFeedback (). |
boolean |
isCnpCopyEnabled()
True if a copy operation is possible. |
boolean |
isCnpCutEnabled()
True if a cut operation is possible. |
boolean |
isCnpPasteEnabled(Transferable transferable)
True if a paste operation with a given transferable is possible. |
boolean |
isDragOK(DragGestureEvent e)
Return true if starting a drag in the given context is possible. |
boolean |
isDropOK(DropTargetDragEvent e)
Return true if a drop in the context in a DropTargetDragEvent is possible. |
void |
removeSelectionListener(SelectionListener l)
|
void |
selectEntry(Object entry)
|
protected void |
selectionChanged(TreeSelectionEvent e)
|
void |
setCnpCommandsEnabled(boolean newValue)
|
void |
setEditable(boolean flag)
|
void |
setSelectedEntry(Object entry)
|
void |
setSelectionModel(TreeSelectionModel newSelModel)
|
void |
showDragUnderFeedback(boolean dropOK,
DropTargetDragEvent e)
Display any drag under (ie displayed under the mouse in the component) feedback. |
Transferable |
startDrag(DragGestureEvent e)
Start a drag operation. |
protected void |
updateCnpEnabled()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface dsto.dfc.util.PropertyEventSource |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public DfcTree()
public DfcTree(TreeModel model)
| Method Detail |
|---|
public void dispose()
Disposable
dispose in interface Disposablepublic void enableDragAndDrop()
public void enableEditCommands()
public void disableEditCommands()
public void setCnpCommandsEnabled(boolean newValue)
public boolean getCnpCommandsEnabled()
public void setEditable(boolean flag)
setEditable in class JTreepublic void selectEntry(Object entry)
public DfcTreeModel getDfcTreeModel()
public void setSelectionModel(TreeSelectionModel newSelModel)
setSelectionModel in class JTree
public void expandChildren(TreePath parentPath,
Object[] children)
public void expandAll()
public void expandAll(int maxLevel)
public void expandAll(TreePath path)
public void expandAll(TreePath path,
int maxLevel)
public void expandAll(TreePath path,
int maxLevel,
Selector selector)
path - The path to start expanding from.maxLevel - The number of levels to expand (eg level == 1
would expand only the entry itself, level == 2 would expand the
entry and its children etc).selector - Only paths that are matched by this selector will
be expanded. The matches () method of the selector is passed a
TreePath instance.
protected void doExpandAll(TreePath path,
int levelCount,
Selector selector)
public int[] deleteRows(int[] rows)
throws UnsupportedOperationException
rows - The rows to delete.
UnsupportedOperationException - if the current model is
not a DfcTreeModel or if the model vetoed a delete operation.public Object getSelectedEntry()
public void setSelectedEntry(Object entry)
public void addSelectedEntry(Object entry)
public List getSelectedEntries()
public static Object[] getPathForEntry(TreeModel model,
Object entry)
public void addSelectionListener(SelectionListener l)
addSelectionListener in interface SelectionEventSourcepublic void removeSelectionListener(SelectionListener l)
removeSelectionListener in interface SelectionEventSourcepublic CommandView getCommandView(String viewName)
CommandSource
getCommandView in interface CommandSourceviewName - The name of the view to be retrieved. Usually one of
CommandView.MAIN_MENU_VIEW, CommandView.CONTEXT_MENU_VIEW or
CommandView.TOOLBAR_VIEW, but custom views may be supported also.
public boolean isCnpCopyEnabled()
CnpProvider
isCnpCopyEnabled in interface CnpProviderpublic boolean isCnpCutEnabled()
CnpProvider
isCnpCutEnabled in interface CnpProviderpublic boolean isCnpPasteEnabled(Transferable transferable)
CnpProvider
isCnpPasteEnabled in interface CnpProvider
public Transferable cnpCopy()
throws UnsupportedOperationException,
CloneNotSupportedException
CnpProvider
cnpCopy in interface CnpProviderUnsupportedOperationException - if copy operation not supported.
CloneNotSupportedException - if the data could not be cloned.
public Transferable cnpCut()
throws UnsupportedOperationException,
CloneNotSupportedException
CnpProvider
cnpCut in interface CnpProviderUnsupportedOperationException - if cut operation not supported.
CloneNotSupportedException - if the data could not be cloned.
public boolean cnpPaste(Transferable transferable)
throws UnsupportedOperationException,
UnsupportedFlavorException,
CloneNotSupportedException,
IOException
CnpProvider
cnpPaste in interface CnpProvidertransferable - The data to be pasted.
UnsupportedOperationException - if paste operation not supported.
UnsupportedFlavorException - if transferable does not contain a
supported data flavor for pasting.
CloneNotSupportedException - if the data could not be cloned.
IOException - if IO exception occurs during data transfer.protected final void updateCnpEnabled()
public int getSupportedDragActions()
DragComponentDragComponent.isDragOK(java.awt.dnd.DragGestureEvent).
getSupportedDragActions in interface DragComponentpublic int getSupportedDropActions()
DropComponentDropComponent.isDropOK(java.awt.dnd.DropTargetDragEvent).
getSupportedDropActions in interface DropComponentpublic boolean isDragOK(DragGestureEvent e)
DragComponent
isDragOK in interface DragComponente - The drag context.public Transferable startDrag(DragGestureEvent e)
DragComponent
startDrag in interface DragComponente - The gesture that started the drag.
public void endDrag(DragSourceDropEvent e,
boolean moveData)
endDrag in interface DragComponentpublic boolean isDropOK(DropTargetDragEvent e)
DropComponent
isDropOK in interface DropComponente - The drop context.public void executeDrop(DropTargetDropEvent e)
DropComponent
executeDrop in interface DropComponent
public void showDragUnderFeedback(boolean dropOK,
DropTargetDragEvent e)
DropComponent
showDragUnderFeedback in interface DropComponentdropOK - The value of isDropOK () when the mouse first
entered the component.e - The drop context.public void hideDragUnderFeedback()
DropComponent
hideDragUnderFeedback in interface DropComponentprotected void selectionChanged(TreeSelectionEvent e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||