jmri.util.table
Class ButtonEditor
java.lang.Object
jmri.util.table.BasicCellEditor
jmri.util.table.ButtonEditor
- All Implemented Interfaces:
- ActionListener, MouseListener, PropertyChangeListener, EventListener, CellEditor, TableCellEditor
public class ButtonEditor
- extends BasicCellEditor
- implements ActionListener, TableCellEditor, MouseListener
Make a JButton in a table cell function.
Works with ButtonRenderer.
This was adapted from Core Swing Advanced Programming, Prentice Hall
Changes: Remove DataWithIcon reference. Change package
This also now implements and registers as a MouseListener, so you can change
the mouse-event behavior by overriding the needed methods.
| Methods inherited from class jmri.util.table.BasicCellEditor |
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getComponent, getEditingEvent, isCellEditable, propertyChange, removeCellEditorListener, setComponent, shouldSelectCell, stopCellEditing |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
value
protected Object value
foreground
protected Color foreground
background
protected Color background
font
protected Font font
ButtonEditor
public ButtonEditor(JButton button)
setForeground
public void setForeground(Color foreground)
setBackground
public void setBackground(Color background)
setFont
public void setFont(Font font)
getCellEditorValue
public Object getCellEditorValue()
- Specified by:
getCellEditorValue in interface CellEditor- Overrides:
getCellEditorValue in class BasicCellEditor
editingStarted
public void editingStarted(EventObject event)
- Overrides:
editingStarted in class BasicCellEditor
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable tbl,
Object value,
boolean isSelected,
int row,
int column)
- Specified by:
getTableCellEditorComponent in interface TableCellEditor
setValue
protected void setValue(Object value)
actionPerformed
public void actionPerformed(ActionEvent evt)
- Specified by:
actionPerformed in interface ActionListener
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressed in interface MouseListener
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExited in interface MouseListener
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEntered in interface MouseListener
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleased in interface MouseListener
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClicked in interface MouseListener
Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.
Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: