net.xoetrope.optional.svg
Class XSvgButtonStateHelper

java.lang.Object
  extended by net.xoetrope.optional.svg.XSvgStateHelper
      extended by net.xoetrope.optional.svg.XSvgButtonStateHelper

public class XSvgButtonStateHelper
extends XSvgStateHelper

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) Xoetrope 2001-2006, see license.txt for more details


Field Summary
protected  XSvgElementState[][] states
           
 
Fields inherited from class net.xoetrope.optional.svg.XSvgStateHelper
component, containsMouse, defaultIds, ids, mask, MASK_ID, NUM_IDS, PRESSED_ID, ROLLOVER_ID
 
Constructor Summary
XSvgButtonStateHelper()
          Creates a new instance of XSvgButtonStateHelper
 
Method Summary
 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
 boolean updateState(int itemId)
          Update the svg state to be consistent with the button's state
 
Methods inherited from class net.xoetrope.optional.svg.XSvgStateHelper
contains, getSelectedId, setElementIds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

states

protected XSvgElementState[][] states
Constructor Detail

XSvgButtonStateHelper

public XSvgButtonStateHelper()
Creates a new instance of XSvgButtonStateHelper

Method Detail

setComponent

public void setComponent(javax.swing.JComponent comp)
Set the component instance

Overrides:
setComponent in class XSvgStateHelper
Parameters:
comp - the component instacne

getStates

public XSvgElementState[][] getStates(com.kitfox.svg.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 XSvgStateHelper
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 XSvgStateHelper
Parameters:
itemId - the item index or -1 to update all items
Returns:
true if the state has changed