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
ConstructorDescriptionAttributesTableModel
(XsdTreeNode node, de.javagl.treetable.JTreeTable treeTable) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyColumnWidth
(JTable attributeTable) Apply the column widths to a newly created table.Class<?>
getColumnClass
(int columnIndex) int
getColumnName
(int columnIndex) getNode()
Returns the underlying node for which attributes are shown.int
getValueAt
(int rowIndex, int columnIndex) boolean
isCellEditable
(int rowIndex, int columnIndex) void
setValueAt
(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:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
getValueAt
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in 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.
-