public class UpdateManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
UpdateManager.RepaintTimerTask |
protected static class |
UpdateManager.SuspensionInfo |
protected class |
UpdateManager.UpdateManagerRunHander |
Modifier and Type | Field and Description |
---|---|
protected BridgeContext |
bridgeContext
The bridge context.
|
protected Document |
document
The document to manage.
|
protected GraphicsNode |
graphicsNode
The GraphicsNode whose updates are to be tracked.
|
protected java.util.List |
listeners
The listeners.
|
protected int |
minRepaintTime
The current minRepaintTime
|
protected RepaintManager |
repaintManager
The repaint manager.
|
protected RunnableQueue.RunHandler |
runHandler
The RunHandler for the RunnableQueue.
|
protected boolean |
running
Whether the update manager is running.
|
protected ScriptingEnvironment |
scriptingEnvironment
The scripting environment.
|
protected BridgeContext[] |
secondaryBridgeContexts
Array of resource documents' BridgeContexts.
|
protected ScriptingEnvironment[] |
secondaryScriptingEnvironments
Array of resource documents' ScriptingEnvironments that should
have their SVGLoad event dispatched.
|
protected boolean |
started
Whether the manager was started.
|
protected boolean |
suspendCalled
Whether the suspend() method was called.
|
protected RunnableQueue |
updateRunnableQueue
The update RunnableQueue.
|
protected UpdateTracker |
updateTracker
The update tracker.
|
Constructor and Description |
---|
UpdateManager(BridgeContext ctx,
GraphicsNode gn,
Document doc)
Creates a new update manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addUpdateManagerListener(UpdateManagerListener l)
Adds a UpdateManagerListener to this UpdateManager.
|
protected RunnableQueue.RunHandler |
createRunHandler() |
void |
dispatchSVGLoadEvent()
Dispatches an 'SVGLoad' event to the document.
|
protected void |
dispatchSVGLoadEvent(BridgeContext ctx,
ScriptingEnvironment se)
Dispatches an 'SVGLoad' event to the document.
|
void |
dispatchSVGResizeEvent()
Dispatches an "SVGZoom" event to the document.
|
void |
dispatchSVGScrollEvent()
Dispatches an "SVGZoom" event to the document.
|
void |
dispatchSVGUnLoadEvent()
Dispatches an 'SVGUnLoad' event to the document.
|
void |
dispatchSVGZoomEvent()
Dispatches an "SVGZoom" event to the document.
|
protected void |
fireEvent(EventDispatcher.Dispatcher dispatcher,
java.lang.Object event) |
void |
forceRepaint()
Users of Batik should essentially never call
this directly from Java.
|
BridgeContext |
getBridgeContext()
Returns the bridge context.
|
Document |
getDocument()
Returns the current Document.
|
int |
getMinRepaintTime() |
RepaintManager |
getRepaintManager()
Returns the repaint manager.
|
ScriptingEnvironment |
getScriptingEnvironment()
Returns the scripting environment.
|
RunnableQueue |
getUpdateRunnableQueue()
Returns the update RunnableQueue.
|
UpdateTracker |
getUpdateTracker()
Returns the GVT update tracker.
|
protected ScriptingEnvironment |
initializeScriptingEnvironment(BridgeContext ctx)
Creates an appropriate ScriptingEnvironment and XBL manager for
the given document.
|
void |
interrupt()
Interrupts the manager tasks.
|
boolean |
isRunning()
Tells whether the update manager is currently running.
|
void |
manageUpdates(ImageRenderer r)
Finishes the UpdateManager initialization.
|
void |
removeUpdateManagerListener(UpdateManagerListener l)
Removes a UpdateManagerListener from this UpdateManager.
|
protected void |
repaint()
Repaints the dirty areas, if needed.
|
void |
resume()
Resumes the update manager.
|
void |
setMinRepaintTime(int minRepaintTime) |
void |
suspend()
Suspends the update manager.
|
void |
updateRendering(java.awt.geom.AffineTransform u2d,
boolean dbr,
boolean cpt,
java.awt.Shape aoi,
int width,
int height)
Updates the rendering buffer.
|
void |
updateRendering(java.awt.geom.AffineTransform u2d,
boolean dbr,
java.awt.Shape aoi,
int width,
int height)
Updates the rendering buffer.
|
protected void |
updateRendering(java.util.List areas,
boolean clearPaintingTransform)
Updates the rendering buffer.
|
protected BridgeContext bridgeContext
protected Document document
protected RunnableQueue updateRunnableQueue
protected RunnableQueue.RunHandler runHandler
protected volatile boolean running
protected volatile boolean suspendCalled
protected java.util.List listeners
protected ScriptingEnvironment scriptingEnvironment
protected RepaintManager repaintManager
protected UpdateTracker updateTracker
protected GraphicsNode graphicsNode
protected boolean started
protected BridgeContext[] secondaryBridgeContexts
protected ScriptingEnvironment[] secondaryScriptingEnvironments
protected int minRepaintTime
public UpdateManager(BridgeContext ctx, GraphicsNode gn, Document doc)
ctx
- The bridge context.gn
- GraphicsNode whose updates are to be tracked.doc
- The document to manage.public int getMinRepaintTime()
public void setMinRepaintTime(int minRepaintTime)
protected ScriptingEnvironment initializeScriptingEnvironment(BridgeContext ctx)
public void dispatchSVGLoadEvent() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void dispatchSVGLoadEvent(BridgeContext ctx, ScriptingEnvironment se)
public void dispatchSVGZoomEvent() throws java.lang.InterruptedException
java.lang.InterruptedException
public void dispatchSVGScrollEvent() throws java.lang.InterruptedException
java.lang.InterruptedException
public void dispatchSVGResizeEvent() throws java.lang.InterruptedException
java.lang.InterruptedException
public void manageUpdates(ImageRenderer r)
public BridgeContext getBridgeContext()
public RunnableQueue getUpdateRunnableQueue()
public RepaintManager getRepaintManager()
public UpdateTracker getUpdateTracker()
public Document getDocument()
public ScriptingEnvironment getScriptingEnvironment()
public boolean isRunning()
public void suspend()
public void resume()
public void interrupt()
public void dispatchSVGUnLoadEvent()
public void updateRendering(java.awt.geom.AffineTransform u2d, boolean dbr, java.awt.Shape aoi, int width, int height)
u2d
- The user to device transform.dbr
- Whether the double buffering should be used.aoi
- The area of interest in the renderer space units.width
- The offscreen buffer width.height
- The offscreen buffer height.public void updateRendering(java.awt.geom.AffineTransform u2d, boolean dbr, boolean cpt, java.awt.Shape aoi, int width, int height)
u2d
- The user to device transform.dbr
- Whether the double buffering should be used.cpt
- If the canvas painting transform should be cleared
when the update completsaoi
- The area of interest in the renderer space units.width
- The offscreen buffer width.height
- The offscreen buffer height.protected void updateRendering(java.util.List areas, boolean clearPaintingTransform)
areas
- List of areas of interest in rederer space units.clearPaintingTransform
- Indicates if the painting transform
should be cleared as a result of this update.protected void repaint()
public void forceRepaint()
public void addUpdateManagerListener(UpdateManagerListener l)
public void removeUpdateManagerListener(UpdateManagerListener l)
protected void fireEvent(EventDispatcher.Dispatcher dispatcher, java.lang.Object event)
protected RunnableQueue.RunHandler createRunHandler()
Copyright © 2022 Apache Software Foundation. All Rights Reserved.