javax.swing.text
Class AsyncBoxView.ChildState

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.text.AsyncBoxView.ChildState
All Implemented Interfaces:
Runnable sample code for java.lang.Runnable definition code for java.lang.Runnable
Enclosing class:
AsyncBoxView sample code for javax.swing.text.AsyncBoxView definition code for javax.swing.text.AsyncBoxView

public class AsyncBoxView.ChildState
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Runnable sample code for java.lang.Runnable definition code for java.lang.Runnable

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.


Constructor Summary
AsyncBoxView.ChildState sample code for javax.swing.text.AsyncBoxView.ChildState.AsyncBoxView.ChildState(javax.swing.text.View) definition code for javax.swing.text.AsyncBoxView.ChildState.AsyncBoxView.ChildState(javax.swing.text.View) (View sample code for javax.swing.text.View definition code for javax.swing.text.View  v)
          Construct a child status.
 
Method Summary
 View sample code for javax.swing.text.View definition code for javax.swing.text.View getChildView sample code for javax.swing.text.AsyncBoxView.ChildState.getChildView() definition code for javax.swing.text.AsyncBoxView.ChildState.getChildView() ()
          Fetch the child view this record represents
 float getMajorOffset sample code for javax.swing.text.AsyncBoxView.ChildState.getMajorOffset() definition code for javax.swing.text.AsyncBoxView.ChildState.getMajorOffset() ()
          Get the offset along the major axis
 float getMajorSpan sample code for javax.swing.text.AsyncBoxView.ChildState.getMajorSpan() definition code for javax.swing.text.AsyncBoxView.ChildState.getMajorSpan() ()
          What is the span along the major axis.
 float getMinorOffset sample code for javax.swing.text.AsyncBoxView.ChildState.getMinorOffset() definition code for javax.swing.text.AsyncBoxView.ChildState.getMinorOffset() ()
          What is the offset along the minor axis
 float getMinorSpan sample code for javax.swing.text.AsyncBoxView.ChildState.getMinorSpan() definition code for javax.swing.text.AsyncBoxView.ChildState.getMinorSpan() ()
          What is the span along the minor axis.
 boolean isLayoutValid sample code for javax.swing.text.AsyncBoxView.ChildState.isLayoutValid() definition code for javax.swing.text.AsyncBoxView.ChildState.isLayoutValid() ()
          Has the child view been laid out.
 void preferenceChanged sample code for javax.swing.text.AsyncBoxView.ChildState.preferenceChanged(boolean, boolean) definition code for javax.swing.text.AsyncBoxView.ChildState.preferenceChanged(boolean, boolean) (boolean width, boolean height)
          Mark preferences changed for this child.
 void run sample code for javax.swing.text.AsyncBoxView.ChildState.run() definition code for javax.swing.text.AsyncBoxView.ChildState.run() ()
          Update the child state.
 void setMajorOffset sample code for javax.swing.text.AsyncBoxView.ChildState.setMajorOffset(float) definition code for javax.swing.text.AsyncBoxView.ChildState.setMajorOffset(float) (float offs)
          This method should only be called by the ChildLocator, it is simply a convenient place to hold the cached location.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

AsyncBoxView.ChildState sample code for javax.swing.text.AsyncBoxView.ChildState(javax.swing.text.View) definition code for javax.swing.text.AsyncBoxView.ChildState(javax.swing.text.View)

public AsyncBoxView.ChildState(View sample code for javax.swing.text.View definition code for javax.swing.text.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.

Method Detail

getChildView sample code for javax.swing.text.AsyncBoxView.ChildState.getChildView() definition code for javax.swing.text.AsyncBoxView.ChildState.getChildView()

public View sample code for javax.swing.text.View definition code for javax.swing.text.View  getChildView()
Fetch the child view this record represents


run sample code for javax.swing.text.AsyncBoxView.ChildState.run() definition code for javax.swing.text.AsyncBoxView.ChildState.run()

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:

  1. The child may have been removed from the view hierarchy.
  2. The child may have been updated by a higher priority operation (i.e. the child may have become visible).

Specified by:
run sample code for java.lang.Runnable.run() definition code for java.lang.Runnable.run() in interface Runnable sample code for java.lang.Runnable definition code for java.lang.Runnable
See Also:
Thread.run() sample code for java.lang.Thread.run() definition code for java.lang.Thread.run()

getMinorSpan sample code for javax.swing.text.AsyncBoxView.ChildState.getMinorSpan() definition code for javax.swing.text.AsyncBoxView.ChildState.getMinorSpan()

public float getMinorSpan()
What is the span along the minor axis.


getMinorOffset sample code for javax.swing.text.AsyncBoxView.ChildState.getMinorOffset() definition code for javax.swing.text.AsyncBoxView.ChildState.getMinorOffset()

public float getMinorOffset()
What is the offset along the minor axis


getMajorSpan sample code for javax.swing.text.AsyncBoxView.ChildState.getMajorSpan() definition code for javax.swing.text.AsyncBoxView.ChildState.getMajorSpan()

public float getMajorSpan()
What is the span along the major axis.


getMajorOffset sample code for javax.swing.text.AsyncBoxView.ChildState.getMajorOffset() definition code for javax.swing.text.AsyncBoxView.ChildState.getMajorOffset()

public float getMajorOffset()
Get the offset along the major axis


setMajorOffset sample code for javax.swing.text.AsyncBoxView.ChildState.setMajorOffset(float) definition code for javax.swing.text.AsyncBoxView.ChildState.setMajorOffset(float)

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.


preferenceChanged sample code for javax.swing.text.AsyncBoxView.ChildState.preferenceChanged(boolean, boolean) definition code for javax.swing.text.AsyncBoxView.ChildState.preferenceChanged(boolean, boolean)

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
See Also:
JComponent.revalidate() sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate()

isLayoutValid sample code for javax.swing.text.AsyncBoxView.ChildState.isLayoutValid() definition code for javax.swing.text.AsyncBoxView.ChildState.isLayoutValid()

public boolean isLayoutValid()
Has the child view been laid out.