Package org.csstudio.utility.batik
Class SVGHandler
java.lang.Object
org.csstudio.utility.batik.SVGHandler
SVGDocument
handler. Handles render and animation of SVG files.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
To hide the listener methods. -
Field Summary
Modifier and TypeFieldDescriptionprotected float
The amount of animation limiting.protected int
The animation limiting mode.protected org.apache.batik.bridge.BridgeContext
The current bridge context.protected org.apache.batik.bridge.GVTBuilder
protected AnimatedSVGCache
protected org.apache.batik.gvt.GraphicsNode
protected SVGHandlerListener
protected boolean
Whether the current document has dynamic features.protected SVGHandler.Listener
The listener.protected org.apache.batik.bridge.DocumentLoader
The concrete bridge document loader.protected Dimension2D
protected org.w3c.dom.svg.SVGDocument
protected org.apache.batik.gvt.renderer.ImageRenderer
The current renderer.protected org.apache.batik.gvt.renderer.ImageRendererFactory
The renderer factory.protected SVGAnimationEngine
protected org.w3c.dom.svg.SVGDocument
The current SVG document.protected org.apache.batik.anim.timing.TimedDocumentRoot
protected UpdateManager
The update manager.protected org.apache.batik.bridge.UserAgent
The user agent. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToBuffer
(Image image) protected org.apache.batik.bridge.BridgeContext
createBridgeContext
(org.apache.batik.anim.dom.SVGOMDocument doc) Creates a new bridge context.protected org.apache.batik.gvt.renderer.ImageRenderer
Creates a new renderer.protected org.apache.batik.bridge.UserAgent
Creates a new user agent.void
dispose()
protected void
doRender()
protected org.apache.batik.gvt.CanvasGraphicsNode
getCanvasGraphicsNode
(org.apache.batik.gvt.GraphicsNode gn) org.w3c.dom.svg.SVGDocument
protected void
boolean
protected void
notifyNewImage
(Image newImage) void
void
protected void
render()
protected void
void
Resumes the processing of the current document.void
setAlignedToNearestSecond
(boolean alignedToNearestSecond) void
setAnimationLimitingCPU
(float pc) Sets the animation limiting mode to a percentage of CPU.void
setAnimationLimitingFPS
(float fps) Sets the animation limiting mode to a number of frames per second.void
Sets the animation limiting mode to "none".protected void
Sets the animation limiting mode on the current bridge context.void
setCanvasSize
(int width, int height) void
setColorToApply
(Color newColor) void
setColorToChange
(Color newColor) void
setRenderingHint
(Object key, Object value) void
setRenderListener
(SVGHandlerListener renderListener) void
setTransformMatrix
(double[][] newMatrix) void
Start the processing of the current document.void
Suspend the processing of the current document.
-
Field Details
-
handlerListener
-
listener
The listener. -
rendererFactory
protected org.apache.batik.gvt.renderer.ImageRendererFactory rendererFactoryThe renderer factory. -
renderer
protected org.apache.batik.gvt.renderer.ImageRenderer rendererThe current renderer. -
userAgent
protected org.apache.batik.bridge.UserAgent userAgentThe user agent. -
bridgeContext
protected org.apache.batik.bridge.BridgeContext bridgeContextThe current bridge context. -
loader
protected org.apache.batik.bridge.DocumentLoader loaderThe concrete bridge document loader. -
gvtRoot
protected org.apache.batik.gvt.GraphicsNode gvtRoot -
updateManager
The update manager. -
timedDocumentRoot
protected org.apache.batik.anim.timing.TimedDocumentRoot timedDocumentRoot -
svgAnimationEngine
-
cache
-
svgDocument
protected org.w3c.dom.svg.SVGDocument svgDocumentThe current SVG document. -
originalSVGDocument
protected org.w3c.dom.svg.SVGDocument originalSVGDocument -
originalDimension
-
isDynamicDocument
protected boolean isDynamicDocumentWhether the current document has dynamic features. -
animationLimitingMode
protected int animationLimitingModeThe animation limiting mode. -
animationLimitingAmount
protected float animationLimitingAmountThe amount of animation limiting. -
builder
protected org.apache.batik.bridge.GVTBuilder builder
-
-
Constructor Details
-
SVGHandler
-
-
Method Details
-
dispose
public void dispose() -
createUserAgent
protected org.apache.batik.bridge.UserAgent createUserAgent()Creates a new user agent. -
createBridgeContext
protected org.apache.batik.bridge.BridgeContext createBridgeContext(org.apache.batik.anim.dom.SVGOMDocument doc) Creates a new bridge context. -
createImageRenderer
protected org.apache.batik.gvt.renderer.ImageRenderer createImageRenderer()Creates a new renderer. -
handleException
-
getOriginalDocument
public org.w3c.dom.svg.SVGDocument getOriginalDocument() -
setRenderListener
-
setRenderingHint
-
removeRenderingHint
-
setCanvasSize
public void setCanvasSize(int width, int height) -
setColorToApply
-
setColorToChange
-
setTransformMatrix
public void setTransformMatrix(double[][] newMatrix) -
refreshContent
public void refreshContent() -
isDynamicDocument
public boolean isDynamicDocument() -
getDocumentSize
- Returns:
- document size after applying matrix.
-
setAlignedToNearestSecond
public void setAlignedToNearestSecond(boolean alignedToNearestSecond) -
resumeProcessing
public void resumeProcessing()Resumes the processing of the current document. -
suspendProcessing
public void suspendProcessing()Suspend the processing of the current document. -
startProcessing
public void startProcessing()Start the processing of the current document. -
setAnimationLimitingNone
public void setAnimationLimitingNone()Sets the animation limiting mode to "none". -
setAnimationLimitingCPU
public void setAnimationLimitingCPU(float pc) Sets the animation limiting mode to a percentage of CPU.- Parameters:
pc
- the maximum percentage of CPU to use (0 < pc ≤ 1)
-
setAnimationLimitingFPS
public void setAnimationLimitingFPS(float fps) Sets the animation limiting mode to a number of frames per second.- Parameters:
fps
- the maximum number of frames per second (fps > 0)
-
setBridgeContextAnimationLimitingMode
protected void setBridgeContextAnimationLimitingMode()Sets the animation limiting mode on the current bridge context. -
getOffScreen
- Returns:
- SVG static image.
-
render
protected void render() -
doRender
protected void doRender() -
getCanvasGraphicsNode
protected org.apache.batik.gvt.CanvasGraphicsNode getCanvasGraphicsNode(org.apache.batik.gvt.GraphicsNode gn) -
resetCache
protected void resetCache() -
addToBuffer
-
notifyNewImage
-