.. | .. |
---|
4 | 4 | import javax.swing.*; |
---|
5 | 5 | import javax.swing.event.*; |
---|
6 | 6 | |
---|
| 7 | +import grafeme.ui.*; |
---|
| 8 | + |
---|
7 | 9 | class cSpringEditor extends ObjEditor implements ItemListener, ChangeListener, ObjectUI, ActionListener |
---|
8 | 10 | { |
---|
9 | | - |
---|
10 | 11 | cSpringEditor(cSpring inBP, GroupEditor callee) |
---|
11 | 12 | { |
---|
12 | 13 | super(inBP, callee); |
---|
.. | .. |
---|
51 | 52 | { |
---|
52 | 53 | super.SetupUI2(oe); |
---|
53 | 54 | |
---|
| 55 | + firstrowPanel = new cGridBag(); |
---|
| 56 | + |
---|
54 | 57 | //// oe.ctrlPanel.add(animate = new JCheckBox("Live", spring.live), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
55 | 58 | //// ObjEditor.aConstraints.gridx += 1; |
---|
56 | | - freezeButton = AddButton(oe, "Freeze"); |
---|
| 59 | + freezeButton = AddButton(firstrowPanel, "Freeze"); |
---|
57 | 60 | // oe.ctrlPanel.add(freezeButton = new cButton("Freeze"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
58 | 61 | // ObjEditor.aConstraints.gridx += 1; |
---|
59 | 62 | //// oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
60 | 63 | //// ObjEditor.aConstraints.gridx += 1; |
---|
61 | | - avoiderButton = AddButton(oe, "Avoid"); |
---|
| 64 | + avoiderButton = AddButton(firstrowPanel, "Avoid"); |
---|
62 | 65 | // oe.ctrlPanel.add(avoiderButton = new cButton("Avoid"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
63 | 66 | // ObjEditor.aConstraints.gridx += 1; |
---|
64 | | - autofreeze = AddCheckBox(oe, "Blow", spring.IsAutoFreeze()); |
---|
| 67 | + autofreeze = AddCheckBox(firstrowPanel, "Blow", spring.IsAutoFreeze()); |
---|
65 | 68 | // oe.ctrlPanel.add(autofreeze = new JCheckBox("Blow", spring.IsAutoFreeze()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
66 | 69 | // ObjEditor.aConstraints.gridx += 1; |
---|
67 | 70 | // Return(); |
---|
.. | .. |
---|
69 | 72 | // ObjEditor.aConstraints.gridx = 0; |
---|
70 | 73 | //// oe.ctrlPanel.add(resetButton = new cButton("Reset"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
71 | 74 | //// ObjEditor.aConstraints.gridx += 1; |
---|
72 | | - fastnormals = AddCheckBox(oe, "Fast", spring.IsFastNormals()); |
---|
| 75 | + fastnormals = AddCheckBox(firstrowPanel, "Fast", spring.IsFastNormals()); |
---|
73 | 76 | // oe.ctrlPanel.add(fastnormals = new JCheckBox("Fast", spring.IsFastNormals()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
74 | 77 | // ObjEditor.aConstraints.gridx += 1; |
---|
75 | | - springs = AddCheckBox(oe, "Show", spring.showsprings); |
---|
| 78 | + springs = AddCheckBox(firstrowPanel, "Show", spring.showsprings); |
---|
76 | 79 | // oe.ctrlPanel.add(springs = new JCheckBox("Springs", spring.showsprings), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
77 | 80 | // ObjEditor.aConstraints.gridx += 1; |
---|
78 | | - info = AddCheckBox(oe, "Info", spring.ShowInfo()); |
---|
| 81 | + info = AddCheckBox(firstrowPanel, "Info", spring.ShowInfo()); |
---|
79 | 82 | // oe.ctrlPanel.add(info = new JCheckBox("Info", spring.ShowInfo()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
80 | | - Return(); |
---|
| 83 | + oe.ctrlPanel.add(firstrowPanel); |
---|
| 84 | + oe.ctrlPanel.Return(); |
---|
81 | 85 | // ObjEditor.aConstraints.gridy += 1; |
---|
82 | 86 | // ObjEditor.aConstraints.gridx = 0; |
---|
| 87 | + |
---|
| 88 | + stiffnessPanel = AddSlider(oe.ctrlPanel, "Stiffness:", 0, 20.0, Math.log(spring.K+1), 1); |
---|
83 | 89 | |
---|
84 | 90 | // ObjEditor.aConstraints.anchor = GridBagConstraints.WEST; |
---|
85 | 91 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
94 | 100 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
95 | 101 | // //ObjEditor.aConstraints.fill = 0; |
---|
96 | 102 | // ObjEditor.aConstraints.gridx -= 1; |
---|
97 | | - stiffnessField = AddSlider(oe.ctrlPanel, "Stiffness:", 0, 20.0, Math.log(spring.K+1), 1); |
---|
98 | | - Return(); |
---|
| 103 | + stiffnessField = (cNumberSlider)stiffnessPanel.getComponent(1); |
---|
| 104 | + oe.ctrlPanel.Return(); |
---|
| 105 | + massPanel = AddSlider(oe.ctrlPanel, "Mass:", 0, 20.0, Math.log(spring.M+1), 1); |
---|
99 | 106 | |
---|
100 | 107 | // oe.ctrlPanel.add(massLabel = new JLabel("Mass"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
101 | 108 | // massLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
107 | 114 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
108 | 115 | // //ObjEditor.aConstraints.fill = 0; |
---|
109 | 116 | // ObjEditor.aConstraints.gridx -= 1; |
---|
110 | | - massField = AddSlider(oe.ctrlPanel, "Mass:", 0, 20.0, Math.log(spring.M+1), 1); |
---|
111 | | - Return(); |
---|
| 117 | + massField = (cNumberSlider)massPanel.getComponent(1); |
---|
| 118 | + oe.ctrlPanel.Return(); |
---|
| 119 | + gravityPanel = AddSlider(oe.ctrlPanel, "Gravity:", 0, 20.0, Math.log(spring.G.acceleration+1), 1); |
---|
112 | 120 | |
---|
113 | 121 | // oe.ctrlPanel.add(gravityLabel = new JLabel("Gravity"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
114 | 122 | // gravityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
120 | 128 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
121 | 129 | // //ObjEditor.aConstraints.fill = 0; |
---|
122 | 130 | // ObjEditor.aConstraints.gridx -= 1; |
---|
123 | | - gravityField = AddSlider(oe.ctrlPanel, "Gravity:", 0, 20.0, Math.log(spring.G.acceleration+1), 1); |
---|
124 | | - Return(); |
---|
| 131 | + gravityField = (cNumberSlider)gravityPanel.getComponent(1); |
---|
| 132 | + oe.ctrlPanel.Return(); |
---|
| 133 | + normalPanel = AddSlider(oe.ctrlPanel, "Normal:", 0, 20.0, Math.log(spring.normalpush+1), 1); |
---|
125 | 134 | |
---|
126 | 135 | // oe.ctrlPanel.add(normalLabel = new JLabel("Normal"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
127 | 136 | // normalLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
133 | 142 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
134 | 143 | // //ObjEditor.aConstraints.fill = 0; |
---|
135 | 144 | // ObjEditor.aConstraints.gridx -= 1; |
---|
136 | | - normalField = AddSlider(oe.ctrlPanel, "Normal:", 0, 20.0, Math.log(spring.normalpush+1), 1); |
---|
137 | | - Return(); |
---|
| 145 | + normalField = (cNumberSlider)normalPanel.getComponent(1); |
---|
| 146 | + oe.ctrlPanel.Return(); |
---|
| 147 | + restlengthPanel = AddSlider(oe.ctrlPanel, "Restlength:", 0, 2.0, spring.restlengthFactor, 1); |
---|
138 | 148 | |
---|
139 | 149 | /**/ |
---|
140 | 150 | // oe.ctrlPanel.add(thicknessLabel = new JLabel("Restlength"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
.. | .. |
---|
147 | 157 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
148 | 158 | // //ObjEditor.aConstraints.fill = 0; |
---|
149 | 159 | // ObjEditor.aConstraints.gridx -= 1; |
---|
150 | | - restlengthField = AddSlider(oe.ctrlPanel, "Restlength:", 0, 2.0, spring.restlengthFactor, 1); |
---|
151 | | - Return(); |
---|
| 160 | + restlengthField = (cNumberSlider)restlengthPanel.getComponent(1); |
---|
| 161 | + oe.ctrlPanel.Return(); |
---|
| 162 | + distortionPanel = AddSlider(oe.ctrlPanel, "Distortion:", 0, 2.0, spring.distortion, 1); |
---|
152 | 163 | |
---|
153 | 164 | // oe.ctrlPanel.add(distortionLabel = new JLabel("Distortion"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
154 | 165 | // distortionLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
160 | 171 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
161 | 172 | // //ObjEditor.aConstraints.fill = 0; |
---|
162 | 173 | // ObjEditor.aConstraints.gridx -= 1; |
---|
163 | | - distortionField = AddSlider(oe.ctrlPanel, "Distortion:", 0, 2.0, spring.distortion, 1); |
---|
164 | | - Return(); |
---|
| 174 | + distortionField = (cNumberSlider)distortionPanel.getComponent(1); |
---|
| 175 | + oe.ctrlPanel.Return(); |
---|
165 | 176 | /**/ |
---|
| 177 | + limitPanel = AddSlider(oe.ctrlPanel, "Limit:", 0, 20.0, Math.log(spring.limit+1), 1); |
---|
166 | 178 | |
---|
167 | 179 | // oe.ctrlPanel.add(limitLabel = new JLabel("Limit"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
168 | 180 | // limitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
174 | 186 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
175 | 187 | // //ObjEditor.aConstraints.fill = 0; |
---|
176 | 188 | // ObjEditor.aConstraints.gridx -= 1; |
---|
177 | | - limitField = AddSlider(oe.ctrlPanel, "Limit:", 0, 20.0, Math.log(spring.limit+1), 1); |
---|
178 | | - Return(); |
---|
| 189 | + limitField = (cNumberSlider)limitPanel.getComponent(1); |
---|
| 190 | + oe.ctrlPanel.Return(); |
---|
| 191 | + viscosityPanel = AddSlider(oe.ctrlPanel, "Viscosity:", 0, 20.0, Math.log(spring.W.wind+1), 1); |
---|
179 | 192 | |
---|
180 | 193 | // oe.ctrlPanel.add(viscosityLabel = new JLabel("Viscosity"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
181 | 194 | // viscosityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
187 | 200 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
188 | 201 | // //ObjEditor.aConstraints.fill = 0; |
---|
189 | 202 | // ObjEditor.aConstraints.gridx -= 1; |
---|
190 | | - viscosityField = AddSlider(oe.ctrlPanel, "Viscosity:", 0, 20.0, Math.log(spring.W.wind+1), 1); |
---|
191 | | - Return(); |
---|
| 203 | + viscosityField = (cNumberSlider)viscosityPanel.getComponent(1); |
---|
| 204 | + oe.ctrlPanel.Return(); |
---|
| 205 | + fluidspeedPanel = AddSlider(oe.ctrlPanel, "Speed:", 0, 20.0, Math.log(spring.W.speed+1), 1); |
---|
192 | 206 | |
---|
193 | 207 | // oe.ctrlPanel.add(fluidspeedLabel = new JLabel("Speed"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
194 | 208 | // fluidspeedLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
200 | 214 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
201 | 215 | // //ObjEditor.aConstraints.fill = 0; |
---|
202 | 216 | // ObjEditor.aConstraints.gridx -= 1; |
---|
203 | | - fluidspeedField = AddSlider(oe.ctrlPanel, "Speed:", 0, 20.0, Math.log(spring.W.speed+1), 1); |
---|
204 | | - Return(); |
---|
| 217 | + fluidspeedField = (cNumberSlider)fluidspeedPanel.getComponent(1); |
---|
| 218 | + oe.ctrlPanel.Return(); |
---|
| 219 | + liftPanel = AddSlider(oe.ctrlPanel, "Lift:", 0, 1.0, spring.W.lift, 1); |
---|
205 | 220 | |
---|
206 | 221 | // oe.ctrlPanel.add(liftLabel = new JLabel("Lift"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
207 | 222 | // liftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
213 | 228 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
214 | 229 | // //ObjEditor.aConstraints.fill = 0; |
---|
215 | 230 | // ObjEditor.aConstraints.gridx -= 1; |
---|
216 | | - liftField = AddSlider(oe.ctrlPanel, "Lift:", 0, 1.0, spring.W.lift, 1); |
---|
217 | | - Return(); |
---|
| 231 | + liftField = (cNumberSlider)liftPanel.getComponent(1); |
---|
| 232 | + oe.ctrlPanel.Return(); |
---|
| 233 | + frictionPanel = AddSlider(oe.ctrlPanel, "Friction:", 0, 1.0, spring.friction, 1); |
---|
218 | 234 | |
---|
219 | 235 | // oe.ctrlPanel.add(frictionLabel = new JLabel("Friction"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
220 | 236 | // frictionLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
226 | 242 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
227 | 243 | // //ObjEditor.aConstraints.fill = 0; |
---|
228 | 244 | // ObjEditor.aConstraints.gridx -= 1; |
---|
229 | | - frictionField = AddSlider(oe.ctrlPanel, "Friction:", 0, 1.0, spring.friction, 1); |
---|
230 | | - Return(); |
---|
| 245 | + frictionField = (cNumberSlider)frictionPanel.getComponent(1); |
---|
| 246 | + oe.ctrlPanel.Return(); |
---|
| 247 | + timestepPanel = AddSlider(oe.ctrlPanel, "Timestep:", 0, 1.0, spring.timestep, 1); |
---|
231 | 248 | |
---|
232 | 249 | // oe.ctrlPanel.add(timestepLabel = new JLabel("Timestep"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
233 | 250 | // timestepLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
239 | 256 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
240 | 257 | // //ObjEditor.aConstraints.fill = 0; |
---|
241 | 258 | // ObjEditor.aConstraints.gridx -= 1; |
---|
242 | | - timestepField = AddSlider(oe.ctrlPanel, "Timestep:", 0, 1.0, spring.timestep, 1); |
---|
243 | | - Return(); |
---|
| 259 | + timestepField = (cNumberSlider)timestepPanel.getComponent(1); |
---|
| 260 | + oe.ctrlPanel.Return(); |
---|
| 261 | + poseslownessPanel = AddSlider(oe.ctrlPanel, "Slowness:", 0, 100.0, spring.slowness, 1); |
---|
244 | 262 | |
---|
245 | 263 | // oe.ctrlPanel.add(poseslownessLabel = new JLabel("Slowness"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
246 | 264 | // timestepLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
252 | 270 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
253 | 271 | // //ObjEditor.aConstraints.fill = 0; |
---|
254 | 272 | // ObjEditor.aConstraints.gridx -= 1; |
---|
255 | | - poseslownessField = AddSlider(oe.ctrlPanel, "Slowness:", 0, 100.0, spring.slowness, 1); |
---|
256 | | - Return(); |
---|
| 273 | + poseslownessField = (cNumberSlider)poseslownessPanel.getComponent(1); |
---|
| 274 | + oe.ctrlPanel.Return(); |
---|
| 275 | + dampingPanel = AddSlider(oe.ctrlPanel, "Damping:", 0, 20.0, -Math.log(spring.damping)*10, 1); |
---|
257 | 276 | |
---|
258 | 277 | // oe.ctrlPanel.add(dampingLabel = new JLabel("Damping"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
259 | 278 | // dampingLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
265 | 284 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
266 | 285 | // //ObjEditor.aConstraints.fill = 0; |
---|
267 | 286 | // ObjEditor.aConstraints.gridx -= 1; |
---|
268 | | - dampingField = AddSlider(oe.ctrlPanel, "Damping:", 0, 20.0, -Math.log(spring.damping)*10, 1); |
---|
269 | | - Return(); |
---|
| 287 | + dampingField = (cNumberSlider)dampingPanel.getComponent(1); |
---|
| 288 | + oe.ctrlPanel.Return(); |
---|
| 289 | + solidityPanel = AddSlider(oe.ctrlPanel, "Solidity:", 0, 20.0, Math.log(spring.solidity+1), 1); |
---|
270 | 290 | |
---|
271 | 291 | // oe.ctrlPanel.add(solidityLabel = new JLabel("Solidity"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
272 | 292 | // solidityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
278 | 298 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
279 | 299 | // //ObjEditor.aConstraints.fill = 0; |
---|
280 | 300 | // ObjEditor.aConstraints.gridx -= 1; |
---|
281 | | - solidityField = AddSlider(oe.ctrlPanel, "Solidity:", 0, 20.0, Math.log(spring.solidity+1), 1); |
---|
282 | | - Return(); |
---|
| 301 | + solidityField = (cNumberSlider)solidityPanel.getComponent(1); |
---|
| 302 | + oe.ctrlPanel.Return(); |
---|
283 | 303 | |
---|
284 | 304 | //System.out.println("K = " + spring.K + "; G = " + spring.G.acceleration + "; H = " + spring.H + "; V = " + spring.W.wind); |
---|
285 | 305 | |
---|
.. | .. |
---|
314 | 334 | // solidityField.setFloat(Math.log(spring.solidity+1)); |
---|
315 | 335 | // solidityField.addChangeListener(this); |
---|
316 | 336 | |
---|
| 337 | + secondrowPanel = new cGridBag(); |
---|
| 338 | + |
---|
317 | 339 | // ObjEditor.aConstraints.gridwidth = 1; |
---|
318 | 340 | // ObjEditor.aConstraints.anchor = GridBagConstraints.WEST; |
---|
319 | 341 | // oe.ctrlPanel.add(revertButton = new cButton("Revert"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
320 | 342 | // ObjEditor.aConstraints.gridx += 1; |
---|
321 | | - revertButton = AddButton(oe, "Revert"); |
---|
| 343 | + revertButton = AddButton(secondrowPanel, "Revert"); |
---|
322 | 344 | // oe.ctrlPanel.add(epsequal = new JCheckBox("Eps", spring.IsEpsEqual()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
323 | 345 | // ObjEditor.aConstraints.gridx += 1; |
---|
324 | | - epsequal = AddCheckBox(oe, "Eps", spring.IsEpsEqual()); |
---|
| 346 | + epsequal = AddCheckBox(secondrowPanel, "Eps", spring.IsEpsEqual()); |
---|
325 | 347 | // oe.ctrlPanel.add(linkUV = new JCheckBox("link UV", spring.IsLinkUV()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
326 | 348 | // ObjEditor.aConstraints.gridy += 1; |
---|
327 | 349 | // ObjEditor.aConstraints.gridx = 0; |
---|
328 | | - linkUV = AddCheckBox(oe, "UV", spring.IsLinkUV()); |
---|
| 350 | + linkUV = AddCheckBox(secondrowPanel, "UV", spring.IsLinkUV()); |
---|
329 | 351 | // oe.ctrlPanel.add(poseCB = new JCheckBox("Change:", spring.IsPoseMesh()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
330 | 352 | // ObjEditor.aConstraints.gridx += 1; |
---|
331 | | - poseCB = AddCheckBox(oe, "Loop", spring.IsPoseMesh()); |
---|
| 353 | + poseCB = AddCheckBox(secondrowPanel, "Loop", spring.IsPoseMesh()); |
---|
332 | 354 | // oe.ctrlPanel.add(poseButton = new cButton("Pose"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
333 | 355 | // ObjEditor.aConstraints.gridy += 1; |
---|
334 | 356 | // ObjEditor.aConstraints.gridx = 0; |
---|
335 | | - poseButton = AddButton(oe, "Pose"); |
---|
336 | | - Return(); |
---|
337 | | - |
---|
338 | | - poseField = AddSlider(oe.ctrlPanel, "Pose:", 0, spring.posegroup==null?0:spring.posegroup.size()-1, spring.poseid); |
---|
339 | | - Return(); |
---|
| 357 | + poseButton = AddButton(secondrowPanel, "Pose"); |
---|
340 | 358 | |
---|
| 359 | + oe.ctrlPanel.add(secondrowPanel); |
---|
| 360 | + oe.ctrlPanel.Return(); |
---|
| 361 | + |
---|
| 362 | + posePanel = AddSlider(oe.ctrlPanel, "Pose:", 0, spring.posegroup==null?0:spring.posegroup.size()-1, spring.poseid); |
---|
| 363 | + |
---|
| 364 | + poseField = (cNumberSlider)posePanel.getComponent(1); |
---|
| 365 | + oe.ctrlPanel.Return(); |
---|
| 366 | + |
---|
| 367 | + thirdrowPanel = new cGridBag(); |
---|
| 368 | + |
---|
341 | 369 | // oe.ctrlPanel.add(solid = new JCheckBox("Solid", spring.IsSolid()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
342 | 370 | // ObjEditor.aConstraints.gridx += 1; |
---|
343 | | - solid = AddCheckBox(oe, "3D", spring.IsSolid()); |
---|
| 371 | + solid = AddCheckBox(thirdrowPanel, "3D", spring.IsSolid()); |
---|
344 | 372 | // oe.ctrlPanel.add(soft = new JCheckBox("Soft", spring.IsSoft()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
345 | 373 | // ObjEditor.aConstraints.gridy += 1; |
---|
346 | 374 | // ObjEditor.aConstraints.gridx = 0; |
---|
347 | | - soft = AddCheckBox(oe, "Soft", spring.IsSoft()); |
---|
| 375 | + soft = AddCheckBox(thirdrowPanel, "Soft", spring.IsSoft()); |
---|
348 | 376 | // oe.ctrlPanel.add(fold = new JCheckBox("Fold", spring.IsFold()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
349 | 377 | // ObjEditor.aConstraints.gridx += 1; |
---|
350 | | - fold = AddCheckBox(oe, "Fold", spring.IsFold()); |
---|
| 378 | + fold = AddCheckBox(thirdrowPanel, "Fold", spring.IsFold()); |
---|
351 | 379 | // oe.ctrlPanel.add(unfold = new JCheckBox("Unfold", spring.IsUnfold()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
352 | 380 | // ObjEditor.aConstraints.gridx += 1; |
---|
353 | | - unfold = AddCheckBox(oe, "Unf", spring.IsUnfold()); |
---|
| 381 | + unfold = AddCheckBox(thirdrowPanel, "Unf", spring.IsUnfold()); |
---|
354 | 382 | // oe.ctrlPanel.add(normalizeCounts = new JCheckBox("Counts", spring.IsNormalize()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
355 | 383 | // ObjEditor.aConstraints.gridx += 1; |
---|
356 | 384 | // ObjEditor.aConstraints.gridy += 1; |
---|
357 | 385 | // ObjEditor.aConstraints.gridx = 0; |
---|
358 | | - normalizeCounts = AddCheckBox(oe, "Cnt", spring.IsNormalize()); |
---|
| 386 | + normalizeCounts = AddCheckBox(thirdrowPanel, "Cnt", spring.IsNormalize()); |
---|
359 | 387 | // Invariants?... oe.ctrlPanel.add(updatehandles = new JCheckBox("Update handles", spring.IsUpdateHandles()), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
360 | 388 | // ObjEditor.aConstraints.gridx += 1; |
---|
361 | 389 | |
---|
362 | | - Return(); |
---|
| 390 | + oe.ctrlPanel.add(thirdrowPanel); |
---|
| 391 | + oe.ctrlPanel.Return(); |
---|
363 | 392 | // oe.ctrlPanel.add(freezeButton = new cButton(" Freeze "), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
364 | 393 | // ObjEditor.aConstraints.gridx += 1; |
---|
365 | 394 | // oe.ctrlPanel.add(stepButton = new cButton(" Step "), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
.. | .. |
---|
593 | 622 | { |
---|
594 | 623 | ObjEditor oe = objEditor; |
---|
595 | 624 | |
---|
596 | | - Remove(stiffnessField); |
---|
597 | | - Remove(massField); |
---|
598 | | - Remove(gravityField); |
---|
599 | | - Remove(normalField); |
---|
600 | | - Remove(limitField); |
---|
601 | | - Remove(restlengthField); |
---|
602 | | - Remove(distortionField); |
---|
603 | | - Remove(viscosityField); |
---|
604 | | - Remove(fluidspeedField); |
---|
605 | | - Remove(liftField); |
---|
606 | | - Remove(frictionField); |
---|
607 | | - Remove(timestepField); |
---|
608 | | - Remove(poseslownessField); |
---|
609 | | - Remove(dampingField); |
---|
610 | | - Remove(solidityField); |
---|
| 625 | +// Remove(stiffnessField); |
---|
| 626 | +// Remove(massField); |
---|
| 627 | +// Remove(gravityField); |
---|
| 628 | +// Remove(normalField); |
---|
| 629 | +// Remove(limitField); |
---|
| 630 | +// Remove(restlengthField); |
---|
| 631 | +// Remove(distortionField); |
---|
| 632 | +// Remove(viscosityField); |
---|
| 633 | +// Remove(fluidspeedField); |
---|
| 634 | +// Remove(liftField); |
---|
| 635 | +// Remove(frictionField); |
---|
| 636 | +// Remove(timestepField); |
---|
| 637 | +// Remove(poseslownessField); |
---|
| 638 | +// Remove(dampingField); |
---|
| 639 | +// Remove(solidityField); |
---|
| 640 | + objEditor.ctrlPanel.remove(firstrowPanel); |
---|
| 641 | + objEditor.ctrlPanel.remove(secondrowPanel); |
---|
| 642 | + objEditor.ctrlPanel.remove(thirdrowPanel); |
---|
| 643 | + objEditor.ctrlPanel.remove(stiffnessPanel); |
---|
| 644 | + objEditor.ctrlPanel.remove(massPanel); |
---|
| 645 | + objEditor.ctrlPanel.remove(gravityPanel); |
---|
| 646 | + objEditor.ctrlPanel.remove(normalPanel); |
---|
| 647 | + objEditor.ctrlPanel.remove(limitPanel); |
---|
| 648 | + objEditor.ctrlPanel.remove(restlengthPanel); |
---|
| 649 | + objEditor.ctrlPanel.remove(distortionPanel); |
---|
| 650 | + objEditor.ctrlPanel.remove(viscosityPanel); |
---|
| 651 | + objEditor.ctrlPanel.remove(fluidspeedPanel); |
---|
| 652 | + objEditor.ctrlPanel.remove(liftPanel); |
---|
| 653 | + objEditor.ctrlPanel.remove(frictionPanel); |
---|
| 654 | + objEditor.ctrlPanel.remove(timestepPanel); |
---|
| 655 | + objEditor.ctrlPanel.remove(poseslownessPanel); |
---|
| 656 | + objEditor.ctrlPanel.remove(dampingPanel); |
---|
| 657 | + objEditor.ctrlPanel.remove(solidityPanel); |
---|
| 658 | + objEditor.ctrlPanel.remove(posePanel); |
---|
611 | 659 | // stiffnessField.removeChangeListener(this); |
---|
612 | 660 | // massField.removeChangeListener(this); |
---|
613 | 661 | // gravityField.removeChangeListener(this); |
---|
.. | .. |
---|
748 | 796 | JLabel liftLabel; |
---|
749 | 797 | JLabel solidityLabel; |
---|
750 | 798 | |
---|
751 | | - NumberSlider stiffnessField; |
---|
752 | | - NumberSlider massField; |
---|
753 | | - NumberSlider gravityField; |
---|
754 | | - NumberSlider normalField; |
---|
755 | | - NumberSlider mgravityField; |
---|
756 | | - NumberSlider fluidspeedField; |
---|
757 | | - NumberSlider viscosityField; |
---|
758 | | - NumberSlider floorField; |
---|
759 | | - NumberSlider limitField; |
---|
760 | | - NumberSlider restlengthField; |
---|
761 | | - NumberSlider distortionField; |
---|
762 | | - NumberSlider frictionField; |
---|
763 | | - NumberSlider timestepField; |
---|
764 | | - NumberSlider poseslownessField; |
---|
765 | | - NumberSlider dampingField; |
---|
766 | | - NumberSlider liftField; |
---|
767 | | - NumberSlider solidityField; |
---|
| 799 | + cNumberSlider stiffnessField; |
---|
| 800 | + cNumberSlider massField; |
---|
| 801 | + cNumberSlider gravityField; |
---|
| 802 | + cNumberSlider normalField; |
---|
| 803 | + cNumberSlider fluidspeedField; |
---|
| 804 | + cNumberSlider viscosityField; |
---|
| 805 | + cNumberSlider limitField; |
---|
| 806 | + cNumberSlider restlengthField; |
---|
| 807 | + cNumberSlider distortionField; |
---|
| 808 | + cNumberSlider frictionField; |
---|
| 809 | + cNumberSlider timestepField; |
---|
| 810 | + cNumberSlider poseslownessField; |
---|
| 811 | + cNumberSlider dampingField; |
---|
| 812 | + cNumberSlider liftField; |
---|
| 813 | + cNumberSlider solidityField; |
---|
768 | 814 | |
---|
769 | | - NumberSlider poseField; |
---|
| 815 | + cNumberSlider poseField; |
---|
770 | 816 | |
---|
| 817 | + cGridBag firstrowPanel; |
---|
| 818 | + cGridBag secondrowPanel; |
---|
| 819 | + cGridBag thirdrowPanel; |
---|
| 820 | + |
---|
| 821 | + cGridBag stiffnessPanel; |
---|
| 822 | + cGridBag massPanel; |
---|
| 823 | + cGridBag gravityPanel; |
---|
| 824 | + cGridBag normalPanel; |
---|
| 825 | + cGridBag fluidspeedPanel; |
---|
| 826 | + cGridBag viscosityPanel; |
---|
| 827 | + cGridBag limitPanel; |
---|
| 828 | + cGridBag restlengthPanel; |
---|
| 829 | + cGridBag distortionPanel; |
---|
| 830 | + cGridBag dampingPanel; |
---|
| 831 | + cGridBag frictionPanel; |
---|
| 832 | + cGridBag liftPanel; |
---|
| 833 | + cGridBag poseslownessPanel; |
---|
| 834 | + cGridBag solidityPanel; |
---|
| 835 | + cGridBag timestepPanel; |
---|
| 836 | + cGridBag posePanel; |
---|
| 837 | + |
---|
771 | 838 | // JCheckBox animate; |
---|
772 | 839 | JCheckBox thick; |
---|
773 | 840 | JCheckBox single; |
---|