|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.optional.svg.XSvgStateHelper
public class XSvgStateHelper
A class to allow a component to display its state via an XSvgPainter. The helper hides details of the state from the painter.
Copyright (c) Xoetrope 2001-2006, see license.txt for more details
| Field Summary | |
|---|---|
protected java.awt.Component |
component
|
protected boolean[] |
containsMouse
|
protected java.lang.String[][] |
defaultIds
|
protected java.lang.String[][] |
ids
|
protected com.kitfox.svg.ShapeElement[] |
mask
|
static int |
MASK_ID
|
static int |
NUM_IDS
|
static int |
PRESSED_ID
|
static int |
ROLLOVER_ID
|
| Constructor Summary | |
|---|---|
XSvgStateHelper()
Create a new state helper |
|
| Method Summary | |
|---|---|
boolean |
contains(double x,
double y)
Check if the cursor is within the client area. |
java.lang.String |
getSelectedId()
Get the ID of the selected element |
XSvgElementState[][] |
getStates(com.kitfox.svg.SVGDiagram diagram)
Get the managed states in the svg diagram. |
void |
setComponent(javax.swing.JComponent comp)
Set the component instance |
void |
setElementIds(java.lang.String[][] ids)
Set the element ids for interactive elements |
boolean |
updateState(int itemIndex)
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 |
| Field Detail |
|---|
public static final int MASK_ID
public static final int ROLLOVER_ID
public static final int PRESSED_ID
public static final int NUM_IDS
protected java.awt.Component component
protected com.kitfox.svg.ShapeElement[] mask
protected java.lang.String[][] ids
protected java.lang.String[][] defaultIds
protected boolean[] containsMouse
| Constructor Detail |
|---|
public XSvgStateHelper()
| Method Detail |
|---|
public java.lang.String getSelectedId()
public void setElementIds(java.lang.String[][] ids)
ids - the SVG element id to usepublic void setComponent(javax.swing.JComponent comp)
comp - the component instacnepublic XSvgElementState[][] getStates(com.kitfox.svg.SVGDiagram diagram)
diagram - the svg diagram
public boolean contains(double x,
double y)
x - the x viewport coordinatey - the y viewport coordinate
public boolean updateState(int itemIndex)
itemIndex - the item index or -1 to update all items
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||