Package elki.visualization.batikutil
Class JSVGUpdateSynchronizer
- java.lang.Object
-
- elki.visualization.batikutil.JSVGUpdateSynchronizer
-
- All Implemented Interfaces:
UpdateSynchronizer
class JSVGUpdateSynchronizer extends java.lang.Object implements UpdateSynchronizer
This class is used to synchronize SVG updates with an JSVG canvas.- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
JSVGUpdateSynchronizer.UMAdapter
Adapter that will track the component for UpdateManager changes.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ref.WeakReference<org.apache.batik.swing.svg.JSVGComponent>
cref
A weak reference to the component the plot is in.private java.util.concurrent.atomic.AtomicReference<java.lang.Runnable>
pending
The current Runnable scheduled, prevents repeated invocations.private JSVGUpdateSynchronizer.UMAdapter
umadapter
Adapter to track component changesprivate java.util.Set<java.lang.ref.WeakReference<UpdateRunner>>
updaterunner
The UpdateRunner we are put into
-
Constructor Summary
Constructors Modifier Constructor Description protected
JSVGUpdateSynchronizer(org.apache.batik.swing.svg.JSVGComponent component)
Create an updateSynchronizer for the given component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate()
This method is called whenever a new pending event was added.void
addUpdateRunner(UpdateRunner updateRunner)
Set an update runner to use.protected void
makeRunnerIfNeeded()
Join the runnable queue of a component.
-
-
-
Field Detail
-
cref
private final java.lang.ref.WeakReference<org.apache.batik.swing.svg.JSVGComponent> cref
A weak reference to the component the plot is in.
-
updaterunner
private java.util.Set<java.lang.ref.WeakReference<UpdateRunner>> updaterunner
The UpdateRunner we are put into
-
umadapter
private final JSVGUpdateSynchronizer.UMAdapter umadapter
Adapter to track component changes
-
pending
private final java.util.concurrent.atomic.AtomicReference<java.lang.Runnable> pending
The current Runnable scheduled, prevents repeated invocations.
-
-
Method Detail
-
activate
public void activate()
Description copied from interface:UpdateSynchronizer
This method is called whenever a new pending event was added.- Specified by:
activate
in interfaceUpdateSynchronizer
-
makeRunnerIfNeeded
protected void makeRunnerIfNeeded()
Join the runnable queue of a component.
-
addUpdateRunner
public void addUpdateRunner(UpdateRunner updateRunner)
Description copied from interface:UpdateSynchronizer
Set an update runner to use.- Specified by:
addUpdateRunner
in interfaceUpdateSynchronizer
-
-