public class LayerTree extends DragJTree
| Modifier and Type | Class and Description |
|---|---|
private class |
LayerTree.CellRenderComponent |
private class |
LayerTree.LayerCellEditor |
private class |
LayerTree.LayerCellRenderer |
private class |
LayerTree.LayerTreeModel |
static class |
LayerTree.LayerTreeUI |
static class |
LayerTree.LayerWrapper |
DragJTree.TransferableTreePathjavax.swing.JTree.AccessibleJTree, javax.swing.JTree.DropLocation, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirectorjavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
private static java.awt.Color |
bgColor |
private static java.awt.Color |
brokenColor |
private boolean |
disableNotifications |
private Layer |
lastClickedLayer |
Delegate<java.lang.Object,java.lang.Object> |
listenerChanged |
Delegate<java.lang.Boolean,java.lang.Object> |
listenerChanging |
private LayerTree.LayerTreeModel |
model |
static int |
MOVE_LAYER_BOTTOM |
static int |
MOVE_LAYER_DOWN |
static int |
MOVE_LAYER_TOP |
static int |
MOVE_LAYER_UP |
private int |
nonLocalDragRow |
static int |
REVERSE_LAYERS |
private ContainerTopicMap |
rootStack |
private static java.awt.Color |
selectedColor |
private static java.awt.Color |
selectedColor2 |
private java.lang.Object |
selectedValue |
private Wandora |
wandora |
enableDrag, localDragging, selectedTreePathANCHOR_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, visibleRowCountlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
LayerTree(ContainerTopicMap rootStack) |
LayerTree(ContainerTopicMap rootStack,
Wandora wandora) |
| Modifier and Type | Method and Description |
|---|---|
int |
allowDrop(javax.swing.tree.TreePath destinationParent,
javax.swing.tree.TreePath destinationPosition,
javax.swing.tree.TreePath source)
Checks if drop is allowed in the destination.
|
int |
allowNonLocalDrop(java.awt.dnd.DropTargetEvent e) |
void |
arrangeLayers(int options) |
void |
arrangeLayers(Layer selected,
int options) |
void |
createLayer(ContainerTopicMap container) |
void |
deleteLayer() |
void |
deleteLayer(Layer l) |
void |
doDrop(javax.swing.tree.TreePath destinationParent,
javax.swing.tree.TreePath destinationPosition,
javax.swing.tree.TreePath source,
int action)
Performs the drop event.
|
void |
expandAll() |
protected void |
expandAll(javax.swing.tree.TreePath path) |
void |
expandPath(java.util.ArrayList<java.lang.String> path) |
Layer |
findLayerFor(TopicMap tm) |
javax.swing.tree.TreePath |
findPathFor(Layer layer) |
javax.swing.tree.TreePath |
findPathFor(TopicMap tm) |
int |
findRowFor(TopicMap tm) |
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getAllExpandedPaths() |
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getAllExpandedPaths(javax.swing.tree.TreePath root) |
java.util.ArrayList<Layer> |
getAllLayers() |
private ContainerTopicMap |
getContainerTopicMap(TopicMap tm) |
protected javax.swing.JPopupMenu |
getContextMenuFor(LayerTree.LayerWrapper layerWrapper) |
protected javax.swing.JPopupMenu |
getContextMenuFor(TopicMap tm) |
Layer |
getLastClickedLayer() |
ContainerTopicMap |
getRootStack() |
Layer |
getSelectedLayer() |
java.lang.String |
getSelectedName() |
protected void |
handleMouseClick(java.awt.event.MouseEvent e) |
private void |
initCellRenderer(LayerTree.CellRenderComponent c,
java.lang.Object value,
int row) |
private boolean |
isContainerTopicMap(TopicMap tm) |
boolean |
isSelectedReadOnly() |
static void |
main(java.lang.String[] args) |
void |
modifyLayer() |
void |
modifyLayer(Layer modifyLayer) |
javax.swing.tree.TreePath |
nameToTreePath(java.util.ArrayList<java.lang.String> path) |
void |
nonLocalDragEnter(java.awt.dnd.DropTargetDragEvent dtde)
Override this method if you wish to process drag and drop events originating from
outside this component.
|
void |
nonLocalDragExit(java.awt.dnd.DropTargetEvent dtde)
Override this method if you wish to process drag and drop events originating from
outside this component.
|
void |
nonLocalDragOver(java.awt.dnd.DropTargetDragEvent dtde)
Override this method if you wish to process drag and drop events originating from
outside this component.
|
void |
nonLocalDrop(java.awt.dnd.DropTargetDropEvent dtde)
Override this method if you wish to process drag and drop events originating from
outside this component.
|
void |
nonLocalDropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
Override this method if you wish to process drag and drop events originating from
outside this component.
|
protected void |
notifyChanged() |
protected boolean |
notifyChanging() |
protected void |
openPopupFor(javax.swing.tree.TreePath path,
java.lang.Object source,
int x,
int y) |
void |
paint(java.awt.Graphics g) |
void |
refreshTree() |
void |
resetLayers() |
void |
selectLayer(Layer layer) |
void |
setChangedListener(Delegate<java.lang.Object,java.lang.Object> listener) |
void |
setChangingListener(Delegate<java.lang.Boolean,java.lang.Object> listener) |
protected void |
setSelectedValue(java.lang.Object value) |
java.util.ArrayList<java.lang.String> |
treeToNamePath(javax.swing.tree.TreePath path) |
autoscroll, getAutoscrollInsets, getTransferable, initialize, isDescendant, isDragEnabled, setDragEnabledaddSelectionInterval, 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, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUIaddAncestorListener, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, updateadd, 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, validateTreeaction, 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, 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, transferFocusBackward, transferFocusUpCycleprivate static java.awt.Color bgColor
private static java.awt.Color selectedColor
private static java.awt.Color selectedColor2
private static java.awt.Color brokenColor
private ContainerTopicMap rootStack
private LayerTree.LayerTreeModel model
public Delegate<java.lang.Object,java.lang.Object> listenerChanged
public Delegate<java.lang.Boolean,java.lang.Object> listenerChanging
private int nonLocalDragRow
private Wandora wandora
private Layer lastClickedLayer
private java.lang.Object selectedValue
private boolean disableNotifications
public static final int MOVE_LAYER_UP
public static final int MOVE_LAYER_DOWN
public static final int MOVE_LAYER_TOP
public static final int MOVE_LAYER_BOTTOM
public static final int REVERSE_LAYERS
public LayerTree(ContainerTopicMap rootStack)
public LayerTree(ContainerTopicMap rootStack, Wandora wandora)
public ContainerTopicMap getRootStack()
protected void handleMouseClick(java.awt.event.MouseEvent e)
public void selectLayer(Layer layer)
protected void setSelectedValue(java.lang.Object value)
public Layer getLastClickedLayer()
protected void openPopupFor(javax.swing.tree.TreePath path,
java.lang.Object source,
int x,
int y)
protected javax.swing.JPopupMenu getContextMenuFor(LayerTree.LayerWrapper layerWrapper)
protected javax.swing.JPopupMenu getContextMenuFor(TopicMap tm)
public Layer getSelectedLayer()
public boolean isSelectedReadOnly()
public java.lang.String getSelectedName()
public void arrangeLayers(int options)
public void arrangeLayers(Layer selected, int options)
public void deleteLayer()
public void deleteLayer(Layer l)
public void createLayer(ContainerTopicMap container)
public java.util.ArrayList<Layer> getAllLayers()
public javax.swing.tree.TreePath findPathFor(Layer layer)
public javax.swing.tree.TreePath findPathFor(TopicMap tm)
public int findRowFor(TopicMap tm)
public void setChangedListener(Delegate<java.lang.Object,java.lang.Object> listener)
public void setChangingListener(Delegate<java.lang.Boolean,java.lang.Object> listener)
protected boolean notifyChanging()
protected void notifyChanged()
public void refreshTree()
public void modifyLayer()
public void modifyLayer(Layer modifyLayer)
public void resetLayers()
public java.util.ArrayList<java.lang.String> treeToNamePath(javax.swing.tree.TreePath path)
public javax.swing.tree.TreePath nameToTreePath(java.util.ArrayList<java.lang.String> path)
public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getAllExpandedPaths()
public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getAllExpandedPaths(javax.swing.tree.TreePath root)
public void expandPath(java.util.ArrayList<java.lang.String> path)
public void expandAll()
protected void expandAll(javax.swing.tree.TreePath path)
private boolean isContainerTopicMap(TopicMap tm)
private ContainerTopicMap getContainerTopicMap(TopicMap tm)
public int allowNonLocalDrop(java.awt.dnd.DropTargetEvent e)
public void nonLocalDrop(java.awt.dnd.DropTargetDropEvent dtde)
DragJTreenonLocalDrop in class DragJTreepublic void nonLocalDragEnter(java.awt.dnd.DropTargetDragEvent dtde)
DragJTreenonLocalDragEnter in class DragJTreepublic void nonLocalDragOver(java.awt.dnd.DropTargetDragEvent dtde)
DragJTreenonLocalDragOver in class DragJTreepublic void nonLocalDragExit(java.awt.dnd.DropTargetEvent dtde)
DragJTreenonLocalDragExit in class DragJTreepublic void nonLocalDropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
DragJTreenonLocalDropActionChanged in class DragJTreepublic int allowDrop(javax.swing.tree.TreePath destinationParent,
javax.swing.tree.TreePath destinationPosition,
javax.swing.tree.TreePath source)
DragJTreeallowDrop in class DragJTreedestinationParent - The parent of the destination where user is about to drop something.destinationPosition - The position after which user is about to drop something. May be
null in which case the item is to be dropped as the first child of
destinationParent.source - The item being dragged.public void doDrop(javax.swing.tree.TreePath destinationParent,
javax.swing.tree.TreePath destinationPosition,
javax.swing.tree.TreePath source,
int action)
DragJTreedoDrop in class DragJTreedestinationParent - The parent of the destination where user is about to drop something.destinationPosition - The position after which user is about to drop something. May be
null in which case the item is to be dropped as the first child of
destinationParent.source - The item being dragged.action - The drop action. One of the action constants in java.awt.dnd.DnDConstants.public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentprivate void initCellRenderer(LayerTree.CellRenderComponent c, java.lang.Object value, int row)
public static void main(java.lang.String[] args)
Copyright 2004-2015 Wandora Team