java.lang.Object
javax.swing.text.AsyncBoxView.ChildState
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- AsyncBoxView
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.
- Since:
- 1.3
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionFetch the child view this record represents.floatGet the offset along the major axis.floatWhat is the span along the major axis.floatWhat is the offset along the minor axisfloatWhat is the span along the minor axis.booleanHas the child view been laid out.voidpreferenceChanged(boolean width, boolean height) Mark preferences changed for this child.voidrun()Update the child state.voidsetMajorOffset(float offs) This method should only be called by the ChildLocator, it is simply a convenient place to hold the cached location.
- 
Constructor Details- 
ChildStateConstruct 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.- Parameters:
- v- the view
- Since:
- 1.4
 
 
- 
- 
Method Details- 
getChildViewFetch the child view this record represents.- Returns:
- the child view this record represents
 
- 
runpublic 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 acquires 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).
 
- 
getMinorSpanpublic float getMinorSpan()What is the span along the minor axis.- Returns:
- the span along the minor axis
 
- 
getMinorOffsetpublic float getMinorOffset()What is the offset along the minor axis- Returns:
- the offset along the minor axis
 
- 
getMajorSpanpublic float getMajorSpan()What is the span along the major axis.- Returns:
- the span along the major axis
 
- 
getMajorOffsetpublic float getMajorOffset()Get the offset along the major axis.- Returns:
- the offset along the major axis
 
- 
setMajorOffsetpublic void setMajorOffset(float offs) This method should only be called by the ChildLocator, it is simply a convenient place to hold the cached location.- Parameters:
- offs- offsets
 
- 
preferenceChangedpublic 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
- See Also:
 
- 
isLayoutValidpublic boolean isLayoutValid()Has the child view been laid out.- Returns:
- whether or not the child view been laid out.
 
 
-