|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.batik.bridge.UserAgentAdapter
org.pushingpixels.flamingo.api.svg.SvgBatikResizableIcon
public class SvgBatikResizableIcon
SVG-based implementation of ResizableIcon
based on Apache Batik
library.
Nested Class Summary | |
---|---|
static class |
org.pushingpixels.flamingo.api.svg.SvgBatikIcon.BufferedImageTranscoder
A transcoder that generates a BufferedImage. |
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.awt.image.BufferedImage> |
cachedImages
Contains all precomputed images. |
protected int |
height
The height of the rendered image. |
protected javax.swing.event.EventListenerList |
listenerList
The listeners. |
protected java.util.List |
listeners
The listeners. |
protected byte[] |
svgBytes
SVG byte array. |
protected int |
width
The width of the rendered image. |
Fields inherited from class org.apache.batik.bridge.UserAgentAdapter |
---|
ctx, extensions, FEATURES |
Method Summary | |
---|---|
void |
addAsynchronousLoadListener(AsynchronousLoadListener l)
Adds listener on the asynchronous loading events. |
void |
addGVTTreeRendererListener(org.apache.batik.swing.gvt.GVTTreeRendererListener l)
Adds a GVTTreeRendererListener to this GVTTreeRenderer . |
protected static java.io.InputStream |
constructFromZipStream(java.io.InputStream zippedStream)
Constructs an input stream with uncompressed contents from the specified input stream with compressed contents. |
protected void |
fireAsyncCompleted(java.lang.Boolean event)
Fires the asynchronous load event. |
void |
fireEvent(org.apache.batik.util.EventDispatcher.Dispatcher dispatcher,
java.lang.Object event)
Fires event. |
int |
getIconHeight()
|
int |
getIconWidth()
|
byte[] |
getSvgBytes()
Returns the SVG bytes of the loaded SVG image. |
static SvgBatikResizableIcon |
getSvgIcon(java.io.InputStream inputStream,
java.awt.Dimension initialDim)
Returns the icon for the specified input stream. |
static SvgBatikResizableIcon |
getSvgIcon(java.net.URL location,
java.awt.Dimension initialDim)
Returns the icon for the specified URL. |
static SvgBatikResizableIcon |
getSvgzIcon(java.io.InputStream inputStream,
java.awt.Dimension initialDim)
Returns the icon for the specified input stream. |
static SvgBatikResizableIcon |
getSvgzIcon(java.net.URL location,
java.awt.Dimension initialDim)
Returns the icon for the specified URL. |
java.awt.geom.Dimension2D |
getViewportSize()
Returns the default size of this user agent. |
boolean |
isLoading()
Returns indication whether the content is still loading. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
|
void |
removeAsynchronousLoadListener(AsynchronousLoadListener l)
Removes listener on the asynchronous loading events. |
void |
removeGVTTreeRendererListener(org.apache.batik.swing.gvt.GVTTreeRendererListener l)
Removes a GVTTreeRendererListener ner from this
GVTTreeRenderer . |
protected boolean |
renderGVTTree(int renderWidth,
int renderHeight)
Renders the GVT tree. |
void |
setDimension(java.awt.Dimension dim)
Changes the dimension of this icon. |
void |
setPreferredSize(java.awt.Dimension dim)
Sets the preferred size for this icon. |
Methods inherited from class org.apache.batik.bridge.UserAgentAdapter |
---|
addStdFeatures, checkLoadExternalResource, checkLoadScript, deselectAll, displayError, displayError, displayMessage, getAlternateStyleSheet, getBolderFontWeight, getBrokenLinkDocument, getClientAreaLocationOnScreen, getDefaultFontFamily, getEventDispatcher, getExternalResourceSecurity, getLanguages, getLighterFontWeight, getMedia, getMediumFontSize, getPixelToMM, getPixelUnitToMillimeter, getScriptSecurity, getStandardBolderFontWeight, getStandardLighterFontWeight, getTransform, getUserStyleSheetURI, getXMLParserClassName, handleElement, hasFeature, isXMLParserValidating, openLink, registerExtension, runThread, setBridgeContext, setSVGCursor, setTextSelection, setTransform, showAlert, showConfirm, showPrompt, showPrompt, supportExtension |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.Icon |
---|
getIconHeight, getIconWidth, paintIcon |
Field Detail |
---|
protected javax.swing.event.EventListenerList listenerList
protected java.util.Map<java.lang.String,java.awt.image.BufferedImage> cachedImages
protected int width
protected int height
protected byte[] svgBytes
protected java.util.List listeners
Method Detail |
---|
protected static java.io.InputStream constructFromZipStream(java.io.InputStream zippedStream) throws java.io.IOException
zippedStream
- Input stream with compressed contents.
java.io.IOException
- in case any I/O operation failed.public static SvgBatikResizableIcon getSvgIcon(java.net.URL location, java.awt.Dimension initialDim)
location
- Icon URL.initialDim
- Initial dimension of the icon.
public static SvgBatikResizableIcon getSvgIcon(java.io.InputStream inputStream, java.awt.Dimension initialDim)
inputStream
- Icon stream.initialDim
- Initial dimension of the icon.
public static SvgBatikResizableIcon getSvgzIcon(java.net.URL location, java.awt.Dimension initialDim)
location
- Icon URL.initialDim
- Initial dimension of the icon.
public static SvgBatikResizableIcon getSvgzIcon(java.io.InputStream inputStream, java.awt.Dimension initialDim)
inputStream
- Icon stream.initialDim
- Initial dimension of the icon.
public void setDimension(java.awt.Dimension dim)
ResizableIcon
this
icon.
setDimension
in interface ResizableIcon
dim
- New dimension for this
icon.public void addAsynchronousLoadListener(AsynchronousLoadListener l)
AsynchronousLoading
addAsynchronousLoadListener
in interface AsynchronousLoading
l
- Listener to add.public void removeAsynchronousLoadListener(AsynchronousLoadListener l)
AsynchronousLoading
removeAsynchronousLoadListener
in interface AsynchronousLoading
l
- Listener to remove.protected boolean renderGVTTree(int renderWidth, int renderHeight)
renderWidth
- Requested rendering width.renderHeight
- Requested rendering height.
true
, the image is already computed and cached.protected void fireAsyncCompleted(java.lang.Boolean event)
event
- Event object.public boolean isLoading()
AsynchronousLoading
isLoading
in interface AsynchronousLoading
true
if the content is still loading,
false
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
public java.awt.geom.Dimension2D getViewportSize()
getViewportSize
in interface org.apache.batik.bridge.UserAgent
getViewportSize
in class org.apache.batik.bridge.UserAgentAdapter
public void setPreferredSize(java.awt.Dimension dim)
this
icon. The rendering is
scheduled automatically.
dim
- Preferred size.public byte[] getSvgBytes()
public void fireEvent(org.apache.batik.util.EventDispatcher.Dispatcher dispatcher, java.lang.Object event)
dispatcher
- Event dispatcher.event
- Event data.public void addGVTTreeRendererListener(org.apache.batik.swing.gvt.GVTTreeRendererListener l)
GVTTreeRendererListener
to this GVTTreeRenderer
.
l
- Listener to add.public void removeGVTTreeRendererListener(org.apache.batik.swing.gvt.GVTTreeRendererListener l)
GVTTreeRendererListener
ner from this
GVTTreeRenderer
.
l
- Listener to remove.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |