com.tensegrity.gui.swing.control.attributetree
Class SwingAttributeTree

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTable
                  extended bycom.tensegrity.gui.swing.control.attributetree.SwingAttributeTree
All Implemented Interfaces:
javax.accessibility.Accessible, AttributeEditor, AttributeTree, BasicComponent, javax.swing.event.CellEditorListener, Evaluable, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener

public final class SwingAttributeTree
extends javax.swing.JTable
implements AttributeTree, java.awt.event.FocusListener

As the name would suggest, The SwingAttributeTree class is a Swing-based implementation of the AttributeTree interface. This has been achieved by extending the JTable class.

A typical SwingAttributeTree showing the attributes of a VisualNode object might look like this:

Screenshot SwingAttributeTree

To create an instance of this class you have to pass a reference to an initialized UIManager instance. In addition, you can enable or disable the persistence mechanism which stores the configuration and set the filename that should be used.

It is possible to rename attributes by clicking on their name when selected or by pressing the F2 key. When pressing the CTRL and + keys, the columns of the table can be resized by dragging or resized to show more or less information. To expand an entire category or complex attribute, the user can click on the '+' symbol while pressing the CTRL key.

This implementation supports the following configuration settings, which can be changed using the AttributeEditorProperties object:

In addition these properties are added in this specific implementation:

This class uses a AttributeTreeModel which can be retrieved for additional functionality, such as expanding rows. See AttributeTreeModel

Version:
$Id: SwingAttributeTree.java,v 1.46 2004/05/26 08:09:20 GillesIachelini Exp $
Author:
BurkhardWick
See Also:
Serialized Form

Nested Class Summary
 
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
static java.lang.Boolean AUTO_START_EDIT
          Auto start edit configuration setting of the table
static int EDIT_LABEL_DELAY
          The delay in ms for the start of editing an attribute name
static java.lang.String PROPERTYNAME_AUTOEXPANDCATEGORIES
          Deprecated. use AttributeEditorProperties.PROPERTYNAME_AUTOEXPANDCATEGORIES
static java.lang.String PROPERTYNAME_DYNAMICROWHEIGHT
          Deprecated. use AttributeEditorProperties.PROPERTYNAME_DYNAMICROWHEIGHT
static java.lang.String PROPERTYNAME_SHOWMENU_MERGETYPEROOT
          This AttributeEditorProperties key changes the visibility of the menu item in the popup menu that controls the merging of the type root.
static java.lang.String PROPERTYNAME_SHOWMENU_SHOWCATEGORIES
          This AttributeEditorProperties key changes the visibility of the menu item in the popup menu that controls if the categories are shown.
static java.lang.String PROPERTYNAME_SHOWMENUITEM_EDITACCESSSTATE
          This AttributeEditorProperties key changes the visibility of the menu item in the popup menu that shows the editor for the access state (write protection and visibility) of the attributes in the editor.
static int TOGGLERECT_TOLERANCE
          The width of an additional border around the toggle rects ('+' / '-') to make it easier to hit them.
 
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 com.tensegrity.gui.component.AttributeTree
PROPERTYNAME_ENABLE_WRITEPROTECTION, PROPERTYNAME_MERGEELEMENTTYPES, PROPERTYNAME_RENAMINGALLOWED, PROPERTYNAME_SHOWCATEGORIES
 
Fields inherited from interface com.tensegrity.gui.component.AttributeEditor
hiddenPrefix, SORT_ASCENDING, SORT_DESCENDING, SORT_NONE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SwingAttributeTree(UIManager uiManager, boolean editable)
          Constructor
SwingAttributeTree(UIManager uiManager, boolean editable, boolean usePropertyPersistence)
          Constructor
SwingAttributeTree(UIManager uiManager, boolean editable, java.lang.String propertyPersistenceFileName)
          Constructor
 
