Class PropertiesComponent

All Implemented Interfaces:
FocusListener, ItemListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, ScrollPaneConstants, PropertiesComponentListener, SliderListener

Componente para crear un cuadro de propiedades de configuracion standard.
Version:
19/04/2007
Author:
BorSanZa - Borja Sánchez Zamorano (borja.sanchez@iver.es)
See Also:
  • Field Details

  • Constructor Details

    • PropertiesComponent

      public PropertiesComponent()
      Constructor de la calse
    • PropertiesComponent

      public PropertiesComponent(ArrayList values)
      Constructor para poder pasarle un ArrayList de PropertyStruct
      Parameters:
      values -
    • PropertiesComponent

      public PropertiesComponent(Properties properties)
      Constructor para poder pasarle un Properties
      Parameters:
      values -
  • Method Details

    • addPropertyStruct

      public void addPropertyStruct(PropertyStruct property)
      Añade un PropertyStruct al componente
      Parameters:
      property -
    • addValue

      public void addValue(String textLabel, String key, Object value, Object[] extras)
      Añade una clave/valor al panel de propiedades.

      El componente seleccionado dependera del instanceof del valor y las opciones extras que se pongan. Por ejemplo: para el instanceof de un String siempre se usara un JTextField, en cambio, para un Integer, se podran usar 3 tipos, el JSlider, JComboBox y JSpinner. Estos tipos se especifican en el array extras, poniendolo siempre en la posicion 0. En la posición 1 y 2 de un JSlider se puede especificar el mínimo y el máximo del Slider.
      Parameters:
      textLabel -
      key -
      value -
      extras -
    • put

      public void put(Object key, Object value)
      Añade una clave valor al panel de propiedades.
      Parameters:
      key -
      value -
    • getValues

      public ArrayList getValues()
      Obtener todos los valores de la ventana, esto será un ArrayList que contendrá elementos de tipo PropertyStruct, pudiendo tener el valor antes de ser modificado y el nuevo valor.
      Returns:
      ArrayList de elementos de tipo PropertyStruct
      See Also:
      • PropertyStruct
    • getComponentUI

      public Component getComponentUI(String name)
      Devuelve el componente del interfaz que trata esa variable, hay que tener cuidado, puede devolver null o un componente distinto al esperado si se modífica esta clase.
      Parameters:
      name -
      Returns:
    • getProperties

      public Properties getProperties()
      Obtener todos los valores de la ventana en formato java.util.Properties
      Returns:
    • addStateChangedListener

      public void addStateChangedListener(PropertiesComponentListener listener)
      Añadir el disparador de cuando se pulsa un botón.
      Parameters:
      listener -
    • removeStateChangedListener

      public void removeStateChangedListener(PropertiesComponentListener listener)
      Borrar el disparador de eventos de los botones.
      Parameters:
      listener -
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Specified by:
      stateChanged in interface ChangeListener
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener
    • focusLost

      public void focusLost(FocusEvent e)
      Specified by:
      focusLost in interface FocusListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Specified by:
      keyReleased in interface KeyListener
    • actionChangeProperties

      public void actionChangeProperties(EventObject e)
      Specified by:
      actionChangeProperties in interface PropertiesComponentListener
    • actionValueChanged

      public void actionValueChanged(SliderEvent e)
      Description copied from interface: SliderListener
      Evento que se dispara cuando cambia el valor del componente. Nunca se dispara mientras se hace un dragged con el ratón.
      Specified by:
      actionValueChanged in interface SliderListener
      Parameters:
      e -
    • actionValueDragged

      public void actionValueDragged(SliderEvent e)
      Description copied from interface: SliderListener
      Evento que se dispara cuando cambia el valor del componente mientras se hace un dragged con el ratón.
      Specified by:
      actionValueDragged in interface SliderListener
      Parameters:
      e -
    • keyTyped

      public void keyTyped(KeyEvent e)
      Specified by:
      keyTyped in interface KeyListener
    • focusGained

      public void focusGained(FocusEvent e)
      Specified by:
      focusGained in interface FocusListener
    • keyPressed

      public void keyPressed(KeyEvent e)
      Specified by:
      keyPressed in interface KeyListener