Package org.opentrafficsim.editor
Class AttributesTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.opentrafficsim.editor.AttributesTableModel
- All Implemented Interfaces:
Serializable,TableModel
Model for a
JTable to display the attributes of a XsdTreeNode.
Copyright (c) 2023-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionAttributesTableModel(XsdTreeNode node, de.javagl.treetable.JTreeTable treeTable) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyColumnWidth(JTable attributeTable) Apply the column widths to a newly created table.Class<?>getColumnClass(int columnIndex) intgetColumnName(int columnIndex) getNode()Returns the underlying node for which attributes are shown.intgetValueAt(int rowIndex, int columnIndex) booleanisCellEditable(int rowIndex, int columnIndex) voidsetValueAt(Object aValue, int rowIndex, int columnIndex) Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
AttributesTableModel
Constructor.- Parameters:
node- XsdTreeNode; node of which the attributes are displayed.treeTable- JTreeTable; tree table.
-
-
Method Details
-
getRowCount
public int getRowCount() -
getColumnCount
public int getColumnCount() -
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getValueAt
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getNode
Returns the underlying node for which attributes are shown.- Returns:
- XsdTreeNode; underlying node for which attributes are shown.
-
applyColumnWidth
Apply the column widths to a newly created table.- Parameters:
attributeTable- JTable; table.
-