Apime v1.0

com.java4ever.apime.ui
Class IButton

java.lang.Object
  extended bycom.java4ever.apime.ui.IComponent
      extended bycom.java4ever.apime.ui.ITextComponent
          extended bycom.java4ever.apime.ui.ILabel
              extended bycom.java4ever.apime.ui.IButton
Direct Known Subclasses:
DefaultListCellRenderer, ICheckBox, IComboBox

public class IButton
extends ILabel

Botón con 2 estados.


Field Summary
static int DISABLED
          Indice visual para el estado disabled (4).
static int NORMAL
          Indice visual para el estado normal (0).
protected  boolean pressed
          Indica si está pretado.
static int PRESSED
          Indice visual para el estado pressed (3).
protected  boolean rollover
          Indica si está el cursor sobre el botón.
static int ROLLOVER
          Indice visual para el estado rollover (2).
protected  boolean selected
          Indica si está seleccionado.
static int SELECTED
          Indice visual para el estado selected (1).
 
Fields inherited from class com.java4ever.apime.ui.IComponent
CURSOR_ENABLED_ALWAYS, CURSOR_ENABLED_NEVER, CURSOR_ENABLED_SWITCH, skin
 
Constructor Summary
IButton(javax.microedition.lcdui.Image image)
          Crea el botón (ajusta el tamaño al de la imagen)..
IButton(java.lang.String text)
          Crea el botón.
IButton(java.lang.String text, javax.microedition.lcdui.Image image)
          Crea el botón.
 
Method Summary
 int getBackground(int index)
          Devuelve un color de fondo.
 javax.microedition.lcdui.Image getImage(int index)
          Devuelve una imagen.
 int getSkinId()
          Devuelve el Id del componente dentro del skin.
 boolean isSelected()
          Devuelve si el botón está seleccionado.
 void paint(javax.microedition.lcdui.Graphics g)
          Pinta el componente (background-paintComponent()-border).
protected  void processMouseEvent(int type, int x, int y)
          Procesa un evento de ratón.
 void processSkinProperties()
          Procesa las propiedades del skin para el componente.
 void setBackground(int index, int color)
          Asigna un color de fondo.
 void setEnabled(boolean enabled)
          Activa/Desactiva el componente.
 void setImage(int index, javax.microedition.lcdui.Image image)
          Asigna una imagen.
 void setSelected(boolean selected)
          Selecciona/Deselecciona el botón.
protected  void updateVisualStatus()
          Actualiza el estado visual (color/imagen) según el estado del botón.
 
Methods inherited from class com.java4ever.apime.ui.ILabel
getImage, paintComponent, setImage
 
Methods inherited from class com.java4ever.apime.ui.ITextComponent
getAlignment, getHorizontalAlignment, getText, getTextListener, getVerticalAlignment, processTextEvent, setAlignment, setHorizontalAlignment, setText, setTextListener, setVerticalAlignment
 
Methods inherited from class com.java4ever.apime.ui.IComponent
contains, getActionListener, getBackground, getBorder, getBounds, getComponentListener, getCursor, getCursorEnabled, getFocusListener, getFont, getForeground, getHeight, getKeyListener, getLocation, getLocationOnScreen, getMouseListener, getParent, getRoot, getScrollPane, getSize, getToolTip, getWidth, getX, getY, isEnabled, isFocusOwner, isVisible, processActionEvent, processComponentEvent, processFocusEvent, processKeyEvent, repaint, requestFocus, setActionListener, setBackground, setBorder, setBounds, setComponentListener, setCursor, setCursorEnabled, setFocusListener, setFont, setForeground, setKeyListener, setLocation, setMouseListener, setSize, setToolTip, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
Indice visual para el estado normal (0).

See Also:
Constant Field Values

SELECTED

public static final int SELECTED
Indice visual para el estado selected (1).

See Also:
Constant Field Values

ROLLOVER