Method Summary
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
protected  int calculateRowHeight(AttributeTreeNode node)
          Calculates the height of the row represented by the given node
 void cancelEditing()
          Cancels editing and discards changes.
 boolean dynamicRowHeightEnabled()
          Returns true, if the row height is dynamic
 boolean editCellAt(int row, int column)
           
 boolean editCellAt(int row, int column, java.util.EventObject e)
           
 void editingCanceled(javax.swing.event.ChangeEvent e)
           
 void editingStopped(javax.swing.event.ChangeEvent e)
           
 void enableMergeElementTypes(boolean enabled)
          Enabled / Disables the merging of the element types.
 void focusGained(java.awt.event.FocusEvent arg0)
           
 void focusLost(java.awt.event.FocusEvent arg0)
           
 AttributableOnSet getAttributableOnSet()
          Returns the current AttributableOnSet.
 AttributeEditorStateManager getAttributeEditorStateManager()
          Returns the currently set state manager
 javax.swing.table.TableCellEditor getCellEditor()
           
 javax.swing.table.TableCellEditor getCellEditor(int row, int column)
           
 java.awt.Rectangle getCellRect(int row, int column, boolean includeSpacing)
           
 javax.swing.table.TableCellRenderer getCellRenderer(int row, int column)
           
 AttributeSet getCurrentAttributeSet()
          Returns the currently active AttributeSet.
 javax.swing.table.TableCellRenderer getDefaultRenderer(java.lang.Class columnClass)
           
 AttributeEditorProperties getEditorProperties()
          This method returns an instance of the currently used AttributeTableProperties instance.
 BasicComponent getParentComponent()
          Returns the parent Component of this instance.
 int getRowHeight(int row)
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
           
 UIManager getUIManager()
          Returns the uimanager that is used by this instance
 void hideAttribute(java.lang.String name)
          Hides the attribute identified by the given name.
 void installEvList()
          Tells the component to setup its internal state.
 boolean isAutoExpandCategoriesEnabled()
          Returns true, if the categories are expanded automatically
 boolean isEditable()
          Returns whether this tree is editable or not
 boolean isMergingElementTypes()
          Returns whether element type merging is used or not
 boolean isRenamingEnabled()
          Returns whether the renaming of attributes is enabled or not
 boolean isTree()
          Returns true, if this editor is displaying an AttributeTree and will call get/setAttributesTree() instead of get/setAttributes().
protected  boolean processKeyBinding(javax.swing.KeyStroke ks, java.awt.event.KeyEvent e, int condition, boolean pressed)
           
protected  void processKeyEvent(java.awt.event.KeyEvent e)
           
protected  void processMouseEvent(java.awt.event.MouseEvent e)
           
protected  void processMouseMotionEvent(java.awt.event.MouseEvent e)
           
 void propertiesChanged()
          Called from the AttributeEditorProperties when a setting changed.
 void rehash()
          Reloads the AttributeSet from the AttributableOnSet and refreshes the view.
 int rowAtPoint(java.awt.Point point)
           
 void setAttributableOnSet(AttributableOnSet attributable)
          Sets the AttributableOnSet that should be shown in the editor.
 void setAttributeCellRenderer(AttributeTreeRenderer renderer)
          Sets the attribute cell renderer for the tree
 void setAttributeEditorStateManager(AttributeEditorStateManager manager)
          Sets the manager that is used to store and restore the state of the editor depending on the selected item.
 void setAutoExpandCategoriesEnabled(boolean enabled)
          Sets the state of the automatic expansion of categories
 void setEditable(boolean editable)
          Sets the tree to editable, if the argument is true.
 AttributeEditorProperties setEditorProperties(AttributeEditorProperties editorProperties)
          This method sets an instance of the AttributeTableProperties to be used.
 void setRenamingEnabled(boolean enabled)
          Enables / disables the renaming of the attribute names using this component
protected  void setSelectedRow(int row)
          Sets the selected row
 void showAttribute(java.lang.String name)
          Toggles the hidden flag for an attribute identified by the given name.
 boolean stopEditing()
          Stops the editing of an Attribute and saves the current value.
 void tableChanged(javax.swing.event.TableModelEvent e)
           
 void 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, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, 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, 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, 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
 
Methods inherited from interface com.tensegrity.gui.component.BasicComponent
getHeight, getWidth, repaint
 

