Class FillEditor

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditor, AncestorListener, TableCellEditor

public class FillEditor extends JPanel implements TableCellEditor, AncestorListener
This widget provides a TableCellEditor for changing the fill color or pattern for drawing something (assuming the Paint value is stored in a TableModel column).
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • FillEditor

      public FillEditor(Window d, boolean isSolidOnly)
      Create a FillEditor instance for a dialog window.
      Parameters:
      d - Window that needs a FillEditor dialog popup
      isSolidOnly - boolean true if only solid fills should be provided
  • Method Details

    • getTableCellEditorComponent

      public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
      Get an editor instance for a table cell.
      Specified by:
      getTableCellEditorComponent in interface TableCellEditor
      Parameters:
      table - JTable that needs an editor
      value - the current Object value of the table cell being edited
      isSelected - boolean true if table cell is selected
      row - zero-based row index of the cell to edit
      column - zero-based column index of the cell to edit
      Returns:
      Component that provides the editing capability
    • getCellEditorValue

      public Object getCellEditorValue()
      Get the current value held in the editor.
      Specified by:
      getCellEditorValue in interface CellEditor
      Returns:
      editor value
    • isCellEditable

      public boolean isCellEditable(EventObject anEvent)
      Test if this cell is editable (which should always be the case if an editor was invoked on it.
      Specified by:
      isCellEditable in interface CellEditor
      Parameters:
      anEvent - EventObject causing this method to be called
      Returns:
      always true
    • shouldSelectCell

      public boolean shouldSelectCell(EventObject anEvent)
      Indicate whether editing this cell should cause the cell to be selected
      Specified by:
      shouldSelectCell in interface CellEditor
      Parameters:
      anEvent - EventObject causing this method to be called
      Returns:
      always true
    • stopCellEditing

      public boolean stopCellEditing()
      Stop editing the cell.
      Specified by:
      stopCellEditing in interface CellEditor
      Returns:
      always true
    • cancelCellEditing

      public void cancelCellEditing()
      Cancel editing the cell, discarding any changes.
      Specified by:
      cancelCellEditing in interface CellEditor
    • addCellEditorListener

      public void addCellEditorListener(CellEditorListener l)
      Register a CellEditorListener to this editor.
      Specified by:
      addCellEditorListener in interface CellEditor
      Parameters:
      l - CellEditorListener to register
    • removeCellEditorListener

      public void removeCellEditorListener(CellEditorListener l)
      Unregister a CellEditorListener from this editor.
      Specified by:
      removeCellEditorListener in interface CellEditor
      Parameters:
      l - CellEditorListener to unregister
    • ancestorAdded

      public void ancestorAdded(AncestorEvent event)
      DO NOT CALL. No-op.
      Specified by:
      ancestorAdded in interface AncestorListener
      Parameters:
      event - AncestorEvent
    • ancestorRemoved

      public void ancestorRemoved(AncestorEvent event)
      DO NOT CALL. Shut down the editor if the edited table is hidden or closed,
      Specified by:
      ancestorRemoved in interface AncestorListener
      Parameters:
      event - AncestorEvent
    • ancestorMoved

      public void ancestorMoved(AncestorEvent event)
      DO NOT CALL. No-op.
      Specified by:
      ancestorMoved in interface AncestorListener
      Parameters:
      event - AncestorEvent