|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.birosoft.liquid.skin.SkinSimpleButtonIndexModel
public class SkinSimpleButtonIndexModel
A Simple Index Model for a button. Use it to calculate which of the subimages of a skin should be used. The order of evaluation of the states is: 1. Test if button is disabled 2. Test if button is pressed 3. Test if button is in rollover state 4. Button must be in normal state then. The first test that evaluates to true determines the index for the skin to be used. If the component is not a subclass of AbstractButton one can explicitly pass the relevant states to getIndexForState but use the same logic.
Constructor Summary | |
---|---|
SkinSimpleButtonIndexModel()
Creates a SkinIndexModel for the button with the indices normal=0, rollover=1, pushed=2 and disabled=3 |
|
SkinSimpleButtonIndexModel(int normal,
int rollover,
int pressed,
int disabled)
Creates a SkinIndexModel for the button with the given states. |
Method Summary | |
---|---|
javax.swing.AbstractButton |
getButton()
Returns the button. |
int |
getIndexForState()
Returns the index of the image of the skin to be used for rendering. |
int |
getIndexForState(boolean isEnabled,
boolean isRollover,
boolean isPressed)
This methode can be used for other Components than AbstractButtons. |
void |
setButton(javax.swing.AbstractButton button)
Sets the button. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SkinSimpleButtonIndexModel()
button
- public SkinSimpleButtonIndexModel(int normal, int rollover, int pressed, int disabled)
normal
- the index of the normal imagerollover
- the index of the rollover imagepressed
- the index of the pressed imagedisabled
- the index of the disabled imageMethod Detail |
---|
public int getIndexForState()
getIndexForState
.
setButton
public int getIndexForState(boolean isEnabled, boolean isRollover, boolean isPressed)
getIndexForState
so that consistency is preserved.
isEnabled
- isPressed
- isRollover
-
public javax.swing.AbstractButton getButton()
public void setButton(javax.swing.AbstractButton button)
button
- The button to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |