Class ButtonsPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ButtonsPanel extends JPanel
ButtonsPanel ofrece un widget con un conjunto de botones preestablecidos, aunque también se pueden añadir botones con el método addButton(String, int)
Version:
09/05/2008
Author:
BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
See Also:
  • Field Details

  • Constructor Details

    • ButtonsPanel

      public ButtonsPanel()
      Crea un ButtonsPanel con un Layout por defecto.
    • ButtonsPanel

      public ButtonsPanel(int items)
      Crea un ButtonsPanel con un Layout por defecto.
      Parameters:
      items - Que botones vamos a usar en la creación.
  • Method Details

    • addButtonPressedListener

      public void addButtonPressedListener(ButtonsPanelListener listener)
      Añadir el disparador de cuando se pulsa un botón.
      Parameters:
      listener -
    • getButtonPressedListeners

      public Object[] getButtonPressedListeners()
      Devuelve el array de listeners del componente
      Returns:
    • removeButtonPressedListener

      public void removeButtonPressedListener(ButtonsPanelListener listener)
      Borrar el disparador de eventos de los botones.
      Parameters:
      listener -
    • addAccept

      public void addAccept()
      Añadir el boton Aceptar.
    • addSave

      public void addSave()
      Añadir el boton Guardar.
    • addCancel

      public void addCancel()
      Añadir el boton Cancelar.
    • addYes

      public void addYes()
      Añadir el boton Sí.
    • addNo

      public void addNo()
      Añadir el boton No.
    • addApply

      public void addApply()
      Añadir el boton Aplicar.
    • addClose

      public void addClose()
      Añadir el boton Cerrar.
    • addExit

      public void addExit()
      Añadir el boton Salir.
    • addSeeDetails

      public void addSeeDetails()
      Añadir el boton Ver detalles.
    • addHideDetails

      public void addHideDetails()
      Añadir el boton Ocultar detalles.
    • addPause

      public void addPause()
      Añadir el boton Pausar.
    • addRestart

      public void addRestart()
      Añadir el boton Reanudar.
    • addButton

      public void addButton(String text, int id)
      Añadimos un botón definido por el usuario.
      Parameters:
      text - Texto que contendrá el botón
      id - Entero para identificar los eventos del botón
    • getButton

      public JButton getButton(int id)
      Obtener un botón por su Entero
      Parameters:
      id - Número del disparador del botón
      Returns:
      El botón especificado o null si no se encontró el botón.
    • removeButton

      public boolean removeButton(int id)

      Removes the button identified by id.

      Parameters:
      id - identifier of the button
      Returns:
      true if has removed the button; otherwise false
    • getButtonText

      protected String getButtonText(int id)

      Returns the text of the button identified by id.

      Parameters:
      id - identifier of the button
      Returns:
      text of the identified button
    • setEnabled

      public boolean setEnabled(int id, boolean b)

      Enables (or disables) the button identified by id.

      Parameters:
      id - identifier of the button
      b - true to enable the button, otherwise false
      Returns:
      true if there was a button of that kind in this group, otherwise false