gui
Class SubmitEditor

java.lang.Object
  extended byjavax.swing.AbstractCellEditor
      extended byjavax.swing.DefaultCellEditor
          extended bygui.SubmitEditor
All Implemented Interfaces:
javax.swing.CellEditor, java.io.Serializable, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor

public class SubmitEditor
extends javax.swing.DefaultCellEditor

Class for making a customized button editor This class is used by the submitButtons in the table in ShipPanel It extends the DefaultCellEditor, and implement how the buttons should react when they are pushed.

See Also:
ShipPanel, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.DefaultCellEditor
javax.swing.DefaultCellEditor.EditorDelegate
 
Field Summary
protected  javax.swing.JButton button
           
 boolean isPushed
           
 
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
SubmitEditor(javax.swing.JCheckBox checkBox, ShipPanel shipPanel)
          Constructor for the SubmitEditor
 
Method Summary
protected  void fireEditingStopped()
          Method that forwards the message from the CellEditor to the delegate.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Method that make this editors component and returns a reference
 boolean stopCellEditing()
          Method nvoked when a component gains the keyboard focus.
 void updateShip(int row)
          Method for updating information about ship This method make the shipPanel update information about a ship
 
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getCellEditorValue, getClickCountToStart, getComponent, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCell
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, getCellEditorListeners, removeCellEditorListener
 
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, removeCellEditorListener
 

Field Detail

button

protected javax.swing.JButton button

isPushed

public boolean isPushed
Constructor Detail

SubmitEditor

public SubmitEditor(javax.swing.JCheckBox checkBox,
                    ShipPanel shipPanel)
Constructor for the SubmitEditor

Method Detail

updateShip

public void updateShip(int row)
Method for updating information about ship This method make the shipPanel update information about a ship


getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Method that make this editors component and returns a reference

Parameters:
value - of the cell to be edited
row - of the cell being edited
column - of the cell being edited
Returns:
Component

stopCellEditing

public boolean stopCellEditing()
Method nvoked when a component gains the keyboard focus. The method call the method from the super class

Returns:
boolean

fireEditingStopped

protected void fireEditingStopped()
Method that forwards the message from the CellEditor to the delegate. The method call the method from the super class