java.lang.Object | |
↳ | sun.java2d.StateTrackableDelegate |
This class provides a basic pre-packaged implementation of the
complete StateTrackable
interface with implementations
of the required methods in the interface and methods to manage
transitions in the state of the object.
Classes which wish to implement StateTrackable could create an
instance of this class and delegate all of their implementations
for StateTrackable
methods to the corresponding methods
of this class.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
IMMUTABLE_DELEGATE | The IMMUTABLE_DELEGATE provides an implementation
of the StateTrackable interface that is permanently in the
IMMUTABLE state. |
||||||||||
UNTRACKABLE_DELEGATE | The UNTRACKABLE_DELEGATE provides an implementation
of the StateTrackable interface that is permanently in the
UNTRACKABLE state. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a
StateTrackableDelegate instance with the
specified initial State . | |||||||||||
@inheritDoc
| |||||||||||
@inheritDoc
| |||||||||||
This method provides an easy way for delegating classes to
indicate that the contents have changed.
| |||||||||||
This method provides an easy way for delegating classes to
change the overall
State of the delegate to
UNTRACKABLE . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
The IMMUTABLE_DELEGATE
provides an implementation
of the StateTrackable interface that is permanently in the
IMMUTABLE
state.
The UNTRACKABLE_DELEGATE
provides an implementation
of the StateTrackable interface that is permanently in the
UNTRACKABLE
state.
This method provides an easy way for delegating classes to
manage temporarily setting the overall State
of the delegate to DYNAMIC
during well-defined time frames of dynamic pixel updating.
This method should be called once before each flow of control
that might dynamically update the pixels in an uncontrolled
or unpredictable fashion.
The companion method removeDynamicAgent()
method should
also be called once after each such flow of control has ended.
Failing to call the remove method will result in this object
permanently becoming DYNAMIC
and therefore effectively untrackable.
This method will only change the State
of the
delegate if it is currently STABLE
.
IllegalStateException | if the current state is
IMMUTABLE |
---|
Returns a StateTrackableDelegate
instance with the
specified initial State
.
If the specified State
is
UNTRACKABLE
or
IMMUTABLE
then the approprirate static instance
UNTRACKABLE_DELEGATE
or IMMUTABLE_DELEGATE
is returned.
@inheritDoc
@inheritDoc
This method provides an easy way for delegating classes to indicate that the contents have changed. This method will invalidate outstanding StateTracker objects so that any other agents which maintain cached information about the pixels will know to refresh their cached copies. This method should be called after every modification to the data, such as any calls to any of the setElem methods.
Note that, for efficiency, this method does not check the
State
of the object to see if it is compatible
with being marked dirty
(i.e. not IMMUTABLE
).
It is up to the callers to enforce the fact that an
IMMUTABLE
delegate is never modified.
This method provides an easy way for delegating classes to
change the overall State
of the delegate to
IMMUTABLE
.
IllegalStateException | if the current state is
UNTRACKABLE |
---|
This method provides an easy way for delegating classes to
change the overall State
of the delegate to
UNTRACKABLE
.
This method is typically called when references to the
internal data buffers have been made public.
IllegalStateException | if the current state is
IMMUTABLE |
---|
This method provides an easy way for delegating classes to
manage restoring the overall State
of the
delegate back to STABLE
after a well-defined time frame of dynamic pixel updating.
This method should be called once after each flow of control
that might dynamically update the pixels in an uncontrolled
or unpredictable fashion has ended.
The companion method addDynamicAgent()
method should
have been called at some point before each such flow of
control began.
If this method is called without having previously called
the add method, the State
of this object
will become unreliable.
This method will only change the State
of the
delegate if the number of outstanding dynamic agents has
gone to 0 and it is currently
DYNAMIC
.