FileDocCategorySizeDatePackage
VolumeEditor.javaAPI DocExample2039Mon Nov 09 12:45:50 GMT 1998None

VolumeEditor

public class VolumeEditor extends JScrollBar implements TableCellEditor

Fields Summary
protected transient Vector
listeners
protected transient int
originalValue
Constructors Summary
public VolumeEditor()

    super(JScrollBar.HORIZONTAL);
    listeners = new Vector();
  
Methods Summary
public voidaddCellEditorListener(javax.swing.event.CellEditorListener cel)

    listeners.addElement(cel);
  
public voidcancelCellEditing()

fireEditingCanceled();
protected voidfireEditingCanceled()

    setValue(originalValue);
    ChangeEvent ce = new ChangeEvent(this);
    for (int i = listeners.size(); i >= 0; i--) {
      ((CellEditorListener)listeners.elementAt(i)).editingCanceled(ce);
    }
  
protected voidfireEditingStopped()

    ChangeEvent ce = new ChangeEvent(this);
    for (int i = listeners.size() - 1; i >= 0; i--) {
      ((CellEditorListener)listeners.elementAt(i)).editingStopped(ce);
    }
  
public java.lang.ObjectgetCellEditorValue()

return new Integer(getValue());
public java.awt.ComponentgetTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)

    if (value == null) {
      return this;
    }
    if (value instanceof Volume) {
      setValue(((Volume)value).getVolume());
    }
    else {
      setValue(0);
    }
    table.setRowSelectionInterval(row, row);
    table.setColumnSelectionInterval(column, column);
    originalValue = getValue();
    return this;
  
public booleanisCellEditable(java.util.EventObject eo)

return true;
public voidremoveCellEditorListener(javax.swing.event.CellEditorListener cel)

    listeners.removeElement(cel);
  
public booleanshouldSelectCell(java.util.EventObject eo)

    return true;
  
public booleanstopCellEditing()

    fireEditingStopped();
    return true;