|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.swing.visuals.dualselector.JTreeDualSelectorAdapter
public class JTreeDualSelectorAdapter
JTreeDualSelectorAdapter is a class that supports using a JTree in a dual selector.
| Field Summary | |
|---|---|
protected javax.swing.JTree |
component
the actual JTree component |
protected javax.swing.JScrollPane |
containerComponent
a scroll pane used by the JTree component |
java.awt.dnd.DragSource |
dragSource
enables this component to be a Drag Source |
java.awt.dnd.DropTarget |
dropTarget
enables this component to be a dropTarget |
protected javax.swing.JComponent |
parentSelector
the parent component |
protected java.lang.Object |
sourceTargetNode
a node in the target tree used add items from the source tree |
| Constructor Summary | |
|---|---|
JTreeDualSelectorAdapter(javax.swing.JComponent parent)
Default constructor. |
|
JTreeDualSelectorAdapter(javax.swing.JTree tree,
javax.swing.JComponent parent)
Constructor method that takes a JTree instance for use in the component. |
|
| Method Summary | |
|---|---|
void |
addItems(java.util.List newItems)
Adds the items to the component. |
boolean |
canMove(int[] indices,
int offset)
Determines whether a particular move is allowed. |
void |
clearSelections()
Clears the selections made on the component. |
void |
dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
this message goes to DragSourceListener, informing it that the dragging has ended |
void |
dragEnter(java.awt.dnd.DragSourceDragEvent event)
this message goes to DragSourceListener, informing it that the dragging has entered the DropSite |
void |
dragEnter(java.awt.dnd.DropTargetDragEvent event)
is invoked when you are dragging over the DropSite |
void |
dragExit(java.awt.dnd.DragSourceEvent event)
this message goes to DragSourceListener, informing it that the dragging has exited the DropSite |
void |
dragExit(java.awt.dnd.DropTargetEvent event)
is invoked when you are exit the DropSite without dropping |
void |
dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
a drag gesture has been initiated |
void |
dragOver(java.awt.dnd.DragSourceDragEvent event)
this message goes to DragSourceListener, informing it that the dragging is currently ocurring over the DropSite |
void |
dragOver(java.awt.dnd.DropTargetDragEvent event)
is invoked when a drag operation is going on |
void |
drop(java.awt.dnd.DropTargetDropEvent event)
a drop has occurred |
void |
dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
is invoked when the user changes the dropAction |
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
is invoked if the use modifies the current drop gesture |
java.util.List |
getAllItems()
Returns all items. |
java.util.List |
getAllMoveableItems()
Returns all of the items that are moveable based on the status of the movement control options. |
javax.swing.JComponent |
getComponent()
Returns the actual component. |
javax.swing.JComponent |
getContainerComponent()
Returns the container holding a component. |
int |
getCount()
Returns the number of items in the component. |
int |
getLastSelectedIndex()
Returns the index of the last item selected. |
int |
getSelectedCount()
Returns the number of items selected. |
java.util.List |
getSelectedItems()
Returns the user selected items. |
boolean |
isChildNodesOnlyMoveable()
Returns true if only the child nodes can be moved. |
boolean |
isInAdapter(java.lang.Object item)
Returns true if the item is a member of the adapter model. |
boolean |
isParentNodeMoveable()
Returns the true if the parents can be moved, false if not. |
boolean |
isParentNodeOnlyMoveable()
Returns the value for moving parent nodes only or parents and children |
void |
removeItems(java.util.List removeItems)
Removes the items from the component. |
void |
setChildNodesOnlyMoveable(boolean nodes)
Sets the value allowing only child nodes to be moveable. |
void |
setParentNodesMoveable(boolean moveableParentNodes)
Sets the value allowing parent nodes to be moved. |
void |
setParentNodesOnlyMoveable(boolean parentNodesMoveable)
Sets the value for moving parent nodes only or parents and children |
void |
setSelectedIndex(int index)
Selects the item at the specified index. |
void |
setSourceTargetNode(java.lang.Object sourceTargetNode)
Sets the target node used to move items from the source component. |
| Field Detail |
|---|
protected javax.swing.JTree component
protected javax.swing.JScrollPane containerComponent
protected javax.swing.JComponent parentSelector
protected java.lang.Object sourceTargetNode
public java.awt.dnd.DropTarget dropTarget
public java.awt.dnd.DragSource dragSource
| Constructor Detail |
|---|
public JTreeDualSelectorAdapter(javax.swing.JComponent parent)
parent - the parent component
public JTreeDualSelectorAdapter(javax.swing.JTree tree,
javax.swing.JComponent parent)
tree - a JTree instanceparent - the parent component| Method Detail |
|---|
public int getCount()
getCount in interface DualSelectorInterfaceDualSelectorInterface.getCount()public int getSelectedCount()
getSelectedCount in interface DualSelectorInterfaceDualSelectorInterface.getSelectedCount()public int getLastSelectedIndex()
getLastSelectedIndex in interface DualSelectorInterfaceDualSelectorInterface.getLastSelectedIndex()public void setSelectedIndex(int index)
setSelectedIndex in interface DualSelectorInterfaceindex - the index of the item to be selectedDualSelectorInterface.setSelectedIndex(int)public java.util.List getSelectedItems()
getSelectedItems in interface DualSelectorInterfaceDualSelectorInterface.getSelectedItems()public java.util.List getAllItems()
getAllItems in interface DualSelectorInterfaceDualSelectorInterface.getAllItems()public java.util.List getAllMoveableItems()
getAllMoveableItems in interface DualSelectorInterfaceDualSelectorInterface.getAllMoveableItems()public javax.swing.JComponent getContainerComponent()
getContainerComponent in interface DualSelectorInterfaceDualSelectorInterface.getContainerComponent()public javax.swing.JComponent getComponent()
getComponent in interface DualSelectorInterfaceDualSelectorInterface.getComponent()public void addItems(java.util.List newItems)
addItems in interface DualSelectorInterfacenewItems - the items to be added.DualSelectorInterface.addItems(List)public void setSourceTargetNode(java.lang.Object sourceTargetNode)
setSourceTargetNode in interface DualSelectorTreeInterfacesourceTargetNode - the tree node used as the targetDualSelectorTreeInterface.setSourceTargetNode(Object)public void removeItems(java.util.List removeItems)
removeItems in interface DualSelectorInterfaceremoveItems - items to be removed from the componentDualSelectorInterface.removeItems(List)public void clearSelections()
clearSelections in interface DualSelectorInterfaceDualSelectorInterface.clearSelections()public void setParentNodesOnlyMoveable(boolean parentNodesMoveable)
parentNodesMoveable - set to true if only parents are to be moved.public boolean isParentNodeOnlyMoveable()
public void setParentNodesMoveable(boolean moveableParentNodes)
moveableParentNodes - set to true if parents can be selected for move/copy.public boolean isParentNodeMoveable()
public void setChildNodesOnlyMoveable(boolean nodes)
nodes - set to true if only child nodes are moveable.isChildNodesOnlyMoveable()public boolean isChildNodesOnlyMoveable()
setChildNodesOnlyMoveable(boolean)public boolean isInAdapter(java.lang.Object item)
isInAdapter in interface DualSelectorInterfaceitem - the object to be checked
DualSelectorInterface.isInAdapter(Object)
public boolean canMove(int[] indices,
int offset)
indices - the indices of the items to be movedoffset - the number of places to move the items
public void dragEnter(java.awt.dnd.DropTargetDragEvent event)
dragEnter in interface java.awt.dnd.DropTargetListenerevent - DropTargetDragEventDropTargetListener.dragEnter(DropTargetDragEvent)public void dragExit(java.awt.dnd.DropTargetEvent event)
dragExit in interface java.awt.dnd.DropTargetListenerevent - DropTargetEventDropTargetListener.dragExit(DropTargetEvent)public void dragOver(java.awt.dnd.DropTargetDragEvent event)
dragOver in interface java.awt.dnd.DropTargetListenerevent - DropTargetDragEventDropTargetListener.dragOver(DropTargetDragEvent)public void drop(java.awt.dnd.DropTargetDropEvent event)
drop in interface java.awt.dnd.DropTargetListenerevent - DropTargetDropEventDropTargetListener.drop(DropTargetDropEvent)public void dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
dropActionChanged in interface java.awt.dnd.DropTargetListenerevent - DropTargetDragEventDropTargetListener.dropActionChanged(DropTargetDragEvent)public void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
dragGestureRecognized in interface java.awt.dnd.DragGestureListenerevent - DragGestureEventDragGestureListener.dragGestureRecognized(DragGestureEvent)public void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
dragDropEnd in interface java.awt.dnd.DragSourceListenerevent - DragSourceDropEventDragSourceListener.dragDropEnd(DragSourceDropEvent)public void dragEnter(java.awt.dnd.DragSourceDragEvent event)
dragEnter in interface java.awt.dnd.DragSourceListenerevent - DragSourceDragEventDragSourceListener.dragEnter(DragSourceDragEvent)public void dragExit(java.awt.dnd.DragSourceEvent event)
dragExit in interface java.awt.dnd.DragSourceListenerevent - DragSourceEventDragSourceListener.dragExit(DragSourceEvent)public void dragOver(java.awt.dnd.DragSourceDragEvent event)
dragOver in interface java.awt.dnd.DragSourceListenerevent - DragSourceDragEventDragSourceListener.dragOver(DragSourceDragEvent)public void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
dropActionChanged in interface java.awt.dnd.DragSourceListenerevent - DragSourceDragEventDragSourceListener.dropActionChanged(DragSourceDragEvent)
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||