|
@@ -6,8 +6,7 @@ |
6 |
6 |
|
|
7 |
7 |
|
import com.google.gwt.user.client.ui.*; |
8 |
8 |
|
|
9 |
|
- |
public class WidgetStruct implements HasAlignment |
10 |
|
- |
{ |
|
9 |
+ |
public class WidgetStruct implements HasAlignment { |
11 |
10 |
|
protected Widget mWidget; |
12 |
11 |
|
protected boolean mSpacer = false; |
13 |
12 |
|
|
|
@@ -19,11 +18,9 @@ |
19 |
18 |
|
protected boolean mFloodsY = false; |
20 |
19 |
|
protected VerticalAlignmentConstant mVerticalAlignment = null; |
21 |
20 |
|
|
22 |
|
- |
public WidgetStruct( Widget pWidget ) |
23 |
|
- |
{ |
|
21 |
+ |
public WidgetStruct( Widget pWidget ) { |
24 |
22 |
|
mWidget = pWidget; |
25 |
|
- |
if ( pWidget instanceof ISizeableWidget ) |
26 |
|
- |
{ |
|
23 |
+ |
if ( pWidget instanceof ISizeableWidget ) { |
27 |
24 |
|
ISizeableWidget w = (ISizeableWidget) pWidget; |
28 |
25 |
|
mStretchableHorizontally = w.getWidthHelper().isStretchable(); |
29 |
26 |
|
mStretchableVertically = w.getHeightHelper().isStretchable(); |
|
@@ -31,78 +28,63 @@ |
31 |
28 |
|
} |
32 |
29 |
|
} |
33 |
30 |
|
|
34 |
|
- |
public Widget getWidget() |
35 |
|
- |
{ |
|
31 |
+ |
public Widget getWidget() { |
36 |
32 |
|
return mWidget; |
37 |
33 |
|
} |
38 |
34 |
|
|
39 |
|
- |
public boolean isSpacer() |
40 |
|
- |
{ |
|
35 |
+ |
public boolean isSpacer() { |
41 |
36 |
|
return mSpacer; |
42 |
37 |
|
} |
43 |
38 |
|
|
44 |
|
- |
public boolean isStretchableHorizontally() |
45 |
|
- |
{ |
|
39 |
+ |
public boolean isStretchableHorizontally() { |
46 |
40 |
|
return mStretchableHorizontally; |
47 |
41 |
|
} |
48 |
42 |
|
|
49 |
|
- |
public boolean isFloodsX() |
50 |
|
- |
{ |
|
43 |
+ |
public boolean isFloodsX() { |
51 |
44 |
|
return mFloodsX; |
52 |
45 |
|
} |
53 |
46 |
|
|
54 |
|
- |
public boolean hasHorizontalAlignment() |
55 |
|
- |
{ |
|
47 |
+ |
public boolean hasHorizontalAlignment() { |
56 |
48 |
|
return (mHorizontalAlignment != null); |
57 |
49 |
|
} |
58 |
50 |
|
|
59 |
51 |
|
@Override |
60 |
|
- |
public HorizontalAlignmentConstant getHorizontalAlignment() |
61 |
|
- |
{ |
|
52 |
+ |
public HorizontalAlignmentConstant getHorizontalAlignment() { |
62 |
53 |
|
return mHorizontalAlignment; |
63 |
54 |
|
} |
64 |
55 |
|
|
65 |
56 |
|
@Override |
66 |
|
- |
public void setHorizontalAlignment( HorizontalAlignmentConstant align ) |
67 |
|
- |
{ |
|
57 |
+ |
public void setHorizontalAlignment( HorizontalAlignmentConstant align ) { |
68 |
58 |
|
throw new UnsupportedOperationException( "HorizontalAlignment auto determined" ); |
69 |
59 |
|
} |
70 |
60 |
|
|
71 |
|
- |
public boolean isStretchableVertically() |
72 |
|
- |
{ |
|
61 |
+ |
public boolean isStretchableVertically() { |
73 |
62 |
|
return mStretchableVertically; |
74 |
63 |
|
} |
75 |
64 |
|
|
76 |
|
- |
public boolean isFloodsY() |
77 |
|
- |
{ |
|
65 |
+ |
public boolean isFloodsY() { |
78 |
66 |
|
return mFloodsY; |
79 |
67 |
|
} |
80 |
68 |
|
|
81 |
|
- |
public boolean hasVerticalAlignment() |
82 |
|
- |
{ |
|
69 |
+ |
public boolean hasVerticalAlignment() { |
83 |
70 |
|
return (mVerticalAlignment != null); |
84 |
71 |
|
} |
85 |
72 |
|
|
86 |
73 |
|
@Override |
87 |
|
- |
public VerticalAlignmentConstant getVerticalAlignment() |
88 |
|
- |
{ |
|
74 |
+ |
public VerticalAlignmentConstant getVerticalAlignment() { |
89 |
75 |
|
return mVerticalAlignment; |
90 |
76 |
|
} |
91 |
77 |
|
|
92 |
78 |
|
@Override |
93 |
|
- |
public void setVerticalAlignment( VerticalAlignmentConstant align ) |
94 |
|
- |
{ |
|
79 |
+ |
public void setVerticalAlignment( VerticalAlignmentConstant align ) { |
95 |
80 |
|
throw new UnsupportedOperationException( "VerticalAlignment auto determined" ); |
96 |
81 |
|
} |
97 |
82 |
|
|
98 |
|
- |
public void center() |
99 |
|
- |
{ |
100 |
|
- |
if ( !isStretchableHorizontally() && !isFloodsX() && (mHorizontalAlignment == null) ) |
101 |
|
- |
{ |
|
83 |
+ |
public void center() { |
|
84 |
+ |
if ( !isStretchableHorizontally() && !isFloodsX() && (mHorizontalAlignment == null) ) { |
102 |
85 |
|
mHorizontalAlignment = ALIGN_CENTER; |
103 |
86 |
|
} |
104 |
|
- |
if ( !isStretchableVertically() && !isFloodsY() && (mVerticalAlignment == null) ) |
105 |
|
- |
{ |
|
87 |
+ |
if ( !isStretchableVertically() && !isFloodsY() && (mVerticalAlignment == null) ) { |
106 |
88 |
|
mVerticalAlignment = ALIGN_MIDDLE; |
107 |
89 |
|
} |
108 |
90 |
|
} |