Field Detail

EDIT_LABEL_DELAY

public static final int EDIT_LABEL_DELAY
The delay in ms for the start of editing an attribute name

See Also:
Constant Field Values

AUTO_START_EDIT

public static final java.lang.Boolean AUTO_START_EDIT
Auto start edit configuration setting of the table


TOGGLERECT_TOLERANCE

public static final int TOGGLERECT_TOLERANCE
The width of an additional border around the toggle rects ('+' / '-') to make it easier to hit them.

See Also:
Constant Field Values

PROPERTYNAME_DYNAMICROWHEIGHT

public static final java.lang.String PROPERTYNAME_DYNAMICROWHEIGHT
Deprecated. use AttributeEditorProperties.PROPERTYNAME_DYNAMICROWHEIGHT

AttributeEditorProperties.PROPERTYNAME_DYNAMICROWHEIGHT

See Also:
Constant Field Values

PROPERTYNAME_AUTOEXPANDCATEGORIES

public static final java.lang.String PROPERTYNAME_AUTOEXPANDCATEGORIES
Deprecated. use AttributeEditorProperties.PROPERTYNAME_AUTOEXPANDCATEGORIES

AttributeEditorProperties.PROPERTYNAME_AUTOEXPANDCATEGORIES

See Also:
Constant Field Values

PROPERTYNAME_SHOWMENU_MERGETYPEROOT

public static final java.lang.String PROPERTYNAME_SHOWMENU_MERGETYPEROOT
This AttributeEditorProperties key changes the visibility of the menu item in the popup menu that controls the merging of the type root. If this value is true (or omitted), the menu entry to merge type roots is shown. Type = Boolean Default = Boolean.TRUE

See Also:
Constant Field Values

PROPERTYNAME_SHOWMENUITEM_EDITACCESSSTATE

public static final java.lang.String PROPERTYNAME_SHOWMENUITEM_EDITACCESSSTATE
This AttributeEditorProperties key changes the visibility of the menu item in the popup menu that shows the editor for the access state (write protection and visibility) of the attributes in the editor. If this value is true (or omitted), the menu entry to edit the access state of attributes is shown. Type = Boolean Default = Boolean.TRUE

See Also:
Constant Field Values

PROPERTYNAME_SHOWMENU_SHOWCATEGORIES

public static final java.lang.String PROPERTYNAME_SHOWMENU_SHOWCATEGORIES
This AttributeEditorProperties key changes the visibility of the menu item in the popup menu that controls if the categories are shown. If this value is true (or omitted), the menu entry to show/hide categories is shown. Type = Boolean Default = Boolean.TRUE

See Also:
Constant Field Values
Constructor Detail

SwingAttributeTree

public SwingAttributeTree(UIManager uiManager,
                          boolean editable)
Constructor

Parameters:
uiManager - The uiManager
editable - True, if the cells can be edited

SwingAttributeTree

public SwingAttributeTree(UIManager uiManager,
                          boolean editable,
                          boolean usePropertyPersistence)
Constructor

Parameters:
uiManager - The uiManager
editable - True, if the cells can be edited
usePropertyPersistence - True, if the configuration of the persistence of the AttributeEditorProperties should be used.

SwingAttributeTree

public SwingAttributeTree(UIManager uiManager,
                          boolean editable,
                          java.lang.String propertyPersistenceFileName)
Constructor

Parameters:
uiManager - The uiManager
editable - True, if the cells can be edited
propertyPersistenceFileName - True, if the configuration of the persistence of the AttributeEditorProperties should be used.
Method Detail

isEditable

public boolean isEditable()
Returns whether this tree is editable or not

Returns:
True, if this tree is editor

setEditable

public void setEditable(boolean editable)
Sets the tree to editable, if the argument is true.

Parameters:
editable - The editable state to set.

setAttributeCellRenderer

public void setAttributeCellRenderer(AttributeTreeRenderer renderer)
Sets the attribute cell renderer for the tree

Parameters:
renderer - The renderer to set

dynamicRowHeightEnabled

public boolean dynamicRowHeightEnabled()
Returns true, if the row height is dynamic

