|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.xoetrope.optional.svg.XSvgIcon
public class XSvgIcon
Render the SVG image as an icon
Copyright (c) Xoetrope 2001-2006, see license.txt for more details
$Revision: 1.6 $
Field Summary | |
---|---|
SVGEventQueue |
eventQueue
The events queue |
com.tinyline.svg.SVGRaster |
raster
The SVG renderer |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
XSvgIcon()
Constructs a new SVGCanvas instance. |
|
XSvgIcon(java.lang.String uri,
int w,
int h)
Constructs a new SVGCanvas instance. |
Method Summary | |
---|---|
void |
alertError(java.lang.String s)
StatusBar: shows an alert |
void |
alertInit(java.lang.String s)
StatusBar: inits the bar |
void |
alertWait(java.lang.String s)
StatusBar: shows a wait |
com.tinyline.tiny2d.TinyBitmap |
createTinyBitmap(byte[] imageData,
int imageOffset,
int imageLength)
Creates a TinyBitmap which decodes the image stored in the specified byte array, and at the specified offset and length. |
com.tinyline.tiny2d.TinyBitmap |
createTinyBitmap(java.lang.String imgRef)
Returns a TinyBitmap for the given image URL or path. |
com.tinyline.tiny2d.TinyBitmap |
createTinyBitmap(com.tinyline.tiny2d.TinyString uri)
Returns a TinyBitmap for the given image URL or path. |
void |
flush()
Flushes allocated resources |
int |
getIconHeight()
Returns the icon's height. |
int |
getIconWidth()
Returns the icon's width. |
java.awt.Dimension |
getMinimumSize()
The minimum size of the canvas. |
java.awt.Dimension |
getPreferredSize()
The preferred size of the canvas. |
void |
goURL(java.lang.String url)
Loads and dispalys an SVG document from the given URL. |
boolean |
imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int width,
int height)
This method is called when information about an image which was previously requested using an asynchronous interface becomes available. |
boolean |
isImageComplete()
Is the image completely loaded? |
com.tinyline.svg.SVGDocument |
loadSVG(java.io.InputStream is)
Loads an SVGT document from the given InputStream. |
com.tinyline.svg.SVGDocument |
loadSVG(java.lang.String urlStr)
Loads an SVGT document from the given URL. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Draw the icon at the specified location. |
void |
run()
Fetch the specified currentURL in a separate thread and plays it in the renderer. |
void |
start()
Starts the SVG player thread |
void |
stop()
Stops the SVG player thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public com.tinyline.svg.SVGRaster raster
public SVGEventQueue eventQueue
Constructor Detail |
---|
public XSvgIcon()
public XSvgIcon(java.lang.String uri, int w, int h)
uri
- the location of the svg filew
- The width of this canvas.h
- The height of this canvas.Method Detail |
---|
public com.tinyline.tiny2d.TinyBitmap createTinyBitmap(com.tinyline.tiny2d.TinyString uri)
createTinyBitmap
in interface com.tinyline.svg.ImageLoader
uri
- The image URL or path.
public boolean isImageComplete()
public com.tinyline.tiny2d.TinyBitmap createTinyBitmap(java.lang.String imgRef)
imgRef
- The image URL or path.
public com.tinyline.tiny2d.TinyBitmap createTinyBitmap(byte[] imageData, int imageOffset, int imageLength)
createTinyBitmap
in interface com.tinyline.svg.ImageLoader
imageData
- an array of bytes, representing
image data in a supported image format.imageOffset
- the offset of the beginning
of the data in the array.imageLength
- the length of the data in the array.
public void start()
public void stop()
public void run()
run
in interface java.lang.Runnable
public void goURL(java.lang.String url)
url
- the location of the svg filepublic boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
img
- the image being observed.flags
- the image status flags.x
- the x coordinate.y
- the y coordinate.width
- the width.height
- the height.
false
if the infoflags indicate that the
image is completely loaded; true
otherwise.public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
c
- the component displaying the icong
- the graphics contextx
- the x locationy
- the y locationpublic java.awt.Dimension getMinimumSize()
public java.awt.Dimension getPreferredSize()
public void flush()
public com.tinyline.svg.SVGDocument loadSVG(java.lang.String urlStr)
urlStr
- The SVGT document URL or path.
public com.tinyline.svg.SVGDocument loadSVG(java.io.InputStream is)
is
- The InputStream.
public void alertError(java.lang.String s)
s
- the messagepublic void alertWait(java.lang.String s)
s
- the messagepublic void alertInit(java.lang.String s)
s
- the message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |