Class Overview
A record representing the layout state of a
child view. It is runnable as a task on another
thread. All access to the child view that is
based upon a read-lock on the model should synchronize
on this object (i.e. The layout thread and the GUI
thread can both have a read lock on the model at the
same time and are not protected from each other).
Access to a child view hierarchy is serialized via
synchronization on the ChildState instance.
Summary
Public Methods |
View
|
getChildView()
Fetch the child view this record represents
|
float
|
getMajorOffset()
Get the offset along the major axis
|
float
|
getMajorSpan()
What is the span along the major axis.
|
float
|
getMinorOffset()
What is the offset along the minor axis
|
float
|
getMinorSpan()
What is the span along the minor axis.
|
boolean
|
isLayoutValid()
Has the child view been laid out.
|
void
|
preferenceChanged(boolean width, boolean height)
Mark preferences changed for this child.
|
void
|
run()
Update the child state.
|
void
|
setMajorOffset(float offs)
This method should only be called by the ChildLocator,
it is simply a convenient place to hold the cached
location.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.lang.Runnable
abstract
void
|
run()
When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread.
|
|
Public Constructors
public
AsyncBoxView.ChildState
(View v)
Construct a child status. This needs to start
out as fairly large so we don't falsely begin with
the idea that all of the children are visible.
Public Methods
public
View
getChildView
()
Fetch the child view this record represents
public
float
getMajorOffset
()
Get the offset along the major axis
public
float
getMajorSpan
()
What is the span along the major axis.
public
float
getMinorOffset
()
What is the offset along the minor axis
public
float
getMinorSpan
()
What is the span along the minor axis.
public
boolean
isLayoutValid
()
Has the child view been laid out.
public
void
preferenceChanged
(boolean width, boolean height)
Mark preferences changed for this child.
Parameters
width
| true if the width preference has changed |
height
| true if the height preference has changed |
public
void
run
()
Update the child state. This should be
called by the thread that desires to spend
time updating the child state (intended to
be the layout thread).
This aquires a read lock on the associated
document for the duration of the update to
ensure the model is not changed while it is
operating. The first thing to do would be
to see if any work actually needs to be done.
The following could have conceivably happened
while the state was waiting to be updated:
- The child may have been removed from the
view hierarchy.
- The child may have been updated by a
higher priority operation (i.e. the child
may have become visible).
public
void
setMajorOffset
(float offs)
This method should only be called by the ChildLocator,
it is simply a convenient place to hold the cached
location.