|
|||||||||
| 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.JPanel
com.samskivert.swing.CollapsiblePanel
com.threerings.editor.swing.BasePropertyEditor
com.threerings.editor.swing.PropertyEditor
com.threerings.editor.swing.editors.ArrayListEditor
com.threerings.editor.swing.editors.TableArrayListEditor
public class TableArrayListEditor
An editor for objects or lists of objects or primitives. Uses a table.
| Nested Class Summary | |
|---|---|
protected class |
TableArrayListEditor.Column
Represents a column in the table. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected JButton |
_addColumn
The add column button. |
protected TableArrayListEditor.Column[] |
_columns
The column info. |
protected JButton |
_copy
The copy and delete buttons. |
protected JButton |
_delete
The copy and delete buttons. |
protected ObjectPanel |
_opanel
The object panel used to edit the non-inline properties. |
protected JTable |
_table
The table containing the array data. |
| Fields inherited from class com.threerings.editor.swing.editors.ArrayListEditor |
|---|
_add, _max, _min |
| Fields inherited from class com.threerings.editor.swing.PropertyEditor |
|---|
_classesByName, _classesByType, _ctx, _lineage, _object, _property |
| Fields inherited from class com.threerings.editor.swing.BasePropertyEditor |
|---|
_collapseIcon, _expandIcon, _highlight, _highlighted, _highlightIcon, _msgmgr, _msgs, BASE_BACKGROUND, DEFAULT_BACKGROUND, PANEL_BUTTON_SIZE, SHADE_DECREMENT |
| Fields inherited from class com.samskivert.swing.CollapsiblePanel |
|---|
_content, _downIcon, _trigger, _upIcon |
| 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 | |
|---|---|
TableArrayListEditor()
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent event)
|
protected void |
addColumn()
Adds a new column. |
void |
addTableModelListener(TableModelListener listener)
|
protected void |
addValue(Object value)
Adds an object to the end of the list. |
protected void |
copyColumn(int column)
Copies the column at the specified index. |
protected void |
copyValue(int idx)
Copies the element at the specified index. |
protected TableArrayListEditor.Column |
createArrayColumn(int column)
Creates and returns an array column. |
protected void |
createArrayColumns()
(Re)creates the columns for a 2D array property. |
protected void |
didInit()
Override to perform custom initialization. |
protected void |
fireTableChanged(int firstRow,
int lastRow,
int column,
int type)
Fires a TableModelEvent. |
Class<?> |
getColumnClass(int column)
|
int |
getColumnCount()
|
String |
getColumnName(int column)
|
protected String |
getMousePath(Point pt)
Returns the path of the property under the mouse cursor relative to this property. |
int |
getRowCount()
|
protected IntTuple |
getSelection()
Returns the selection as a (row, column) pair. |
Object |
getValueAt(int row,
int column)
|
protected boolean |
is2DArray()
Determines whether the property is a 2D array. |
boolean |
isCellEditable(int row,
int column)
|
void |
makeVisible(int idx)
Ensures that the specified index is visible. |
protected void |
moveCell(int row,
int col)
Moves a single cell to the selected cell. |
protected void |
moveColumn(int column)
Moves a column to the selected column. |
protected void |
moveValue(int row)
Moves the specified row to the selected row. |
protected void |
moveWithinArray(Object array,
int source,
int dest)
Moves the value at source to dest, shifting values left
or right to make room. |
protected void |
removeColumn(int column)
Deletes the column at the specified index. |
void |
removeTableModelListener(TableModelListener listener)
|
protected void |
removeValue(int idx)
Removes the element at the specified index. |
protected void |
setSelection(int row,
int column)
Sets the selection in using the convention of getSelection(). |
void |
setValueAt(Object value,
int row,
int column)
|
void |
stateChanged(ChangeEvent event)
|
void |
update()
Updates the state of the editor from the object. |
protected void |
updateColumnWidths()
Updates the preferred widths of the columns. |
protected void |
updateSelected()
Updates based on the selection state. |
void |
valueChanged(ListSelectionEvent event)
|
| Methods inherited from class com.threerings.editor.swing.editors.ArrayListEditor |
|---|
fireStateChanged, getActionLabel, getActionLabel, getLength, getValue, setValue |
| Methods inherited from class com.threerings.editor.swing.PropertyEditor |
|---|
createEditor, getDefaultInstance, getMaximum, getMaxSize, getMinimum, getMinSize, getMode, getObject, getProperty, getPropertyColor, getPropertyLabel, getScale, getStep, getUnits, init, isTableCellType, registerEditorClass, registerEditorClass, setObject |
| Methods inherited from class com.threerings.editor.swing.BasePropertyEditor |
|---|
addChangeListener, copyPropertyPath, createButton, darkenColor, fireStateChanged, getBackgroundColor, getColor, getColor, getColor, getDarkerBackground, getLabel, getLabel, getLabel, getLabel, getLabels, getLabels, getLabels, getMousePath, getPropertyColor, loadIcon, makeCollapsible, removeChangeListener, updateBorder |
| Methods inherited from class com.samskivert.swing.CollapsiblePanel |
|---|
getContent, isCollapsed, setCollapsed, setGap, setTrigger, setTriggerContainer, setTriggerContainer, setTriggerContainer |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected TableArrayListEditor.Column[] _columns
protected JTable _table
protected JButton _addColumn
protected JButton _copy
protected JButton _delete
protected ObjectPanel _opanel
| Constructor Detail |
|---|
public TableArrayListEditor()
| Method Detail |
|---|
public int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic String getColumnName(int column)
getColumnName in interface TableModelpublic Class<?> getColumnClass(int column)
getColumnClass in interface TableModel
public boolean isCellEditable(int row,
int column)
isCellEditable in interface TableModel
public Object getValueAt(int row,
int column)
getValueAt in interface TableModel
public void setValueAt(Object value,
int row,
int column)
setValueAt in interface TableModelpublic void addTableModelListener(TableModelListener listener)
addTableModelListener in interface TableModelpublic void removeTableModelListener(TableModelListener listener)
removeTableModelListener in interface TableModelpublic void valueChanged(ListSelectionEvent event)
valueChanged in interface ListSelectionListenerpublic void stateChanged(ChangeEvent event)
stateChanged in interface ChangeListenerpublic void actionPerformed(ActionEvent event)
actionPerformed in interface ActionListeneractionPerformed in class ArrayListEditorpublic void update()
PropertyEditor
update in class PropertyEditorpublic void makeVisible(int idx)
ArrayListEditor
makeVisible in class ArrayListEditorprotected void didInit()
PropertyEditor
didInit in class ArrayListEditorprotected String getMousePath(Point pt)
BasePropertyEditor
getMousePath in class BasePropertyEditorpt - the location of the mouse cursor.protected void addValue(Object value)
ArrayListEditor
addValue in class ArrayListEditorprotected void copyValue(int idx)
ArrayListEditor
copyValue in class ArrayListEditorprotected void removeValue(int idx)
ArrayListEditor
removeValue in class ArrayListEditorprotected void addColumn()
protected void copyColumn(int column)
protected void removeColumn(int column)
protected void updateColumnWidths()
protected boolean is2DArray()
protected void createArrayColumns()
protected TableArrayListEditor.Column createArrayColumn(int column)
protected void moveValue(int row)
protected void moveColumn(int column)
protected void moveCell(int row,
int col)
protected void moveWithinArray(Object array,
int source,
int dest)
source to dest, shifting values left
or right to make room.
protected void updateSelected()
protected IntTuple getSelection()
null to indicate that there is no usable selection.
protected void setSelection(int row,
int column)
getSelection().
protected void fireTableChanged(int firstRow,
int lastRow,
int column,
int type)
TableModelEvent.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||