home *** CD-ROM | disk | FTP | other *** search
- package javax.swing;
-
- import java.util.ArrayList;
- import java.util.List;
- import javax.swing.GroupLayout.ComponentInfo;
-
- class GroupLayout$LinkInfo {
- private final int axis;
- private final List<GroupLayout.ComponentInfo> linked = new ArrayList();
- private int size = Integer.MIN_VALUE;
- // $FF: synthetic field
- static final boolean $assertionsDisabled = !GroupLayout.class.desiredAssertionStatus();
-
- GroupLayout$LinkInfo(int var1) {
- this.axis = var1;
- }
-
- public void add(GroupLayout.ComponentInfo var1) {
- GroupLayout$LinkInfo var2 = ComponentInfo.access$1100(var1, this.axis, false);
- if (var2 == null) {
- this.linked.add(var1);
- ComponentInfo.access$1200(var1, this.axis, this);
- } else if (var2 != this) {
- this.linked.addAll(var2.linked);
-
- for(GroupLayout.ComponentInfo var4 : var2.linked) {
- ComponentInfo.access$1200(var4, this.axis, this);
- }
- }
-
- this.clearCachedSize();
- }
-
- public void remove(GroupLayout.ComponentInfo var1) {
- this.linked.remove(var1);
- ComponentInfo.access$1200(var1, this.axis, (GroupLayout$LinkInfo)null);
- if (this.linked.size() == 1) {
- ComponentInfo.access$1200((GroupLayout.ComponentInfo)this.linked.get(0), this.axis, (GroupLayout$LinkInfo)null);
- }
-
- this.clearCachedSize();
- }
-
- public void clearCachedSize() {
- this.size = Integer.MIN_VALUE;
- }
-
- public int getSize(int var1) {
- if (this.size == Integer.MIN_VALUE) {
- this.size = this.calculateLinkedSize(var1);
- }
-
- return this.size;
- }
-
- private int calculateLinkedSize(int var1) {
- int var2 = 0;
-
- for(GroupLayout.ComponentInfo var4 : this.linked) {
- GroupLayout.ComponentSpring var5;
- if (var1 == 0) {
- var5 = var4.horizontalSpring;
- } else {
- if (!$assertionsDisabled && var1 != 1) {
- throw new AssertionError();
- }
-
- var5 = var4.verticalSpring;
- }
-
- var2 = Math.max(var2, var5.calculateNonlinkedPreferredSize(var1));
- }
-
- return var2;
- }
- }
-