com.tensegrity.skeleton.container.swing
Class SwingAttributeTreeContainer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.tensegrity.skeleton.container.AbstractSwingToolContainer
                      extended bycom.tensegrity.skeleton.container.swing.SwingAttributeTreeContainer
All Implemented Interfaces:
javax.accessibility.Accessible, AttributeEditor, AttributeEditorContainer, AttributeTreeContainer, Container, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, ToolContainer

public class SwingAttributeTreeContainer
extends AbstractSwingToolContainer
implements AttributeTreeContainer

The swing based container for the attributeTable.

Version:
$Id: SwingAttributeTreeContainer.java,v 1.29 2006/01/05 12:33:31 BurkhardWick Exp $
Author:
GillesIachelini
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
 
Fields inherited from class com.tensegrity.skeleton.container.AbstractSwingToolContainer
defaultBorder, isSelected, selectedBorder
 
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.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
SwingAttributeTreeContainer(ApplicationFrame applicationFrame)
          Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".
SwingAttributeTreeContainer(ApplicationFrame applicationFrame, JPopupMenuSource popupMenuSource)
          Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".
SwingAttributeTreeContainer(ApplicationFrame applicationFrame, java.lang.String keyTitle)
          Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".
SwingAttributeTreeContainer(ApplicationFrame applicationFrame, java.lang.String keyTitle, JPopupMenuSource popupMenuSource)
          Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".
SwingAttributeTreeContainer(ApplicationFrame applicationFrame, java.lang.String keyTitle, JPopupMenuSource popupMenuSource, java.lang.String attributeEditorPropertiesFilename)
          Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".
SwingAttributeTreeContainer(ApplicationFrame applicationFrame, java.lang.String keyTitle, java.lang.String attributeEditorPropertiesFilename)
          Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".
 
