|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
ice.ri.enhancedawt.iscl.LightweightBase
ice.ri.enhancedawt.iscl.SkinnableButton
This is a light weight custom component which provides the functionality of a button.
The button is a skinnable one, which has up to four images associated with it.
| Nested Class Summary | |
protected class |
SkinnableButton.ButtonSkin
|
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
static String |
DEFAULT_SKIN
|
protected static int |
DISABLED
states of the button |
protected static String |
DISABLED_IMAGE
the file name for the disabled image - "disabled" |
protected static int |
HIGHLIGHTED
states of the button |
protected static String |
HIGHLIGHTED_IMAGE
the file name for the hover image - "highlighted" |
protected Skin |
m_skin
The Skin for this button. |
protected SkinManager |
m_skinManager
|
protected String |
m_skinName
|
protected int |
m_state
the current state of the button |
protected static int |
NORMAL
states of the button |
protected static String |
NORMAL_IMAGE
the file name for the normal image - "normal" |
protected static int |
OFF_PRESSED
states of the button |
protected static int |
PRESSED
states of the button |
protected static String |
PRESSED_IMAGE
the file name for the pressed image - "pressed" |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
SkinnableButton()
default constructor. |
|
SkinnableButton(String name,
SkinManager skinManager,
String skinName)
|
|
| Method Summary | |
void |
addActionListener(ActionListener p_newListener)
adds an ActionListener. |
void |
drawButton(Graphics g)
called to draw a button which has no images associated with it. |
void |
drawLabel(Graphics g)
called to draw the label on the button. |
protected Dimension |
figureMySize(Graphics g)
* Abstract method which must be defined in child classes to determine * their sizes. |
String |
getActionCommand()
get the action command that will be sent with ActionEvent, when one is fired |
String |
getLabel()
gets the label that appears on the button in its default representation, or when setShowingLabel is set to true |
String |
getSkin()
Gets the skin being used by this component. |
SkinManager |
getSkinManager()
|
boolean |
isShowingLabel()
finds out if the button shows the label even if there are images set |
void |
paint(Graphics g)
overriden method from Component |
void |
processMouseEvent(MouseEvent e)
this method processes mouse event recieved from the user. |
void |
removeActionListener(ActionListener p_oldListener)
removes an ActionListener from listening to this button. |
void |
setActionCommand(String p_command)
set the action command that will be sent with ActionEvent, when one is fired |
void |
setEnabled(boolean enabled)
enables / disables the button |
void |
setLabel(String p_label)
explicitly sets the label that appears on the button in its default representation, or when setShowingLabel is set to true |
void |
setShowingLabel(boolean p_show)
tells the button to show the label even if there are images set |
void |
setSkin(String skinName)
Sets all the necessary images through a directory structure and predetermined names. |
void |
setSkinManager(SkinManager skinManager)
|
void |
update(Graphics g)
overriden method from component. |
| Methods inherited from class ice.ri.enhancedawt.iscl.LightweightBase |
addNotify, getMinimumSize, getPreferredSize |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final String HIGHLIGHTED_IMAGE
protected static final String PRESSED_IMAGE
protected static final String NORMAL_IMAGE
protected static final String DISABLED_IMAGE
protected Skin m_skin
public static final String DEFAULT_SKIN
protected String m_skinName
protected static final int HIGHLIGHTED
protected static final int PRESSED
protected static final int NORMAL
protected static final int DISABLED
protected static final int OFF_PRESSED
protected int m_state
protected SkinManager m_skinManager
| Constructor Detail |
public SkinnableButton()
public SkinnableButton(String name,
SkinManager skinManager,
String skinName)
| Method Detail |
public void setSkinManager(SkinManager skinManager)
public SkinManager getSkinManager()
public void setSkin(String skinName)
setSkin in interface SkinnableskinName - provides the directory structure in which to look for the images.protected Dimension figureMySize(Graphics g)
LightweightBase
figureMySize in class LightweightBasepublic String getSkin()
getSkin in interface Skinnablepublic String getActionCommand()
public void setActionCommand(String p_command)
p_command - the action command of this button.public void setLabel(String p_label)
public String getLabel()
public void setShowingLabel(boolean p_show)
p_show - true to show the label, false not to show the labelpublic boolean isShowingLabel()
public void addActionListener(ActionListener p_newListener)
p_newListener - a listener that is interested in getting ActionEvents from this buttonpublic void removeActionListener(ActionListener p_oldListener)
p_oldListener - the listener to be removed.public void setEnabled(boolean enabled)
setEnabled in class LightweightBaseenabled - the state of the button: true - enabled, false - disabled.public void processMouseEvent(MouseEvent e)
public void update(Graphics g)
update in class LightweightBasepublic void paint(Graphics g)
public void drawLabel(Graphics g)
public void drawButton(Graphics g)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||