org.annotation.wordfreak.viewer
Class TreeTableViewer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.annotation.wordfreak.viewer.Viewer
                      extended byorg.annotation.wordfreak.viewer.TreeTableViewer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, AnnotationSchemeListener, DynamicFeatureTreeTableModel.TreeShouldExpandListener, EventListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, Plugin, java.io.Serializable, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeModelListener, javax.swing.event.TreeSelectionListener, WordFreakKeyboardFocusManager.HotKeyListener

public class TreeTableViewer
extends Viewer
implements java.awt.event.ActionListener, javax.swing.event.TreeSelectionListener, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeModelListener, DynamicFeatureTreeTableModel.TreeShouldExpandListener, java.awt.event.MouseListener, WordFreakKeyboardFocusManager.HotKeyListener

Displays annotations in a tree layout. This is most useful for annotation which have an inherient tree structure.

See Also:
Serialized Form

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
static java.lang.String MOVE_DOWN
           
static java.lang.String MOVE_UP
           
 
Fields inherited from class org.annotation.wordfreak.viewer.Viewer
currentAnnotation, FEATURE_NAME, features, fontName, groups, HORIZONTAL, labels, NONE, outcomes, relationColor, selection, separators, showRelations, sortCriteria, statusBar, swipe, VERTICAL, view
 
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
TreeTableViewer(java.lang.String type)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addProperty(DynamicFeature f, java.lang.String l, java.lang.String s)
           
 void adjustSelectionLeft()
           
 void adjustSelectionRight()
           
 void annotation(Annotation a)
          Notifies the listener to focus display the specified annotation.
 void collapseAll(javax.swing.tree.TreePath path)
           
 void copy()
           
 void cut()
           
 void dispose()
           
 void doDrop(javax.swing.tree.TreeNode child, javax.swing.tree.TreeNode newParent, javax.swing.tree.TreeNode oldParent)
           
 void doLink(javax.swing.tree.TreeNode source, javax.swing.tree.TreeNode target, int modifiers)
           
 void expandAll()
           
 void expandAll(javax.swing.tree.TreePath path)
           
static java.lang.String[] getNames()
           
 javax.swing.JPopupMenu getPopup()
          Returns a viewer specific popup menu.
 java.lang.String getTreeTextFromSelection()
           
 boolean hasPopup()
           
 void hotKeyPressed(java.lang.String name)
          Indicates that the hot key with the specified name has been pressed.
 boolean isValidDrop(javax.swing.tree.TreeNode childNode, javax.swing.tree.TreeNode newParentNode, javax.swing.tree.TreeNode oldParentNode)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void makeVisible(Annotation a)
          Notifies the listener to make sure the annotation is visible
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
protected  void paste(int modifiers)
           
 void rebuild()
          Instructs the viewer to rebuild itself because the annotations have changed in arbitrary ways.
 void refresh()
          Notifies the listener that annotated files have been filtered in the scheme and may need to be redisplayed
 void reloadedFiles()
          Notifies the listener that annotated files have been reloaded in the scheme and may have been changed in arbitrary ways.
 void select(Annotation ann)
          Notifies the listner that the specified annotation should be displayed as selected.
 void select(AnnotationSelection anns)
          Notifies the listener that the specified selection should be displayed as selected.
 void setAnnotationView(AnnotationView v)
          Indicates that annotations from the specified view should be processed.
 void setColorScheme(java.util.Map cs)
          Provides a mapping between outcomes and colors for display purposes.
 void setFontSize(int size)
          Sets the font used by the viewer to the specified size.
 void setFontType(java.lang.String type)
          Set the name of the font used by the viewer to the specified font name.
protected  void showSelection()
           
protected  void toggleIcons()
           
 void treeCollapsed(javax.swing.event.TreeExpansionEvent e)
           
 void treeExpanded(javax.swing.event.TreeExpansionEvent e)
           
 void treeNodesChanged(javax.swing.event.TreeModelEvent e)
           
 void treeNodesInserted(javax.swing.event.TreeModelEvent e)
           
 void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
           
 void treeShouldExpand(javax.swing.event.TreeModelEvent e)
          Indicates that the node indicated by the specifed event should be expanded.
 void treeStructureChanged(javax.swing.event.TreeModelEvent e)
           
 void updateAnnotation(Annotation a)
          Designates that the specified annotation has been changed.
 void valueChanged(javax.swing.event.TreeSelectionEvent event)
           
 
