home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text;
-
- public class AsyncBoxView$ChildState implements Runnable {
- private float min;
- private float pref;
- private float max;
- private float align;
- private boolean minorValid;
- private float span;
- private float offset;
- private boolean majorValid;
- private View child;
- private boolean childSizeValid;
- // $FF: synthetic field
- private final AsyncBoxView this$0;
-
- public AsyncBoxView$ChildState(AsyncBoxView var1, View var2) {
- this.this$0 = var1;
- this.child = var2;
- this.minorValid = false;
- this.majorValid = false;
- this.childSizeValid = false;
- this.child.setParent(var1);
- }
-
- public View getChildView() {
- return this.child;
- }
-
- public void run() {
- AbstractDocument var1 = (AbstractDocument)this.this$0.getDocument();
-
- try {
- var1.readLock();
- if (!this.minorValid || !this.majorValid || !this.childSizeValid) {
- if (this.child.getParent() != this.this$0) {
- return;
- }
-
- AsyncBoxView var2 = this.this$0;
- synchronized(var2) {
- this.this$0.changing = this;
- }
-
- this.updateChild();
- AsyncBoxView var3 = this.this$0;
- synchronized(var3) {
- this.this$0.changing = null;
- }
-
- this.updateChild();
- return;
- }
- } finally {
- var1.readUnlock();
- }
-
- }
-
- void updateChild() {
- boolean var1 = false;
- synchronized(this) {
- if (!this.minorValid) {
- int var3 = this.this$0.getMinorAxis();
- this.min = this.child.getMinimumSpan(var3);
- this.pref = this.child.getPreferredSpan(var3);
- this.max = this.child.getMaximumSpan(var3);
- this.minorValid = true;
- var1 = true;
- }
- }
-
- if (var1) {
- this.this$0.minorRequirementChange(this);
- }
-
- boolean var13 = false;
- float var4 = 0.0F;
- synchronized(this) {
- if (!this.majorValid) {
- float var6 = this.span;
- this.span = this.child.getPreferredSpan(this.this$0.axis);
- var4 = this.span - var6;
- this.majorValid = true;
- var13 = true;
- }
- }
-
- if (var13) {
- this.this$0.majorRequirementChange(this, var4);
- this.this$0.locator.childChanged(this);
- }
-
- synchronized(this) {
- if (!this.childSizeValid) {
- float var7;
- float var8;
- if (this.this$0.axis == 0) {
- var7 = this.span;
- var8 = this.getMinorSpan();
- } else {
- var7 = this.getMinorSpan();
- var8 = this.span;
- }
-
- this.childSizeValid = true;
- this.child.setSize(var7, var8);
- }
-
- }
- }
-
- public float getMinorSpan() {
- return this.max < this.this$0.minorSpan ? this.max : Math.max(this.min, this.this$0.minorSpan);
- }
-
- public float getMinorOffset() {
- if (this.max < this.this$0.minorSpan) {
- float var1 = this.child.getAlignment(this.this$0.getMinorAxis());
- return (this.this$0.minorSpan - this.max) * var1;
- } else {
- return 0.0F;
- }
- }
-
- public float getMajorSpan() {
- return this.span;
- }
-
- public float getMajorOffset() {
- return this.offset;
- }
-
- public void setMajorOffset(float var1) {
- this.offset = var1;
- }
-
- public void preferenceChanged(boolean var1, boolean var2) {
- if (this.this$0.axis == 0) {
- if (var1) {
- this.majorValid = false;
- }
-
- if (var2) {
- this.minorValid = false;
- }
- } else {
- if (var1) {
- this.minorValid = false;
- }
-
- if (var2) {
- this.majorValid = false;
- }
- }
-
- this.childSizeValid = false;
- }
-
- public boolean isLayoutValid() {
- return this.minorValid && this.majorValid && this.childSizeValid;
- }
-
- // $FF: synthetic method
- static boolean access$002(AsyncBoxView$ChildState var0, boolean var1) {
- return var0.childSizeValid = var1;
- }
-
- // $FF: synthetic method
- static float access$100(AsyncBoxView$ChildState var0) {
- return var0.min;
- }
-
- // $FF: synthetic method
- static float access$200(AsyncBoxView$ChildState var0) {
- return var0.pref;
- }
- }
-