Returns:
true, if the row height is dynamic

getUIManager

public UIManager getUIManager()
Returns the uimanager that is used by this instance

Returns:
the uimanager that is used by this instance

setRenamingEnabled

public void setRenamingEnabled(boolean enabled)
Enables / disables the renaming of the attribute names using this component

Parameters:
enabled - If true, the user is allowed to rename attribute names using this component

isRenamingEnabled

public boolean isRenamingEnabled()
Returns whether the renaming of attributes is enabled or not

Returns:
True, if the user is allowed to rename attribute names using this component

setAutoExpandCategoriesEnabled

public void setAutoExpandCategoriesEnabled(boolean enabled)
Sets the state of the automatic expansion of categories

Parameters:
enabled - If true, categories are expanded automatically

isAutoExpandCategoriesEnabled

public boolean isAutoExpandCategoriesEnabled()
Returns true, if the categories are expanded automatically

Returns:
true, if the categories are expanded automatically

enableMergeElementTypes

public void enableMergeElementTypes(boolean enabled)
Enabled / Disables the merging of the element types.

Parameters:
enabled - True, to enable merging

isMergingElementTypes

public boolean isMergingElementTypes()
Returns whether element type merging is used or not

Returns:
True, if element types are merged

focusGained

public void focusGained(java.awt.event.FocusEvent arg0)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent arg0)
Specified by:
focusLost in interface java.awt.event.FocusListener

setAttributableOnSet

public void setAttributableOnSet(AttributableOnSet attributable)
Description copied from interface: AttributeEditor
Sets the AttributableOnSet that should be shown in the editor. The parameter may be null in which case the editor will be empty.

Specified by:
setAttributableOnSet in interface AttributeEditor
Parameters:
attributable - the AttributableOnSet to set.

getAttributableOnSet

public AttributableOnSet getAttributableOnSet()
Description copied from interface: AttributeEditor
Returns the current AttributableOnSet. This might be null.

Specified by:
getAttributableOnSet in interface AttributeEditor
Returns:
The AttributableOnSet or null, if the editor is empty.

getCurrentAttributeSet

public AttributeSet getCurrentAttributeSet()
Description copied from interface: AttributeEditor
Returns the currently active AttributeSet. This set is the instance that is currently shown in the editor, while retrieving the AttributableOnSet and calling AttributableOnSet.getAttributes() or AttributableOnSet.getAttributesTree() might return a clone of the AttributeSet. Note: Changes to the AttributeSet will not have an effect on the AttributableOnSet and changes in the structure will not be visible in the editor. Changes will be discarded when an event occurrs that requires reloading the AttributeSet from the AttributableOnSet.

Specified by:
getCurrentAttributeSet in interface AttributeEditor
Returns:
AttributeSet The AttributeSet that is currently shown in the editor.

propertiesChanged

public void propertiesChanged()
Description copied from interface: AttributeEditor
Called from the AttributeEditorProperties when a setting changed. The editor implementation should rehash the attributes whenever this method is called.

Specified by:
propertiesChanged in interface AttributeEditor

rehash

public void rehash()
Description copied from interface: AttributeEditor
Reloads the AttributeSet from the AttributableOnSet and refreshes the view.

Specified by:
rehash in interface AttributeEditor

getEditorProperties

public AttributeEditorProperties getEditorProperties()
Description copied from interface: AttributeEditor
This method returns an instance of the currently used AttributeTableProperties instance.

Specified by:
getEditorProperties in interface AttributeEditor
Returns:
The properties instance used by this editor

setEditorProperties

public AttributeEditorProperties setEditorProperties(AttributeEditorProperties editorProperties)
Description copied from interface: AttributeEditor
This method sets an instance of the AttributeTableProperties to be used.

Specified by:
setEditorProperties in interface AttributeEditor
Parameters:
editorProperties - The properties instance that should be used by this editor
Returns:
The properties instance that has been used before

hideAttribute

