.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GrafreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
102 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
149 | 150 | |
---|
150 | 151 | void SetupMenu2(ObjEditor oe) |
---|
151 | 152 | { |
---|
| 153 | + if (Globals.ADVANCED) |
---|
| 154 | + { |
---|
152 | 155 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 156 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 157 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 163 | lookAtItem.addActionListener(this); |
---|
161 | 164 | //lookFromItem.addActinoListener(this); |
---|
162 | 165 | //switchItem.addActionListener(this); |
---|
| 166 | + } |
---|
| 167 | + |
---|
163 | 168 | Menu menu; |
---|
164 | 169 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 170 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 171 | //editItem.addActionListener(this); |
---|
167 | 172 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | 173 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 174 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 175 | cloneItem.addActionListener(this); |
---|
| 176 | + if (Globals.ADVANCED) |
---|
| 177 | + { |
---|
172 | 178 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 179 | cloneSupportItem.addActionListener(this); |
---|
| 180 | + } |
---|
174 | 181 | menu.add("-"); |
---|
175 | 182 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 183 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 185 | copyItem.addActionListener(this); |
---|
179 | 186 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 187 | pasteItem.addActionListener(this); |
---|
| 188 | + menu.add("-"); |
---|
| 189 | + |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 192 | + pasteIntoItem.addActionListener(this); |
---|
181 | 193 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 194 | pasteLinkItem.addActionListener(this); |
---|
183 | 195 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 196 | pasteCloneItem.addActionListener(this); |
---|
185 | 197 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 198 | // pasteExpandItem.addActionListener(this); |
---|
| 199 | + menu.add("-"); |
---|
187 | 200 | clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | 201 | clearItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + if (Globals.ADVANCED) |
---|
| 204 | + { |
---|
| 205 | + // Deletes the cameras... |
---|
189 | 206 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 207 | clearAllItem.addActionListener(this); |
---|
| 208 | + } |
---|
191 | 209 | |
---|
192 | 210 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
193 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
194 | | - resetMeshItem.addActionListener(this); |
---|
195 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
196 | | - stepAllItem.addActionListener(this); |
---|
| 211 | + if (Globals.ADVANCED) |
---|
| 212 | + { |
---|
197 | 213 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 214 | revertMeshItem.addActionListener(this); |
---|
199 | 215 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 216 | resetreferencesItem.addActionListener(this); |
---|
201 | 217 | menu.add("-"); |
---|
| 218 | + } |
---|
202 | 219 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 220 | overwriteGeoItem.addActionListener(this); |
---|
204 | 221 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 227 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 228 | overwriteUVItem.addActionListener(this); |
---|
212 | 229 | menu.add("-"); |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
213 | 232 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 233 | generateMeshItem.addActionListener(this); |
---|
215 | 234 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 235 | poseMeshItem.addActionListener(this); |
---|
217 | 236 | menu.add("-"); |
---|
| 237 | + } |
---|
218 | 238 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 239 | resetsupportItem.addActionListener(this); |
---|
220 | 240 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 241 | linkverticesItem.addActionListener(this); |
---|
222 | 242 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 243 | relinkverticesItem.addActionListener(this); |
---|
| 244 | + |
---|
| 245 | + if (Globals.ADVANCED) |
---|
| 246 | + { |
---|
224 | 247 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 248 | setMasterItem.addActionListener(this); |
---|
| 249 | + } |
---|
226 | 250 | |
---|
227 | 251 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | 252 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
233 | 257 | frontItem.addActionListener(this); |
---|
234 | 258 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | 259 | compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 260 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 261 | hideItem.addActionListener(this); |
---|
238 | 262 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 263 | ungroupItem.addActionListener(this); |
---|
240 | 264 | menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 265 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
242 | 266 | randomItem.addActionListener(this); |
---|
243 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
244 | | - physicsItem.addActionListener(this); |
---|
245 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
246 | | - frameselectorItem.addActionListener(this); |
---|
247 | 267 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 268 | switchGeoItem.addActionListener(this); |
---|
249 | 269 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 270 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 271 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 272 | morphItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
| 276 | + menu.add("-"); |
---|
| 277 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 278 | + physicsItem.addActionListener(this); |
---|
| 279 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 280 | + frameselectorItem.addActionListener(this); |
---|
253 | 281 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 282 | scriptNodeItem.addActionListener(this); |
---|
255 | 283 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | 284 | cameraItem.addActionListener(this); |
---|
| 285 | + } |
---|
257 | 286 | |
---|
258 | 287 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | 288 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
268 | 297 | shadowYItem.addActionListener(this); |
---|
269 | 298 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
270 | 299 | shadowZItem.addActionListener(this); |
---|
| 300 | + if (Globals.ADVANCED) |
---|
| 301 | + { |
---|
| 302 | + menu.add("-"); |
---|
271 | 303 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 304 | linkerItem.addActionListener(this); |
---|
273 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
274 | | - templateItem.addActionListener(this); |
---|
275 | 305 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | 306 | attributeItem.addActionListener(this); |
---|
| 307 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 308 | + templateItem.addActionListener(this); |
---|
277 | 309 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 310 | pointflowItem.addActionListener(this); |
---|
| 311 | + } |
---|
279 | 312 | menu.add("-"); |
---|
280 | 313 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 314 | resetTransformItem.addActionListener(this); |
---|
282 | 315 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 316 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 317 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 318 | + resetCentroidXZItem.addActionListener(this); |
---|
| 319 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 320 | + transformGeometryItem.addActionListener(this); |
---|
| 321 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 322 | + transformChildrenItem.addActionListener(this); |
---|
286 | 323 | |
---|
287 | 324 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 325 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 330 | genNormalsCADItem.addActionListener(this); |
---|
294 | 331 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 332 | genNormalsMESHItem.addActionListener(this); |
---|
| 333 | + if (Globals.ADVANCED) |
---|
| 334 | + { |
---|
296 | 335 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 336 | genNormalsMINEItem.addActionListener(this); |
---|
| 337 | + } |
---|
298 | 338 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 339 | stripifyItem.addActionListener(this); |
---|
300 | 340 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 356 | reduce34MeshItem.addActionListener(this); |
---|
317 | 357 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 358 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 359 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 360 | clipMeshItem.addActionListener(this); |
---|
| 361 | + |
---|
| 362 | + if (Globals.ADVANCED) |
---|
| 363 | + { |
---|
| 364 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 365 | + smoothMeshItem.addActionListener(this); |
---|
| 366 | + } |
---|
323 | 367 | |
---|
324 | 368 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 369 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 370 | clearMaterialsItem.addActionListener(this); |
---|
| 371 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 372 | + resetAllItem.addActionListener(this); |
---|
| 373 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 374 | + stepAllItem.addActionListener(this); |
---|
327 | 375 | menu.add("-"); |
---|
328 | 376 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 377 | liveleavesItem.addActionListener(this); |
---|
330 | 378 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 379 | unliveleavesItem.addActionListener(this); |
---|
| 380 | + if (Globals.ADVANCED) |
---|
| 381 | + { |
---|
332 | 382 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 383 | supportleavesItem.addActionListener(this); |
---|
334 | 384 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 385 | unsupportleavesItem.addActionListener(this); |
---|
| 386 | + } |
---|
336 | 387 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 388 | hideleavesItem.addActionListener(this); |
---|
338 | 389 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
376 | 427 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 428 | sortbynameItem.addActionListener(this); |
---|
378 | 429 | menu.add("-"); |
---|
| 430 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 431 | + shareGeometriesItem.addActionListener(this); |
---|
| 432 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 433 | + mergeGeometriesItem.addActionListener(this); |
---|
| 434 | + if (Globals.ADVANCED) |
---|
| 435 | + { |
---|
| 436 | + // Pretty much the same as duplicate and clone. |
---|
379 | 437 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 438 | extractGeometriesItem.addActionListener(this); |
---|
381 | 439 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 440 | cloneGeometriesItem.addActionListener(this); |
---|
383 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
384 | | - shareGeometriesItem.addActionListener(this); |
---|
385 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 441 | + } |
---|
387 | 442 | |
---|
388 | 443 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 444 | buildCreateMenu(menu); |
---|
390 | 445 | |
---|
391 | | - |
---|
392 | 446 | oe.menuBar.add(menu = new Menu("Include")); |
---|
393 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
394 | | - importGFDItem.addActionListener(this); |
---|
395 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
396 | | - importVRMLX3DItem.addActionListener(this); |
---|
397 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
| 447 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
398 | 448 | importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
| 449 | + menu.add("-"); |
---|
| 450 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
400 | 451 | import3DSItem.addActionListener(this); |
---|
| 452 | + menu.add("-"); |
---|
| 453 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 454 | + importVRMLX3DItem.addActionListener(this); |
---|
| 455 | + menu.add("-"); |
---|
| 456 | + importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
| 457 | + importGFDItem.addActionListener(this); |
---|
401 | 458 | |
---|
402 | 459 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 460 | buildToolsMenu(menu); |
---|
.. | .. |
---|
433 | 490 | oe.radioPanel.add(dummyButton); |
---|
434 | 491 | oe.buttonGroup.add(dummyButton); |
---|
435 | 492 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 493 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 494 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
| 495 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 496 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 497 | liveCB.addItemListener(this); |
---|
442 | 498 | |
---|
443 | | - oe.aConstraints.gridx += 1; |
---|
444 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
445 | | - supportCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - // oe.aConstraints.gridx += 1; |
---|
448 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
449 | | - // localCB.addItemListener(this); |
---|
450 | | - |
---|
451 | | - oe.aConstraints.gridx += 1; |
---|
452 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints); |
---|
453 | | - crowdCB.addItemListener(this); |
---|
454 | | - |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
457 | | - smoothCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | - oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 499 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 500 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 501 | + oneStepButton.addActionListener(this); |
---|
| 502 | + |
---|
| 503 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 504 | + fastCB.setToolTipText("Fast mode"); |
---|
461 | 505 | fastCB.addItemListener(this); |
---|
462 | | - oe.aConstraints.gridx += 1; |
---|
463 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
464 | | - slowCB.addItemListener(this); |
---|
465 | | - oe.aConstraints.gridx += 1; |
---|
466 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
467 | | - boxCB.addItemListener(this); |
---|
468 | | - |
---|
469 | | -// oe.aConstraints.gridx += 1; |
---|
470 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
471 | | -// speakerMocapCB.addItemListener(this); |
---|
472 | | - |
---|
473 | | - if (false) |
---|
474 | | - { |
---|
475 | | - // handled in scripts |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
478 | | - speakerCameraCB.addItemListener(this); |
---|
479 | | - |
---|
480 | | - oe.aConstraints.gridx += 1; |
---|
481 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
482 | | - speakerFocusCB.addItemListener(this); |
---|
483 | | - |
---|
484 | | - oe.aConstraints.gridx += 1; |
---|
485 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
486 | | - smoothfocusCB.addItemListener(this); |
---|
487 | | - } |
---|
488 | | - |
---|
489 | | -//oe.aConstraints.gridx += 1; |
---|
490 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
491 | | -// debugCB.addItemListener(this); |
---|
492 | | - |
---|
493 | | - oe.aConstraints.gridx += 1; |
---|
494 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
495 | | - oeilCB.addItemListener(this); |
---|
496 | | - |
---|
497 | | - oe.aConstraints.gridx += 1; |
---|
498 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
499 | | - lookAtCB.addItemListener(this); |
---|
500 | | - |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 506 | + |
---|
| 507 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 508 | + trackCB.setToolTipText("Enable tracking"); |
---|
503 | 509 | trackCB.addItemListener(this); |
---|
504 | 510 | |
---|
505 | | - oe.aConstraints.gridx += 1; |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 511 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 512 | + screenfitButton.setToolTipText("Screen fit"); |
---|
507 | 513 | screenfitButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
| 514 | + |
---|
509 | 515 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
510 | 516 | // screenfitpointButton.addActionListener(this); |
---|
511 | | -// oe.aConstraints.gridx += 1; |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
513 | | - snapobjectButton.addActionListener(this); |
---|
514 | | - oe.aConstraints.gridx += 1; |
---|
515 | 517 | |
---|
516 | | - //aConstraints.gridx = 0; |
---|
517 | | - //aConstraints.gridy += 1; |
---|
518 | | - oe.aConstraints.weighty = 0; |
---|
519 | | - oe.aConstraints.gridwidth = 1; |
---|
520 | | - |
---|
521 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 518 | + if (Globals.ADVANCED) |
---|
| 519 | + { |
---|
| 520 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 521 | + snapobjectButton.addActionListener(this); |
---|
| 522 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 523 | + } |
---|
| 524 | + |
---|
| 525 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 526 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 527 | flashSelectionButton.addActionListener(this); |
---|
523 | 528 | |
---|
524 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 529 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 530 | |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - // |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 531 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 532 | + twoButton.setToolTipText("Show center view only"); |
---|
532 | 533 | twoButton.addActionListener(this); |
---|
533 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 534 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 535 | fourButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 536 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 537 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 538 | + sixButton.setToolTipText("2-column layout left"); |
---|
536 | 539 | sixButton.addActionListener(this); |
---|
537 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 540 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 541 | + threeButton.setToolTipText("2-column layout right"); |
---|
538 | 542 | threeButton.addActionListener(this); |
---|
539 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 543 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 544 | + sevenButton.setToolTipText("3-column layout"); |
---|
540 | 545 | sevenButton.addActionListener(this); |
---|
541 | 546 | // |
---|
542 | 547 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 548 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 549 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
544 | 550 | rootButton.addActionListener(this); |
---|
545 | | - oe.aConstraints.gridx += 1; |
---|
546 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 551 | + |
---|
| 552 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 553 | + closeButton.setToolTipText("Close tab"); |
---|
547 | 554 | closeButton.addActionListener(this); |
---|
548 | 555 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
549 | 556 | //clearButton.addActionListener(this); |
---|
550 | | - oe.aConstraints.gridx += 1; |
---|
551 | 557 | |
---|
552 | | - oe.aConstraints.gridx = 1; // |
---|
553 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 558 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 559 | + |
---|
| 560 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + editButton.setToolTipText("Edit selection"); |
---|
554 | 562 | editButton.addActionListener(this); |
---|
555 | | - oe.aConstraints.gridx += 1; |
---|
556 | | - oe.aConstraints.weighty = 0; |
---|
557 | | - oe.aConstraints.gridwidth = 1; |
---|
558 | 563 | |
---|
559 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 564 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + uneditButton.setToolTipText("Unedit selection"); |
---|
560 | 566 | uneditButton.addActionListener(this); |
---|
561 | 567 | |
---|
562 | | - oe.aConstraints.gridx += 1; |
---|
563 | | - oe.aConstraints.weighty = 0; |
---|
564 | | - oe.aConstraints.gridwidth = 1; |
---|
565 | | - |
---|
566 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
567 | | - clearPanelButton.addActionListener(this); |
---|
568 | | - |
---|
569 | | - oe.aConstraints.gridx += 1; |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 1; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 568 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 569 | + allParamsButton.setToolTipText("Edit all params"); |
---|
574 | 570 | allParamsButton.addActionListener(this); |
---|
575 | 571 | |
---|
576 | | - oe.aConstraints.gridx += 1; |
---|
577 | | - oe.aConstraints.weighty = 0; |
---|
578 | | - oe.aConstraints.gridwidth = 1; |
---|
579 | | - |
---|
580 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 572 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 573 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 574 | + clearPanelButton.addActionListener(this); |
---|
| 575 | + |
---|
| 576 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + unselectButton.setToolTipText("Unselect"); |
---|
581 | 578 | unselectButton.addActionListener(this); |
---|
582 | 579 | |
---|
| 580 | + commandsPanel.preferredHeight = 1; |
---|
| 581 | + |
---|
| 582 | + oe.treePanel.add(commandsPanel); |
---|
| 583 | + oe.treePanel.Return(); |
---|
| 584 | + |
---|
583 | 585 | // oe.aConstraints.gridx += 1; |
---|
584 | 586 | // oe.aConstraints.weighty = 0; |
---|
585 | 587 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
591 | 593 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
592 | 594 | // gcButton.addActionListener(this); |
---|
593 | 595 | |
---|
594 | | - oe.aConstraints.gridx = 0; |
---|
595 | | - oe.aConstraints.gridy += 1; |
---|
596 | | - |
---|
597 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
598 | | - oe.aConstraints.gridwidth = 100; |
---|
599 | | - // oe.aConstraints.gridheight = 100; |
---|
600 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
601 | | - oe.aConstraints.gridheight = 1; |
---|
602 | | - oe.aConstraints.weighty = 0.5; |
---|
603 | | - oe.aConstraints.gridx = 0; |
---|
604 | | - JScrollPane jSP; |
---|
| 596 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 597 | + |
---|
| 598 | + JScrollPane jSP; |
---|
605 | 599 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
606 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 600 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
607 | 601 | ResetModel(); |
---|
608 | | - oe.aConstraints.weighty = 0.5; |
---|
609 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
610 | | - oe.aConstraints.gridy += 1; |
---|
611 | | - oe.aConstraints.gridwidth = 1; |
---|
| 602 | + |
---|
| 603 | + oe.treePanel.add(jSPPanel); |
---|
| 604 | + oe.treePanel.Return(); |
---|
612 | 605 | |
---|
613 | | - oe.aConstraints.weighty = 0; |
---|
614 | | - oe.aConstraints.gridwidth = 2; |
---|
615 | | - |
---|
616 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 606 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 607 | + |
---|
| 608 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 609 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
617 | 610 | colorCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 611 | + |
---|
| 612 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 613 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
620 | 614 | materialCB.addItemListener(this); |
---|
621 | | - oe.aConstraints.gridx += 2; |
---|
622 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 615 | + |
---|
| 616 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 617 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
623 | 618 | textureCB.addItemListener(this); |
---|
624 | 619 | |
---|
625 | | - oe.aConstraints.gridx = 0; |
---|
626 | | - oe.aConstraints.gridy += 1; |
---|
| 620 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 621 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 622 | + oe.treePanel.Return(); |
---|
627 | 623 | |
---|
| 624 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 625 | +// mainPanel.setResizeWeight(0.5); |
---|
| 626 | + |
---|
628 | 627 | //jList.addListSelectionListener(this); |
---|
629 | 628 | oe.jTree.addTreeSelectionListener(this); |
---|
630 | 629 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
646 | 645 | radio.layout = sevenButton; |
---|
647 | 646 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
648 | 647 | } |
---|
| 648 | + |
---|
| 649 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 650 | + { |
---|
| 651 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 652 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 653 | + boxCB.addItemListener(this); |
---|
| 654 | + |
---|
| 655 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 656 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 657 | + zoomBoxCB.addItemListener(this); |
---|
| 658 | + |
---|
| 659 | + if (true) // Globals.ADVANCED) |
---|
| 660 | + { |
---|
| 661 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 662 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 663 | + supportCB.addItemListener(this); |
---|
| 664 | + |
---|
| 665 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 666 | + // localCB.addItemListener(this); |
---|
| 667 | + |
---|
| 668 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 669 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 670 | + crowdCB.addItemListener(this); |
---|
| 671 | + |
---|
| 672 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 673 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 674 | + smoothCB.addItemListener(this); |
---|
| 675 | + |
---|
| 676 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 677 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 678 | + slowCB.addItemListener(this); |
---|
| 679 | + |
---|
| 680 | +// constraints.gridy += 1; |
---|
| 681 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 682 | +// speakerMocapCB.addItemListener(this); |
---|
| 683 | + |
---|
| 684 | + if (false) |
---|
| 685 | + { |
---|
| 686 | + // handled in scripts |
---|
| 687 | + //constraints.gridy += 1; |
---|
| 688 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 689 | + speakerCameraCB.addItemListener(this); |
---|
| 690 | + |
---|
| 691 | + //constraints.gridy += 1; |
---|
| 692 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 693 | + speakerFocusCB.addItemListener(this); |
---|
| 694 | + |
---|
| 695 | + //constraints.gridy += 1; |
---|
| 696 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 697 | + smoothfocusCB.addItemListener(this); |
---|
| 698 | + } |
---|
| 699 | + |
---|
| 700 | +//constraints.gridx += 1; |
---|
| 701 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 702 | +// debugCB.addItemListener(this); |
---|
| 703 | + |
---|
| 704 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 705 | + oeilCB.addItemListener(this); |
---|
| 706 | + |
---|
| 707 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 708 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 709 | + lookAtCB.addItemListener(this); |
---|
| 710 | + |
---|
| 711 | + } |
---|
| 712 | + |
---|
| 713 | + cGridBag fill = new cGridBag(); |
---|
| 714 | + |
---|
| 715 | + fill.preferredHeight = 200; |
---|
| 716 | + |
---|
| 717 | + panel.add(fill); |
---|
| 718 | + |
---|
| 719 | + } |
---|
649 | 720 | |
---|
650 | 721 | void EditObject(Object3D obj) |
---|
651 | 722 | { |
---|
.. | .. |
---|
676 | 747 | JCheckBox fastCB; |
---|
677 | 748 | JCheckBox slowCB; |
---|
678 | 749 | JCheckBox boxCB; |
---|
| 750 | + JCheckBox zoomBoxCB; |
---|
679 | 751 | JCheckBox trackCB; |
---|
680 | 752 | JCheckBox smoothfocusCB; |
---|
681 | 753 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
755 | 827 | Recompile(); |
---|
756 | 828 | cameraView.repaint(); |
---|
757 | 829 | // refreshContents(); |
---|
| 830 | + } |
---|
| 831 | + else if(e.getSource() == zoomBoxCB) |
---|
| 832 | + { |
---|
| 833 | + cameraView.ToggleZoomBoxMode(); |
---|
758 | 834 | } |
---|
759 | 835 | else if(e.getSource() == smoothfocusCB) |
---|
760 | 836 | { |
---|
.. | .. |
---|
869 | 945 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
870 | 946 | // return; |
---|
871 | 947 | // } |
---|
872 | | - if (string.charAt(0) == '/') |
---|
| 948 | + |
---|
| 949 | + // File path for Mac and Windows |
---|
| 950 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
873 | 951 | { |
---|
874 | 952 | // file(s) |
---|
875 | 953 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
896 | 974 | |
---|
897 | 975 | flashIt = false; |
---|
898 | 976 | CameraPane pane = (CameraPane) target; |
---|
899 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 977 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
900 | 978 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
901 | 979 | |
---|
902 | 980 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
923 | 1001 | { |
---|
924 | 1002 | loadClipboard(true); |
---|
925 | 1003 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
926 | | - pasteInto(false); |
---|
| 1004 | + pasteInto(false, false); |
---|
927 | 1005 | } else { |
---|
928 | 1006 | loadClipboard(false); |
---|
929 | 1007 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
930 | | - pasteInto(false); // true); // ??? |
---|
| 1008 | + pasteInto(false, false); // true); // ??? |
---|
931 | 1009 | } |
---|
932 | 1010 | } |
---|
933 | 1011 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1049 | 1127 | kleinItem.addActionListener(this); |
---|
1050 | 1128 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1051 | 1129 | particleItem.addActionListener(this); |
---|
| 1130 | + if (Globals.ADVANCED) |
---|
| 1131 | + { |
---|
1052 | 1132 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1053 | 1133 | ragdollItem.addActionListener(this); |
---|
1054 | 1134 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1055 | 1135 | ragdoll2Item.addActionListener(this); |
---|
| 1136 | + } |
---|
1056 | 1137 | menu.add("-"); |
---|
1057 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1138 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1058 | 1139 | meshItem.addActionListener(this); |
---|
1059 | 1140 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1060 | 1141 | // meshGroupItem.addActionListener(this); |
---|
| 1142 | + if (Globals.ADVANCED) |
---|
| 1143 | + { |
---|
1061 | 1144 | springItem = menu.add(new MenuItem("Spring")); |
---|
1062 | 1145 | springItem.addActionListener(this); |
---|
1063 | 1146 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1064 | 1147 | flagItem.addActionListener(this); |
---|
1065 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1066 | | - bezierItem.addActionListener(this); |
---|
1067 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1068 | | - checkerItem.addActionListener(this); |
---|
1069 | 1148 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1070 | 1149 | blobItem.addActionListener(this); |
---|
1071 | 1150 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1072 | 1151 | latheItem.addActionListener(this); |
---|
| 1152 | + } |
---|
| 1153 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1154 | + bezierItem.addActionListener(this); |
---|
| 1155 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1156 | + overlayItem.addActionListener(this); |
---|
1073 | 1157 | lightItem = menu.add(new MenuItem("Light")); |
---|
1074 | 1158 | lightItem.addActionListener(this); |
---|
1075 | 1159 | menu.add("-"); |
---|
.. | .. |
---|
1079 | 1163 | loopItem.addActionListener(this); |
---|
1080 | 1164 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1081 | 1165 | doubleItem.addActionListener(this); |
---|
| 1166 | + if (Globals.ADVANCED) |
---|
| 1167 | + { |
---|
1082 | 1168 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1083 | 1169 | tripleItem.addActionListener(this); |
---|
| 1170 | + } |
---|
1084 | 1171 | } |
---|
1085 | 1172 | |
---|
1086 | 1173 | void buildToolsMenu(Menu menu) |
---|
1087 | 1174 | { |
---|
1088 | 1175 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1089 | 1176 | animationItem.addItemListener(this); |
---|
1090 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1177 | + animationItem.setState(Globals.ANIMATION); |
---|
1091 | 1178 | |
---|
1092 | 1179 | menu.add("-"); |
---|
1093 | 1180 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1094 | 1181 | parseverticesItem.addActionListener(this); |
---|
1095 | 1182 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1096 | 1183 | textureFieldItem.addActionListener(this); |
---|
1097 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1184 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1098 | 1185 | alignItem.addActionListener(this); |
---|
1099 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1100 | | - mirrorItem.addActionListener(this); |
---|
1101 | 1186 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1102 | 1187 | reduceMorphItem.addActionListener(this); |
---|
1103 | 1188 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1104 | 1189 | reduce34MorphItem.addActionListener(this); |
---|
1105 | | - |
---|
| 1190 | + menu.add("-"); |
---|
1106 | 1191 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1107 | 1192 | computeAOItem.addActionListener(this); |
---|
1108 | | - menu.add("-"); |
---|
1109 | 1193 | |
---|
| 1194 | + if (Globals.ADVANCED) |
---|
| 1195 | + { |
---|
| 1196 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1197 | + mirrorItem.addActionListener(this); |
---|
| 1198 | + menu.add("-"); |
---|
1110 | 1199 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1111 | 1200 | memoryItem.addActionListener(this); |
---|
1112 | 1201 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1129 | 1218 | menu.add("-"); |
---|
1130 | 1219 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1131 | 1220 | editScriptItem.addActionListener(this); |
---|
| 1221 | + } |
---|
1132 | 1222 | } |
---|
1133 | 1223 | |
---|
1134 | 1224 | void ScreenFit() |
---|
.. | .. |
---|
1457 | 1547 | |
---|
1458 | 1548 | void Overwrite(int mask) |
---|
1459 | 1549 | { |
---|
1460 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1550 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1461 | 1551 | { |
---|
1462 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1552 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1463 | 1553 | |
---|
1464 | 1554 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1465 | 1555 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1482 | 1572 | // |
---|
1483 | 1573 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1484 | 1574 | { |
---|
| 1575 | + Object source = event.getSource(); |
---|
1485 | 1576 | /* |
---|
1486 | 1577 | if (event.getSource() == nameField) |
---|
1487 | 1578 | { |
---|
.. | .. |
---|
1493 | 1584 | } |
---|
1494 | 1585 | else |
---|
1495 | 1586 | */ |
---|
1496 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1587 | + if (source == lookAtItem || source == lookFromItem) |
---|
1497 | 1588 | { |
---|
1498 | 1589 | ScreenFit(); |
---|
1499 | 1590 | } else |
---|
1500 | | - if (event.getSource() == switchItem) |
---|
| 1591 | + if (source == switchItem) |
---|
1501 | 1592 | { |
---|
1502 | 1593 | cVector v1 = new cVector(); |
---|
1503 | 1594 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1506 | 1597 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1507 | 1598 | objEditor.cameraView.repaint(); |
---|
1508 | 1599 | } else |
---|
1509 | | - if (event.getSource() == rectoidItem) |
---|
| 1600 | + if (source == rectoidItem) |
---|
1510 | 1601 | { |
---|
1511 | 1602 | makeSomething(new Box()); |
---|
1512 | 1603 | } else |
---|
1513 | | - if (event.getSource() == particleItem) |
---|
| 1604 | + if (source == particleItem) |
---|
1514 | 1605 | { |
---|
1515 | 1606 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1516 | 1607 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1531 | 1622 | applyExample(particleGeom, "SMOKE"); |
---|
1532 | 1623 | makeSomething(particleGeom); |
---|
1533 | 1624 | } else |
---|
1534 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1625 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1535 | 1626 | { |
---|
1536 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1627 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1537 | 1628 | |
---|
1538 | 1629 | ragdoll.toParent = LA.newMatrix(); |
---|
1539 | 1630 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1551 | 1642 | } else |
---|
1552 | 1643 | /* |
---|
1553 | 1644 | */ |
---|
1554 | | - if (event.getSource() == heightFieldItem) |
---|
| 1645 | + if (source == heightFieldItem) |
---|
1555 | 1646 | { |
---|
1556 | 1647 | Object3D obj = new Object3D(); |
---|
1557 | 1648 | |
---|
.. | .. |
---|
1589 | 1680 | |
---|
1590 | 1681 | makeSomething(obj); |
---|
1591 | 1682 | } else |
---|
1592 | | - if (event.getSource() == gridItem) |
---|
| 1683 | + if (source == gridItem) |
---|
1593 | 1684 | { |
---|
1594 | 1685 | makeSomething(new Grid()); |
---|
1595 | 1686 | } else |
---|
1596 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1687 | + if (source == ellipsoidItem) |
---|
1597 | 1688 | { |
---|
1598 | 1689 | makeSomething(new Sphere()); |
---|
1599 | 1690 | } else |
---|
1600 | | - if (event.getSource() == coneItem) |
---|
| 1691 | + if (source == coneItem) |
---|
1601 | 1692 | { |
---|
1602 | 1693 | makeSomething(new Cone()); |
---|
1603 | 1694 | } else |
---|
1604 | | - if (event.getSource() == torusItem) |
---|
| 1695 | + if (source == torusItem) |
---|
1605 | 1696 | { |
---|
1606 | 1697 | makeSomething(new Torus()); |
---|
1607 | 1698 | } else |
---|
1608 | | - if (event.getSource() == superItem) |
---|
| 1699 | + if (source == superItem) |
---|
1609 | 1700 | { |
---|
1610 | 1701 | makeSomething(new Superellipsoid()); |
---|
1611 | 1702 | } else |
---|
1612 | | - if (event.getSource() == kleinItem) |
---|
| 1703 | + if (source == kleinItem) |
---|
1613 | 1704 | { |
---|
1614 | 1705 | makeSomething(new Klein()); |
---|
1615 | 1706 | } else |
---|
1616 | | - if (event.getSource() == blobItem) |
---|
| 1707 | + if (source == blobItem) |
---|
1617 | 1708 | { |
---|
1618 | 1709 | Blob blob = new Blob(); |
---|
1619 | 1710 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1621 | 1712 | //blob.retile(); |
---|
1622 | 1713 | makeSomething(blob); |
---|
1623 | 1714 | } else |
---|
1624 | | - if (event.getSource() == latheItem) |
---|
| 1715 | + if (source == latheItem) |
---|
1625 | 1716 | { |
---|
1626 | 1717 | makeSomething(new Lathe()); |
---|
1627 | 1718 | } else |
---|
1628 | | - if (event.getSource() == bezierItem) |
---|
| 1719 | + if (source == bezierItem) |
---|
1629 | 1720 | { |
---|
1630 | 1721 | makeSomething(new BezierSurface()); |
---|
1631 | 1722 | } else |
---|
1632 | | - if (event.getSource() == checkerItem) |
---|
| 1723 | + if (source == overlayItem) |
---|
1633 | 1724 | { |
---|
1634 | 1725 | /* |
---|
1635 | 1726 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1644 | 1735 | */ |
---|
1645 | 1736 | makeSomething(new Checker()); |
---|
1646 | 1737 | } else |
---|
1647 | | - if (event.getSource() == meshItem) |
---|
| 1738 | + if (source == meshItem) |
---|
1648 | 1739 | { |
---|
1649 | 1740 | Object3D itemtomake = new Object3D(); |
---|
1650 | 1741 | Object3D child; |
---|
.. | .. |
---|
1665 | 1756 | makeSomething(child); |
---|
1666 | 1757 | } |
---|
1667 | 1758 | } else |
---|
1668 | | - if (event.getSource() == springItem) |
---|
| 1759 | + if (source == springItem) |
---|
1669 | 1760 | { |
---|
1670 | 1761 | cSpring s = new cSpring(); |
---|
1671 | 1762 | s.setup(); |
---|
1672 | 1763 | makeSomething(s); |
---|
1673 | 1764 | } else |
---|
1674 | | - if (event.getSource() == flagItem) |
---|
| 1765 | + if (source == flagItem) |
---|
1675 | 1766 | { |
---|
1676 | 1767 | cSpring s = new cFlag(); |
---|
1677 | 1768 | s.setup(); |
---|
1678 | 1769 | makeSomething(s); |
---|
1679 | 1770 | } else |
---|
1680 | | - if (event.getSource() == lightItem) |
---|
| 1771 | + if (source == lightItem) |
---|
1681 | 1772 | { |
---|
1682 | 1773 | makeSomething(new Light()); |
---|
1683 | 1774 | } else |
---|
1684 | | - if (event.getSource() == csgItem) |
---|
| 1775 | + if (source == csgItem) |
---|
1685 | 1776 | { |
---|
1686 | 1777 | group(new CSG()); |
---|
1687 | 1778 | } else |
---|
1688 | | - if (event.getSource() == templateItem) |
---|
| 1779 | + if (source == templateItem) |
---|
1689 | 1780 | { |
---|
1690 | 1781 | group(new cTemplate()); |
---|
1691 | 1782 | } else |
---|
1692 | | - if (event.getSource() == attributeItem) |
---|
| 1783 | + if (source == attributeItem) |
---|
1693 | 1784 | { |
---|
1694 | 1785 | makeSomething(new Attribute()); |
---|
1695 | 1786 | } else |
---|
1696 | | - if (event.getSource() == pointflowItem) |
---|
| 1787 | + if (source == pointflowItem) |
---|
1697 | 1788 | { |
---|
1698 | 1789 | makeSomething(new PointFlow()); |
---|
1699 | 1790 | } else |
---|
.. | .. |
---|
1705 | 1796 | } else |
---|
1706 | 1797 | */ |
---|
1707 | 1798 | |
---|
1708 | | - if (event.getSource() == superLoopItem) |
---|
| 1799 | + if (source == superLoopItem) |
---|
1709 | 1800 | { |
---|
1710 | 1801 | Composite g = new cGroup(); |
---|
1711 | 1802 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1727 | 1818 | |
---|
1728 | 1819 | group(g); |
---|
1729 | 1820 | } else |
---|
1730 | | - if (event.getSource() == loopItem) |
---|
| 1821 | + if (source == loopItem) |
---|
1731 | 1822 | { |
---|
1732 | 1823 | Composite csg = new GroupLeaf(); |
---|
1733 | 1824 | csg.count = 5; |
---|
.. | .. |
---|
1736 | 1827 | csg.addChild(child); |
---|
1737 | 1828 | child.addChild(csg); |
---|
1738 | 1829 | } else |
---|
1739 | | - if (event.getSource() == doubleItem) |
---|
| 1830 | + if (source == doubleItem) |
---|
1740 | 1831 | { |
---|
1741 | 1832 | Composite csg = new GroupLeaf(); |
---|
1742 | 1833 | csg.count = 5; |
---|
.. | .. |
---|
1748 | 1839 | csg.addChild(child); |
---|
1749 | 1840 | child.addChild(csg); |
---|
1750 | 1841 | } else |
---|
1751 | | - if (event.getSource() == tripleItem) |
---|
| 1842 | + if (source == tripleItem) |
---|
1752 | 1843 | { |
---|
1753 | 1844 | Composite csg = new GroupLeaf(); |
---|
1754 | 1845 | csg.count = 4; |
---|
.. | .. |
---|
1764 | 1855 | child.addChild(csg); |
---|
1765 | 1856 | } else |
---|
1766 | 1857 | |
---|
1767 | | - if (event.getSource() == importGFDItem) |
---|
| 1858 | + if (source == importGFDItem) |
---|
1768 | 1859 | { |
---|
1769 | 1860 | ImportGFD(); |
---|
1770 | 1861 | } else |
---|
1771 | | - if (event.getSource() == importVRMLX3DItem) |
---|
| 1862 | + if (source == importVRMLX3DItem) |
---|
1772 | 1863 | { |
---|
1773 | 1864 | ImportVRMLX3D(); |
---|
1774 | 1865 | } else |
---|
1775 | | - if (event.getSource() == import3DSItem) |
---|
| 1866 | + if (source == import3DSItem) |
---|
1776 | 1867 | { |
---|
1777 | 1868 | objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1778 | 1869 | } else |
---|
1779 | | - if (event.getSource() == importOBJItem) |
---|
| 1870 | + if (source == importOBJItem) |
---|
1780 | 1871 | { |
---|
1781 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1872 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1873 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 1874 | + browser.setVisible(true); |
---|
| 1875 | + String filename = browser.getFile(); |
---|
| 1876 | + if (filename != null && filename.length() > 0) |
---|
| 1877 | + { |
---|
| 1878 | + String fullname = browser.getDirectory() + filename; |
---|
| 1879 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 1880 | + } |
---|
1782 | 1881 | } else |
---|
1783 | | - if (event.getSource() == computeAOItem) |
---|
| 1882 | + if (source == computeAOItem) |
---|
1784 | 1883 | { |
---|
1785 | 1884 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1786 | 1885 | Globals.theRenderer.repaint(); |
---|
1787 | 1886 | } else |
---|
1788 | | - if (event.getSource() == recompileItem) |
---|
| 1887 | + if (source == recompileItem) |
---|
1789 | 1888 | { |
---|
1790 | 1889 | Recompile(); |
---|
1791 | 1890 | refreshContents(); |
---|
1792 | 1891 | } else |
---|
1793 | | - if (event.getSource() == editScriptItem) |
---|
| 1892 | + if (source == editScriptItem) |
---|
1794 | 1893 | { |
---|
1795 | 1894 | OpenDialog(); |
---|
1796 | 1895 | refreshContents(); |
---|
1797 | 1896 | } else |
---|
1798 | | - if (event.getSource() == invariantsItem) |
---|
| 1897 | + if (source == invariantsItem) |
---|
1799 | 1898 | { |
---|
1800 | 1899 | System.out.println("Invariants:"); |
---|
1801 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1900 | + Grafreed.grafreeD.universe.invariants(); |
---|
1802 | 1901 | } else |
---|
1803 | | - if (event.getSource() == memoryItem) |
---|
| 1902 | + if (source == memoryItem) |
---|
1804 | 1903 | { |
---|
1805 | 1904 | //System.out.println("Invariants:"); |
---|
1806 | 1905 | PrintMemory(); |
---|
1807 | 1906 | } else |
---|
1808 | | - if (event.getSource() == pathItem) |
---|
| 1907 | + if (source == pathItem) |
---|
1809 | 1908 | { |
---|
1810 | 1909 | PrintPath(); |
---|
1811 | 1910 | } else |
---|
1812 | | - if (event.getSource() == analyzeItem) |
---|
| 1911 | + if (source == analyzeItem) |
---|
1813 | 1912 | { |
---|
1814 | 1913 | AnalyzeObject(); |
---|
1815 | 1914 | } else |
---|
1816 | | - if (event.getSource() == dumpItem) |
---|
| 1915 | + if (source == dumpItem) |
---|
1817 | 1916 | { |
---|
1818 | 1917 | DumpObject(); |
---|
1819 | 1918 | } else |
---|
1820 | | - if (event.getSource() == screenfitButton) |
---|
| 1919 | + if (source == oneStepButton) |
---|
| 1920 | + { |
---|
| 1921 | + Globals.ONESTEP = true; |
---|
| 1922 | + cameraView.repaint(); |
---|
| 1923 | + } else |
---|
| 1924 | + if (source == screenfitButton) |
---|
1821 | 1925 | { |
---|
1822 | 1926 | //Reload(lastConverter, lastFilename, true); |
---|
1823 | 1927 | ScreenFit(); |
---|
1824 | 1928 | } else |
---|
1825 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1929 | + if (source == screenfitpointButton) |
---|
1826 | 1930 | { |
---|
1827 | 1931 | //Reload(lastConverter, lastFilename, true); |
---|
1828 | 1932 | ScreenFitPoint(); |
---|
1829 | 1933 | } else |
---|
1830 | | - if (event.getSource() == snapobjectButton) |
---|
| 1934 | + if (source == snapobjectButton) |
---|
1831 | 1935 | { |
---|
1832 | 1936 | //Reload(lastConverter, lastFilename, true); |
---|
1833 | 1937 | SnapObject(); |
---|
.. | .. |
---|
1838 | 1942 | // Recompile(); |
---|
1839 | 1943 | // refreshContents(); |
---|
1840 | 1944 | // } else |
---|
1841 | | - if (event.getSource() == gcButton) |
---|
| 1945 | + if (source == gcButton) |
---|
1842 | 1946 | { |
---|
1843 | 1947 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1844 | 1948 | System.gc(); |
---|
1845 | 1949 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1846 | 1950 | } else |
---|
1847 | | - if (event.getSource() == editLeafItem) |
---|
| 1951 | + if (source == editLeafItem) |
---|
1848 | 1952 | { |
---|
1849 | 1953 | Object3D obj; |
---|
1850 | 1954 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1858 | 1962 | } |
---|
1859 | 1963 | refreshContents(true); |
---|
1860 | 1964 | } else |
---|
1861 | | - if (event.getSource() == openWindowItem) |
---|
| 1965 | + if (source == openWindowItem) |
---|
1862 | 1966 | { |
---|
1863 | 1967 | EditSelection(true); |
---|
1864 | 1968 | } else |
---|
1865 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 1969 | + if (source == cutItem || source == clearButton) |
---|
1866 | 1970 | { |
---|
1867 | 1971 | loadClipboard(true); |
---|
1868 | 1972 | } else |
---|
1869 | | - if (event.getSource() == duplicateItem) |
---|
| 1973 | + if (source == duplicateItem) |
---|
1870 | 1974 | { |
---|
1871 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 1975 | + Object3D keep = Grafreed.clipboard; |
---|
1872 | 1976 | loadClipboard(false); |
---|
1873 | 1977 | paste(false); |
---|
1874 | | - GrafreeD.clipboard = keep; |
---|
| 1978 | + Grafreed.clipboard = keep; |
---|
1875 | 1979 | } else |
---|
1876 | | - if (event.getSource() == cloneItem) |
---|
| 1980 | + if (source == cloneItem) |
---|
1877 | 1981 | { |
---|
1878 | 1982 | CloneSelection(false); |
---|
1879 | 1983 | } else |
---|
1880 | | - if (event.getSource() == cloneSupportItem) |
---|
| 1984 | + if (source == cloneSupportItem) |
---|
1881 | 1985 | { |
---|
1882 | 1986 | CloneSelection(true); |
---|
1883 | 1987 | } else |
---|
1884 | | - if (event.getSource() == copyItem) |
---|
| 1988 | + if (source == copyItem) |
---|
1885 | 1989 | { |
---|
1886 | 1990 | loadClipboard(false); |
---|
1887 | 1991 | } else |
---|
1888 | | - if (event.getSource() == pasteItem) |
---|
| 1992 | + if (source == pasteItem) |
---|
1889 | 1993 | { |
---|
1890 | 1994 | paste(false); |
---|
1891 | 1995 | } else |
---|
1892 | | - if (event.getSource() == pasteLinkItem) |
---|
| 1996 | + if (source == pasteIntoItem) |
---|
1893 | 1997 | { |
---|
1894 | | - pasteInto(false); |
---|
| 1998 | + pasteInto(true, false); |
---|
1895 | 1999 | } else |
---|
1896 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2000 | + if (source == pasteLinkItem) |
---|
1897 | 2001 | { |
---|
1898 | | - pasteInto(true); |
---|
| 2002 | + pasteInto(false, false); |
---|
1899 | 2003 | } else |
---|
1900 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2004 | + if (source == pasteCloneItem) |
---|
| 2005 | + { |
---|
| 2006 | + pasteInto(true, true); |
---|
| 2007 | + } else |
---|
| 2008 | + if (source == pasteExpandItem) |
---|
1901 | 2009 | { |
---|
1902 | 2010 | paste(true); |
---|
1903 | 2011 | } else |
---|
1904 | | - if (event.getSource() == synchronizeItem) |
---|
| 2012 | + if (source == synchronizeItem) |
---|
1905 | 2013 | { |
---|
1906 | 2014 | Overwrite(Object3D.TRANSFORM); |
---|
1907 | 2015 | } else |
---|
1908 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2016 | + if (source == overwriteNameItem) |
---|
1909 | 2017 | { |
---|
1910 | 2018 | Overwrite(Object3D.NAME); |
---|
1911 | 2019 | } else |
---|
1912 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2020 | + if (source == overwriteUVItem) |
---|
1913 | 2021 | { |
---|
1914 | 2022 | Overwrite(Object3D.UV); |
---|
1915 | 2023 | } else |
---|
1916 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2024 | + if (source == overwriteMatItem) |
---|
1917 | 2025 | { |
---|
1918 | 2026 | /* july 2015 |
---|
1919 | 2027 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1933 | 2041 | |
---|
1934 | 2042 | Overwrite(dropAttributes); |
---|
1935 | 2043 | } |
---|
1936 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2044 | + if (source == overwriteGeoItem) |
---|
1937 | 2045 | { |
---|
1938 | 2046 | Overwrite(Object3D.GEOMETRY); |
---|
1939 | 2047 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1950 | 2058 | // refreshContents(); |
---|
1951 | 2059 | // } |
---|
1952 | 2060 | } else |
---|
1953 | | - if (event.getSource() == generateMeshItem) |
---|
| 2061 | + if (source == generateMeshItem) |
---|
1954 | 2062 | { |
---|
1955 | 2063 | //if (group.selection.size() == 1) |
---|
1956 | 2064 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1961 | 2069 | ResetModel(); |
---|
1962 | 2070 | refreshContents(); |
---|
1963 | 2071 | } else |
---|
1964 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2072 | + if (source == extractGeometriesItem) |
---|
1965 | 2073 | { |
---|
1966 | 2074 | boolean one = false; |
---|
1967 | 2075 | |
---|
.. | .. |
---|
1988 | 2096 | ResetModel(); |
---|
1989 | 2097 | refreshContents(); |
---|
1990 | 2098 | } else |
---|
1991 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2099 | + if (source == cloneGeometriesItem) |
---|
1992 | 2100 | { |
---|
1993 | 2101 | boolean one = false; |
---|
1994 | 2102 | |
---|
.. | .. |
---|
2014 | 2122 | ResetModel(); |
---|
2015 | 2123 | refreshContents(); |
---|
2016 | 2124 | } else |
---|
2017 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2125 | + if (source == shareGeometriesItem) |
---|
2018 | 2126 | { |
---|
2019 | 2127 | boolean one = false; |
---|
2020 | 2128 | |
---|
.. | .. |
---|
2044 | 2152 | refreshContents(); |
---|
2045 | 2153 | } |
---|
2046 | 2154 | } else |
---|
2047 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2155 | + if (source == mergeGeometriesItem) |
---|
2048 | 2156 | { |
---|
2049 | 2157 | boolean one = false; |
---|
2050 | 2158 | |
---|
.. | .. |
---|
2074 | 2182 | ResetModel(); |
---|
2075 | 2183 | refreshContents(); |
---|
2076 | 2184 | } else |
---|
2077 | | - if (event.getSource() == linkverticesItem) |
---|
| 2185 | + if (source == linkverticesItem) |
---|
2078 | 2186 | { |
---|
2079 | 2187 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2080 | 2188 | // { |
---|
.. | .. |
---|
2087 | 2195 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2088 | 2196 | // refreshContents(); |
---|
2089 | 2197 | // } |
---|
2090 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2198 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2091 | 2199 | { |
---|
2092 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2200 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2093 | 2201 | |
---|
2094 | 2202 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2095 | 2203 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2097 | 2205 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2098 | 2206 | for (int i=0; i<group.selection.size(); i++) |
---|
2099 | 2207 | { |
---|
2100 | | - boolean random = CameraPane.RANDOM; |
---|
2101 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2208 | + boolean random = CameraPane.SWITCH; |
---|
| 2209 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2102 | 2210 | group.selection.get(i).linkVerticesThis(content); |
---|
2103 | 2211 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2104 | | - CameraPane.RANDOM = random; |
---|
| 2212 | + CameraPane.SWITCH = random; |
---|
2105 | 2213 | } |
---|
2106 | 2214 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2107 | 2215 | refreshContents(); |
---|
2108 | 2216 | } |
---|
2109 | 2217 | } else |
---|
2110 | | - if (event.getSource() == resetsupportItem) |
---|
| 2218 | + if (source == resetsupportItem) |
---|
2111 | 2219 | { |
---|
2112 | 2220 | for (int i=0; i<group.selection.size(); i++) |
---|
2113 | 2221 | { |
---|
2114 | | - boolean random = CameraPane.RANDOM; |
---|
2115 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2222 | + boolean random = CameraPane.SWITCH; |
---|
| 2223 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2116 | 2224 | group.selection.get(i).linkVerticesThis(null); |
---|
2117 | | - CameraPane.RANDOM = random; |
---|
| 2225 | + CameraPane.SWITCH = random; |
---|
2118 | 2226 | } |
---|
2119 | 2227 | |
---|
2120 | 2228 | refreshContents(); |
---|
2121 | 2229 | } else |
---|
2122 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2230 | + if (source == relinkverticesItem) |
---|
2123 | 2231 | { |
---|
2124 | | - boolean random = CameraPane.RANDOM; |
---|
2125 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2232 | + boolean random = CameraPane.SWITCH; |
---|
| 2233 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2126 | 2234 | group.selection.RelinkToSupport(); |
---|
2127 | | - CameraPane.RANDOM = random; |
---|
| 2235 | + CameraPane.SWITCH = random; |
---|
2128 | 2236 | |
---|
2129 | 2237 | refreshContents(); |
---|
2130 | 2238 | } else |
---|
2131 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2239 | + if (source == resetreferencesItem) |
---|
2132 | 2240 | { |
---|
2133 | 2241 | for (int i=0; i<group.selection.size(); i++) |
---|
2134 | 2242 | { |
---|
.. | .. |
---|
2137 | 2245 | |
---|
2138 | 2246 | refreshContents(); |
---|
2139 | 2247 | } else |
---|
2140 | | - if (event.getSource() == setMasterItem) |
---|
| 2248 | + if (source == setMasterItem) |
---|
2141 | 2249 | { |
---|
2142 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2250 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2143 | 2251 | { |
---|
2144 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2252 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2145 | 2253 | |
---|
2146 | 2254 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2147 | 2255 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2150 | 2258 | refreshContents(); |
---|
2151 | 2259 | } |
---|
2152 | 2260 | } else |
---|
2153 | | - if (event.getSource() == poseMeshItem) |
---|
| 2261 | + if (source == poseMeshItem) |
---|
2154 | 2262 | { |
---|
2155 | 2263 | if (group.selection.size() == 1) |
---|
2156 | 2264 | { |
---|
2157 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2265 | + if (Grafreed.clipboard.size() == 1) |
---|
2158 | 2266 | { |
---|
2159 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2267 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2160 | 2268 | |
---|
2161 | 2269 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2162 | 2270 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2169 | 2277 | } |
---|
2170 | 2278 | |
---|
2171 | 2279 | } else |
---|
2172 | | - if (event.getSource() == revertMeshItem) |
---|
| 2280 | + if (source == revertMeshItem) |
---|
2173 | 2281 | { |
---|
2174 | 2282 | RevertMeshes(); |
---|
2175 | 2283 | } else |
---|
2176 | | - if (event.getSource() == resetMeshItem) |
---|
| 2284 | + if (source == resetAllItem) |
---|
2177 | 2285 | { |
---|
2178 | 2286 | ResetAll(); |
---|
2179 | 2287 | } else |
---|
2180 | | - if (event.getSource() == stepAllItem) |
---|
| 2288 | + if (source == stepAllItem) |
---|
2181 | 2289 | { |
---|
2182 | 2290 | StepAll(); |
---|
2183 | 2291 | } else |
---|
2184 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2292 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2185 | 2293 | { |
---|
2186 | 2294 | //int indices[] = jList.getSelectedIndices(); |
---|
2187 | 2295 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2189 | 2297 | |
---|
2190 | 2298 | ClearSelection(false); |
---|
2191 | 2299 | } else |
---|
2192 | | - if (event.getSource() == clearAllItem) |
---|
| 2300 | + if (source == clearAllItem) |
---|
2193 | 2301 | { |
---|
2194 | 2302 | ClearSelection(true); |
---|
2195 | 2303 | } else |
---|
2196 | | - if (event.getSource() == grabItem) |
---|
| 2304 | + if (source == grabItem) |
---|
2197 | 2305 | { |
---|
2198 | 2306 | group(new cGroup(), true); |
---|
2199 | 2307 | } else |
---|
2200 | | - if (event.getSource() == hideItem) |
---|
| 2308 | + if (source == hideItem) |
---|
2201 | 2309 | { |
---|
2202 | 2310 | group(new HiddenObject()); |
---|
2203 | 2311 | } else |
---|
2204 | | - if (event.getSource() == frontItem) |
---|
| 2312 | + if (source == frontItem) |
---|
2205 | 2313 | { |
---|
2206 | 2314 | front(); |
---|
2207 | 2315 | } else |
---|
2208 | | - if (event.getSource() == backItem) |
---|
| 2316 | + if (source == backItem) |
---|
2209 | 2317 | { |
---|
2210 | 2318 | back(); |
---|
2211 | 2319 | } else |
---|
2212 | | - if (event.getSource() == cameraItem) |
---|
| 2320 | + if (source == cameraItem) |
---|
2213 | 2321 | { |
---|
2214 | 2322 | makeSomething(new Camera()); |
---|
2215 | 2323 | } else |
---|
2216 | | - if (event.getSource() == compositeItem) |
---|
| 2324 | + if (source == compositeItem) |
---|
2217 | 2325 | { |
---|
2218 | 2326 | group(new Composite()); |
---|
2219 | 2327 | } else |
---|
2220 | | - if (event.getSource() == randomItem) |
---|
| 2328 | + if (source == randomItem) |
---|
2221 | 2329 | { |
---|
2222 | 2330 | RandomNode random = new RandomNode(); |
---|
2223 | 2331 | group(random); |
---|
2224 | 2332 | if (random.size() > 0) |
---|
2225 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2333 | + random.name = random.get(0).name + "Switch"; |
---|
2226 | 2334 | } else |
---|
2227 | | - if (event.getSource() == physicsItem) |
---|
| 2335 | + if (source == physicsItem) |
---|
2228 | 2336 | { |
---|
2229 | 2337 | group(new PhysicsNode()); |
---|
2230 | 2338 | } else |
---|
2231 | | - if (event.getSource() == frameselectorItem) |
---|
| 2339 | + if (source == frameselectorItem) |
---|
2232 | 2340 | { |
---|
2233 | 2341 | for (int i=0; i<group.selection.size(); i++) |
---|
2234 | 2342 | { |
---|
.. | .. |
---|
2240 | 2348 | ResetModel(); |
---|
2241 | 2349 | refreshContents(); |
---|
2242 | 2350 | } else |
---|
2243 | | - if (event.getSource() == switchGeoItem) |
---|
| 2351 | + if (source == switchGeoItem) |
---|
2244 | 2352 | { |
---|
2245 | 2353 | for (int i=0; i<group.selection.size(); i++) |
---|
2246 | 2354 | { |
---|
.. | .. |
---|
2252 | 2360 | ResetModel(); |
---|
2253 | 2361 | refreshContents(); |
---|
2254 | 2362 | } else |
---|
2255 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2363 | + if (source == switchTransfoItem) |
---|
2256 | 2364 | { |
---|
2257 | 2365 | for (int i=0; i<group.selection.size(); i++) |
---|
2258 | 2366 | { |
---|
.. | .. |
---|
2264 | 2372 | ResetModel(); |
---|
2265 | 2373 | refreshContents(); |
---|
2266 | 2374 | } else |
---|
2267 | | - if (event.getSource() == morphItem) |
---|
| 2375 | + if (source == morphItem) |
---|
2268 | 2376 | { |
---|
2269 | 2377 | for (int i=0; i<group.selection.size(); i++) |
---|
2270 | 2378 | { |
---|
.. | .. |
---|
2276 | 2384 | ResetModel(); |
---|
2277 | 2385 | refreshContents(); |
---|
2278 | 2386 | } else |
---|
2279 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2387 | + if (source == scriptNodeItem) |
---|
2280 | 2388 | { |
---|
2281 | 2389 | boolean atleastone = false; |
---|
2282 | 2390 | |
---|
.. | .. |
---|
2315 | 2423 | } |
---|
2316 | 2424 | } |
---|
2317 | 2425 | } else |
---|
2318 | | - if (event.getSource() == linkerItem) |
---|
| 2426 | + if (source == linkerItem) |
---|
2319 | 2427 | { |
---|
2320 | 2428 | group(new cLinker()); |
---|
2321 | 2429 | } else |
---|
2322 | | - if (event.getSource() == textureItem) |
---|
| 2430 | + if (source == textureItem) |
---|
2323 | 2431 | { |
---|
2324 | 2432 | group(new TextureNode()); |
---|
2325 | 2433 | } else |
---|
2326 | | - if (event.getSource() == billboardItem) |
---|
| 2434 | + if (source == billboardItem) |
---|
2327 | 2435 | { |
---|
2328 | 2436 | group(new BillboardNode()); |
---|
2329 | 2437 | } else |
---|
2330 | | - if (event.getSource() == shadowXItem) |
---|
| 2438 | + if (source == shadowXItem) |
---|
2331 | 2439 | { |
---|
2332 | 2440 | CastShadow(0); |
---|
2333 | 2441 | } else |
---|
2334 | | - if (event.getSource() == shadowYItem) |
---|
| 2442 | + if (source == shadowYItem) |
---|
2335 | 2443 | { |
---|
2336 | 2444 | CastShadow(1); |
---|
2337 | 2445 | } else |
---|
2338 | | - if (event.getSource() == shadowZItem) |
---|
| 2446 | + if (source == shadowZItem) |
---|
2339 | 2447 | { |
---|
2340 | 2448 | CastShadow(2); |
---|
2341 | 2449 | } else |
---|
2342 | | - if (event.getSource() == ungroupItem) |
---|
| 2450 | + if (source == ungroupItem) |
---|
2343 | 2451 | { |
---|
2344 | 2452 | //ungroup(); |
---|
2345 | 2453 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2351 | 2459 | |
---|
2352 | 2460 | refreshContents(); |
---|
2353 | 2461 | } else |
---|
2354 | | - if (event.getSource() == genUVItem) |
---|
| 2462 | + if (source == genUVItem) |
---|
2355 | 2463 | { |
---|
2356 | 2464 | GenUV(); |
---|
2357 | 2465 | } else |
---|
2358 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2466 | + if (source == genNormalsCADItem) |
---|
2359 | 2467 | { |
---|
2360 | 2468 | GenNormals(true); |
---|
2361 | 2469 | } else |
---|
2362 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2470 | + if (source == genNormalsMESHItem) |
---|
2363 | 2471 | { |
---|
2364 | 2472 | GenNormals(true); // TODO |
---|
2365 | 2473 | } else |
---|
2366 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2474 | + if (source == genNormalsORGANItem) |
---|
2367 | 2475 | { |
---|
2368 | 2476 | GenNormals(false); |
---|
2369 | 2477 | } else |
---|
2370 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2478 | + if (source == genNormalsMINEItem) |
---|
2371 | 2479 | { |
---|
2372 | 2480 | GenNormalsMINE(); |
---|
2373 | 2481 | } else |
---|
2374 | | - if (event.getSource() == stripifyItem) |
---|
| 2482 | + if (source == stripifyItem) |
---|
2375 | 2483 | { |
---|
2376 | 2484 | Stripify(); |
---|
2377 | 2485 | } else |
---|
2378 | | - if (event.getSource() == unstripifyItem) |
---|
| 2486 | + if (source == unstripifyItem) |
---|
2379 | 2487 | { |
---|
2380 | 2488 | Unstripify(); |
---|
2381 | 2489 | } else |
---|
2382 | | - if (event.getSource() == trimItem) |
---|
| 2490 | + if (source == trimItem) |
---|
2383 | 2491 | { |
---|
2384 | 2492 | Trim(); |
---|
2385 | 2493 | } else |
---|
2386 | | - if (event.getSource() == untrimItem) |
---|
| 2494 | + if (source == untrimItem) |
---|
2387 | 2495 | { |
---|
2388 | 2496 | Untrim(); |
---|
2389 | 2497 | } else |
---|
2390 | | - if (event.getSource() == clearColorsItem) |
---|
| 2498 | + if (source == clearColorsItem) |
---|
2391 | 2499 | { |
---|
2392 | 2500 | ClearColors(); |
---|
2393 | 2501 | } else |
---|
2394 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2502 | + if (source == clearMaterialsItem) |
---|
2395 | 2503 | { |
---|
2396 | 2504 | ClearMaterials(); |
---|
2397 | 2505 | } else |
---|
2398 | | - if (event.getSource() == liveleavesItem) |
---|
| 2506 | + if (source == liveleavesItem) |
---|
2399 | 2507 | { |
---|
2400 | 2508 | LiveLeaves(true); |
---|
2401 | 2509 | } else |
---|
2402 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2510 | + if (source == unliveleavesItem) |
---|
2403 | 2511 | { |
---|
2404 | 2512 | LiveLeaves(false); |
---|
2405 | 2513 | } else |
---|
2406 | | - if (event.getSource() == supportleavesItem) |
---|
| 2514 | + if (source == supportleavesItem) |
---|
2407 | 2515 | { |
---|
2408 | 2516 | SupportLeaves(true); |
---|
2409 | 2517 | } else |
---|
2410 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2518 | + if (source == unsupportleavesItem) |
---|
2411 | 2519 | { |
---|
2412 | 2520 | SupportLeaves(false); |
---|
2413 | 2521 | } else |
---|
2414 | | - if (event.getSource() == hideleavesItem) |
---|
| 2522 | + if (source == hideleavesItem) |
---|
2415 | 2523 | { |
---|
2416 | 2524 | HideLeaves(true); |
---|
2417 | 2525 | } else |
---|
2418 | | - if (event.getSource() == showleavesItem) |
---|
| 2526 | + if (source == showleavesItem) |
---|
2419 | 2527 | { |
---|
2420 | 2528 | HideLeaves(false); |
---|
2421 | 2529 | } else |
---|
2422 | | - if (event.getSource() == markleavesItem) |
---|
| 2530 | + if (source == markleavesItem) |
---|
2423 | 2531 | { |
---|
2424 | 2532 | MarkLeaves(true); |
---|
2425 | 2533 | } else |
---|
2426 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2534 | + if (source == unmarkleavesItem) |
---|
2427 | 2535 | { |
---|
2428 | 2536 | MarkLeaves(false); |
---|
2429 | 2537 | } else |
---|
2430 | | - if (event.getSource() == flipVItem) |
---|
| 2538 | + if (source == flipVItem) |
---|
2431 | 2539 | { |
---|
2432 | 2540 | FlipV(true); |
---|
2433 | 2541 | } else |
---|
2434 | | - if (event.getSource() == unflipVItem) |
---|
| 2542 | + if (source == unflipVItem) |
---|
2435 | 2543 | { |
---|
2436 | 2544 | FlipV(false); |
---|
2437 | 2545 | } else |
---|
2438 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2546 | + if (source == lowTexturesItem) |
---|
2439 | 2547 | { |
---|
2440 | 2548 | SetTexRes(0); |
---|
2441 | 2549 | } else |
---|
2442 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2550 | + if (source == normalTexturesItem) |
---|
2443 | 2551 | { |
---|
2444 | 2552 | SetTexRes(1); |
---|
2445 | 2553 | } else |
---|
2446 | | - if (event.getSource() == highTexturesItem) |
---|
| 2554 | + if (source == highTexturesItem) |
---|
2447 | 2555 | { |
---|
2448 | 2556 | SetTexRes(2); |
---|
2449 | 2557 | } else |
---|
2450 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2558 | + if (source == veryhighTexturesItem) |
---|
2451 | 2559 | { |
---|
2452 | 2560 | SetTexRes(3); |
---|
2453 | 2561 | } else |
---|
2454 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2562 | + if (source == maxTexturesItem) |
---|
2455 | 2563 | { |
---|
2456 | 2564 | SetTexRes(4); |
---|
2457 | 2565 | } else |
---|
2458 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2566 | + if (source == panoTexturesItem) |
---|
2459 | 2567 | { |
---|
2460 | 2568 | SetTexRes(5); |
---|
2461 | 2569 | } else |
---|
2462 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2570 | + if (source == reverseNormalsItem) |
---|
2463 | 2571 | { |
---|
2464 | 2572 | ReverseNormals(); |
---|
2465 | 2573 | } else |
---|
2466 | | - if (event.getSource() == parseverticesItem) |
---|
| 2574 | + if (source == parseverticesItem) |
---|
2467 | 2575 | { |
---|
2468 | 2576 | ParseVertices(); |
---|
2469 | 2577 | } else |
---|
2470 | | - if (event.getSource() == textureFieldItem) |
---|
| 2578 | + if (source == textureFieldItem) |
---|
2471 | 2579 | { |
---|
2472 | 2580 | TextureVertices(); |
---|
2473 | 2581 | } else |
---|
2474 | | - if (event.getSource() == alignItem) |
---|
| 2582 | + if (source == alignItem) |
---|
2475 | 2583 | { |
---|
2476 | 2584 | Align(); |
---|
2477 | 2585 | } else |
---|
2478 | | - if (event.getSource() == mirrorItem) |
---|
| 2586 | + if (source == mirrorItem) |
---|
2479 | 2587 | { |
---|
2480 | 2588 | MirrorPoses(); |
---|
2481 | 2589 | } else |
---|
2482 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2590 | + if (source == reduceMorphItem) |
---|
2483 | 2591 | { |
---|
2484 | 2592 | MeshReduction(false); |
---|
2485 | 2593 | } else |
---|
2486 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2594 | + if (source == reduce34MorphItem) |
---|
2487 | 2595 | { |
---|
2488 | 2596 | MeshReduction(true); |
---|
2489 | 2597 | } else |
---|
2490 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2598 | + if (source == reverseTrianglesItem) |
---|
2491 | 2599 | { |
---|
2492 | 2600 | ReverseTriangles(); |
---|
2493 | 2601 | } else |
---|
2494 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2602 | + if (source == reduceMeshItem) |
---|
2495 | 2603 | { |
---|
2496 | 2604 | ReduceMesh(false); |
---|
2497 | 2605 | } else |
---|
2498 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2606 | + if (source == reduce34MeshItem) |
---|
2499 | 2607 | { |
---|
2500 | 2608 | ReduceMesh(true); |
---|
2501 | 2609 | } else |
---|
2502 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2610 | + if (source == increaseMeshItem) |
---|
2503 | 2611 | { |
---|
2504 | 2612 | IncreaseMesh(); |
---|
2505 | 2613 | } else |
---|
2506 | | - if (event.getSource() == clipMeshItem) |
---|
| 2614 | + if (source == clipMeshItem) |
---|
2507 | 2615 | { |
---|
2508 | 2616 | ClipMesh(); |
---|
2509 | 2617 | } else |
---|
2510 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2618 | + if (source == smoothMeshItem) |
---|
2511 | 2619 | { |
---|
2512 | 2620 | SmoothMesh(); |
---|
2513 | 2621 | } else |
---|
2514 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2622 | + if (source == transformGeometryItem) |
---|
2515 | 2623 | { |
---|
2516 | 2624 | TransformGeometry(); |
---|
2517 | 2625 | } else |
---|
2518 | | - if (event.getSource() == resetTransformItem) |
---|
| 2626 | + if (source == transformChildrenItem) |
---|
| 2627 | + { |
---|
| 2628 | + TransformChildren(); |
---|
| 2629 | + } else |
---|
| 2630 | + if (source == resetTransformItem) |
---|
2519 | 2631 | { |
---|
2520 | 2632 | ResetTransform(); |
---|
2521 | 2633 | } else |
---|
2522 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2634 | + if (source == resetCentroidItem) |
---|
2523 | 2635 | { |
---|
2524 | | - ResetCentroid(); |
---|
| 2636 | + ResetCentroid(true); |
---|
2525 | 2637 | } else |
---|
2526 | | - if (event.getSource() == resetParentItem) |
---|
| 2638 | + if (source == resetCentroidXZItem) |
---|
| 2639 | + { |
---|
| 2640 | + ResetCentroid(false); |
---|
| 2641 | + } else |
---|
| 2642 | + if (source == resetParentItem) |
---|
2527 | 2643 | { |
---|
2528 | 2644 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2529 | 2645 | { |
---|
.. | .. |
---|
2533 | 2649 | |
---|
2534 | 2650 | refreshContents(); |
---|
2535 | 2651 | } else |
---|
2536 | | - if (event.getSource() == repairParentItem) |
---|
| 2652 | + if (source == repairParentItem) |
---|
2537 | 2653 | { |
---|
2538 | 2654 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2539 | 2655 | { |
---|
.. | .. |
---|
2547 | 2663 | |
---|
2548 | 2664 | refreshContents(); |
---|
2549 | 2665 | } else |
---|
2550 | | - if (event.getSource() == repairShadowItem) |
---|
| 2666 | + if (source == repairShadowItem) |
---|
2551 | 2667 | { |
---|
2552 | 2668 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2553 | 2669 | { |
---|
.. | .. |
---|
2561 | 2677 | |
---|
2562 | 2678 | refreshContents(); |
---|
2563 | 2679 | } else |
---|
2564 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2680 | + if (source == sortbysizeItem) |
---|
2565 | 2681 | { |
---|
2566 | 2682 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2567 | 2683 | { |
---|
.. | .. |
---|
2573 | 2689 | ResetModel(); |
---|
2574 | 2690 | refreshContents(); |
---|
2575 | 2691 | } else |
---|
2576 | | - if (event.getSource() == sortbynameItem) |
---|
| 2692 | + if (source == sortbynameItem) |
---|
2577 | 2693 | { |
---|
2578 | 2694 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2579 | 2695 | { |
---|
.. | .. |
---|
2585 | 2701 | ResetModel(); |
---|
2586 | 2702 | refreshContents(); |
---|
2587 | 2703 | } else |
---|
2588 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2704 | + if (source == attachPigmentItem) |
---|
2589 | 2705 | { |
---|
2590 | 2706 | String texture = GetFile("Attach pigment"); |
---|
2591 | 2707 | Object3D obj; |
---|
.. | .. |
---|
2597 | 2713 | |
---|
2598 | 2714 | refreshContents(); |
---|
2599 | 2715 | } else |
---|
2600 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2716 | + if (source == detachPigmentItem) |
---|
2601 | 2717 | { |
---|
2602 | 2718 | Object3D obj; |
---|
2603 | 2719 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2608 | 2724 | |
---|
2609 | 2725 | refreshContents(); |
---|
2610 | 2726 | } else |
---|
2611 | | - if (event.getSource() == attachBumpItem) |
---|
| 2727 | + if (source == attachBumpItem) |
---|
2612 | 2728 | { |
---|
2613 | 2729 | String texture = GetFile("Attach bump"); |
---|
2614 | 2730 | Object3D obj; |
---|
.. | .. |
---|
2620 | 2736 | |
---|
2621 | 2737 | refreshContents(); |
---|
2622 | 2738 | } else |
---|
2623 | | - if (event.getSource() == detachBumpItem) |
---|
| 2739 | + if (source == detachBumpItem) |
---|
2624 | 2740 | { |
---|
2625 | 2741 | Object3D obj; |
---|
2626 | 2742 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2631 | 2747 | |
---|
2632 | 2748 | refreshContents(); |
---|
2633 | 2749 | } else |
---|
2634 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2750 | + if (source == pigmentBumpItem) |
---|
2635 | 2751 | { |
---|
2636 | 2752 | Object3D obj; |
---|
2637 | 2753 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2642 | 2758 | |
---|
2643 | 2759 | refreshContents(); |
---|
2644 | 2760 | } else |
---|
2645 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2761 | + if (source == flashSelectionButton) |
---|
2646 | 2762 | { |
---|
2647 | 2763 | CameraPane.flash = true; |
---|
2648 | 2764 | refreshContents(); |
---|
2649 | 2765 | } else |
---|
2650 | | - if (event.getSource() == oneButton) |
---|
| 2766 | + if (source == oneButton) |
---|
2651 | 2767 | { |
---|
2652 | 2768 | } else |
---|
2653 | | - if (event.getSource() == twoButton) |
---|
| 2769 | + if (source == twoButton) |
---|
2654 | 2770 | { |
---|
2655 | 2771 | radio.layout = twoButton; |
---|
2656 | 2772 | // bug |
---|
2657 | 2773 | //gridPanel.setDividerLocation(1.0); |
---|
2658 | 2774 | //bigPanel.setDividerLocation(0.0); |
---|
2659 | | - bigThree.remove(scenePanel); |
---|
2660 | | - bigThree.remove(centralPanel); |
---|
2661 | | - bigThree.remove(XYZPanel); |
---|
2662 | | - aWindowConstraints.gridx = 0; |
---|
2663 | | - aWindowConstraints.gridy = 0; |
---|
2664 | | - aWindowConstraints.gridwidth = 1; |
---|
2665 | | - // aConstraints.gridheight = 3; |
---|
2666 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2667 | | - aWindowConstraints.weightx = 0; |
---|
2668 | | - aWindowConstraints.weighty = 1; |
---|
2669 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2670 | | - aWindowConstraints.weightx = 1; |
---|
2671 | | - aWindowConstraints.gridwidth = 3; |
---|
2672 | | - // aConstraints.gridheight = 3; |
---|
2673 | | - aWindowConstraints.gridx = 1; |
---|
2674 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2675 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2676 | | - aWindowConstraints.weightx = 0; |
---|
2677 | | - aWindowConstraints.gridx = 4; |
---|
2678 | | - aWindowConstraints.gridwidth = 1; |
---|
2679 | | - // aConstraints.gridheight = 3; |
---|
2680 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2681 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2682 | | - bigThree.revalidate(); |
---|
| 2775 | +// bigThree.remove(scenePanel); |
---|
| 2776 | +// bigThree.remove(centralPanel); |
---|
| 2777 | +// bigThree.remove(XYZPanel); |
---|
| 2778 | +// aWindowConstraints.gridx = 0; |
---|
| 2779 | +// aWindowConstraints.gridy = 0; |
---|
| 2780 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2781 | +// // aConstraints.gridheight = 3; |
---|
| 2782 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2783 | +// aWindowConstraints.weightx = 0; |
---|
| 2784 | +// aWindowConstraints.weighty = 1; |
---|
| 2785 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2786 | +// aWindowConstraints.weightx = 1; |
---|
| 2787 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2788 | +// // aConstraints.gridheight = 3; |
---|
| 2789 | +// aWindowConstraints.gridx = 1; |
---|
| 2790 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2791 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2792 | +// aWindowConstraints.weightx = 0; |
---|
| 2793 | +// aWindowConstraints.gridx = 4; |
---|
| 2794 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2795 | +// // aConstraints.gridheight = 3; |
---|
| 2796 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2797 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2798 | +// scenePanel.setVisible(false); |
---|
| 2799 | +// centralPanel.setVisible(true); |
---|
| 2800 | +// XYZPanel.setVisible(false); |
---|
| 2801 | + bigThree.ClearUI(); |
---|
| 2802 | + bigThree.add(centralPanel); |
---|
| 2803 | + bigThree.FlushUI(); |
---|
2683 | 2804 | } else |
---|
2684 | | - if (event.getSource() == threeButton) |
---|
| 2805 | + if (source == threeButton) |
---|
2685 | 2806 | { |
---|
2686 | 2807 | radio.layout = threeButton; |
---|
2687 | | - bigThree.remove(scenePanel); |
---|
2688 | | - bigThree.remove(centralPanel); |
---|
2689 | | - bigThree.remove(XYZPanel); |
---|
2690 | | - aWindowConstraints.gridx = 0; |
---|
2691 | | - aWindowConstraints.gridy = 0; |
---|
2692 | | - aWindowConstraints.gridwidth = 1; |
---|
2693 | | - // aConstraints.gridheight = 3; |
---|
2694 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2695 | | - aWindowConstraints.weightx = 0; |
---|
2696 | | - aWindowConstraints.weighty = 1; |
---|
2697 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2698 | | - aWindowConstraints.weightx = 1; |
---|
2699 | | - aWindowConstraints.gridwidth = 3; |
---|
2700 | | - // aConstraints.gridheight = 3; |
---|
2701 | | - aWindowConstraints.gridx = 1; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2703 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2704 | | - aWindowConstraints.weightx = 0; |
---|
2705 | | - aWindowConstraints.gridx = 4; |
---|
2706 | | - aWindowConstraints.gridwidth = 1; |
---|
2707 | | - // aConstraints.gridheight = 3; |
---|
2708 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2709 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2710 | | - bigThree.revalidate(); |
---|
| 2808 | + |
---|
| 2809 | +// bigThree.remove(scenePanel); |
---|
| 2810 | +// bigThree.remove(centralPanel); |
---|
| 2811 | +// bigThree.remove(XYZPanel); |
---|
| 2812 | +// aWindowConstraints.gridx = 0; |
---|
| 2813 | +// aWindowConstraints.gridy = 0; |
---|
| 2814 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2815 | +// // aConstraints.gridheight = 3; |
---|
| 2816 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2817 | +// aWindowConstraints.weightx = 0; |
---|
| 2818 | +// aWindowConstraints.weighty = 1; |
---|
| 2819 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2820 | +// aWindowConstraints.weightx = 1; |
---|
| 2821 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2822 | +// // aConstraints.gridheight = 3; |
---|
| 2823 | +// aWindowConstraints.gridx = 1; |
---|
| 2824 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2825 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2826 | +// aWindowConstraints.weightx = 0; |
---|
| 2827 | +// aWindowConstraints.gridx = 4; |
---|
| 2828 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2829 | +// // aConstraints.gridheight = 3; |
---|
| 2830 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2831 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2832 | +// bigThree.validate(); |
---|
| 2833 | +// scenePanel.setVisible(false); |
---|
| 2834 | +// centralPanel.setVisible(true); |
---|
| 2835 | +// XYZPanel.setVisible(true); |
---|
| 2836 | + bigThree.ClearUI(); |
---|
| 2837 | + bigThree.add(centralPanel); |
---|
| 2838 | + bigThree.add(XYZPanel); |
---|
| 2839 | + bigThree.FlushUI(); |
---|
2711 | 2840 | } else |
---|
2712 | | - if (event.getSource() == fourButton) |
---|
| 2841 | + if (source == fourButton) |
---|
2713 | 2842 | { |
---|
2714 | 2843 | radio.layout = fourButton; |
---|
2715 | | - bigThree.remove(scenePanel); |
---|
2716 | | - bigThree.remove(centralPanel); |
---|
2717 | | - bigThree.remove(XYZPanel); |
---|
2718 | | - aWindowConstraints.gridx = 0; |
---|
2719 | | - aWindowConstraints.gridy = 0; |
---|
2720 | | - aWindowConstraints.gridwidth = 1; |
---|
2721 | | - // aWindowConstraints.gridheight = 3; |
---|
2722 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2723 | | - aWindowConstraints.weightx = 1; |
---|
2724 | | - aWindowConstraints.weighty = 1; |
---|
2725 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2726 | | - aWindowConstraints.weightx = 1; |
---|
2727 | | - aWindowConstraints.gridwidth = 3; |
---|
2728 | | - // aConstraints.gridheight = 3; |
---|
2729 | | - aWindowConstraints.gridx = 1; |
---|
2730 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2731 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2732 | | - aWindowConstraints.weightx = 0; |
---|
2733 | | - aWindowConstraints.gridx = 4; |
---|
2734 | | - aWindowConstraints.gridwidth = 1; |
---|
2735 | | - // aWindowConstraints.gridheight = 3; |
---|
2736 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2737 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2738 | | - bigThree.revalidate(); |
---|
| 2844 | + |
---|
| 2845 | +// bigThree.remove(scenePanel); |
---|
| 2846 | +// bigThree.remove(centralPanel); |
---|
| 2847 | +// bigThree.remove(XYZPanel); |
---|
| 2848 | +// aWindowConstraints.gridx = 0; |
---|
| 2849 | +// aWindowConstraints.gridy = 0; |
---|
| 2850 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2851 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2852 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2853 | +// aWindowConstraints.weightx = 1; |
---|
| 2854 | +// aWindowConstraints.weighty = 1; |
---|
| 2855 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2856 | +// aWindowConstraints.weightx = 1; |
---|
| 2857 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2858 | +// // aConstraints.gridheight = 3; |
---|
| 2859 | +// aWindowConstraints.gridx = 1; |
---|
| 2860 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2861 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2862 | +// aWindowConstraints.weightx = 0; |
---|
| 2863 | +// aWindowConstraints.gridx = 4; |
---|
| 2864 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2865 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2866 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2867 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2868 | +// bigThree.validate(); |
---|
| 2869 | +// scenePanel.setVisible(true); |
---|
| 2870 | +// centralPanel.setVisible(false); |
---|
| 2871 | +// XYZPanel.setVisible(false); |
---|
| 2872 | + bigThree.ClearUI(); |
---|
| 2873 | + bigThree.add(scenePanel); |
---|
| 2874 | + bigThree.FlushUI(); |
---|
2739 | 2875 | } else |
---|
2740 | | - if (event.getSource() == sixButton) |
---|
| 2876 | + if (source == sixButton) |
---|
2741 | 2877 | { |
---|
2742 | 2878 | radio.layout = sixButton; |
---|
2743 | | - bigThree.remove(scenePanel); |
---|
2744 | | - bigThree.remove(centralPanel); |
---|
2745 | | - bigThree.remove(XYZPanel); |
---|
2746 | | - aWindowConstraints.gridx = 0; |
---|
2747 | | - aWindowConstraints.gridy = 0; |
---|
2748 | | - aWindowConstraints.gridwidth = 1; |
---|
2749 | | - // aConstraints.gridheight = 3; |
---|
2750 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2751 | | - aWindowConstraints.weightx = 0; |
---|
2752 | | - aWindowConstraints.weighty = 1; |
---|
2753 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2754 | | - aWindowConstraints.weightx = 1; |
---|
2755 | | - aWindowConstraints.gridwidth = 3; |
---|
2756 | | - // aWindowConstraints.gridheight = 3; |
---|
2757 | | - aWindowConstraints.gridx = 1; |
---|
2758 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2759 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2760 | | - aWindowConstraints.weightx = 0; |
---|
2761 | | - aWindowConstraints.gridx = 4; |
---|
2762 | | - aWindowConstraints.gridwidth = 1; |
---|
2763 | | - // aWindowConstraints.gridheight = 3; |
---|
2764 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2765 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2766 | | - bigThree.revalidate(); |
---|
| 2879 | + |
---|
| 2880 | +// bigThree.remove(scenePanel); |
---|
| 2881 | +// bigThree.remove(centralPanel); |
---|
| 2882 | +// bigThree.remove(XYZPanel); |
---|
| 2883 | +// aWindowConstraints.gridx = 0; |
---|
| 2884 | +// aWindowConstraints.gridy = 0; |
---|
| 2885 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2886 | +// // aConstraints.gridheight = 3; |
---|
| 2887 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2888 | +// aWindowConstraints.weightx = 0; |
---|
| 2889 | +// aWindowConstraints.weighty = 1; |
---|
| 2890 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2891 | +// aWindowConstraints.weightx = 1; |
---|
| 2892 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2893 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2894 | +// aWindowConstraints.gridx = 1; |
---|
| 2895 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2896 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2897 | +// aWindowConstraints.weightx = 0; |
---|
| 2898 | +// aWindowConstraints.gridx = 4; |
---|
| 2899 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2900 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2901 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2902 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2903 | +// bigThree.validate(); |
---|
| 2904 | +// scenePanel.setVisible(true); |
---|
| 2905 | +// centralPanel.setVisible(true); |
---|
| 2906 | +// XYZPanel.setVisible(false); |
---|
| 2907 | + bigThree.ClearUI(); |
---|
| 2908 | + bigThree.add(scenePanel); |
---|
| 2909 | + bigThree.add(centralPanel); |
---|
| 2910 | + bigThree.FlushUI(); |
---|
2767 | 2911 | } else |
---|
2768 | | - if (event.getSource() == sevenButton) |
---|
| 2912 | + if (source == sevenButton) |
---|
2769 | 2913 | { |
---|
2770 | 2914 | radio.layout = sevenButton; |
---|
2771 | | - bigThree.remove(scenePanel); |
---|
2772 | | - bigThree.remove(centralPanel); |
---|
2773 | | - bigThree.remove(XYZPanel); |
---|
2774 | | - aWindowConstraints.gridx = 0; |
---|
2775 | | - aWindowConstraints.gridy = 0; |
---|
2776 | | - aWindowConstraints.gridwidth = 1; |
---|
2777 | | - // aWindowConstraints.gridheight = 3; |
---|
2778 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2779 | | - aWindowConstraints.weightx = 0; |
---|
2780 | | - aWindowConstraints.weighty = 1; |
---|
2781 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2782 | | - aWindowConstraints.weightx = 1; |
---|
2783 | | - aWindowConstraints.gridwidth = 3; |
---|
2784 | | - // aWindowConstraints.gridheight = 3; |
---|
2785 | | - aWindowConstraints.gridx = 1; |
---|
2786 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2787 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2788 | | - aWindowConstraints.weightx = 0; |
---|
2789 | | - aWindowConstraints.gridx = 4; |
---|
2790 | | - aWindowConstraints.gridwidth = 1; |
---|
2791 | | - // aConstraints.gridheight = 3; |
---|
2792 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2793 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2794 | | - bigThree.revalidate(); |
---|
| 2915 | + |
---|
| 2916 | +// bigThree.remove(scenePanel); |
---|
| 2917 | +// bigThree.remove(centralPanel); |
---|
| 2918 | +// bigThree.remove(XYZPanel); |
---|
| 2919 | +// aWindowConstraints.gridx = 0; |
---|
| 2920 | +// aWindowConstraints.gridy = 0; |
---|
| 2921 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2922 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2923 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2924 | +// aWindowConstraints.weightx = 0; |
---|
| 2925 | +// aWindowConstraints.weighty = 1; |
---|
| 2926 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2927 | +// aWindowConstraints.weightx = 1; |
---|
| 2928 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2929 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2930 | +// aWindowConstraints.gridx = 1; |
---|
| 2931 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2932 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2933 | +// aWindowConstraints.weightx = 0; |
---|
| 2934 | +// aWindowConstraints.gridx = 4; |
---|
| 2935 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2936 | +// // aConstraints.gridheight = 3; |
---|
| 2937 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2938 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2939 | +// bigThree.validate(); |
---|
| 2940 | +// scenePanel.setVisible(true); |
---|
| 2941 | +// centralPanel.setVisible(true); |
---|
| 2942 | +// XYZPanel.setVisible(true); |
---|
| 2943 | + bigThree.ClearUI(); |
---|
| 2944 | + bigThree.add(scenePanel); |
---|
| 2945 | + bigThree.add(centralPanel); |
---|
| 2946 | + bigThree.add(XYZPanel); |
---|
| 2947 | + bigThree.FlushUI(); |
---|
2795 | 2948 | } else |
---|
2796 | | - if (event.getSource() == rootButton) |
---|
| 2949 | + if (source == rootButton) |
---|
2797 | 2950 | { |
---|
2798 | 2951 | Object3D obj; |
---|
2799 | 2952 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2805 | 2958 | |
---|
2806 | 2959 | refreshContents(true); |
---|
2807 | 2960 | } else |
---|
2808 | | - if (event.getSource() == closeButton) |
---|
| 2961 | + if (source == closeButton) |
---|
2809 | 2962 | { |
---|
2810 | 2963 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2811 | 2964 | cRadio ab; |
---|
.. | .. |
---|
2826 | 2979 | } |
---|
2827 | 2980 | refreshContents(true); |
---|
2828 | 2981 | } else |
---|
2829 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 2982 | + if (source == editItem || source == editButton) |
---|
2830 | 2983 | { |
---|
2831 | 2984 | EditSelection(false); |
---|
2832 | 2985 | } else |
---|
2833 | | - if (event.getSource() == uneditButton) |
---|
| 2986 | + if (source == uneditButton) |
---|
2834 | 2987 | { |
---|
2835 | 2988 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2836 | 2989 | { |
---|
.. | .. |
---|
2842 | 2995 | |
---|
2843 | 2996 | child.editWindow = null; // ??????????? |
---|
2844 | 2997 | } |
---|
2845 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 2998 | + objEditor.ctrlPanel.FlushUI(); |
---|
2846 | 2999 | //objEditor.jTree.clearSelection(); |
---|
2847 | 3000 | //objEditor.ResetSliders(); |
---|
2848 | 3001 | refreshContents(true); |
---|
2849 | 3002 | } else |
---|
2850 | | - if (event.getSource() == clearPanelButton) |
---|
| 3003 | + if (source == clearPanelButton) |
---|
2851 | 3004 | { |
---|
2852 | 3005 | assert(copy == group); |
---|
2853 | 3006 | //copy.ClearUI(); |
---|
.. | .. |
---|
2858 | 3011 | listUI.clear(); |
---|
2859 | 3012 | refreshContents(true); |
---|
2860 | 3013 | } else |
---|
2861 | | - if (event.getSource() == allParamsButton) |
---|
| 3014 | + if (source == allParamsButton) |
---|
2862 | 3015 | { |
---|
2863 | 3016 | assert(copy == group); |
---|
2864 | 3017 | |
---|
.. | .. |
---|
2879 | 3032 | |
---|
2880 | 3033 | refreshContents(true); |
---|
2881 | 3034 | } else |
---|
2882 | | - if (event.getSource() == unselectButton) |
---|
| 3035 | + if (source == unselectButton) |
---|
2883 | 3036 | { |
---|
2884 | 3037 | objEditor.jTree.clearSelection(); |
---|
2885 | 3038 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2886 | 3039 | objEditor.ResetSliders(); |
---|
2887 | 3040 | refreshContents(true); |
---|
2888 | 3041 | } else |
---|
2889 | | - if(event.getSource() instanceof cRadio) |
---|
| 3042 | + if(source instanceof cRadio) |
---|
2890 | 3043 | { |
---|
2891 | 3044 | group.parent = keepparent; |
---|
2892 | 3045 | group.attributes = 0; |
---|
2893 | 3046 | //group.editWindow = null; |
---|
2894 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3047 | + /*cRadio*/ radio = (cRadio)source; |
---|
2895 | 3048 | Object3D obj = radio.GetObject(); |
---|
2896 | 3049 | System.out.println("Edit " + obj); |
---|
2897 | 3050 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
3000 | 3153 | refreshContents(); |
---|
3001 | 3154 | } |
---|
3002 | 3155 | |
---|
| 3156 | + void TransformChildren() |
---|
| 3157 | + { |
---|
| 3158 | + Object3D obj; |
---|
| 3159 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3160 | + { |
---|
| 3161 | + obj = (Object3D)e.nextElement(); |
---|
| 3162 | + obj.KeepTextureMatrices(); |
---|
| 3163 | + obj.TransformChildren(); |
---|
| 3164 | + obj.RestoreTextureMatrices(); |
---|
| 3165 | + |
---|
| 3166 | +// if (obj.parent == null) |
---|
| 3167 | +// { |
---|
| 3168 | +// System.out.println("NULL PARENT!"); |
---|
| 3169 | +// new Exception().printStackTrace(); |
---|
| 3170 | +// } |
---|
| 3171 | +// else |
---|
| 3172 | +// TouchTransform(obj); |
---|
| 3173 | +// //obj.parent.Touch(); |
---|
| 3174 | + } |
---|
| 3175 | + |
---|
| 3176 | + refreshContents(); |
---|
| 3177 | + } |
---|
3003 | 3178 | |
---|
3004 | 3179 | void ResetTransform() |
---|
3005 | 3180 | { |
---|
.. | .. |
---|
3112 | 3287 | refreshContents(); |
---|
3113 | 3288 | } |
---|
3114 | 3289 | |
---|
3115 | | - void ResetCentroid() |
---|
| 3290 | + void ResetCentroid(boolean full) |
---|
3116 | 3291 | { |
---|
3117 | 3292 | Object3D obj; |
---|
3118 | 3293 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3127 | 3302 | LA.matIdentity(Object3D.mat); |
---|
3128 | 3303 | obj.getBounds(minima, maxima, false); |
---|
3129 | 3304 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3130 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3305 | + if (full) |
---|
| 3306 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3131 | 3307 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3132 | 3308 | obj.TransformMesh(Object3D.mat); |
---|
| 3309 | + |
---|
3133 | 3310 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3134 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3311 | + if (full) |
---|
| 3312 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3135 | 3313 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3314 | + |
---|
3136 | 3315 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3137 | 3316 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3138 | 3317 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3198 | 3377 | obj = (Object3D)e.nextElement(); |
---|
3199 | 3378 | |
---|
3200 | 3379 | System.out.println("Object is: " + obj); |
---|
3201 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3380 | + Grafreed.AnalyzeObject(obj); |
---|
3202 | 3381 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3203 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3382 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3204 | 3383 | |
---|
3205 | 3384 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3206 | 3385 | } |
---|
.. | .. |
---|
3414 | 3593 | |
---|
3415 | 3594 | void ParseVertices() |
---|
3416 | 3595 | { |
---|
3417 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3418 | | - GrafreeD.epsequal = true; |
---|
| 3596 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3597 | + Grafreed.epsequal = true; |
---|
3419 | 3598 | |
---|
3420 | 3599 | for (int i=0; i<group.selection.size(); i++) |
---|
3421 | 3600 | { |
---|
.. | .. |
---|
3440 | 3619 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3441 | 3620 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3442 | 3621 | |
---|
3443 | | - g.add(GrafreeD.clipboard); |
---|
| 3622 | + g.add(Grafreed.clipboard); |
---|
3444 | 3623 | |
---|
3445 | 3624 | buffer.add(g); |
---|
3446 | 3625 | } |
---|
.. | .. |
---|
3455 | 3634 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3456 | 3635 | } |
---|
3457 | 3636 | |
---|
3458 | | - GrafreeD.epsequal = epsequal; |
---|
| 3637 | + Grafreed.epsequal = epsequal; |
---|
3459 | 3638 | |
---|
3460 | 3639 | refreshContents(); |
---|
3461 | 3640 | } |
---|
.. | .. |
---|
3473 | 3652 | String pigment = Object3D.GetPigment(tex); |
---|
3474 | 3653 | //String bump = Object3D.GetBump(tex); |
---|
3475 | 3654 | |
---|
3476 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3655 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3656 | + |
---|
| 3657 | + try |
---|
| 3658 | + { |
---|
| 3659 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3660 | + } |
---|
| 3661 | + catch (Exception e) |
---|
| 3662 | + { |
---|
| 3663 | + System.err.println("FAIL: " + node); |
---|
| 3664 | + } |
---|
3477 | 3665 | |
---|
3478 | 3666 | double s = v.s; |
---|
3479 | 3667 | |
---|
.. | .. |
---|
3561 | 3749 | |
---|
3562 | 3750 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3563 | 3751 | |
---|
3564 | | - boolean random = CameraPane.RANDOM; |
---|
3565 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3752 | + boolean random = CameraPane.SWITCH; |
---|
| 3753 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3566 | 3754 | lowres.linkVerticesThis(null); |
---|
3567 | 3755 | lowres.linkVerticesThis(sn); |
---|
3568 | | - CameraPane.RANDOM = random; |
---|
| 3756 | + CameraPane.SWITCH = random; |
---|
3569 | 3757 | |
---|
3570 | 3758 | System.err.flush(); |
---|
3571 | 3759 | |
---|
.. | .. |
---|
3605 | 3793 | return; |
---|
3606 | 3794 | |
---|
3607 | 3795 | Object3D poses = group.selection.get(0); |
---|
3608 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3796 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3609 | 3797 | |
---|
3610 | 3798 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3611 | 3799 | |
---|
.. | .. |
---|
3799 | 3987 | |
---|
3800 | 3988 | void ClipMesh() |
---|
3801 | 3989 | { |
---|
3802 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 3990 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3803 | 3991 | { |
---|
3804 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3992 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3805 | 3993 | |
---|
3806 | 3994 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3807 | 3995 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3810 | 3998 | // { |
---|
3811 | 3999 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3812 | 4000 | // } |
---|
3813 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4001 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3814 | 4002 | } |
---|
3815 | 4003 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3816 | 4004 | System.out.println("DONE."); |
---|
.. | .. |
---|
4050 | 4238 | System.err.println("info : " + child.GetPath()); |
---|
4051 | 4239 | } |
---|
4052 | 4240 | } |
---|
4053 | | - else |
---|
4054 | | - { |
---|
4055 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4056 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4057 | | - System.err.println("info : " + group.GetPath()); |
---|
4058 | | - } |
---|
| 4241 | +// else |
---|
| 4242 | +// { |
---|
| 4243 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4244 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4245 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4246 | +// } |
---|
4059 | 4247 | |
---|
4060 | 4248 | objEditor.SetText(); // jan 2014 |
---|
4061 | 4249 | |
---|
.. | .. |
---|
4150 | 4338 | { |
---|
4151 | 4339 | if (group.selection.isEmpty()) |
---|
4152 | 4340 | return; |
---|
4153 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4341 | + Grafreed.clipboardIsTempGroup = false; |
---|
4154 | 4342 | Composite tGroup = null; |
---|
4155 | 4343 | if (group.selection.size() > 0) // 1) |
---|
4156 | 4344 | { |
---|
4157 | 4345 | tGroup = new cGroup(); |
---|
4158 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4346 | + Grafreed.clipboardIsTempGroup = true; |
---|
4159 | 4347 | } |
---|
4160 | 4348 | |
---|
4161 | 4349 | if (cut) |
---|
.. | .. |
---|
4195 | 4383 | //System.out.println("cut " + child); |
---|
4196 | 4384 | //System.out.println("parent = " + child.parent); |
---|
4197 | 4385 | // tmp.addChild(child); |
---|
4198 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4386 | + if (Grafreed.clipboardIsTempGroup) |
---|
4199 | 4387 | tGroup.add/*Child*/(tmp); |
---|
4200 | 4388 | else |
---|
4201 | | - GrafreeD.clipboard = tmp; |
---|
| 4389 | + Grafreed.clipboard = tmp; |
---|
4202 | 4390 | } |
---|
4203 | 4391 | else |
---|
4204 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4392 | + if (Grafreed.clipboardIsTempGroup) |
---|
4205 | 4393 | tGroup.add/*Child*/(child); |
---|
4206 | 4394 | else |
---|
4207 | | - GrafreeD.clipboard = child; |
---|
| 4395 | + Grafreed.clipboard = child; |
---|
4208 | 4396 | } |
---|
4209 | 4397 | |
---|
4210 | 4398 | //ResetModel(); |
---|
.. | .. |
---|
4236 | 4424 | //System.out.println("cut " + elem); |
---|
4237 | 4425 | //System.out.println("parent = " + elem.parent); |
---|
4238 | 4426 | // tmp.addChild(elem); |
---|
4239 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4427 | + if (Grafreed.clipboardIsTempGroup) |
---|
4240 | 4428 | tGroup.add/*Child*/(tmp); |
---|
4241 | 4429 | else |
---|
4242 | | - GrafreeD.clipboard = tmp; |
---|
| 4430 | + Grafreed.clipboard = tmp; |
---|
4243 | 4431 | } |
---|
4244 | 4432 | else |
---|
4245 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4433 | + if (Grafreed.clipboardIsTempGroup) |
---|
4246 | 4434 | tGroup.add/*Child*/(child); |
---|
4247 | 4435 | else |
---|
4248 | | - GrafreeD.clipboard = child; |
---|
| 4436 | + Grafreed.clipboard = child; |
---|
4249 | 4437 | } |
---|
4250 | 4438 | |
---|
4251 | 4439 | } |
---|
4252 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4253 | | - GrafreeD.clipboard = tGroup; |
---|
| 4440 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4441 | + Grafreed.clipboard = tGroup; |
---|
4254 | 4442 | if (cut) |
---|
4255 | 4443 | { |
---|
4256 | 4444 | ResetModel(); |
---|
.. | .. |
---|
4264 | 4452 | // return; |
---|
4265 | 4453 | boolean first = true; |
---|
4266 | 4454 | |
---|
4267 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4455 | + if (Grafreed.clipboardIsTempGroup) |
---|
4268 | 4456 | { |
---|
4269 | 4457 | Composite temp; |
---|
4270 | 4458 | |
---|
.. | .. |
---|
4275 | 4463 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4276 | 4464 | */ |
---|
4277 | 4465 | Object3D elem; |
---|
4278 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4466 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4279 | 4467 | { |
---|
4280 | 4468 | Object3D child = (Object3D)e.nextElement(); |
---|
4281 | 4469 | |
---|
.. | .. |
---|
4309 | 4497 | //Object3D cb = Applet3D.clipboard; |
---|
4310 | 4498 | //temp.addChild(cb); |
---|
4311 | 4499 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4312 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4313 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4314 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4315 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4316 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4500 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4501 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4502 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4503 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4504 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4317 | 4505 | else |
---|
4318 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4319 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4506 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4507 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4320 | 4508 | } |
---|
4321 | 4509 | |
---|
4322 | 4510 | ResetModel(); |
---|
4323 | 4511 | refreshContents(); |
---|
4324 | 4512 | } |
---|
4325 | 4513 | |
---|
4326 | | - void pasteInto(boolean copyit) |
---|
| 4514 | + void pasteInto(boolean copyit, boolean clone) |
---|
4327 | 4515 | { |
---|
4328 | 4516 | // if (GrafreeD.clipboard == null) |
---|
4329 | 4517 | // return; |
---|
.. | .. |
---|
4352 | 4540 | if (copyit) |
---|
4353 | 4541 | { |
---|
4354 | 4542 | // paste(false); |
---|
4355 | | - CloneClipboard(false); // sept 2014 |
---|
| 4543 | + if (clone) |
---|
| 4544 | + { |
---|
| 4545 | + CloneClipboard(false); // sept 2014 |
---|
| 4546 | + } |
---|
| 4547 | + else |
---|
| 4548 | + { |
---|
| 4549 | + paste(false); |
---|
| 4550 | + } |
---|
4356 | 4551 | } |
---|
4357 | 4552 | else |
---|
4358 | 4553 | { |
---|
4359 | 4554 | boolean first = true; |
---|
4360 | 4555 | |
---|
4361 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4556 | + if (Grafreed.clipboardIsTempGroup) |
---|
4362 | 4557 | { |
---|
4363 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4558 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4364 | 4559 | Object3D copy; |
---|
4365 | 4560 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4366 | 4561 | { |
---|
.. | .. |
---|
4370 | 4565 | } |
---|
4371 | 4566 | } else |
---|
4372 | 4567 | { |
---|
4373 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4568 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4374 | 4569 | } |
---|
4375 | 4570 | } |
---|
4376 | 4571 | } |
---|
.. | .. |
---|
4815 | 5010 | |
---|
4816 | 5011 | void ImportVRMLX3D() |
---|
4817 | 5012 | { |
---|
4818 | | - if (GrafreeD.standAlone) |
---|
| 5013 | + if (Grafreed.standAlone) |
---|
4819 | 5014 | { |
---|
4820 | 5015 | /**/ |
---|
4821 | 5016 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4832 | 5027 | |
---|
4833 | 5028 | String GetFile(String dialogName) |
---|
4834 | 5029 | { |
---|
4835 | | - if (GrafreeD.standAlone) |
---|
| 5030 | + if (Grafreed.standAlone) |
---|
4836 | 5031 | { |
---|
4837 | 5032 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4838 | 5033 | browser.show(); |
---|
.. | .. |
---|
4896 | 5091 | cButton flashSelectionButton; |
---|
4897 | 5092 | cButton editButton; |
---|
4898 | 5093 | cButton uneditButton; |
---|
| 5094 | + JCheckBox allParamsButton; |
---|
4899 | 5095 | cButton clearpanelButton; |
---|
4900 | | - cButton allParamsButton; |
---|
4901 | 5096 | cButton unselectButton; |
---|
4902 | 5097 | |
---|
| 5098 | + cButton oneStepButton; |
---|
| 5099 | + |
---|
4903 | 5100 | cButton screenfitButton; |
---|
4904 | 5101 | cButton screenfitpointButton; |
---|
4905 | 5102 | cButton snapobjectButton; |
---|
.. | .. |
---|
4943 | 5140 | private MenuItem linkverticesItem; |
---|
4944 | 5141 | private MenuItem relinkverticesItem; |
---|
4945 | 5142 | private MenuItem setMasterItem; |
---|
4946 | | - private MenuItem resetMeshItem; |
---|
| 5143 | + private MenuItem resetAllItem; |
---|
4947 | 5144 | private MenuItem stepAllItem; |
---|
4948 | 5145 | private MenuItem revertMeshItem; |
---|
4949 | 5146 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4954 | 5151 | private MenuItem mergeGeometriesItem; |
---|
4955 | 5152 | private MenuItem copyItem; |
---|
4956 | 5153 | private MenuItem pasteItem; |
---|
| 5154 | + private MenuItem pasteIntoItem; |
---|
4957 | 5155 | private MenuItem pasteLinkItem; |
---|
4958 | 5156 | private MenuItem pasteCloneItem; |
---|
4959 | 5157 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5003 | 5201 | private MenuItem panoTexturesItem; |
---|
5004 | 5202 | |
---|
5005 | 5203 | private MenuItem resetCentroidItem; |
---|
5006 | | - private MenuItem transformgeometryItem; |
---|
| 5204 | + private MenuItem resetCentroidXZItem; |
---|
5007 | 5205 | private MenuItem resetTransformItem; |
---|
| 5206 | + private MenuItem transformGeometryItem; |
---|
| 5207 | + private MenuItem transformChildrenItem; |
---|
5008 | 5208 | private MenuItem hideItem; |
---|
5009 | 5209 | private MenuItem grabItem; |
---|
5010 | 5210 | private MenuItem backItem; |
---|
.. | .. |
---|
5051 | 5251 | private MenuItem blobItem; |
---|
5052 | 5252 | private MenuItem latheItem; |
---|
5053 | 5253 | private MenuItem bezierItem; |
---|
5054 | | - private MenuItem checkerItem; |
---|
| 5254 | + private MenuItem overlayItem; |
---|
5055 | 5255 | private MenuItem meshItem; |
---|
5056 | 5256 | // private MenuItem meshGroupItem; |
---|
5057 | 5257 | private MenuItem springItem; |
---|