net.sf.freecol.client.gui.panel
Class ColorCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
net.sf.freecol.client.gui.panel.ColorCellEditor
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener, javax.swing.CellEditor, javax.swing.table.TableCellEditor
public final class ColorCellEditor
- extends javax.swing.AbstractCellEditor
- implements javax.swing.table.TableCellEditor, java.awt.event.ActionListener
A table cell editor that can be used to edit colors.
- See Also:
- Serialized Form
| Fields inherited from class javax.swing.AbstractCellEditor |
changeEvent, listenerList |
|
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent event)
This function analyzes an event and calls the right methods to take
care of the user's requests. |
java.lang.Object |
getCellEditorValue()
Returns the value of the cell editor. |
java.awt.Component |
getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean hasFocus,
int row,
int column)
Returns the component used to edit the cell's value. |
| Methods inherited from class javax.swing.AbstractCellEditor |
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.CellEditor |
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing |
logger
private static final java.util.logging.Logger logger
EDIT
private static final java.lang.String EDIT
- See Also:
- Constant Field Values
OK
private static final java.lang.String OK
- See Also:
- Constant Field Values
CANCEL
private static final java.lang.String CANCEL
- See Also:
- Constant Field Values
colorEditButton
private final javax.swing.JButton colorEditButton
colorChooser
private final javax.swing.JColorChooser colorChooser
colorChooserPanel
private final ColorCellEditor.ColorChooserPanel colorChooserPanel
canvas
private final Canvas canvas
currentColor
private java.awt.Color currentColor
ColorCellEditor
public ColorCellEditor(Canvas canvas)
- The constructor to use.
- Parameters:
canvas - The top level component that holds all other components.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- This function analyzes an event and calls the right methods to take
care of the user's requests.
- Specified by:
actionPerformed in interface java.awt.event.ActionListener
- Parameters:
event - The incoming ActionEvent.
getTableCellEditorComponent
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean hasFocus,
int row,
int column)
- Returns the component used to edit the cell's value.
- Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
- Parameters:
table - The table whose cell needs to be edited.value - The value of the cell being edited.hasFocus - Indicates whether or not the cell in question has focus.row - The row index of the cell that is being edited.column - The column index of the cell that is being edited.
- Returns:
- The component used to edit the cell's value.
getCellEditorValue
public java.lang.Object getCellEditorValue()
- Returns the value of the cell editor.
- Specified by:
getCellEditorValue in interface javax.swing.CellEditor
- Returns:
- The value of the cell editor.