Package jmri.jmrit.picker
Class PickListModel<E extends NamedBean>
java.lang.Object
javax.swing.table.AbstractTableModel
jmri.jmrit.beantable.BeanTableDataModel<E>
jmri.jmrit.picker.PickListModel<E>
- Type Parameters:
E- the supported type of NamedBean
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
- Direct Known Subclasses:
PickListModel.AudioPickModel,PickListModel.BlockPickModel,PickListModel.EntryExitPickModel,PickListModel.GlobalVariablePickModel,PickListModel.LightPickModel,PickListModel.LogixPickModel,PickListModel.MemoryPickModel,PickListModel.OBlockPickModel,PickListModel.ReporterPickModel,PickListModel.SensorPickModel,PickListModel.SignalHeadPickModel,PickListModel.SignalMastPickModel,PickListModel.TurnoutPickModel,PickListModel.WarrantPickModel
Abstract class to make pick lists for NamedBeans; Table model for pick lists
in IconAdder
This file is part of JMRI.
Concrete pick list class for many beans are include at the end of this file. This class also has instantiation methods serve as a factory for those classes.
Note: Extensions of this class must call init() after instantiation.
This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static classNested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected TableRowSorter<PickListModel<E>>static final intstatic final ResourceBundlestatic final intstatic final intFields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOLFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract EReturn bean with name given in parameter.abstract Estatic PickListModel<Audio>static PickListModel<Block>abstract booleanCheck if beans can be added by this model.voidProcess a click on The value cell.voiddispose()Removes property change listeners from Beans.static PickListModel<DestinationPoints>getBeanAt(int index) If table has been sorted table row no longer is the same as array index.This method is overridden if only a limited set of the beans should be retrieved.protected StringGet String of the Single Bean Type.getBySystemName(String name) protected EgetByUserName(String name) Class<?>getColumnClass(int c) intGet Column Count INCLUDING Bean Property Columns.getColumnName(int c) intgetIndexOf(E bean) Get the Table Model Bean Manager.protected StringgetName()static intgetNumInstances(String type) intgetTable()Get the current Bean state value in human readable form.getValueAt(int r, int c) SYSNAMECOL returns the actual Bean, NOT the System Name.static PickListModel<GlobalVariable>booleanisCellEditable(int r, int c) static PickListModel<Light>static PickListModel<Logix>Make pick table, DND enabled.voidmakeSorter(JTable table) static PickListModel<Memory>static PickListModel<Sensor>static PickListModel<OBlock>voidHandle additions and deletions in the table and changes to beans within the table.static PickListModel<Reporter>static PickListModel<Sensor>voidsetValueAt(Object type, int r, int c) static PickListModel<SignalHead>static PickListModel<SignalMast>static PickListModel<Turnout>protected voidoverride BeanTableDataModel only lists SystemNamestatic PickListModel<Warrant>Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureButton, configureJTable, configureTable, configValueColumn, copySystemName, copyUserName, deleteBean, doDelete, editComment, exportToCSV, formatToolTip, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPreferredWidth, getPropertyColumnCount, getPropertyColumnDescriptor, isClearUserNameAllowed, makeJTable, matchPropertyName, moveBean, persistTable, printColumns, printTable, removeName, renameBean, setColumnIdentities, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, setManager, setPropertyColumnsVisible, showPopup, showTableHeaderPopup, stopPersistingTableMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
_pickList
-
_name
-
_sorter
-
SNAME_COLUMN
- See Also:
-
UNAME_COLUMN
- See Also:
-
POSITION_COL
- See Also:
-
rb
-
_listMap
-
-
Constructor Details
-
PickListModel
public PickListModel()Default constructor makes a table sorted by System Name.
-
-
Method Details
-
getNumInstances
-
getBeanAt
If table has been sorted table row no longer is the same as array index.- Parameters:
index- row of table- Returns:
- bean at index or null if index is out of range
-
getIndexOf
-
getBeanList
This method is overridden if only a limited set of the beans should be retrieved.- Returns:
- the list of beans
-
updateNameList
override BeanTableDataModel only lists SystemName- Overrides:
updateNameListin classBeanTableDataModel<E extends NamedBean>
-
getNamedBeanSet
-
getBySystemName
- Specified by:
getBySystemNamein classBeanTableDataModel<E extends NamedBean>
-
getByUserName
- Specified by:
getByUserNamein classBeanTableDataModel<E extends NamedBean>
-
getManager
Get the Table Model Bean Manager. In many cases, especially around Model startup, this will be the Proxy Manager, which is then changed to the hardware specific manager.- Specified by:
getManagerin classBeanTableDataModel<E extends NamedBean>- Returns:
- current Manager in use by the Model.
-
addBean
Return bean with name given in parameter. Create if needed and possible.- Parameters:
name- the System name for the Bean.- Returns:
- the Bean or null if not made.
- Throws:
IllegalArgumentException- with reason why Bean cannot be created.
-
addBean
@CheckForNull public abstract E addBean(@Nonnull String sysName, String userName) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
canAddBean
Check if beans can be added by this model.- Returns:
- true if model can create beans; false otherwise
-
getMasterClassName
- Specified by:
getMasterClassNamein classBeanTableDataModel<E extends NamedBean>
-
clickOn
Process a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<E extends NamedBean>- Parameters:
t- the Bean that has been clicked.
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classBeanTableDataModel<E extends NamedBean>
-
getColumnCount
Get Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classBeanTableDataModel<E extends NamedBean>
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classBeanTableDataModel<E extends NamedBean>
-
isCellEditable
- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classBeanTableDataModel<E extends NamedBean>
-
getRowCount
- Specified by:
getRowCountin interfaceTableModel- Overrides:
getRowCountin classBeanTableDataModel<E extends NamedBean>
-
getValueAt
SYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classBeanTableDataModel<E extends NamedBean>
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classBeanTableDataModel<E extends NamedBean>
-
getValue
Get the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<E extends NamedBean>- Parameters:
systemName- System name of Bean.- Returns:
- state value in localised human readable form.
-
getName
-
getBeanType
Get String of the Single Bean Type. In many cases the return is Bundle localised so should not be used for matching Bean types.- Overrides:
getBeanTypein classBeanTableDataModel<E extends NamedBean>- Returns:
- Bean Type String.
-
propertyChange
Handle additions and deletions in the table and changes to beans within the table.- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBeanTableDataModel<E extends NamedBean>- Parameters:
e- the change
-
makePickTable
Make pick table, DND enabled.- Returns:
- the table
-
makeSorter
-
getTable
-
dispose
Removes property change listeners from Beans.- Overrides:
disposein classBeanTableDataModel<E extends NamedBean>
-
turnoutPickModelInstance
-
sensorPickModelInstance
-
multiSensorPickModelInstance
-
signalHeadPickModelInstance
-
signalMastPickModelInstance
-
memoryPickModelInstance
-
globalVariablePickModelInstance
-
blockPickModelInstance
-
reporterPickModelInstance
-
lightPickModelInstance
-
oBlockPickModelInstance
-
warrantPickModelInstance
-
entryExitPickModelInstance
-
logixPickModelInstance
-
audioPickModelInstance
-