Class ImagedComboBoxCellEditorFactory

java.lang.Object
common.editors.ImagedComboBoxCellEditorFactory

public class ImagedComboBoxCellEditorFactory extends Object

Title: Imaged ComboBox Table CellViewer/CellEditor Factory

Description: A component that creates Comboboxes with station or class names and images to be used as both a viewer and an editor in a table. Uses internal caching to speed up visualization.

Author:
Bertoli Marco Date: 11-may-2006 Time: 17.03.54
  • Field Details

  • Constructor Details

    • ImagedComboBoxCellEditorFactory

      public ImagedComboBoxCellEditorFactory()
      Creates a new ImagedComboBoxCellEditorFactory used to display texts without images.
    • ImagedComboBoxCellEditorFactory

      public ImagedComboBoxCellEditorFactory(ClassDefinition cd)
      Creates a new ImagedComboBoxCellEditorFactory used to display class name comboboxes
      Parameters:
      cd - reference to class definition data structure
    • ImagedComboBoxCellEditorFactory

      public ImagedComboBoxCellEditorFactory(StationDefinition sd)
      Creates a new ImagedComboBoxCellEditorFactory used to display station name comboboxes
      Parameters:
      sd - reference to station definition data structure
    • ImagedComboBoxCellEditorFactory

      public ImagedComboBoxCellEditorFactory(Object md, int option)
      Creates a new ImagedComboBoxCellEditorFactory used to display texts with images according to the specified option.
  • Method Details

    • setData

      public void setData(ClassDefinition cd)
      Changes stored reference to class data structure
      Parameters:
      cd - reference to class definition data structure
    • setData

      public void setData(StationDefinition sd)
      Changes stored reference to station data structure
      Parameters:
      sd - reference to station definition data structure
    • clearCache

      public void clearCache()
      Clears inner component cache. Must be called each time name or type of a class/station changes.
    • getEditor

      public TableCellEditor getEditor(Object[] data)
      Returns an instance of editor, given search key for elements to be shown
      Parameters:
      data - array with search's key for elements to be shown
    • getEditor

      public TableCellEditor getEditor(List data)
      Returns an instance of editor, given search key for elements to be shown
      Parameters:
      data - vector with search's key for elements to be shown
    • getDrawComponent

      protected ImagedComboBoxCellEditorFactory.LabelRenderer getDrawComponent(Object key)
      Returns component to draw a station or a class in a comboBox. Provides caching functionalities.
      Parameters:
      key - search's key for component to be shown
      Returns:
      created component
    • getRenderer

      public TableCellRenderer getRenderer()
      Returns an instance of Imaged combobox renderer
      Returns:
      an instance of Imaged combobox renderer
    • getRenderer

      public TableCellRenderer getRenderer(boolean isGrayRenderer, int referenceColumn)
      Parameters:
      isGrayRenderer - if it is enabled or disable renderer
      referenceColumn - if it is disable renderer then the column that is use to the cell's editable status
      Returns:
      an instance of Imaged combobox renderer