VdexReload 1.1.3 API

uk.ac.reload.editor.metadata.tableview
Class MetadataTreeTable

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTable
                  extended byuk.ac.reload.dweezil.gui.treetable.JTreeTable
                      extended byuk.ac.reload.dweezil.gui.treetable.ReloadTreeTable
                          extended byuk.ac.reload.editor.metadata.tableview.MetadataTreeTable
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.CellEditorListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, ReloadDocumentListener, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.event.TreeSelectionListener

public class MetadataTreeTable
extends ReloadTreeTable
implements javax.swing.event.TreeSelectionListener, ReloadDocumentListener, java.awt.event.FocusListener

The Metadata Tree Table to display the Metadata

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class uk.ac.reload.dweezil.gui.treetable.JTreeTable
JTreeTable.TreeTableCellEditor, JTreeTable.TreeTableCellRenderer
 
Nested classes inherited from class javax.swing.JTable
javax.swing.JTable.AccessibleJTable
 
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
protected  uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyCopyHandler _copyHandler
          The Proxy Copy Handler
protected  javax.swing.tree.TreePath _currentTreePath
          Keeping note of the current selected tree node means we don't have to do unneccesary updating
protected  uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyCutHandler _cutHandler
          The Proxy Cut Handler
protected  uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyDeleteHandler _deleteHandler
          The Proxy Delete Handler
protected  Menu_Edit _editMenu
          The Edit menu which we will use
protected  ReloadInfoPanel _infoPanel
          The Element Value/Attribute Edit Panel
protected  Metadata _metadata
          The Metadata Document
protected  uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyMoveDownHandler _moveDownHandler
          The Proxy Move Down Handler
protected  uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyMoveUpHandler _moveUpHandler
          The Proxy Move Up Handler
protected  uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyPasteHandler _pasteHandler
          The Proxy Paste Handler
protected  javax.swing.JPopupMenu _popupMenu
          Popup Menu on Right-clicks
protected  ReloadEditorSchemaController _schemaController
          The Schema Controller
 
Fields inherited from class uk.ac.reload.dweezil.gui.treetable.ReloadTreeTable
treeTableModel
 
Fields inherited from class uk.ac.reload.dweezil.gui.treetable.JTreeTable
tree
 
Fields inherited from class javax.swing.JTable
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
 
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
MetadataTreeTable(MetadataTreeTableModel treeTableModel, ReloadInfoPanel infoPanel, Menu_Edit editMenu)
          Constructor
 
Method Summary
protected  void checkPopupTrigger(java.awt.event.MouseEvent e)
          Check to see if we have triggered the popup menu.
protected  void clearMenus()
          Clear any popup or other menus
 void destroy()
          Clean up
 void documentSaved(ReloadSchemaDocument doc)
          The ReloadDocument was saved (do nothing).
 void elementAdded(ReloadDocumentListenerEvent event)
          An Element was added to the the Document so we must add it to the Tree at the correct node position.
 void elementChanged(ReloadDocumentListenerEvent event)
          An Element was changed in some way (maybe the text or Attribute) so we inform the Tree Table Model
 void elementRemoved(ReloadDocumentListenerEvent event)
          An Element was removed from the Document so we must find it tree node and remove that from the Tree.
 void focusGained(java.awt.event.FocusEvent e)
          We got the focus
 void focusLost(java.awt.event.FocusEvent e)
          We lost the focus
protected  int getInsertNodePosition(javax.swing.tree.DefaultMutableTreeNode parentNode, org.jdom.Element element)
          Determine where to correctly insert the node for an Element.
 void refresh()
          Refresh the view
protected  void updateInfoPanel(javax.swing.tree.TreePath selPath)
          Update the Info Panel according to the selected node on the tree.
protected  void updateMenus(javax.swing.tree.TreePath selPath)
          Update the menus according to the selected node on the tree.
 void valueChanged(javax.swing.event.TreeSelectionEvent event)
          A node has been selected on the tree.
 
Methods inherited from class uk.ac.reload.dweezil.gui.treetable.ReloadTreeTable
getNode, getSelectedNode, getTreeTableModel, selectNode, tableChanged, updateSelectedNode
 
Methods inherited from class uk.ac.reload.dweezil.gui.treetable.JTreeTable
getEditingRow, getTree, setRowHeight, updateUI
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setValueAt, sizeColumnsToFit, sizeColumnsToFit, unconfigureEnclosingScrollPane, valueChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, 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, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, 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, setLayout, 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

