|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
com.tensegrity.gui.swing.control.attributetable.SwingAttributeTable
Class SwingAttributeTable is a Swing-based implementation of the
AttributeTable interface. This has been realized by extending the
JTable class.
A typical SwingAttributeTable showing the attributes of a
VisualNode object might look like this:
To create an instance of this class you have to pass a reference to an
initialized UIManager.
To embed the table in a Swing-based application you can benefit by using
the AttributeTablePanel class, which wraps this table in a
JPanel instance.
This implementation supports the following settings, which can be changed
using an AttributeEditorProperties object:
AttributeEditorProperties.PROPERTYNAME_SHOWCATEGORIESAttributeEditorProperties.PROPERTYNAME_AUTOEXPANDCATEGORIESAttributeEditorProperties.PROPERTYNAME_MERGEELEMENTTYPESAttributeEditorProperties.PROPERTYNAME_ENABLE_WRITEPROTECTIONAttributeEditorProperties.PROPERTYNAME_RENAMINGALLOWEDAttributeEditorProperties.PROPERTYNAME_DYNAMICROWHEIGHTAttributeEditorProperties.PROPERTYNAME_USEEXACTMATCHING
| Nested Class Summary | |
static class |
SwingAttributeTable.CustomMappedComparator
Custom attribute comparator. |
| 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 |
| 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.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 | |
SwingAttributeTable(UIManager uiManager)
Constructs an attribute table that is editable. |
|
SwingAttributeTable(UIManager uiManager,
boolean editable)
Constructs an attribute table. |
|
SwingAttributeTable(UIManager uiManager,
boolean editable,
java.lang.String attributeEditorPropertiesFilename)
Constructs an attribute table. |
|
| Method Summary | |
void |
applyEvList()
Tells the component to apply its UIItemEvaluationList. |
void |
attributesChanged(AttributableOnSetEvent attributableonsetevent)
Invoked when an attribute in an AttributableOnSet object
has changed. |
void |
cancelEditing()
Cancels editing and discards changes. |
void |
destroyPopupMenu()
|
void |
editingStopped(javax.swing.event.ChangeEvent e)
|
void |
foldCategories()
Folds the categories |
AttributableOnSet |
getAttributableOnSet()
Returns the current AttributableOnSet. |
com.tensegrity.gui.swing.control.attributetable.AttributeTableCellEditor |
getAttributeTableCellEditor()
Returns the active cell editor. |
AttributeTableCellRenderer |
getAttributeTableCellRenderer()
Returns the active renderer. |
com.tensegrity.gui.swing.control.attributetable.AttributeTableModel |
getAttributeTableModel()
Returns the data-model. |
AttributeSet |
getCurrentAttributeSet()
Returns the AttributeSet currently displayed in the table. |
AttributeEditorProperties |
getEditorProperties()
This method returns an instance of the currently used AttributeTableProperties instance. |
BasicComponent |
getParentComponent()
Returns the parent Component of this instance. |
javax.swing.JPopupMenu |
getPopupMenu()
|
PopupMenuMarkup |
getPopupMenu(java.lang.Object eventObject)
Returns the current popup menu of the popup source. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
|
UIManager |
getUIManager()
Returns the uiManager of this instance |
void |
hideAttribute(java.lang.String name)
Hides the attribute identified by the given name. |
void |
initPopupMenu()
Creates the menuitems and adds them to the given menu. |
void |
installEvList()
Tells the component to setup its internal state. |
boolean |
isEditable()
Returns the editable flag |
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 |
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. |
protected void |
rehashCategories(AttributeSet attributes)
|
void |
scrollToAttribute(java.lang.String path)
Makes an attribute visible by scrolling to it. |
void |
setAttributableOnSet(AttributableOnSet attributable)
Associates a new attributeset with the attributetable's model. |
void |
setAttributeCellRenderer(AttributeTableCellRenderer renderer)
TODO: comment. |
void |
setEditable(boolean editable)
Sets the editable flag. if false, then table is read-only. |
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. |
void |
showCategories(boolean show)
|
void |
sort(int mode)
Sorts the table. |
boolean |
stopEditing()
Stops the editing of an Attribute and saves the current value. |
void |
unfoldCategories()
Unfolds the categories |
void |
updateUI()
Custom ui update. |
| 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, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, 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, getUI, getUIClassID, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, 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, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setValueAt, sizeColumnsToFit, sizeColumnsToFit, tableChanged, 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, 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 |
| Constructor Detail |
public SwingAttributeTable(UIManager uiManager)
public SwingAttributeTable(UIManager uiManager,
boolean editable)
editable - flag for editing, if set to true, then the table is
editable, otherwise it is not.
public SwingAttributeTable(UIManager uiManager,
boolean editable,
java.lang.String attributeEditorPropertiesFilename)
editable - flag for editing, if set to true, then the table is
editable, otherwise it is not.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 |
public void setAttributableOnSet(AttributableOnSet attributable)
setAttributableOnSet in interface AttributeEditorattributable - the AttributableOnSet to set.public AttributeSet getCurrentAttributeSet()
AttributeSet currently displayed in the table.
getCurrentAttributeSet in interface AttributeEditorAttributeSet of the tablepublic boolean stopEditing()
AttributeEditorAttribute and saves the current value.
stopEditing in interface AttributeEditorpublic void cancelEditing()
AttributeEditor
cancelEditing in interface AttributeEditorpublic javax.swing.JPopupMenu getPopupMenu()
protected void rehashCategories(AttributeSet attributes)
public void sort(int mode)
mode - one the constants defined in this class.public void unfoldCategories()
public void foldCategories()
public void initPopupMenu()
public void destroyPopupMenu()
public void applyEvList()
EvaluableUIItemEvaluationList.
applyEvList in interface Evaluablepublic void installEvList()
Evaluable
installEvList in interface Evaluablepublic final com.tensegrity.gui.swing.control.attributetable.AttributeTableModel getAttributeTableModel()
public final AttributeTableCellRenderer getAttributeTableCellRenderer()
public final com.tensegrity.gui.swing.control.attributetable.AttributeTableCellEditor getAttributeTableCellEditor()
public boolean isEditable()
public void setEditable(boolean editable)
editable - The editable to setpublic void editingStopped(javax.swing.event.ChangeEvent e)
editingStopped in interface javax.swing.event.CellEditorListenerpublic void attributesChanged(AttributableOnSetEvent attributableonsetevent)
AttributableOnSetListenerAttributableOnSet object
has changed.
attributesChanged in interface AttributableOnSetListenerattributableonsetevent - the event carrying information.public PopupMenuMarkup getPopupMenu(java.lang.Object eventObject)
JPopupMenuSource
getPopupMenu in interface JPopupMenuSourceeventObject - the mouse-event that triggered the request.
public void rehash()
AttributeEditorAttributeSet from the
AttributableOnSet and refreshes the view.
rehash in interface AttributeEditorpublic void scrollToAttribute(java.lang.String path)
public void updateUI()
public void hideAttribute(java.lang.String name)
AttributeEditorGEOMETRY.X or COMPOSITE.name.
This method will just forward the call to
AttributeEditorProperties.setVisible(String, boolean)
hideAttribute in interface AttributeEditorname - the full name of the attribute.AttributeEditor.hideAttribute(String)public void showAttribute(java.lang.String name)
AttributeEditorhideAttribute(String), this
name describes the full path to the attribute.
This method will just forward the call to
AttributeEditorProperties.setVisible(String, boolean)
showAttribute in interface AttributeEditorname - the full name of the attribute.AttributeEditor.showAttribute(String)public AttributeEditorProperties getEditorProperties()
AttributeEditorAttributeTableProperties instance.
getEditorProperties in interface AttributeEditorAttributeEditor.getEditorProperties()public AttributeEditorProperties setEditorProperties(AttributeEditorProperties editorProperties)
AttributeEditorAttributeTableProperties to be used.
setEditorProperties in interface AttributeEditoreditorProperties - The properties instance that should
be used by this editor
public AttributableOnSet getAttributableOnSet()
AttributeEditorAttributableOnSet. This might be null.
getAttributableOnSet in interface AttributeEditorAttributableOnSet or null, if the editor
is empty.public void showCategories(boolean show)
#showCategories()public BasicComponent getParentComponent()
BasicComponent
getParentComponent in interface BasicComponentnull if no parent exists.public void propertiesChanged()
AttributeEditorAttributeEditorProperties when a setting
changed. The editor implementation should rehash the attributes whenever
this method is called.
propertiesChanged in interface AttributeEditorpublic UIManager getUIManager()
public void setAttributeCellRenderer(AttributeTableCellRenderer renderer)
renderer - public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
public boolean isTree()
AttributeEditorAttributeTree and will
call get/setAttributesTree() instead of get/setAttributes().
isTree in interface AttributeEditorAttributeTree
protected boolean processKeyBinding(javax.swing.KeyStroke ks,
java.awt.event.KeyEvent e,
int condition,
boolean pressed)
protected void processMouseEvent(java.awt.event.MouseEvent e)
protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||