An icon that provides for the possibility that figures may be
dynamically updated. While some icons are generally 'static' and it
is simplest to regenerate new figures when their attributes change,
other icons are more 'dynamic'. For instance, some icons might
display live video or a live plot. This icon provides some basic
infrastructure for dealing with such cases.
The main difficulty is that, by design, an icon cannot keep track of
the figures it creates, otherwise there is a possibility for memory
leaks or inconsistencies in the case of multiple views. This class
solves the problem by using a WeakReferences to keep track of
generated figures. These references do not prevent objects from being
garbage collected. This class also provides a 'safe' iterator that
can be used to traverse the weak references without the normal
Construct an icon in the specified workspace and name.
This constructor is typically used in conjunction with
setContainerToBe() and createFigure() to create an icon
and generate a figure without having to have write access
to the workspace.
If the workspace argument is null, then use the default workspace.
The object is added to the directory of the workspace.
workspace - The workspace that will list the attribute.
public java.lang.Object clone(Workspace workspace)
Clone the object into the specified workspace. The new object is
not added to the directory of that workspace (you must do this
yourself if you want it there).
The result is an object with no container.
Add the figure to the list of figures managed by this icon.
A WeakReference object will be created that points to the figure
which will not prevent it from being garbage collected.
This method should be called in the createBackgroundFigure method
with the figure that will be returned.
Return a regular iterator over the figures created by this
icon which have not been garbage collected. The objects
returned by the iterator are Figures, not WeakReferences.
Furthermore, the objects returned by this iterator are
guaranteed to not be null.
protected void _trimLiveFigures()
Trim the list of figures to discard entries that are no longer