_infoPanel

protected ReloadInfoPanel _infoPanel
The Element Value/Attribute Edit Panel


_popupMenu

protected javax.swing.JPopupMenu _popupMenu
Popup Menu on Right-clicks


_metadata

protected Metadata _metadata
The Metadata Document


_schemaController

protected ReloadEditorSchemaController _schemaController
The Schema Controller


_editMenu

protected Menu_Edit _editMenu
The Edit menu which we will use


_currentTreePath

protected javax.swing.tree.TreePath _currentTreePath
Keeping note of the current selected tree node means we don't have to do unneccesary updating


_deleteHandler

protected uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyDeleteHandler _deleteHandler
The Proxy Delete Handler


_cutHandler

protected uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyCutHandler _cutHandler
The Proxy Cut Handler


_copyHandler

protected uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyCopyHandler _copyHandler
The Proxy Copy Handler


_pasteHandler

protected uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyPasteHandler _pasteHandler
The Proxy Paste Handler


_moveUpHandler

protected uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyMoveUpHandler _moveUpHandler
The Proxy Move Up Handler


_moveDownHandler

protected uk.ac.reload.editor.metadata.tableview.MetadataTreeTable.ProxyMoveDownHandler _moveDownHandler
The Proxy Move Down Handler

Constructor Detail

MetadataTreeTable

public MetadataTreeTable(MetadataTreeTableModel treeTableModel,
                         ReloadInfoPanel infoPanel,
                         Menu_Edit editMenu)
Constructor

Parameters:
treeTableModel - The TreeTabelModel infoPanel the ReloadInfoPanel that displays a tip, the value and attributes of a JDOM element editMenu the Edit Menu
Method Detail

focusGained

public void focusGained(java.awt.event.FocusEvent e)
We got the focus

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
e - the FocusEvent

focusLost

public void focusLost(java.awt.event.FocusEvent e)
We lost the focus

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
e - the FocusEvent

destroy

public void destroy()
Clean up


refresh

public void refresh()
Refresh the view


valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent event)
A node has been selected on the tree.

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener
Parameters:
event - The TreeSelectionEvent fired from us being a TreeSelectionListener

updateInfoPanel

protected void updateInfoPanel(javax.swing.tree.TreePath selPath)
Update the Info Panel according to the selected node on the tree.

Parameters:
selPath - the path of the selected node on the tree

updateMenus

protected void updateMenus(javax.swing.tree.TreePath selPath)
Update the menus according to the selected node on the tree. This has to be synchronized so different threads don't access it at the same time

Parameters:
selPath - the path of the selected node on the tree

clearMenus

protected void clearMenus()
Clear any popup or other menus


checkPopupTrigger

protected void checkPopupTrigger(java.awt.event.MouseEvent e)
Check to see if we have triggered the popup menu.

Parameters:
e - The MouseEvent that has been triggered.

elementAdded

public void elementAdded(ReloadDocumentListenerEvent event)
An Element was added to the the Document so we must add it to the Tree at the correct node position.

Specified by:
elementAdded in interface ReloadDocumentListener
Parameters:
event - the ReloadDocumentListenerEvent event

getInsertNodePosition

protected int getInsertNodePosition(javax.swing.tree.DefaultMutableTreeNode parentNode,
                                    org.jdom.Element element)
Determine where to correctly insert the node for an Element. Some nodes might not be visible and therefore the node to Elements count is wrong. Return -1 if we shouldn't insert it.

Parameters:
parentNode - the parent tree node element the element to be added to the parent
Returns:
correct insert position of the node for an element, or -1 if we should'nt insert it

elementRemoved

public void elementRemoved(ReloadDocumentListenerEvent event)
An Element was removed from the Document so we must find it tree node and remove that from the Tree.

Specified by:
elementRemoved in interface ReloadDocumentListener
Parameters:
event - the ReloadDocumentListenerEvent event

elementChanged

public void elementChanged(ReloadDocumentListenerEvent event)
An Element was changed in some way (maybe the text or Attribute) so we inform the Tree Table Model

Specified by:
elementChanged in interface ReloadDocumentListener
Parameters:
event - the ReloadDocumentListenerEvent event

documentSaved

public void documentSaved(ReloadSchemaDocument doc)
The ReloadDocument was saved (do nothing).

Specified by:
documentSaved in interface ReloadDocumentListener
Parameters:
doc - the ReloadDocument concerned

VdexReload 1.1.3 API