org.formaria.svg
Class SvgButtonStateHelper
java.lang.Object
org.formaria.svg.SvgStateHelper
org.formaria.svg.SvgButtonStateHelper
public class SvgButtonStateHelper
- extends SvgStateHelper
A helper for an AbstractButton's state. The helper controls a number of
layers, including 'mask', 'rollover' and 'pressed'. The mask layer or
group element contains a shape that is used to define the client area of the
component. The 'rollover' layer includes graphical elements that are shown
when the mouse is over the component
Copyright (c) Formaria 2008, see license.txt for more details
|
Method Summary |
SvgElementState[][] |
getStates(SVGDiagram diagram)
Get the managed states in the svg diagram. |
void |
setComponent(javax.swing.JComponent comp)
Set the component instance |
boolean |
updateState(int itemId)
Update the svg state to be consistent with the button's state |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
states
protected SvgElementState[][] states
SvgButtonStateHelper
public SvgButtonStateHelper()
- Creates a new instance of SvgButtonStateHelper
setComponent
public void setComponent(javax.swing.JComponent comp)
- Set the component instance
- Overrides:
setComponent in class SvgStateHelper
- Parameters:
comp - the component instacne
getStates
public SvgElementState[][] getStates(SVGDiagram diagram)
- Get the managed states in the svg diagram. In the case of this button
helper the managed states are 'pressed' and 'rollover'.
- Overrides:
getStates in class SvgStateHelper
- Parameters:
diagram - the svg diagram
- Returns:
- an array of state objects
updateState
public boolean updateState(int itemId)
- Update the svg state to be consistent with the button's state
- Overrides:
updateState in class SvgStateHelper
- Parameters:
itemId - the item index or -1 to update all items
- Returns:
- true if the state has changed