|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.optional.svg.svgsalamander.XSvgPainter
public class XSvgPainter
A painter that renders an SVG image
Copyright (c) Xoetrope 2001-2006, see license.txt for more details
| Field Summary | |
|---|---|
protected java.awt.Color |
bkColor
|
protected com.kitfox.svg.SVGDiagram |
diagram
|
protected int |
oldHeight
|
protected int |
oldWidth
|
protected double |
scaleX
|
protected double |
scaleY
|
| Constructor Summary | |
|---|---|
XSvgPainter(javax.swing.JComponent comp)
Creates a new instance of XSvgPainter |
|
| Method Summary | |
|---|---|
void |
componentResized()
The component has been resize, so resize the svg |
boolean |
contains(int x,
int y)
Check to see if the coordinates are within the component's active area |
double |
getCurTime()
|
com.kitfox.svg.SVGElement |
getElement(java.lang.String id)
|
java.lang.String |
getSelectedId()
Get the ID of the selected element |
void |
paint(java.awt.Graphics2D g,
javax.swing.JComponent component,
int width,
int height)
Paints on the given Graphics2D object some effect which may or may not be related to the given component. |
void |
play()
|
void |
setAnimate(boolean state)
Flag this painter as an animation painter |
void |
setBackground(java.awt.Color c)
|
void |
setElementIds(java.lang.String[][] ids)
Set the element id for elements like masks etc |
void |
setImage(java.net.URL imageURL)
Set the image managed and rendered by this painter |
void |
setImage(java.net.URL imageURL,
boolean clear)
Set the image managed and rendered by this painter |
void |
setInsets(java.awt.Insets insets)
|
void |
setMetadata(java.net.URL mdURL)
Set the metadata URL |
void |
setup()
Get the managed states in the svg diagram. |
boolean |
updateState(int itemIndex)
Update the svg state to be consistent with the button's state |
void |
updateTime(double curTime,
double timeStep,
int playState)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected com.kitfox.svg.SVGDiagram diagram
protected int oldWidth
protected int oldHeight
protected java.awt.Color bkColor
protected double scaleX
protected double scaleY
| Constructor Detail |
|---|
public XSvgPainter(javax.swing.JComponent comp)
comp - the target component| Method Detail |
|---|
public java.lang.String getSelectedId()
returns - a comma separated list of idspublic void setAnimate(boolean state)
state - true to animatepublic void play()
public double getCurTime()
public void updateTime(double curTime,
double timeStep,
int playState)
updateTime in interface com.kitfox.svg.app.PlayerThreadListenerpublic void setElementIds(java.lang.String[][] ids)
element - the element type/roleid - the SVG element id to usepublic void setMetadata(java.net.URL mdURL)
mdURL - the host componentpublic void setImage(java.net.URL imageURL)
imageURL - the url of the svg
public void setImage(java.net.URL imageURL,
boolean clear)
imageURL - the url of the svgclear - true to clear the svg universe, if for instance the svg
image has changed
public void paint(java.awt.Graphics2D g,
javax.swing.JComponent component,
int width,
int height)
Paints on the given Graphics2D object some effect which may or may not be related to the given component. For example, BackgroundPainter will use the background property of the component and the width/height of the component to perform a fill rect. Most other Painters will disregard the component entirely, except to get the component width/height.
The Graphics2D object must be returned to the same state it started at by the end of the method. For example, if "setColor(c)" was called on the graphics object, it should be reset to the original color before the method returns.
paint in interface Painterg - The Graphics2D object in which to paintcomponent - The JComponent that the Painter is delegate for. This
must not be null.width - height - public void setBackground(java.awt.Color c)
public boolean contains(int x,
int y)
HitTester
contains in interface HitTesterx - the x coordinate, in device coordinatesy - the y coordinate, in device coordinates
public boolean updateState(int itemIndex)
itemIndex - the item index or -1 to update all items
public void setup()
public void componentResized()
public com.kitfox.svg.SVGElement getElement(java.lang.String id)
public void setInsets(java.awt.Insets insets)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||