com.irisel.oms.guiom.comp
Class ComponentFactoryBase

java.lang.Object
  extended by com.irisel.oms.guiom.comp.ComponentFactoryBase
All Implemented Interfaces:
ComponentFactory

public class ComponentFactoryBase
extends java.lang.Object
implements ComponentFactory

Título:

Descripción:

Copyright: Copyright (c) 2003

Empresa:

Version:
1.0
Author:
Jose Manuel Gomez Alvarez

Field Summary
static java.awt.Color HYPERLINK_COLOR
           
static java.awt.Color MANDATORY_COLOR
           
static JComboList static_jcb
           
static javax.swing.table.DefaultTableCellRenderer static_txtf
           
static int TEXTFIELD_HEIGHT
           
static int TEXTFIELD_WIDTH
           
 
Constructor Summary
ComponentFactoryBase()
           
 
Method Summary
 java.awt.Component getComponent(ClassVO clsvo, Instance instance, int propId)
          It returns a JComponent object used as input control for a OMS Property.
 java.awt.Component getComponent(ClassVO clsvo, PropertyVO prop, java.lang.Object value)
           
 java.lang.Object getComponentValue(java.awt.Component component)
          This method is provided to obtain a component value.
 javax.swing.JLabel getLabel(ClassVO clsvo, int propId)
           
 javax.swing.JLabel getLabel(ClassVO clsvo, PropertyVO prop)
           
 java.awt.Component getTableCellComponent(ClassVO cvo, Instance inst, int col)
           
 java.awt.Component getTableCellComponent(ClassVO clsvo, PropertyVO prop, java.lang.Object value)
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been clicked (pressed and released) on a component.
 void setComponentValue(java.awt.Component component, java.lang.Object value)
          This method is used to set a component value.
 void setDimensions(java.awt.Component c, java.lang.String dimensions)
          String format matches that of dimensions field in oms_gui_comp_map: comma-separated integer values (2, 4 or 6 ) corresponding to height,width for preferred,minimum and maximum dimension, respectively.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MANDATORY_COLOR

public static final java.awt.Color MANDATORY_COLOR

HYPERLINK_COLOR

public static final java.awt.Color HYPERLINK_COLOR

TEXTFIELD_WIDTH

public static final int TEXTFIELD_WIDTH
See Also:
Constant Field Values

TEXTFIELD_HEIGHT

public static final int TEXTFIELD_HEIGHT
See Also:
Constant Field Values

static_txtf

public static javax.swing.table.DefaultTableCellRenderer static_txtf

static_jcb

public static JComboList static_jcb
Constructor Detail

ComponentFactoryBase

public ComponentFactoryBase()
                     throws GuiException
Throws:
GuiException
Method Detail

getLabel

public javax.swing.JLabel getLabel(ClassVO clsvo,
                                   int propId)
Specified by:
getLabel in interface ComponentFactory

getLabel

public javax.swing.JLabel getLabel(ClassVO clsvo,
                                   PropertyVO prop)
Specified by:
getLabel in interface ComponentFactory

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component.


getComponent

public java.awt.Component getComponent(ClassVO clsvo,
                                       Instance instance,
                                       int propId)
Description copied from interface: ComponentFactory
It returns a JComponent object used as input control for a OMS Property. The property is defined by its class (clsvo), and property id (propId).

Specified by:
getComponent in interface ComponentFactory
Parameters:
clsvo - ClassVO object
instance - Instance object used to initialize the control
propId - Index of the property in the instance associated with this control
Returns:
JComponent

getComponent

public java.awt.Component getComponent(ClassVO clsvo,
                                       PropertyVO prop,
                                       java.lang.Object value)
Specified by:
getComponent in interface ComponentFactory

setDimensions

public void setDimensions(java.awt.Component c,
                          java.lang.String dimensions)
String format matches that of dimensions field in oms_gui_comp_map: comma-separated integer values (2, 4 or 6 ) corresponding to height,width for preferred,minimum and maximum dimension, respectively. Example: 2,3,,,5,6 --> minimum dimension (2,3), preferred dimension not specified, maximum dimension (5,6).

Parameters:
dimensions -
c - component

getTableCellComponent

public java.awt.Component getTableCellComponent(ClassVO cvo,
                                                Instance inst,
                                                int col)
Specified by:
getTableCellComponent in interface ComponentFactory

getTableCellComponent

public java.awt.Component getTableCellComponent(ClassVO clsvo,
                                                PropertyVO prop,
                                                java.lang.Object value)

getComponentValue

public java.lang.Object getComponentValue(java.awt.Component component)
This method is provided to obtain a component value. As different components have different methods to obtain the value (JTextField.getText(), JComboBox.getValue(), JCheckBox.isSelected()...) this method encapsulates the logic to access the component value regardless of its type.

Specified by:
getComponentValue in interface ComponentFactory

setComponentValue

public void setComponentValue(java.awt.Component component,
                              java.lang.Object value)
This method is used to set a component value. Subclasses can extend the functionality for custom controls, but must call super() to initialize baseline components.

Specified by:
setComponentValue in interface ComponentFactory