Class ImagedComboBoxCellEditorFactory
java.lang.Object
common.editors.ImagedComboBoxCellEditorFactory
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThis class is used to display a custom renderer into the comboBox with Jlabels generated by getDrawComponent method.protected classThis is a combobox editor.protected classprotected classprotected classClass used to display a component in a combobox -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanAllows null as a valid componentCache for componentsprotected ClassDefinitionClass Definition data structureEditor instanceNull element rendererprotected intInstance Optionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected TableCellRendererRenderer instanceprotected StationDefinitionStation Definition data structure -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ImagedComboBoxCellEditorFactory used to display texts without images.Creates a new ImagedComboBoxCellEditorFactory used to display class name comboboxesCreates a new ImagedComboBoxCellEditorFactory used to display station name comboboxesImagedComboBoxCellEditorFactory(Object md, int option) Creates a new ImagedComboBoxCellEditorFactory used to display texts with images according to the specified option. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears inner component cache.getDrawComponent(Object key) Returns component to draw a station or a class in a comboBox.Returns an instance of editor, given search key for elements to be shownReturns an instance of editor, given search key for elements to be shownReturns an instance of Imaged combobox renderergetRenderer(boolean isGrayRenderer, int referenceColumn) voidChanges stored reference to class data structurevoidChanges stored reference to station data structure
-
Field Details
-
OPTION_DEFAULT
public static final int OPTION_DEFAULT- See Also:
-
OPTION_CLASS_TYPES
public static final int OPTION_CLASS_TYPES- See Also:
-
OPTION_STATION_TYPES
public static final int OPTION_STATION_TYPES- See Also:
-
OPTION_CLASS_NAMES
public static final int OPTION_CLASS_NAMES- See Also:
-
OPTION_STATION_NAMES
public static final int OPTION_STATION_NAMES- See Also:
-
OPTION_FJ_STATION_NAMES
public static final int OPTION_FJ_STATION_NAMES- See Also:
-
OPTION_TRANSITION_MODES
public static final int OPTION_TRANSITION_MODES- See Also:
-
cd
Class Definition data structure -
sd
Station Definition data structure -
option
protected int optionInstance Option -
cache
Cache for components -
renderer
Renderer instance -
editor
Editor instance -
nullRenderer
Null element renderer -
allowsNull
protected boolean allowsNullAllows null as a valid component
-
-
Constructor Details
-
ImagedComboBoxCellEditorFactory
public ImagedComboBoxCellEditorFactory()Creates a new ImagedComboBoxCellEditorFactory used to display texts without images. -
ImagedComboBoxCellEditorFactory
Creates a new ImagedComboBoxCellEditorFactory used to display class name comboboxes- Parameters:
cd- reference to class definition data structure
-
ImagedComboBoxCellEditorFactory
Creates a new ImagedComboBoxCellEditorFactory used to display station name comboboxes- Parameters:
sd- reference to station definition data structure
-
ImagedComboBoxCellEditorFactory
Creates a new ImagedComboBoxCellEditorFactory used to display texts with images according to the specified option.
-
-
Method Details
-
setData
Changes stored reference to class data structure- Parameters:
cd- reference to class definition data structure
-
setData
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
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
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
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
Returns an instance of Imaged combobox renderer- Returns:
- an instance of Imaged combobox renderer
-
getRenderer
- Parameters:
isGrayRenderer- if it is enabled or disable rendererreferenceColumn- if it is disable renderer then the column that is use to the cell's editable status- Returns:
- an instance of Imaged combobox renderer
-