public void hideAttribute(java.lang.String name)
Description copied from interface: AttributeEditor
Hides the attribute identified by the given name. Such a name usually describes the full path to that attribute, like: GEOMETRY.X or COMPOSITE.name. This method will just forward the call to AttributeEditorProperties.setVisible(String, boolean)

Specified by:
hideAttribute in interface AttributeEditor
Parameters:
name - the full name of the attribute.

showAttribute

public void showAttribute(java.lang.String name)
Description copied from interface: AttributeEditor
Toggles the hidden flag for an attribute identified by the given name. Similar to hideAttribute(String), this name describes the full path to the attribute. This method will just forward the call to AttributeEditorProperties.setVisible(String, boolean)

Specified by:
showAttribute in interface AttributeEditor
Parameters:
name - the full name of the attribute.

stopEditing

public boolean stopEditing()
Description copied from interface: AttributeEditor
Stops the editing of an Attribute and saves the current value.

Specified by:
stopEditing in interface AttributeEditor
Returns:
true, if editing was active

cancelEditing

public void cancelEditing()
Description copied from interface: AttributeEditor
Cancels editing and discards changes.

Specified by:
cancelEditing in interface AttributeEditor

setAttributeEditorStateManager

public final void setAttributeEditorStateManager(AttributeEditorStateManager manager)
Description copied from interface: AttributeTree
Sets the manager that is used to store and restore the state of the editor depending on the selected item.

Specified by:
setAttributeEditorStateManager in interface AttributeTree
Parameters:
manager - The manager to set

getAttributeEditorStateManager

public final AttributeEditorStateManager getAttributeEditorStateManager()
Description copied from interface: AttributeTree
Returns the currently set state manager

Specified by:
getAttributeEditorStateManager in interface AttributeTree
Returns:
the currently set state manager

installEvList

public void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable

applyEvList

public void applyEvList()
Description copied from interface: Evaluable
Tells the component to apply its UIItemEvaluationList.

Specified by:
applyEvList in interface Evaluable

getParentComponent

public BasicComponent getParentComponent()
Description copied from interface: BasicComponent
Returns the parent Component of this instance.

Specified by:
getParentComponent in interface BasicComponent
Returns:
the parent component or null if no parent exists.

editCellAt

public boolean editCellAt(int row,
                          int column)

editCellAt

public boolean editCellAt(int row,
                          int column,
                          java.util.EventObject e)

editingCanceled

public void editingCanceled(javax.swing.event.ChangeEvent e)
Specified by:
editingCanceled in interface javax.swing.event.CellEditorListener

editingStopped

public void editingStopped(javax.swing.event.ChangeEvent e)
Specified by:
editingStopped in interface javax.swing.event.CellEditorListener

updateUI

public void updateUI()

getRowHeight

public int getRowHeight(int row)

getCellRect

public java.awt.Rectangle getCellRect(int row,
                                      int column,
                                      boolean includeSpacing)

rowAtPoint

public int rowAtPoint(java.awt.Point point)

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(int row,
                                                           int column)

getDefaultRenderer

public javax.swing.table.TableCellRenderer getDefaultRenderer(java.lang.Class columnClass)

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(int row,
                                                       int column)

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor()

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
Specified by:
tableChanged in interface javax.swing.event.TableModelListener

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent e)

processMouseMotionEvent

protected void processMouseMotionEvent(java.awt.event.MouseEvent e)

processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent e)

setSelectedRow

protected void setSelectedRow(int row)
Sets the selected row

Parameters:
row - The index of the row to select

calculateRowHeight

protected int calculateRowHeight(AttributeTreeNode node)
Calculates the height of the row represented by the given node

Parameters:
node - The node representing the row
Returns:
The height in pixels

isTree

public boolean isTree()
Description copied from interface: AttributeEditor
Returns true, if this editor is displaying an AttributeTree and will call get/setAttributesTree() instead of get/setAttributes().

Specified by:
isTree in interface AttributeEditor
Returns:
true, if this editor is displaying an AttributeTree

processKeyBinding

protected boolean processKeyBinding(javax.swing.KeyStroke ks,
                                    java.awt.event.KeyEvent e,
                                    int condition,
                                    boolean pressed)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.