AsyncBoxView.ChildState (Java Platform SE 8 ) (original) (raw)
- javax.swing.text.AsyncBoxView.ChildState
All Implemented Interfaces:
Runnable
Enclosing class:
AsyncBoxView
public class AsyncBoxView.ChildState
extends Object
implements 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.
Since:
1.3
Constructor Summary
Constructors
Constructor Description ChildState(View v) Construct a child status. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description 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. * ### Methods inherited from class java.lang.[Object](../../../java/lang/Object.html "class in java.lang") `[clone](../../../java/lang/Object.html#clone--), [equals](../../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../../java/lang/Object.html#finalize--), [getClass](../../../java/lang/Object.html#getClass--), [hashCode](../../../java/lang/Object.html#hashCode--), [notify](../../../java/lang/Object.html#notify--), [notifyAll](../../../java/lang/Object.html#notifyAll--), [toString](../../../java/lang/Object.html#toString--), [wait](../../../java/lang/Object.html#wait--), [wait](../../../java/lang/Object.html#wait-long-), [wait](../../../java/lang/Object.html#wait-long-int-)`
Constructor Detail
* #### ChildState public ChildState([View](../../../javax/swing/text/View.html "class in javax.swing.text") 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. Since: 1.4
Method Detail
* #### getChildView public [View](../../../javax/swing/text/View.html "class in javax.swing.text") getChildView() Fetch the child view this record represents * #### 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 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: 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](../../../java/lang/Runnable.html#run--)` in interface `[Runnable](../../../java/lang/Runnable.html "interface in java.lang")` See Also: [Thread.run()](../../../java/lang/Thread.html#run--) * #### getMinorSpan public float getMinorSpan() What is the span along the minor axis. * #### getMinorOffset public float getMinorOffset() What is the offset along the minor axis * #### getMajorSpan public float getMajorSpan() What is the span along the major axis. * #### getMajorOffset public float getMajorOffset() Get the offset along the major axis * #### setMajorOffset 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 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()](../../../javax/swing/JComponent.html#revalidate--) * #### isLayoutValid public boolean isLayoutValid() Has the child view been laid out.
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.