Class SVGIcon
java.lang.Object
org.apache.batik.bridge.UserAgentAdapter
de.klassenserver7b.danceinterpreter.graphics.util.icons.SVGIcon
- All Implemented Interfaces:
Icon
,org.apache.batik.bridge.UserAgent
A Swing Icon that draws an SVG image.
- Author:
- Cameron McCormack
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A transcoder that generates a BufferedImage. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedImage
The BufferedImage generated from the SVG document.protected int
The height of the rendered image.protected int
The width of the rendered image.Fields inherited from class org.apache.batik.bridge.UserAgentAdapter
ctx, extensions, FEATURES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
generateBufferedImage
(org.apache.batik.transcoder.TranscoderInput in, int w, int h) Generate the BufferedImage.int
Returns the icon's height.int
Returns the icon's width.getImage()
Returns the default size of this user agent.void
Draw the icon at the specified location.Methods inherited from class org.apache.batik.bridge.UserAgentAdapter
addStdFeatures, checkLoadExternalResource, checkLoadScript, deselectAll, displayError, displayError, displayMessage, getAlternateStyleSheet, getBolderFontWeight, getBrokenLinkDocument, getClientAreaLocationOnScreen, getDefaultFontFamily, getEventDispatcher, getExternalResourceSecurity, getFontFamilyResolver, getLanguages, getLighterFontWeight, getMedia, getMediumFontSize, getPixelToMM, getPixelUnitToMillimeter, getScriptSecurity, getStandardBolderFontWeight, getStandardLighterFontWeight, getTransform, getUserStyleSheetURI, getXMLParserClassName, handleElement, hasFeature, isXMLParserValidating, loadDocument, openLink, registerExtension, runThread, setBridgeContext, setSVGCursor, setTextSelection, setTransform, showAlert, showConfirm, showPrompt, showPrompt, supportExtension
-
Field Details
-
bufferedImage
The BufferedImage generated from the SVG document. -
width
protected int widthThe width of the rendered image. -
height
protected int heightThe height of the rendered image.
-
-
Constructor Details
-
SVGIcon
Create a new SVGIcon object.- Parameters:
uri
- The URI to read the SVG document from.- Throws:
org.apache.batik.transcoder.TranscoderException
-
SVGIcon
Create a new SVGIcon object.- Parameters:
uri
- The URI to read the SVG document from.w
- The width of the icon.h
- The height of the icon.- Throws:
org.apache.batik.transcoder.TranscoderException
-
SVGIcon
Create a new SVGIcon object.- Parameters:
doc
- The SVG document.- Throws:
org.apache.batik.transcoder.TranscoderException
-
SVGIcon
Create a new SVGIcon object.- Parameters:
doc
- The SVG document.w
- The width of the icon.h
- The height of the icon.- Throws:
org.apache.batik.transcoder.TranscoderException
-
-
Method Details
-
generateBufferedImage
protected void generateBufferedImage(org.apache.batik.transcoder.TranscoderInput in, int w, int h) throws org.apache.batik.transcoder.TranscoderException Generate the BufferedImage.- Throws:
org.apache.batik.transcoder.TranscoderException
-
getIconWidth
public int getIconWidth()Returns the icon's width.- Specified by:
getIconWidth
in interfaceIcon
-
getIconHeight
public int getIconHeight()Returns the icon's height.- Specified by:
getIconHeight
in interfaceIcon
-
paintIcon
Draw the icon at the specified location. -
getImage
-
getViewportSize
Returns the default size of this user agent.- Specified by:
getViewportSize
in interfaceorg.apache.batik.bridge.UserAgent
- Overrides:
getViewportSize
in classorg.apache.batik.bridge.UserAgentAdapter
-