Methods inherited from class org.annotation.wordfreak.viewer.Viewer
addAnnotation, addAnnotation, addListener, addProperty, addProperty, addProperty, addProperty, addStyle, clearAnnotationHighlights, clearKeyMaps, colorAttributeSet, deflag, eventTranspired, file, flagSpan, flagType, getContentPane, getFeaturesIterator, getSplitType, highlightAnnotation, markOutcomes, markOutcomes, moveAnnotation, outcomes, outcomes, outcomes, progress, progress, refresh, removeAnnotatedFile, removeAnnotation, removeContextualMenuItems, removeListener, select, setAnnotationStyle, setBackgroundColor, setClipboard, setContextualMenuItems, setContextualMenuItems, setGuiListener, setIcons, setKeyboardComponent, setKeyBuffer, setLayout, setProperty, setProperty, setProperty, setProperty, setProperty, setSortCriteria, showRelations
 
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, setForeground, 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, 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

MOVE_UP

public static final java.lang.String MOVE_UP
See Also:
Constant Field Values

MOVE_DOWN

public static final java.lang.String MOVE_DOWN
See Also:
Constant Field Values
Constructor Detail

TreeTableViewer

public TreeTableViewer(java.lang.String type)
Method Detail

addProperty

public void addProperty(DynamicFeature f,
                        java.lang.String l,
                        java.lang.String s)
Specified by:
addProperty in interface AnnotationSchemeListener
Overrides:
addProperty in class Viewer

hotKeyPressed

public void hotKeyPressed(java.lang.String name)
Description copied from interface: WordFreakKeyboardFocusManager.HotKeyListener
Indicates that the hot key with the specified name has been pressed.

Specified by:
hotKeyPressed in interface WordFreakKeyboardFocusManager.HotKeyListener
Parameters:
name - The name of the hot key.

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

getNames

public static java.lang.String[] getNames()

hasPopup

public boolean hasPopup()

getPopup

public javax.swing.JPopupMenu getPopup()
Description copied from class: Viewer
Returns a viewer specific popup menu. This is currently accessible via the status bar.

Overrides:
getPopup in class Viewer
Returns:
A viewer specific popup menu or null if no such menu exists.

rebuild

public void rebuild()
Description copied from class: Viewer
Instructs the viewer to rebuild itself because the annotations have changed in arbitrary ways.

Overrides:
rebuild in class Viewer

refresh

public void refresh()
Description copied from interface: AnnotationSchemeListener
Notifies the listener that annotated files have been filtered in the scheme and may need to be redisplayed

Specified by:
refresh in interface AnnotationSchemeListener
Specified by:
refresh in class Viewer

setAnnotationView

public void setAnnotationView(AnnotationView v)
Description copied from interface: AnnotationSchemeListener
Indicates that annotations from the specified view should be processed. If the specified view is null then there are currently no annotations to process. Typically processing entails displaying the annotations.

Specified by:
setAnnotationView in interface AnnotationSchemeListener
Overrides:
setAnnotationView in class Viewer

dispose

public void dispose()
Overrides:
dispose in class Viewer

annotation

public void annotation(Annotation a)
Description copied from interface: AnnotationSchemeListener
Notifies the listener to focus display the specified annotation. This may be the annotation that is currently being displayed.

Specified by:
annotation in interface AnnotationSchemeListener
Overrides:
annotation in class Viewer

makeVisible

public void makeVisible(Annotation a)
Description copied from interface: AnnotationSchemeListener
Notifies the listener to make sure the annotation is visible

Specified by:
makeVisible in interface AnnotationSchemeListener
Overrides:
makeVisible in class Viewer

select

public void select(Annotation ann)
Description copied from interface: AnnotationSchemeListener
Notifies the listner that the specified annotation should be displayed as selected.

Specified by:
select in interface AnnotationSchemeListener
Overrides:
select in class Viewer

select

public void select(AnnotationSelection anns)
Description copied from interface: AnnotationSchemeListener
Notifies the listener that the specified selection should be displayed as selected.

Specified by:
select in interface AnnotationSchemeListener
Overrides:
select in class Viewer

setColorScheme

public void setColorScheme(java.util.Map cs)
Description copied from interface: AnnotationSchemeListener
Provides a mapping between outcomes and colors for display purposes.

Specified by:
setColorScheme in interface AnnotationSchemeListener
Overrides:
setColorScheme in class Viewer

setFontType

public void setFontType(java.lang.String type)
Description copied from class: Viewer
Set the name of the font used by the viewer to the specified font name.

Overrides:
setFontType in class Viewer
Parameters:
type - The name of the font that the viewer should use.

setFontSize

public void setFontSize(int size)
Description copied from class: Viewer
Sets the font used by the viewer to the specified size.

Overrides:
setFontSize in class Viewer

toggleIcons

protected void toggleIcons()

showSelection

protected void showSelection()

cut

public void cut()
Overrides:
cut in class Viewer

copy

public void copy()
Overrides:
copy in class Viewer

paste

protected void paste(int modifiers)
Overrides:
paste in class Viewer

getTreeTextFromSelection

public java.lang.String getTreeTextFromSelection()

isValidDrop

public boolean isValidDrop(javax.swing.tree.TreeNode childNode,
                           javax.swing.tree.TreeNode newParentNode,
                           javax.swing.tree.TreeNode oldParentNode)

doLink

public void doLink(javax.swing.tree.TreeNode source,
                   javax.swing.tree.TreeNode target,
                   int modifiers)

doDrop

public void doDrop(javax.swing.tree.TreeNode child,
                   javax.swing.tree.TreeNode newParent,
                   javax.swing.tree.TreeNode oldParent)

updateAnnotation

public void updateAnnotation(Annotation a)
Description copied from interface: AnnotationSchemeListener
Designates that the specified annotation has been changed.

Specified by:
updateAnnotation in interface AnnotationSchemeListener
Overrides:
updateAnnotation in class Viewer

reloadedFiles

public void reloadedFiles()
Description copied from interface: AnnotationSchemeListener
Notifies the listener that annotated files have been reloaded in the scheme and may have been changed in arbitrary ways.

Specified by:
reloadedFiles in interface AnnotationSchemeListener
Overrides:
reloadedFiles in class Viewer

expandAll

public void expandAll()

expandAll

public void expandAll(javax.swing.tree.TreePath path)

collapseAll

public void collapseAll(javax.swing.tree.TreePath path)

treeExpanded

public void treeExpanded(javax.swing.event.TreeExpansionEvent e)
Specified by:
treeExpanded in interface javax.swing.event.TreeExpansionListener

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent e)
Specified by:
treeCollapsed in interface javax.swing.event.TreeExpansionListener

adjustSelectionLeft

public void adjustSelectionLeft()

adjustSelectionRight

public void adjustSelectionRight()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class Viewer

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent event)
Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener

treeNodesInserted

public void treeNodesInserted(javax.swing.event.TreeModelEvent e)
Specified by:
treeNodesInserted in interface javax.swing.event.TreeModelListener

treeShouldExpand

public void treeShouldExpand(javax.swing.event.TreeModelEvent e)
Description copied from interface: DynamicFeatureTreeTableModel.TreeShouldExpandListener
Indicates that the node indicated by the specifed event should be expanded.

Specified by:
treeShouldExpand in interface DynamicFeatureTreeTableModel.TreeShouldExpandListener
Parameters:
e - The tree event which caused this notification.

treeStructureChanged

public void treeStructureChanged(javax.swing.event.TreeModelEvent e)
Specified by:
treeStructureChanged in interface javax.swing.event.TreeModelListener

treeNodesChanged

public void treeNodesChanged(javax.swing.event.TreeModelEvent e)
Specified by:
treeNodesChanged in interface javax.swing.event.TreeModelListener

treeNodesRemoved

public void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
Specified by:
treeNodesRemoved in interface javax.swing.event.TreeModelListener


Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.