public static final int ROLLOVER
Indice visual para el estado rollover (2).

See Also:
Constant Field Values

PRESSED

public static final int PRESSED
Indice visual para el estado pressed (3).

See Also:
Constant Field Values

DISABLED

public static final int DISABLED
Indice visual para el estado disabled (4).

See Also:
Constant Field Values

selected

protected boolean selected
Indica si está seleccionado.


rollover

protected boolean rollover
Indica si está el cursor sobre el botón.


pressed

protected boolean pressed
Indica si está pretado.

Constructor Detail

IButton

public IButton(java.lang.String text)
Crea el botón.

Parameters:
text - Texto del botón

IButton

public IButton(javax.microedition.lcdui.Image image)
Crea el botón (ajusta el tamaño al de la imagen)..

Parameters:
image - Imagen

IButton

public IButton(java.lang.String text,
               javax.microedition.lcdui.Image image)
Crea el botón.

Parameters:
text - Texto del botón
image - Imagen
Method Detail

setBackground

public void setBackground(int index,
                          int color)
Asigna un color de fondo.

Parameters:
index - Indice visual
color - Color
See Also:
NORMAL, SELECTED, ROLLOVER, PRESSED, DISABLED

getBackground

public int getBackground(int index)
Devuelve un color de fondo.

Parameters:
index - Indice visual
Returns:
Color
See Also:
NORMAL, SELECTED, ROLLOVER, PRESSED, DISABLED

setImage

public void setImage(int index,
                     javax.microedition.lcdui.Image image)
Asigna una imagen.

Parameters:
index - Indice visual
image - Imagen (puede ser 'null')
See Also:
NORMAL, SELECTED, ROLLOVER, PRESSED, DISABLED

getImage

public javax.microedition.lcdui.Image getImage(int index)
Devuelve una imagen.

Parameters:
index - Indice visual
Returns:
Imagen o 'null' si no tiene
See Also:
NORMAL, SELECTED, ROLLOVER, PRESSED, DISABLED

setSelected

public void setSelected(boolean selected)
Selecciona/Deselecciona el botón.

Parameters:
selected - True para seleccionarlo

isSelected

public boolean isSelected()
Devuelve si el botón está seleccionado.


setEnabled

public void setEnabled(boolean enabled)
Description copied from class: IComponent
Activa/Desactiva el componente.

Overrides:
setEnabled in class IComponent
Parameters:
enabled - True para activarlo

getSkinId

public int getSkinId()
Description copied from class: IComponent
Devuelve el Id del componente dentro del skin.

Overrides:
getSkinId in class ILabel

processSkinProperties

public void processSkinProperties()
Description copied from class: IComponent
Procesa las propiedades del skin para el componente.

Overrides:
processSkinProperties in class IComponent

paint

public void paint(javax.microedition.lcdui.Graphics g)
Description copied from class: IComponent
Pinta el componente (background-paintComponent()-border).

Overrides:
paint in class IComponent
Parameters:
g - Contexto gráfico
See Also:
IComponent.paintComponent(javax.microedition.lcdui.Graphics)

updateVisualStatus

protected void updateVisualStatus()
Actualiza el estado visual (color/imagen) según el estado del botón.


processMouseEvent

protected void processMouseEvent(int type,
                                 int x,
                                 int y)
Description copied from class: IComponent
Procesa un evento de ratón.

Overrides:
processMouseEvent in class IComponent
Parameters:
type - Tipo de evento
x - Coordenada X relativa al componente
y - Coordenada Y relativa al componente
See Also:
Event.MOUSE_ENTERED, Event.MOUSE_EXITED, Event.MOUSE_PRESSED, Event.MOUSE_RELEASED, Event.MOUSE_CLICKED, Event.MOUSE_MOVED, Event.MOUSE_DRAGGED

Apime v1.0

Copyright 2004 Java4Ever.com. All Rights Reserved.