Method Summary
 void cancelEditing()
          Cancels editing and discards changes.
 AttributableOnSet getAttributableOnSet()
          Returns the current AttributableOnSet.
 AttributeEditor getAttributeEditor()
          Each AttributeTableContainer should be based on a AttributeEditor implementation.
 AttributeTree getAttributeTree()
          Each AttributeTreeContainer should be based on a AttributeTree implementation.
 AttributeSet getCurrentAttributeSet()
          Returns the currently active AttributeSet.
 AttributeEditorProperties getEditorProperties()
          This method returns an instance of the currently used AttributeTableProperties instance.
 java.lang.String getName()
          A container has a name.
 void hideAttribute(java.lang.String name)
          Hides the attribute identified by the given name.
 void init()
          Subclasses implement this method to start their initialization code.
 void init(java.lang.String titleResourceKey, JPopupMenuSource popupMenuSource)
          Initializes this container by creating a new AttributeTree (based on the SwingAttributeTree implementation.
 void init(java.lang.String titleResourceKey, JPopupMenuSource popupMenuSource, java.lang.String attributeEditorPropertiesFilename)
          Initializes this container by creating a new AttributeTree (based on the SwingAttributeTree implementation.
 boolean isTree()
          Returns true, if this editor is displaying an AttributeTree and will call get/setAttributesTree() instead of get/setAttributes().
 void propertiesChanged()
          Called from the AttributeEditorProperties when a setting changed.
 void rehash()
          Reloads the AttributeSet from the AttributableOnSet and refreshes the view.
 void setAttributableOnSet(AttributableOnSet attributable)
          Sets the AttributableOnSet that should be shown in the editor.
 AttributeEditorProperties setEditorProperties(AttributeEditorProperties editorProperties)
          This method sets an instance of the AttributeTableProperties to be used.
 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.
 
Methods inherited from class com.tensegrity.skeleton.container.AbstractSwingToolContainer
add, add, getApplicationFrame, getContainerAction, getSlideByTitle, getSlides, getUiManager, manageVerticalScrollbarPolicy, remove, remove, setBorder, setScrollbarIncrement, setSelected, setUiManager, updateUI
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
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, 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, 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, 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, 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
 
Methods inherited from interface com.tensegrity.gui.container.Container
getApplicationFrame, setName, setSelected
 
Methods inherited from interface com.tensegrity.skeleton.container.ToolContainer
getHeight, getWidth, repaint
 

Constructor Detail

SwingAttributeTreeContainer

public SwingAttributeTreeContainer(ApplicationFrame applicationFrame)
Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".

Parameters:
applicationFrame - the Application context of this Container.

SwingAttributeTreeContainer

public SwingAttributeTreeContainer(ApplicationFrame applicationFrame,
                                   JPopupMenuSource popupMenuSource)
Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".

Parameters:
applicationFrame - the Application context of this Container.
popupMenuSource - The popupMenuSource to use for the root SlideTitle

SwingAttributeTreeContainer

public SwingAttributeTreeContainer(ApplicationFrame applicationFrame,
                                   java.lang.String keyTitle)
Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".

Parameters:
applicationFrame - the Application context of this Container.
keyTitle - the resource id for the title of this container.

SwingAttributeTreeContainer

public SwingAttributeTreeContainer(ApplicationFrame applicationFrame,
                                   java.lang.String keyTitle,
                                   JPopupMenuSource popupMenuSource)
Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".

Parameters:
applicationFrame - the Application context of this Container.
keyTitle - the resource id for the title of this container.
popupMenuSource - The popupMenuSource to use for the root SlideTitle

SwingAttributeTreeContainer

public SwingAttributeTreeContainer(ApplicationFrame applicationFrame,
                                   java.lang.String keyTitle,
                                   java.lang.String attributeEditorPropertiesFilename)
Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".

Parameters:
applicationFrame - the Application context of this Container.
keyTitle - the resource id for the title of this container.
attributeEditorPropertiesFilename - the file name for the properties file holding the attribute editor settings. This parameter can be null to disable persistence or can be AttributeEditorProperties.DEFAULT_FILENAME to use the default for the main attribute editor.

SwingAttributeTreeContainer

public SwingAttributeTreeContainer(ApplicationFrame applicationFrame,
                                   java.lang.String keyTitle,
                                   JPopupMenuSource popupMenuSource,
                                   java.lang.String attributeEditorPropertiesFilename)
Creates the SwingAttributeTableContainer for the given ApplicationFrame and the hardwired helpID "attributetree".

Parameters:
applicationFrame - the Application context of this Container.
keyTitle - the resource id for the title of this container.
popupMenuSource - The popupMenuSource to use for the root SlideTitle
attributeEditorPropertiesFilename - the file name for the properties file holding the attribute editor settings This parameter can be null to disable persistence or can be AttributeEditorProperties.DEFAULT_FILENAME to use the default for the main attribute editor.
Method Detail

init

public void init()
Description copied from class: AbstractSwingToolContainer
Subclasses implement this method to start their initialization code. This method is called from within the constructor of this class.

Specified by:
init in class AbstractSwingToolContainer

init

public void init(java.lang.String titleResourceKey,
                 JPopupMenuSource popupMenuSource)
Initializes this container by creating a new AttributeTree (based on the SwingAttributeTree implementation. This Tree will be encapsulated in a SlidePanel.

Parameters:
titleResourceKey - the id to be used to retrieve the localized version of the title of this container.
popupMenuSource - The popupMenuSource to use for the root SlideTitle

init

public void init(java.lang.String titleResourceKey,
                 JPopupMenuSource popupMenuSource,
                 java.lang.String attributeEditorPropertiesFilename)
Initializes this container by creating a new AttributeTree (based on the SwingAttributeTree implementation. This Tree will be encapsulated in a SlidePanel.

Parameters:
titleResourceKey - the id to be used to retrieve the localized version of the title of this container.
popupMenuSource - The popupMenuSource to use for the root SlideTitle
attributeEditorPropertiesFilename - the file name for the properties file holding the attribute editor settings This parameter can be null to disable persistence or can be AttributeEditorProperties.DEFAULT_FILENAME to use the default for the main attribute editor.

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.

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

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.

getAttributeEditor

public AttributeEditor getAttributeEditor()
Description copied from interface: AttributeEditorContainer
Each AttributeTableContainer should be based on a AttributeEditor implementation. Thus this instance is returned by this method.

Specified by:
getAttributeEditor in interface AttributeEditorContainer
Returns:
The attribute editor of this container

getAttributeTree

public AttributeTree getAttributeTree()
Description copied from interface: AttributeTreeContainer
Each AttributeTreeContainer should be based on a AttributeTree implementation. Thus this instance is returned by this method.

Specified by:
getAttributeTree in interface AttributeTreeContainer
Returns:
The attribute tree of this container

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

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

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

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

getName

public java.lang.String getName()
Description copied from interface: Container
A container has a name. This name can be used for title elements, menu entries or within any other component which refers to this container.

Specified by:
getName in interface Container


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