1 Clazz.declarePackage ("javax.swing");
\r
2 Clazz.load (["javax.swing.JComponent"], "javax.swing.JSplitPane", ["java.lang.Boolean", "$.IllegalArgumentException", "javax.swing.JButton", "$.UIManager"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.orientation = 0;
\r
5 this.continuousLayout = false;
\r
6 this.leftComponent = null;
\r
7 this.rightComponent = null;
\r
8 this.dividerSize = 0;
\r
9 this.dividerSizeSet = false;
\r
10 this.oneTouchExpandable = false;
\r
11 this.oneTouchExpandableSet = false;
\r
12 this.lastDividerLocation = 0;
\r
13 this.resizeWeight = 0;
\r
14 this.dividerLocation = 0;
\r
15 Clazz.instantialize (this, arguments);
\r
16 }, javax.swing, "JSplitPane", javax.swing.JComponent);
\r
17 Clazz.makeConstructor (c$,
\r
19 this.construct (1, false, new javax.swing.JButton (javax.swing.UIManager.getString ("SplitPane.leftButtonText")), new javax.swing.JButton (javax.swing.UIManager.getString ("SplitPane.rightButtonText")));
\r
21 Clazz.makeConstructor (c$,
\r
22 function (newOrientation) {
\r
23 this.construct (newOrientation, false);
\r
25 Clazz.makeConstructor (c$,
\r
26 function (newOrientation, newContinuousLayout) {
\r
27 this.construct (newOrientation, newContinuousLayout, null, null);
\r
29 Clazz.makeConstructor (c$,
\r
30 function (newOrientation, newLeftComponent, newRightComponent) {
\r
31 this.construct (newOrientation, false, newLeftComponent, newRightComponent);
\r
32 }, "~N,java.awt.Component,java.awt.Component");
\r
33 Clazz.makeConstructor (c$,
\r
34 function (newOrientation, newContinuousLayout, newLeftComponent, newRightComponent) {
\r
35 Clazz.superConstructor (this, javax.swing.JSplitPane);
\r
36 this.dividerLocation = -1;
\r
37 this.setLayout (null);
\r
38 this.setUIProperty ("opaque", Boolean.TRUE);
\r
39 this.orientation = newOrientation;
\r
40 if (this.orientation != 1 && this.orientation != 0) throw new IllegalArgumentException ("cannot create JSplitPane, orientation must be one of JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT");
\r
41 this.continuousLayout = newContinuousLayout;
\r
42 if (newLeftComponent != null) this.setLeftComponent (newLeftComponent);
\r
43 if (newRightComponent != null) this.setRightComponent (newRightComponent);
\r
45 }, "~N,~B,java.awt.Component,java.awt.Component");
\r
46 Clazz.defineMethod (c$, "setUI",
\r
48 if (this.ui !== ui) {
\r
49 Clazz.superCall (this, javax.swing.JSplitPane, "setUI", [ui]);
\r
51 }}, "javax.swing.plaf.SplitPaneUI");
\r
52 Clazz.overrideMethod (c$, "getUI",
\r
56 Clazz.overrideMethod (c$, "updateUI",
\r
58 this.setUI (javax.swing.UIManager.getUI (this));
\r
61 Clazz.overrideMethod (c$, "getUIClassID",
\r
63 return "SplitPaneUI";
\r
65 Clazz.defineMethod (c$, "setDividerSize",
\r
66 function (newSize) {
\r
67 var oldSize = this.dividerSize;
\r
68 this.dividerSizeSet = true;
\r
69 if (oldSize != newSize) {
\r
70 this.dividerSize = newSize;
\r
71 this.firePropertyChangeInt ("dividerSize", oldSize, newSize);
\r
73 Clazz.defineMethod (c$, "getDividerSize",
\r
75 return this.dividerSize;
\r
77 Clazz.defineMethod (c$, "setLeftComponent",
\r
80 if (this.leftComponent != null) {
\r
81 this.remove (this.leftComponent);
\r
82 this.leftComponent = null;
\r
84 this.add (comp, "left");
\r
85 }}, "java.awt.Component");
\r
86 Clazz.defineMethod (c$, "getLeftComponent",
\r
88 return this.leftComponent;
\r
90 Clazz.defineMethod (c$, "setTopComponent",
\r
92 this.setLeftComponent (comp);
\r
93 }, "java.awt.Component");
\r
94 Clazz.defineMethod (c$, "getTopComponent",
\r
96 return this.leftComponent;
\r
98 Clazz.defineMethod (c$, "setRightComponent",
\r
100 if (comp == null) {
\r
101 if (this.rightComponent != null) {
\r
102 this.remove (this.rightComponent);
\r
103 this.rightComponent = null;
\r
105 this.add (comp, "right");
\r
106 }}, "java.awt.Component");
\r
107 Clazz.defineMethod (c$, "getRightComponent",
\r
109 return this.rightComponent;
\r
111 Clazz.defineMethod (c$, "setBottomComponent",
\r
113 this.setRightComponent (comp);
\r
114 }, "java.awt.Component");
\r
115 Clazz.defineMethod (c$, "getBottomComponent",
\r
117 return this.rightComponent;
\r
119 Clazz.defineMethod (c$, "setOneTouchExpandable",
\r
120 function (newValue) {
\r
121 var oldValue = this.oneTouchExpandable;
\r
122 this.oneTouchExpandable = newValue;
\r
123 this.oneTouchExpandableSet = true;
\r
124 this.firePropertyChangeBool ("oneTouchExpandable", oldValue, newValue);
\r
127 Clazz.defineMethod (c$, "isOneTouchExpandable",
\r
129 return this.oneTouchExpandable;
\r
131 Clazz.defineMethod (c$, "setLastDividerLocation",
\r
132 function (newLastLocation) {
\r
133 var oldLocation = this.lastDividerLocation;
\r
134 this.lastDividerLocation = newLastLocation;
\r
135 this.firePropertyChangeInt ("lastDividerLocation", oldLocation, newLastLocation);
\r
137 Clazz.defineMethod (c$, "getLastDividerLocation",
\r
139 return this.lastDividerLocation;
\r
141 Clazz.defineMethod (c$, "setOrientation",
\r
142 function (orientation) {
\r
143 if ((orientation != 0) && (orientation != 1)) {
\r
144 throw new IllegalArgumentException ("JSplitPane: orientation must be one of JSplitPane.VERTICAL_SPLIT or JSplitPane.HORIZONTAL_SPLIT");
\r
145 }var oldOrientation = this.orientation;
\r
146 this.orientation = orientation;
\r
147 this.firePropertyChangeInt ("orientation", oldOrientation, orientation);
\r
149 Clazz.defineMethod (c$, "getOrientation",
\r
151 return this.orientation;
\r
153 Clazz.defineMethod (c$, "setContinuousLayout",
\r
154 function (newContinuousLayout) {
\r
155 var oldCD = this.continuousLayout;
\r
156 this.continuousLayout = newContinuousLayout;
\r
157 this.firePropertyChangeBool ("continuousLayout", oldCD, newContinuousLayout);
\r
159 Clazz.defineMethod (c$, "isContinuousLayout",
\r
161 return this.continuousLayout;
\r
163 Clazz.defineMethod (c$, "setResizeWeight",
\r
165 if (value < 0 || value > 1) {
\r
166 throw new IllegalArgumentException ("JSplitPane weight must be between 0 and 1");
\r
167 }var oldWeight = this.resizeWeight;
\r
168 this.resizeWeight = value;
\r
169 this.firePropertyChangeObject ("resizeWeight", new Double (oldWeight), new Double (value));
\r
171 Clazz.defineMethod (c$, "getResizeWeight",
\r
173 return this.resizeWeight;
\r
175 Clazz.defineMethod (c$, "resetToPreferredSizes",
\r
177 var ui = this.getUI ();
\r
179 ui.resetToPreferredSizes (this);
\r
181 Clazz.defineMethod (c$, "setDividerLocation",
\r
182 function (proportionalLocation) {
\r
183 if (proportionalLocation < 0.0 || proportionalLocation > 1.0) {
\r
184 throw new IllegalArgumentException ("proportional location must be between 0.0 and 1.0.");
\r
185 }if (this.getOrientation () == 0) {
\r
186 this.setDividerLocation (Clazz.doubleToInt ((this.getHeight () - this.getDividerSize ()) * proportionalLocation));
\r
188 this.setDividerLocation (Clazz.doubleToInt ((this.getWidth () - this.getDividerSize ()) * proportionalLocation));
\r
190 Clazz.defineMethod (c$, "setDividerLocation",
\r
191 function (location) {
\r
192 var oldValue = this.dividerLocation;
\r
193 this.dividerLocation = location;
\r
194 var ui = this.getUI ();
\r
196 ui.setDividerLocation (this, location);
\r
197 }this.firePropertyChangeInt ("dividerLocation", oldValue, location);
\r
198 this.setLastDividerLocation (oldValue);
\r
200 Clazz.defineMethod (c$, "getDividerLocation",
\r
202 return this.dividerLocation;
\r
204 Clazz.defineMethod (c$, "getMinimumDividerLocation",
\r
206 var ui = this.getUI ();
\r
208 return ui.getMinimumDividerLocation (this);
\r
211 Clazz.defineMethod (c$, "getMaximumDividerLocation",
\r
213 var ui = this.getUI ();
\r
215 return ui.getMaximumDividerLocation (this);
\r
218 Clazz.defineMethod (c$, "remove",
\r
219 function (component) {
\r
220 if (component === this.leftComponent) {
\r
221 this.leftComponent = null;
\r
222 } else if (component === this.rightComponent) {
\r
223 this.rightComponent = null;
\r
224 }Clazz.superCall (this, javax.swing.JSplitPane, "remove", [component]);
\r
225 this.revalidate ();
\r
227 }, "java.awt.Component");
\r
228 Clazz.defineMethod (c$, "remove",
\r
230 var comp = this.getComponent (index);
\r
231 if (comp === this.leftComponent) {
\r
232 this.leftComponent = null;
\r
233 } else if (comp === this.rightComponent) {
\r
234 this.rightComponent = null;
\r
235 }Clazz.superCall (this, javax.swing.JSplitPane, "remove", [index]);
\r
236 this.revalidate ();
\r
239 Clazz.defineMethod (c$, "removeAll",
\r
241 this.leftComponent = this.rightComponent = null;
\r
242 Clazz.superCall (this, javax.swing.JSplitPane, "removeAll", []);
\r
243 this.revalidate ();
\r
246 Clazz.overrideMethod (c$, "isValidateRoot",
\r
250 Clazz.overrideMethod (c$, "addImpl",
\r
251 function (comp, constraints, index) {
\r
253 if (constraints != null && !(Clazz.instanceOf (constraints, String))) {
\r
254 throw new IllegalArgumentException ("cannot add to layout: constraint must be a string (or null)");
\r
255 }if (constraints == null) {
\r
256 if (this.getLeftComponent () == null) {
\r
257 constraints = "left";
\r
258 } else if (this.getRightComponent () == null) {
\r
259 constraints = "right";
\r
260 }}if (constraints != null && (constraints.equals ("left") || constraints.equals ("top"))) {
\r
261 toRemove = this.getLeftComponent ();
\r
262 if (toRemove != null) {
\r
263 this.remove (toRemove);
\r
264 }this.leftComponent = comp;
\r
266 } else if (constraints != null && (constraints.equals ("right") || constraints.equals ("bottom"))) {
\r
267 toRemove = this.getRightComponent ();
\r
268 if (toRemove != null) {
\r
269 this.remove (toRemove);
\r
270 }this.rightComponent = comp;
\r
272 } else if (constraints != null && constraints.equals ("divider")) {
\r
274 }this.addImplSAEM (comp, constraints, index);
\r
275 this.revalidate ();
\r
278 }, "java.awt.Component,~O,~N");
\r
279 Clazz.defineMethod (c$, "paintChildren",
\r
281 Clazz.superCall (this, javax.swing.JSplitPane, "paintChildren", [g]);
\r
282 var ui = this.getUI ();
\r
284 var tempG = g.createSwingJS ();
\r
285 ui.finishedPaintingChildren (this, tempG);
\r
287 }}, "java.awt.Graphics");
\r
288 Clazz.defineMethod (c$, "setUIProperty",
\r
289 function (propertyName, value) {
\r
290 if (propertyName === "dividerSize") {
\r
291 if (!this.dividerSizeSet) {
\r
292 this.setDividerSize ((value).intValue ());
\r
293 this.dividerSizeSet = false;
\r
294 }} else if (propertyName === "oneTouchExpandable") {
\r
295 if (!this.oneTouchExpandableSet) {
\r
296 this.setOneTouchExpandable ((value).booleanValue ());
\r
297 this.oneTouchExpandableSet = false;
\r
299 Clazz.superCall (this, javax.swing.JSplitPane, "setUIProperty", [propertyName, value]);
\r
301 Clazz.defineMethod (c$, "paramString",
\r
303 var orientationString = (this.orientation == 1 ? "HORIZONTAL_SPLIT" : "VERTICAL_SPLIT");
\r
304 var continuousLayoutString = (this.continuousLayout ? "true" : "false");
\r
305 var oneTouchExpandableString = (this.oneTouchExpandable ? "true" : "false");
\r
306 return Clazz.superCall (this, javax.swing.JSplitPane, "paramString", []) + ",continuousLayout=" + continuousLayoutString + ",dividerSize=" + this.dividerSize + ",lastDividerLocation=" + this.lastDividerLocation + ",oneTouchExpandable=" + oneTouchExpandableString + ",orientation=" + orientationString;
\r
308 Clazz.defineStatics (c$,
\r
309 "$uiClassID", "SplitPaneUI",
\r
310 "VERTICAL_SPLIT", 0,
\r
311 "HORIZONTAL_SPLIT", 1,
\r
315 "BOTTOM", "bottom",
\r
316 "DIVIDER", "divider",
\r
317 "ORIENTATION_PROPERTY", "orientation",
\r
318 "CONTINUOUS_LAYOUT_PROPERTY", "continuousLayout",
\r
319 "DIVIDER_SIZE_PROPERTY", "dividerSize",
\r
320 "ONE_TOUCH_EXPANDABLE_PROPERTY", "oneTouchExpandable",
\r
321 "LAST_DIVIDER_LOCATION_PROPERTY", "lastDividerLocation",
\r
322 "DIVIDER_LOCATION_PROPERTY", "dividerLocation",
\r
323 "RESIZE_WEIGHT_PROPERTY", "resizeWeight");
\r