com.incrediblesoft.redjey
Class Button

java.lang.Object
  extended by com.incrediblesoft.redjey.Component
      extended by com.incrediblesoft.redjey.TextComponent
          extended by com.incrediblesoft.redjey.Button
Direct Known Subclasses:
CustomButton, MenuItem, RadioButton

public class Button
extends TextComponent


Field Summary
 
Fields inherited from class com.incrediblesoft.redjey.Component
BOTTOM_LAYOUT, DISABLED, H_EXPAND, HCENTER_LAYOUT, HIGHLIGHTED, LEFT_LAYOUT, NORMAL, PRESSED, RIGHT_LAYOUT, TOP_LAYOUT, TOTAL_STATES, V_EXPAND, VCENTER_LAYOUT
 
Constructor Summary
Button(java.lang.String title)
          Constructs button with a given title
Button(java.lang.String title, CustomImage image)
          Constructs button with a given title and image
Button(java.lang.String title, CustomImage image, java.lang.String styleClassName)
          Constructs button with a given title, image and style class
Button(java.lang.String title, java.lang.String styleClassName)
          Constructs button with a given title and style class
 
Method Summary
 CustomImage getImage()
          Returns image icon
 java.lang.String getName()
          This method is used to retrieve the appropriate style set from a hashtable of styles
 boolean isFocusable()
           
 void setImage(CustomImage image)
          Sets image
 void setState(int index)
          Sets component state (NORMAL, FOCUSED, DISABLED or custom one).
 void tick(int dt)
          Called every tick.
 
Methods inherited from class com.incrediblesoft.redjey.TextComponent
getText, setText, toString
 
Methods inherited from class com.incrediblesoft.redjey.Component
addActionListener, addMouseListener, dispatchEvent, fireActionEvent, getAbsoluteRect, getAbsoluteX, getAbsoluteY, getAlignment, getBounds, getClientSize, getContentAlignment, getCurrentStyle, getHeight, getParent, getPreferredSize, getState, getStyle, getStyleClass, getWidth, getX, getY, invalidate, invalidateTree, isFocused, isHighlightable, isVisible, keyPressed, keyReleased, paint, removeActonListener, removeMouseListener, repaint, repaint, setAlignment, setBounds, setContentAlignment, setLocation, setPreferredSize, setSize, setSize, setStyle, setStyle, setStyleClass, setTag, setVisible, setX, setY, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Button

public Button(java.lang.String title)
Constructs button with a given title

Parameters:
title - title

Button

public Button(java.lang.String title,
              java.lang.String styleClassName)
Constructs button with a given title and style class

Parameters:
title - title
styleClassName - class

Button

public Button(java.lang.String title,
              CustomImage image)
Constructs button with a given title and image

Parameters:
title - title
image - image

Button

public Button(java.lang.String title,
              CustomImage image,
              java.lang.String styleClassName)
Constructs button with a given title, image and style class

Parameters:
title - title
image - image
styleClassName - style class
Method Detail

getName

public java.lang.String getName()
Description copied from class: Component
This method is used to retrieve the appropriate style set from a hashtable of styles

Specified by:
getName in class Component
Returns:
Name of component

isFocusable

public boolean isFocusable()

setState

public void setState(int index)
Description copied from class: Component
Sets component state (NORMAL, FOCUSED, DISABLED or custom one). It is also changes appearance styles.

Overrides:
setState in class Component
Parameters:
index - Component state index

getImage

public CustomImage getImage()
Returns image icon

Returns:
image

setImage

public void setImage(CustomImage image)
Sets image

Parameters:
image - image

tick

public void tick(int dt)
Description copied from class: Component
Called every tick. Subclasses must override this method to do custom actions that depend on real time.

Overrides:
tick in class Component
Parameters:
dt - time in milliseconds