|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.birosoft.liquid.skin.SkinToggleButtonIndexModel
public class SkinToggleButtonIndexModel
A Simple Index Model for a button. Use it to calculate which of the subimages of a skin should be used for rendering. The order of evaluation of the states is: 1 Test if button is selected 1.1 Test if button is disabled 1.2. Test if button is pressed 1.3. Test if button is in rollover state 1.4. Button must be in normal state then. 2. If not selected 2.1 Test if button is disabled 2.2. Test if button is pressed 2.3. Test if button is in rollover state 2.4. If checkForDefaultButton is true there check whether it's the default button. If it's not or checkForDefaultButton is false return the normal state. The first test that evaluates to true determines the index of 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 | |
---|---|
SkinToggleButtonIndexModel()
Creates a SkinIndexModel for the button with the indices normal=0, rollover=1, pushed=2 and disabled=3, selected=4, selectedRollover=5, selectedPressed=6, selectedDisabled=7; There's no check concering the default button |
|
SkinToggleButtonIndexModel(boolean checkForDefaultButton)
Creates a SkinIndexModel for the button with the indices normal=0, rollover=1, pushed=2 and disabled=3, selected=4, selectedRollover=5, selectedPressed=6, selectedDisabled=7; |
|
SkinToggleButtonIndexModel(int normal,
int rollover,
int pressed,
int disabled,
int selected,
int selectedRollover,
int selectedPressed,
int selectedDisabled)
Creates a SkinIndexModel for the button with the states normal, rollover, pushed and disabled |
Method Summary | |
---|---|
javax.swing.AbstractButton |
getButton()
Returns the button. |
int |
getIndexForState()
|
int |
getIndexForState(boolean isSelected,
boolean isEnabled,
boolean isPressed,
boolean isRollover)
This methode can be used for Non-AbstractButtons. |
boolean |
isCheckForDefaultButton()
Returns the checkForDefaultButton. |
void |
setButton(javax.swing.AbstractButton button)
Sets the button. |
void |
setCheckForDefaultButton(boolean hasToggleButton)
Sets the checkForDefaultButton. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SkinToggleButtonIndexModel()
public SkinToggleButtonIndexModel(boolean checkForDefaultButton)
checkForDefaultButton
- if true the button is checked whether it's the default button.
The component used for the index model must be a JButton.public SkinToggleButtonIndexModel(int normal, int rollover, int pressed, int disabled, int selected, int selectedRollover, int selectedPressed, int selectedDisabled)
button
- Method Detail |
---|
public int getIndexForState()
com.stefankrause.xplookandfeel.skin.SkinOffsetModel#getIndexForState()
public int getIndexForState(boolean isSelected, boolean isEnabled, boolean isPressed, boolean isRollover)
isSelected
- isEnabled
- isPressed
- isRollover
-
public javax.swing.AbstractButton getButton()
public void setButton(javax.swing.AbstractButton button)
button
- The button to setpublic boolean isCheckForDefaultButton()
public void setCheckForDefaultButton(boolean hasToggleButton)
checkForDefaultButton
- The checkForDefaultButton to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |