Package jmri.jmrit.beantable.turnout
Class TurnoutTableDataModel.ImageIconRenderer
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- jmri.jmrit.beantable.turnout.TurnoutTableDataModel.ImageIconRenderer
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.CellEditor
,javax.swing.table.TableCellEditor
,javax.swing.table.TableCellRenderer
- Enclosing class:
- TurnoutTableDataModel
class TurnoutTableDataModel.ImageIconRenderer extends javax.swing.AbstractCellEditor implements javax.swing.table.TableCellEditor, javax.swing.table.TableCellRenderer
Visualize state in table as a graphic, customized for Turnouts (4 states). Renderer and Editor are identical, as the cell contents are not actually edited, only used to toggle state usingTurnoutTableDataModel.clickOn(Turnout)
.
-
-
Field Summary
Fields Modifier and Type Field Description protected char
beanTypeChar
protected int
iconHeight
protected javax.swing.JLabel
label
protected javax.swing.ImageIcon
offIcon
protected java.lang.String
offIconPath
protected java.awt.image.BufferedImage
offImage
protected javax.swing.ImageIcon
onIcon
protected java.lang.String
onIconPath
protected java.awt.image.BufferedImage
onImage
protected java.lang.String
rootPath
-
Constructor Summary
Constructors Constructor Description ImageIconRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getCellEditorValue()
java.awt.Component
getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
java.awt.Component
getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
protected void
loadIcons()
Read and buffer graphics.javax.swing.JLabel
updateLabel(java.lang.String value, int row, javax.swing.JTable table)
-
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
-
-
-
-
Field Detail
-
label
protected javax.swing.JLabel label
-
rootPath
protected java.lang.String rootPath
-
beanTypeChar
protected char beanTypeChar
-
onIconPath
protected java.lang.String onIconPath
-
offIconPath
protected java.lang.String offIconPath
-
onImage
protected java.awt.image.BufferedImage onImage
-
offImage
protected java.awt.image.BufferedImage offImage
-
onIcon
protected javax.swing.ImageIcon onIcon
-
offIcon
protected javax.swing.ImageIcon offIcon
-
iconHeight
protected int iconHeight
-
-
Constructor Detail
-
ImageIconRenderer
ImageIconRenderer()
-
-
Method Detail
-
getTableCellRendererComponent
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
- Specified by:
getTableCellRendererComponent
in interfacejavax.swing.table.TableCellRenderer
-
getTableCellEditorComponent
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
- Specified by:
getTableCellEditorComponent
in interfacejavax.swing.table.TableCellEditor
-
updateLabel
public javax.swing.JLabel updateLabel(java.lang.String value, int row, javax.swing.JTable table)
-
getCellEditorValue
public java.lang.Object getCellEditorValue()
- Specified by:
getCellEditorValue
in interfacejavax.swing.CellEditor
-
loadIcons
protected void loadIcons()
Read and buffer graphics. Only called once for this table.
-
-