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 analyses 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. |
void |
setData(java.util.Vector<Player> players,
Player owningPlayer)
Gives this table model the data that is being used in the table. |
| 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 |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- See Also:
- Constant Field Values
LICENSE
public static final java.lang.String LICENSE
- See Also:
- Constant Field Values
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
ColorCellEditor
public ColorCellEditor(Canvas canvas,
javax.swing.JPanel parent)
- The constructor to use.
- Parameters:
canvas - The top level component that holds all other components.parent - The parent JPanel of the table
setData
public void setData(java.util.Vector<Player> players,
Player owningPlayer)
- Gives this table model the data that is being used in the table.
- Parameters:
players - The players that should be edited in the table.owningPlayer - The player running the client that is displaying the table.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- This function analyses 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.