net.sf.freecol.client.gui.panel
Class ColorCellEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by 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

Constructor Summary
ColorCellEditor(Canvas canvas)
          The constructor to use.
 
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, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
 

Constructor Detail

ColorCellEditor

public ColorCellEditor(Canvas canvas)
The constructor to use.

Parameters:
canvas - The top level component that holds all other components.
Method Detail

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.