public class TopicTree extends SimpleTree implements Clipboardable, java.awt.event.MouseListener, TopicMapListener
JTree type structure for topics.
Each tree node represents single topic. Node's children depend
on associations and instance-of relations of node topic. Associations
represented as a parent-child relation are user configurable. Also
TopicTree's root node is user configurable.| Modifier and Type | Class and Description |
|---|---|
static class |
TopicTree.TopicTreeTransferable |
private class |
TopicTree.TopicTreeTransferHandler |
javax.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 TopicTreeRelation[] |
associations |
private boolean |
autoCreateTopicsInPaste |
private TopicTreePanel |
chooser |
protected TopicTreeModel |
model |
private java.awt.event.MouseEvent |
mouseEvent |
private boolean |
needsRefresh |
private boolean |
openWithDoubleClick |
protected Topic |
rootTopic |
protected java.lang.String |
rootTopicSI |
private java.util.ArrayList<TopicTreeRelation> |
selectedAs |
private java.util.HashSet<Locator> |
selectedAsLocators |
protected Wandora |
wandora |
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, visibleRowCountlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
TopicTree(java.lang.String rootTopicSI,
Wandora wandora)
Creates a new instance of TopicTree
|
TopicTree(java.lang.String rootTopicSI,
Wandora wandora,
java.util.Set<java.lang.String> selectedAssociations,
TopicTreeRelation[] associations) |
TopicTree(java.lang.String rootTopicSI,
Wandora wandora,
java.util.Set<java.lang.String> selectedAssociations,
TopicTreeRelation[] associations,
TopicTreePanel chooser) |
TopicTree(java.lang.String rootTopicSI,
Wandora wandora,
TopicTreePanel chooser) |
| Modifier and Type | Method and Description |
|---|---|
void |
associationChanged(Association a)
A notification used to report general or large changes in association.
|
void |
associationPlayerChanged(Association a,
Topic role,
Topic newPlayer,
Topic oldPlayer)
A notification that a player in an association with a certain role has
been changed.
|
void |
associationRemoved(Association a)
A notification that an association has been completely removed.
|
void |
associationTypeChanged(Association a,
Topic newType,
Topic oldType)
A notification that association type has changed.
|
private <T> boolean |
collectionsOverlap(java.util.Collection<T> a,
java.util.Collection<T> b) |
void |
copy() |
void |
cut() |
void |
expandPath(java.util.ArrayList<Tuples.T2<Locator,java.lang.String>> path) |
java.util.ArrayList<java.util.ArrayList<Tuples.T2<Locator,java.lang.String>>> |
getAllExpandedPaths(javax.swing.tree.TreePath root) |
java.lang.String |
getCopyString() |
java.util.ArrayList<Tuples.T2<Locator,java.lang.String>> |
getLocatorPath(javax.swing.tree.TreePath tp) |
boolean |
getNeedsRefresh() |
Topic |
getSelection() |
Topic |
getTopicAt(int x,
int y) |
Topic |
getTopicAt(java.awt.event.MouseEvent e) |
Topic |
getTopicAt(java.awt.Point point) |
protected Topic |
getTopicForIdentifier(java.lang.String id) |
javax.swing.tree.TreePath |
getTreePath(java.util.ArrayList<Tuples.T2<Locator,java.lang.String>> path) |
java.lang.Object |
getValueAt(int x,
int y) |
java.lang.Object |
getValueAt(java.awt.event.MouseEvent e) |
java.lang.Object |
getValueAt(java.awt.Point p) |
protected void |
handlePopupMouseEvent(java.awt.event.MouseEvent e) |
boolean |
isBroken() |
void |
mouseClicked(java.awt.event.MouseEvent mouseEvent) |
void |
mouseEntered(java.awt.event.MouseEvent mouseEvent) |
void |
mouseExited(java.awt.event.MouseEvent mouseEvent) |
void |
mousePressed(java.awt.event.MouseEvent mouseEvent) |
void |
mouseReleased(java.awt.event.MouseEvent mouseEvent) |
void |
paste() |
private void |
recreateModel() |
void |
refresh() |
void |
refreshSize() |
boolean |
selectTopic(Topic t) |
void |
setNeedsRefresh(boolean value) |
void |
setOpenWithDoubleClick(boolean value) |
void |
topicBaseNameChanged(Topic t,
java.lang.String newName,
java.lang.String oldName)
Notification that the base name has been changed.
|
void |
topicChanged(Topic t)
A notification used to report general or large changes in topic, for example when topics are merged.
|
void |
topicDataChanged(Topic t,
Topic type,
Topic version,
java.lang.String newValue,
java.lang.String oldValue)
Notification that topic occurrence has been changed.
|
void |
topicRemoved(Topic t)
Notification that a topic has been completely removed.
|
void |
topicSubjectIdentifierChanged(Topic t,
Locator added,
Locator removed)
Notification that a subject identifier has changed.
|
void |
topicSubjectLocatorChanged(Topic t,
Locator newLocator,
Locator oldLocator)
Notification that the subject locator has been changed.
|
void |
topicTypeChanged(Topic t,
Topic added,
Topic removed)
Notification that a topic type has changed.
|
void |
topicVariantChanged(Topic t,
java.util.Collection<Topic> scope,
java.lang.String newName,
java.lang.String oldName)
Notification that a variant name has been changed.
|
void |
update() |
void |
updateModel(java.lang.String rootSI,
java.util.Set<java.lang.String> selectedAssociations,
TopicTreeRelation[] associations) |
focusGained, focusLost, paintaddSelectionInterval, 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, 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 boolean needsRefresh
private java.util.ArrayList<TopicTreeRelation> selectedAs
private java.util.HashSet<Locator> selectedAsLocators
protected java.lang.String rootTopicSI
protected Topic rootTopic
protected TopicTreeModel model
protected Wandora wandora
private java.awt.event.MouseEvent mouseEvent
private TopicTreeRelation[] associations
private boolean openWithDoubleClick
private TopicTreePanel chooser
private boolean autoCreateTopicsInPaste
public TopicTree(java.lang.String rootTopicSI,
Wandora wandora)
throws TopicMapException
TopicMapExceptionpublic TopicTree(java.lang.String rootTopicSI,
Wandora wandora,
TopicTreePanel chooser)
throws TopicMapException
TopicMapExceptionpublic TopicTree(java.lang.String rootTopicSI,
Wandora wandora,
java.util.Set<java.lang.String> selectedAssociations,
TopicTreeRelation[] associations)
throws TopicMapException
TopicMapExceptionpublic TopicTree(java.lang.String rootTopicSI,
Wandora wandora,
java.util.Set<java.lang.String> selectedAssociations,
TopicTreeRelation[] associations,
TopicTreePanel chooser)
throws TopicMapException
TopicMapExceptionprivate <T> boolean collectionsOverlap(java.util.Collection<T> a,
java.util.Collection<T> b)
public boolean isBroken()
public void setNeedsRefresh(boolean value)
public boolean getNeedsRefresh()
public void topicSubjectIdentifierChanged(Topic t, Locator added, Locator removed) throws TopicMapException
TopicMapListenertopicSubjectIdentifierChanged in interface TopicMapListenerTopicMapExceptionpublic void topicBaseNameChanged(Topic t, java.lang.String newName, java.lang.String oldName) throws TopicMapException
TopicMapListenertopicBaseNameChanged in interface TopicMapListenerTopicMapExceptionpublic void topicTypeChanged(Topic t, Topic added, Topic removed) throws TopicMapException
TopicMapListenertopicTypeChanged in interface TopicMapListenerTopicMapExceptionpublic void topicVariantChanged(Topic t, java.util.Collection<Topic> scope, java.lang.String newName, java.lang.String oldName) throws TopicMapException
TopicMapListenertopicVariantChanged in interface TopicMapListenerTopicMapExceptionpublic void topicDataChanged(Topic t, Topic type, Topic version, java.lang.String newValue, java.lang.String oldValue) throws TopicMapException
TopicMapListenertopicDataChanged in interface TopicMapListenerTopicMapExceptionpublic void topicSubjectLocatorChanged(Topic t, Locator newLocator, Locator oldLocator) throws TopicMapException
TopicMapListenertopicSubjectLocatorChanged in interface TopicMapListenerTopicMapExceptionpublic void topicRemoved(Topic t) throws TopicMapException
TopicMapListenertopicRemoved in interface TopicMapListenerTopicMapExceptionpublic void topicChanged(Topic t) throws TopicMapException
TopicMapListenertopicChanged in interface TopicMapListenerTopicMapExceptionpublic void associationTypeChanged(Association a, Topic newType, Topic oldType) throws TopicMapException
TopicMapListenerassociationTypeChanged in interface TopicMapListenerTopicMapExceptionpublic void associationPlayerChanged(Association a, Topic role, Topic newPlayer, Topic oldPlayer) throws TopicMapException
TopicMapListenerassociationPlayerChanged in interface TopicMapListenerTopicMapExceptionpublic void associationRemoved(Association a) throws TopicMapException
TopicMapListenerassociationRemoved in interface TopicMapListenerTopicMapExceptionpublic void associationChanged(Association a) throws TopicMapException
TopicMapListenerassociationChanged in interface TopicMapListenerTopicMapExceptionpublic void setOpenWithDoubleClick(boolean value)
public void refreshSize()
private void recreateModel()
throws TopicMapException
TopicMapExceptionpublic void updateModel(java.lang.String rootSI,
java.util.Set<java.lang.String> selectedAssociations,
TopicTreeRelation[] associations)
throws TopicMapException
rootSI - Subject identifier of the topic that is used as root for the treeselectedAssociations - Names of the associations in associations array that
are used in this topic tree chooser.associations - A list of tree association types. Not all of them are
necessarily used in this topic tree chooser. selectedAssociations
contains the names of the used association types.TopicMapExceptionpublic boolean selectTopic(Topic t)
public Topic getSelection()
public void update()
public java.util.ArrayList<Tuples.T2<Locator,java.lang.String>> getLocatorPath(javax.swing.tree.TreePath tp) throws TopicMapException
TopicMapExceptionpublic javax.swing.tree.TreePath getTreePath(java.util.ArrayList<Tuples.T2<Locator,java.lang.String>> path) throws TopicMapException
TopicMapExceptionpublic java.util.ArrayList<java.util.ArrayList<Tuples.T2<Locator,java.lang.String>>> getAllExpandedPaths(javax.swing.tree.TreePath root) throws TopicMapException
TopicMapExceptionpublic void expandPath(java.util.ArrayList<Tuples.T2<Locator,java.lang.String>> path) throws TopicMapException
TopicMapExceptionpublic void refresh()
throws TopicMapException
TopicMapExceptionpublic void cut()
cut in interface Clipboardablepublic void paste()
paste in interface Clipboardablepublic void copy()
copy in interface Clipboardablepublic java.lang.String getCopyString()
protected Topic getTopicForIdentifier(java.lang.String id)
protected void handlePopupMouseEvent(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent mouseEvent)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent mouseEvent)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent mouseEvent)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent mouseEvent)
mouseReleased in interface java.awt.event.MouseListenerpublic java.lang.Object getValueAt(java.awt.event.MouseEvent e)
public java.lang.Object getValueAt(java.awt.Point p)
public java.lang.Object getValueAt(int x,
int y)
public Topic getTopicAt(java.awt.event.MouseEvent e)
public Topic getTopicAt(java.awt.Point point)
public Topic getTopicAt(int x, int y)
Copyright 2004-2015 Wandora Team