Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
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));
105106 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;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,130 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
286
+ }
287
+
192288 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);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
222320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
224325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225326 setMasterItem.addActionListener(this);
327
+ }
226328
227329 oe.menuBar.add(menu = new Menu("Group"));
228330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +335,32 @@
233335 frontItem.addActionListener(this);
234336 compositeItem = menu.add(new MenuItem("Composite"));
235337 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237339 hideItem.addActionListener(this);
238340 ungroupItem = menu.add(new MenuItem("Ungroup"));
239341 ungroupItem.addActionListener(this);
240342 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
242344 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);
247345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248346 switchGeoItem.addActionListener(this);
249347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250348 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
252350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
253359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254360 scriptNodeItem.addActionListener(this);
255361 cameraItem = menu.add(new MenuItem("Camera"));
256362 cameraItem.addActionListener(this);
363
+ }
257364
258365 oe.menuBar.add(menu = new Menu("Object"));
259366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +375,29 @@
268375 shadowYItem.addActionListener(this);
269376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
271381 linkerItem = menu.add(new MenuItem("Linker"));
272382 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275383 attributeItem = menu.add(new MenuItem("Attribute"));
276384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
277387 pointflowItem = menu.add(new MenuItem("Point Flow"));
278388 pointflowItem.addActionListener(this);
389
+ }
279390 menu.add("-");
280391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281392 resetTransformItem.addActionListener(this);
282393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283394 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
286401
287402 oe.menuBar.add(menu = new Menu("Geometry"));
288403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +408,11 @@
293408 genNormalsCADItem.addActionListener(this);
294409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
296413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297414 genNormalsMINEItem.addActionListener(this);
415
+ }
298416 stripifyItem = menu.add(new MenuItem("Stripify"));
299417 stripifyItem.addActionListener(this);
300418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +434,34 @@
316434 reduce34MeshItem.addActionListener(this);
317435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318436 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
323445
324446 oe.menuBar.add(menu = new Menu("Attributes"));
325447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
327453 menu.add("-");
328454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329455 liveleavesItem.addActionListener(this);
330456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
332460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333461 supportleavesItem.addActionListener(this);
334462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335463 unsupportleavesItem.addActionListener(this);
464
+ }
336465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337466 hideleavesItem.addActionListener(this);
338467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +470,14 @@
341470 markleavesItem.addActionListener(this);
342471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
344481 menu.add("-");
345482 flipVItem = menu.add(new MenuItem("Flip V"));
346483 flipVItem.addActionListener(this);
....@@ -376,29 +513,22 @@
376513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377514 sortbynameItem.addActionListener(this);
378515 menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
520
+ if (Globals.ADVANCED)
521
+ {
522
+ // Pretty much the same as duplicate and clone.
379523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380524 extractGeometriesItem.addActionListener(this);
381525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382526 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);
527
+ }
387528
388529 oe.menuBar.add(menu = new Menu("Insert"));
389530 buildCreateMenu(menu);
390531
391
-
392
- 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..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402532 oe.menuBar.add(menu = new Menu("Tools"));
403533 buildToolsMenu(menu);
404534 }
....@@ -433,110 +563,110 @@
433563 oe.radioPanel.add(dummyButton);
434564 oe.buttonGroup.add(dummyButton);
435565 */
436
- aConstraints.gridy += 1;
437
-
438566 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439567
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
568
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ undoButton.setToolTipText("Undo changes");
570
+ undoButton.addActionListener(this);
442571
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
572
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ redoButton.setToolTipText("Redo changes");
574
+ redoButton.addActionListener(this);
575
+
576
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ saveButton.setToolTipText("Save changes");
578
+ saveButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
581
+ liveCB.setToolTipText("Enable animation");
445582 liveCB.addItemListener(this);
446583
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
584
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ oneStepButton.setToolTipText("Animate one step forward");
586
+ oneStepButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
589
+ fastCB.setToolTipText("Fast mode");
590
+ fastCB.addItemListener(this);
591
+
592
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449593 trackCB.setToolTipText("Enable tracking");
450594 trackCB.addItemListener(this);
451595
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454597 screenfitButton.setToolTipText("Screen fit");
455598 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
599
+
457600 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458601 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464602
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
603
+ if (Globals.ADVANCED)
604
+ {
605
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ snapobjectButton.addActionListener(this);
607
+ snapobjectButton.setToolTipText("Snap Object");
608
+ }
609
+
610
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471611 flashSelectionButton.setToolTipText("Show selection");
472612 flashSelectionButton.addActionListener(this);
473613
474
- oe.toolbarPanel.add(new cButton(" ", false));
614
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475615
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482617 twoButton.setToolTipText("Show center view only");
483618 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485620 fourButton.addActionListener(this);
486621 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
622
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488623 sixButton.setToolTipText("2-column layout left");
489624 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491626 threeButton.setToolTipText("2-column layout right");
492627 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494629 sevenButton.setToolTipText("3-column layout");
495630 sevenButton.addActionListener(this);
496631 //
497632
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
633
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ rootButton.setToolTipText("Edit selection in new tab");
500635 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
636
+
637
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503638 closeButton.setToolTipText("Close tab");
504639 closeButton.addActionListener(this);
505640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506641 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508642
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
643
+ cGridBag commandsPanel = new cGridBag();
644
+
645
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ editButton.setToolTipText("Edit selection");
511647 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515648
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
517651 uneditButton.addActionListener(this);
518652
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
653
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654
+ allParamsButton.setToolTipText("Edit all params");
531655 allParamsButton.addActionListener(this);
532656
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
657
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ clearPanelButton.setToolTipText("Clear edit panel");
659
+ clearPanelButton.addActionListener(this);
660
+
661
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ unselectButton.setToolTipText("Unselect");
538663 unselectButton.addActionListener(this);
539664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
540670 // oe.aConstraints.gridx += 1;
541671 // oe.aConstraints.weighty = 0;
542672 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +678,37 @@
548678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549679 // gcButton.addActionListener(this);
550680
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
562684 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
685
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564686 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
569690
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
691
+ cGridBag copyOptionsPanel = new cGridBag();
692
+
693
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
694
+ colorCB.setToolTipText("Copy color when dropped");
574695 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
696
+
697
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
698
+ materialCB.setToolTipText("Copy material when dropped");
577699 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
700
+
701
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
702
+ textureCB.setToolTipText("Copy texture when dropped");
580703 textureCB.addItemListener(this);
581704
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
584708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
585712 //jList.addListSelectionListener(this);
586713 oe.jTree.addTreeSelectionListener(this);
587714 //jTree.setRootVisible(false);
....@@ -604,45 +731,37 @@
604731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605732 }
606733
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
734
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608735 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
736
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639737 boxCB.setToolTipText("Display bounding boxes");
640738 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
739
+
740
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643741 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644742 zoomBoxCB.addItemListener(this);
645743
744
+ if (true) // Globals.ADVANCED)
745
+ {
746
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
747
+ supportCB.setToolTipText("Enable rigging");
748
+ supportCB.addItemListener(this);
749
+
750
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
751
+ // localCB.addItemListener(this);
752
+
753
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
754
+ crowdCB.setToolTipText("Used for crowds");
755
+ crowdCB.addItemListener(this);
756
+
757
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
758
+ smoothCB.setToolTipText("Snapping delay");
759
+ smoothCB.addItemListener(this);
760
+
761
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
762
+ slowCB.setToolTipText("Smooth interpolation");
763
+ slowCB.addItemListener(this);
764
+
646765 // constraints.gridy += 1;
647766 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648767 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +769,16 @@
650769 if (false)
651770 {
652771 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
772
+ //constraints.gridy += 1;
773
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655774 speakerCameraCB.addItemListener(this);
656775
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
776
+ //constraints.gridy += 1;
777
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659778 speakerFocusCB.addItemListener(this);
660779
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
780
+ //constraints.gridy += 1;
781
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663782 smoothfocusCB.addItemListener(this);
664783 }
665784
....@@ -667,14 +786,20 @@
667786 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668787 // debugCB.addItemListener(this);
669788
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
789
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672790 oeilCB.addItemListener(this);
673791
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
792
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676793 lookAtCB.setToolTipText("Look-at target");
677794 lookAtCB.addItemListener(this);
795
+
796
+ }
797
+
798
+ cGridBag fill = new cGridBag();
799
+
800
+ fill.preferredHeight = 200;
801
+
802
+ panel.add(fill);
678803
679804 }
680805
....@@ -689,6 +814,7 @@
689814 buttonGroup.add(radioButton);
690815 radioButton.doClick();
691816 }
817
+
692818 void SetupViews(ObjEditor oe)
693819 {
694820 oe.SetupViews();
....@@ -753,6 +879,7 @@
753879 } else if(e.getSource() == liveCB)
754880 {
755881 cameraView.ToggleLive();
882
+ refreshContents(false);
756883 }
757884 else if(e.getSource() == supportCB)
758885 {
....@@ -905,7 +1032,9 @@
9051032 // objEditor.DropFile((java.io.File[]) object, true);
9061033 // return;
9071034 // }
908
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091038 {
9101039 // file(s)
9111040 String[] names = string.split("\n");
....@@ -932,7 +1061,7 @@
9321061
9331062 flashIt = false;
9341063 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371066
9381067 if (group.selection.size() == 1)
....@@ -959,11 +1088,11 @@
9591088 {
9601089 loadClipboard(true);
9611090 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1091
+ pasteInto(false, false);
9631092 } else {
9641093 loadClipboard(false);
9651094 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9671096 }
9681097 }
9691098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1214,33 @@
10851214 kleinItem.addActionListener(this);
10861215 particleItem = menu.add(new MenuItem("Particle system"));
10871216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10881219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891220 ragdollItem.addActionListener(this);
10901221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911222 ragdoll2Item.addActionListener(this);
1223
+ }
10921224 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941226 meshItem.addActionListener(this);
10951227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10971231 springItem = menu.add(new MenuItem("Spring"));
10981232 springItem.addActionListener(this);
10991233 flagItem = menu.add(new MenuItem("Flag"));
11001234 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051235 blobItem = menu.add(new MenuItem("Blob"));
11061236 blobItem.addActionListener(this);
11071237 latheItem = menu.add(new MenuItem("Lathe"));
11081238 latheItem.addActionListener(this);
1239
+ }
1240
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1241
+ bezierItem.addActionListener(this);
1242
+ overlayItem = menu.add(new MenuItem("Overlay"));
1243
+ overlayItem.addActionListener(this);
11091244 lightItem = menu.add(new MenuItem("Light"));
11101245 lightItem.addActionListener(this);
11111246 menu.add("-");
....@@ -1115,39 +1250,44 @@
11151250 loopItem.addActionListener(this);
11161251 doubleItem = menu.add(new MenuItem("Fork"));
11171252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
11181255 tripleItem = menu.add(new MenuItem("Trident"));
11191256 tripleItem.addActionListener(this);
1257
+ }
11201258 }
11211259
11221260 void buildToolsMenu(Menu menu)
11231261 {
11241262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251263 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
11271265
11281266 menu.add("-");
11291267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301268 parseverticesItem.addActionListener(this);
11311269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321270 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341272 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381274 reduceMorphItem.addActionListener(this);
11391275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401276 reduce34MorphItem.addActionListener(this);
1141
-
1277
+ menu.add("-");
11421278 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431279 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
11461286 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471287 memoryItem.addActionListener(this);
11481288 menu.add(analyzeItem = new MenuItem("Analyze"));
11491289 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11511291 dumpItem.addActionListener(this);
11521292 // menu.add(pathItem = new MenuItem("From-to path"));
11531293 // pathItem.addActionListener(this);
....@@ -1165,6 +1305,7 @@
11651305 menu.add("-");
11661306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671307 editScriptItem.addActionListener(this);
1308
+ }
11681309 }
11691310
11701311 void ScreenFit()
....@@ -1493,9 +1634,9 @@
14931634
14941635 void Overwrite(int mask)
14951636 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971638 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14991640
15001641 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011642 content = ((cGroup)content).get(0);
....@@ -1518,6 +1659,7 @@
15181659 //
15191660 public void actionPerformed(ActionEvent event) // , Object arg)
15201661 {
1662
+ Object source = event.getSource();
15211663 /*
15221664 if (event.getSource() == nameField)
15231665 {
....@@ -1529,11 +1671,11 @@
15291671 }
15301672 else
15311673 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
15331675 {
15341676 ScreenFit();
15351677 } else
1536
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
15371679 {
15381680 cVector v1 = new cVector();
15391681 cVector v2 = new cVector();
....@@ -1542,11 +1684,11 @@
15421684 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431685 objEditor.cameraView.repaint();
15441686 } else
1545
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
15461688 {
15471689 makeSomething(new Box());
15481690 } else
1549
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
15501692 {
15511693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1709,9 @@
15671709 applyExample(particleGeom, "SMOKE");
15681710 makeSomething(particleGeom);
15691711 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15711713 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731715
15741716 ragdoll.toParent = LA.newMatrix();
15751717 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1729,7 @@
15871729 } else
15881730 /*
15891731 */
1590
- if (event.getSource() == heightFieldItem)
1732
+ if (source == heightFieldItem)
15911733 {
15921734 Object3D obj = new Object3D();
15931735
....@@ -1625,31 +1767,31 @@
16251767
16261768 makeSomething(obj);
16271769 } else
1628
- if (event.getSource() == gridItem)
1770
+ if (source == gridItem)
16291771 {
16301772 makeSomething(new Grid());
16311773 } else
1632
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
16331775 {
16341776 makeSomething(new Sphere());
16351777 } else
1636
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
16371779 {
16381780 makeSomething(new Cone());
16391781 } else
1640
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
16411783 {
16421784 makeSomething(new Torus());
16431785 } else
1644
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
16451787 {
16461788 makeSomething(new Superellipsoid());
16471789 } else
1648
- if (event.getSource() == kleinItem)
1790
+ if (source == kleinItem)
16491791 {
16501792 makeSomething(new Klein());
16511793 } else
1652
- if (event.getSource() == blobItem)
1794
+ if (source == blobItem)
16531795 {
16541796 Blob blob = new Blob();
16551797 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1799,15 @@
16571799 //blob.retile();
16581800 makeSomething(blob);
16591801 } else
1660
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
16611803 {
16621804 makeSomething(new Lathe());
16631805 } else
1664
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
16651807 {
16661808 makeSomething(new BezierSurface());
16671809 } else
1668
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
16691811 {
16701812 /*
16711813 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1822,7 @@
16801822 */
16811823 makeSomething(new Checker());
16821824 } else
1683
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
16841826 {
16851827 Object3D itemtomake = new Object3D();
16861828 Object3D child;
....@@ -1701,35 +1843,35 @@
17011843 makeSomething(child);
17021844 }
17031845 } else
1704
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
17051847 {
17061848 cSpring s = new cSpring();
17071849 s.setup();
17081850 makeSomething(s);
17091851 } else
1710
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
17111853 {
17121854 cSpring s = new cFlag();
17131855 s.setup();
17141856 makeSomething(s);
17151857 } else
1716
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
17171859 {
17181860 makeSomething(new Light());
17191861 } else
1720
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
17211863 {
17221864 group(new CSG());
17231865 } else
1724
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
17251867 {
17261868 group(new cTemplate());
17271869 } else
1728
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
17291871 {
17301872 makeSomething(new Attribute());
17311873 } else
1732
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
17331875 {
17341876 makeSomething(new PointFlow());
17351877 } else
....@@ -1741,7 +1883,7 @@
17411883 } else
17421884 */
17431885
1744
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
17451887 {
17461888 Composite g = new cGroup();
17471889 for (int i=0; i<15; i++)
....@@ -1763,7 +1905,7 @@
17631905
17641906 group(g);
17651907 } else
1766
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
17671909 {
17681910 Composite csg = new GroupLeaf();
17691911 csg.count = 5;
....@@ -1772,7 +1914,7 @@
17721914 csg.addChild(child);
17731915 child.addChild(csg);
17741916 } else
1775
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
17761918 {
17771919 Composite csg = new GroupLeaf();
17781920 csg.count = 5;
....@@ -1784,7 +1926,7 @@
17841926 csg.addChild(child);
17851927 child.addChild(csg);
17861928 } else
1787
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
17881930 {
17891931 Composite csg = new GroupLeaf();
17901932 csg.count = 4;
....@@ -1799,71 +1941,71 @@
17991941 csg.addChild(child);
18001942 child.addChild(csg);
18011943 } else
1802
-
1803
- if (event.getSource() == importGFDItem)
1804
- {
1805
- ImportGFD();
1806
- } else
1807
- if (event.getSource() == importVRMLX3DItem)
1808
- {
1809
- ImportVRMLX3D();
1810
- } else
1811
- if (event.getSource() == import3DSItem)
1812
- {
1813
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1814
- } else
1815
- if (event.getSource() == importOBJItem)
1816
- {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1818
- } else
1819
- if (event.getSource() == computeAOItem)
1944
+ if (source == computeAOItem)
18201945 {
18211946 Globals.drawMode = CameraPane.OCCLUSION;
18221947 Globals.theRenderer.repaint();
18231948 } else
1824
- if (event.getSource() == recompileItem)
1949
+ if (source == recompileItem)
18251950 {
18261951 Recompile();
18271952 refreshContents();
18281953 } else
1829
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
18301955 {
18311956 OpenDialog();
18321957 refreshContents();
18331958 } else
1834
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
18351960 {
18361961 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
18381963 } else
1839
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
18401965 {
18411966 //System.out.println("Invariants:");
18421967 PrintMemory();
18431968 } else
1844
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
18451970 {
18461971 PrintPath();
18471972 } else
1848
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
18491974 {
18501975 AnalyzeObject();
18511976 } else
1852
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
18531978 {
18541979 DumpObject();
18551980 } else
1856
- if (event.getSource() == screenfitButton)
1981
+ if (source == undoButton)
1982
+ {
1983
+ Undo();
1984
+ } else
1985
+ if (source == redoButton)
1986
+ {
1987
+ Redo();
1988
+ } else
1989
+ if (source == saveButton)
1990
+ {
1991
+ Save();
1992
+ } else
1993
+ if (source == oneStepButton)
1994
+ {
1995
+ Globals.ONESTEP = true;
1996
+ cameraView.repaint();
1997
+ } else
1998
+ if (source == screenfitButton)
18571999 {
18582000 //Reload(lastConverter, lastFilename, true);
18592001 ScreenFit();
18602002 } else
1861
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
18622004 {
18632005 //Reload(lastConverter, lastFilename, true);
18642006 ScreenFitPoint();
18652007 } else
1866
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
18672009 {
18682010 //Reload(lastConverter, lastFilename, true);
18692011 SnapObject();
....@@ -1874,13 +2016,13 @@
18742016 // Recompile();
18752017 // refreshContents();
18762018 // } else
1877
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
18782020 {
18792021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802022 System.gc();
18812023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822024 } else
1883
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
18842026 {
18852027 Object3D obj;
18862028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2036,74 @@
18942036 }
18952037 refreshContents(true);
18962038 } else
1897
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
18982040 {
18992041 EditSelection(true);
19002042 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
19022044 {
19032045 loadClipboard(true);
19042046 } else
1905
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
19062048 {
1907
- Object3D keep = GrafreeD.clipboard;
2049
+ Undo();
2050
+ } else
2051
+ if (source == redoItem)
2052
+ {
2053
+ Redo();
2054
+ } else
2055
+ if (source == duplicateItem)
2056
+ {
2057
+ Object3D keep = Grafreed.clipboard;
19082058 loadClipboard(false);
19092059 paste(false);
1910
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
19112061 } else
1912
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
19132063 {
19142064 CloneSelection(false);
19152065 } else
1916
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
19172067 {
19182068 CloneSelection(true);
19192069 } else
1920
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
19212071 {
19222072 loadClipboard(false);
19232073 } else
1924
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
19252075 {
19262076 paste(false);
19272077 } else
1928
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
19292079 {
1930
- pasteInto(false);
2080
+ pasteInto(true, false);
19312081 } else
1932
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
19332083 {
1934
- pasteInto(true);
2084
+ pasteInto(false, false);
19352085 } else
1936
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
19372091 {
19382092 paste(true);
19392093 } else
1940
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
19412095 {
19422096 Overwrite(Object3D.TRANSFORM);
19432097 } else
1944
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
19452099 {
19462100 Overwrite(Object3D.NAME);
19472101 } else
1948
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
19492103 {
19502104 Overwrite(Object3D.UV);
19512105 } else
1952
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
19532107 {
19542108 /* july 2015
19552109 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2123,7 @@
19692123
19702124 Overwrite(dropAttributes);
19712125 }
1972
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
19732127 {
19742128 Overwrite(Object3D.GEOMETRY);
19752129 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2140,7 @@
19862140 // refreshContents();
19872141 // }
19882142 } else
1989
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
19902144 {
19912145 //if (group.selection.size() == 1)
19922146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2151,7 @@
19972151 ResetModel();
19982152 refreshContents();
19992153 } else
2000
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
20012155 {
20022156 boolean one = false;
20032157
....@@ -2024,7 +2178,7 @@
20242178 ResetModel();
20252179 refreshContents();
20262180 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
20282182 {
20292183 boolean one = false;
20302184
....@@ -2050,7 +2204,7 @@
20502204 ResetModel();
20512205 refreshContents();
20522206 } else
2053
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
20542208 {
20552209 boolean one = false;
20562210
....@@ -2080,7 +2234,7 @@
20802234 refreshContents();
20812235 }
20822236 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
20842238 {
20852239 boolean one = false;
20862240
....@@ -2110,7 +2264,7 @@
21102264 ResetModel();
21112265 refreshContents();
21122266 } else
2113
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
21142268 {
21152269 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162270 // {
....@@ -2123,9 +2277,9 @@
21232277 // group.selection.get(0).setMasterThis(content); // should be identity
21242278 // refreshContents();
21252279 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272281 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
21292283
21302284 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312285 content = ((cGroup)content).get(0);
....@@ -2133,38 +2287,38 @@
21332287 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342288 for (int i=0; i<group.selection.size(); i++)
21352289 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
21382292 group.selection.get(i).linkVerticesThis(content);
21392293 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
21412295 }
21422296 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432297 refreshContents();
21442298 }
21452299 } else
2146
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
21472301 {
21482302 for (int i=0; i<group.selection.size(); i++)
21492303 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
21522306 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
21542308 }
21552309
21562310 refreshContents();
21572311 } else
2158
- if (event.getSource() == relinkverticesItem)
2312
+ if (source == relinkverticesItem)
21592313 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
21622316 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2317
+ CameraPane.SWITCH = random;
21642318
21652319 refreshContents();
21662320 } else
2167
- if (event.getSource() == resetreferencesItem)
2321
+ if (source == resetreferencesItem)
21682322 {
21692323 for (int i=0; i<group.selection.size(); i++)
21702324 {
....@@ -2173,11 +2327,11 @@
21732327
21742328 refreshContents();
21752329 } else
2176
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
21772331 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792333 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21812335
21822336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832337 content = ((cGroup)content).get(0);
....@@ -2186,13 +2340,13 @@
21862340 refreshContents();
21872341 }
21882342 } else
2189
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
21902344 {
21912345 if (group.selection.size() == 1)
21922346 {
2193
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21942348 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21962350
21972351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982352 content = ((cGroup)content).get(0);
....@@ -2205,19 +2359,19 @@
22052359 }
22062360
22072361 } else
2208
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
22092363 {
22102364 RevertMeshes();
22112365 } else
2212
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
22132367 {
22142368 ResetAll();
22152369 } else
2216
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
22172371 {
22182372 StepAll();
22192373 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
22212375 {
22222376 //int indices[] = jList.getSelectedIndices();
22232377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2379,46 @@
22252379
22262380 ClearSelection(false);
22272381 } else
2228
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
22292383 {
22302384 ClearSelection(true);
22312385 } else
2232
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
22332387 {
22342388 group(new cGroup(), true);
22352389 } else
2236
- if (event.getSource() == hideItem)
2390
+ if (source == hideItem)
22372391 {
22382392 group(new HiddenObject());
22392393 } else
2240
- if (event.getSource() == frontItem)
2394
+ if (source == frontItem)
22412395 {
22422396 front();
22432397 } else
2244
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
22452399 {
22462400 back();
22472401 } else
2248
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
22492403 {
22502404 makeSomething(new Camera());
22512405 } else
2252
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
22532407 {
22542408 group(new Composite());
22552409 } else
2256
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
22572411 {
22582412 RandomNode random = new RandomNode();
22592413 group(random);
22602414 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
22622416 } else
2263
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
22642418 {
22652419 group(new PhysicsNode());
22662420 } else
2267
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
22682422 {
22692423 for (int i=0; i<group.selection.size(); i++)
22702424 {
....@@ -2276,7 +2430,7 @@
22762430 ResetModel();
22772431 refreshContents();
22782432 } else
2279
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
22802434 {
22812435 for (int i=0; i<group.selection.size(); i++)
22822436 {
....@@ -2288,7 +2442,7 @@
22882442 ResetModel();
22892443 refreshContents();
22902444 } else
2291
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
22922446 {
22932447 for (int i=0; i<group.selection.size(); i++)
22942448 {
....@@ -2300,7 +2454,7 @@
23002454 ResetModel();
23012455 refreshContents();
23022456 } else
2303
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
23042458 {
23052459 for (int i=0; i<group.selection.size(); i++)
23062460 {
....@@ -2312,7 +2466,7 @@
23122466 ResetModel();
23132467 refreshContents();
23142468 } else
2315
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
23162470 {
23172471 boolean atleastone = false;
23182472
....@@ -2351,31 +2505,31 @@
23512505 }
23522506 }
23532507 } else
2354
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
23552509 {
23562510 group(new cLinker());
23572511 } else
2358
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
23592513 {
23602514 group(new TextureNode());
23612515 } else
2362
- if (event.getSource() == billboardItem)
2516
+ if (source == billboardItem)
23632517 {
23642518 group(new BillboardNode());
23652519 } else
2366
- if (event.getSource() == shadowXItem)
2520
+ if (source == shadowXItem)
23672521 {
23682522 CastShadow(0);
23692523 } else
2370
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
23712525 {
23722526 CastShadow(1);
23732527 } else
2374
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
23752529 {
23762530 CastShadow(2);
23772531 } else
2378
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
23792533 {
23802534 //ungroup();
23812535 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2541,203 @@
23872541
23882542 refreshContents();
23892543 } else
2390
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
23912545 {
23922546 GenUV();
23932547 } else
2394
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
23952549 {
23962550 GenNormals(true);
23972551 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2552
+ if (source == genNormalsMESHItem)
23992553 {
2400
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
24012555 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2556
+ if (source == genNormalsORGANItem)
24032557 {
24042558 GenNormals(false);
24052559 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2560
+ if (source == genNormalsMINEItem)
24072561 {
24082562 GenNormalsMINE();
24092563 } else
2410
- if (event.getSource() == stripifyItem)
2564
+ if (source == stripifyItem)
24112565 {
24122566 Stripify();
24132567 } else
2414
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
24152569 {
24162570 Unstripify();
24172571 } else
2418
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
24192573 {
24202574 Trim();
24212575 } else
2422
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
24232577 {
24242578 Untrim();
24252579 } else
2426
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
24272581 {
24282582 ClearColors();
24292583 } else
2430
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
24312585 {
24322586 ClearMaterials();
24332587 } else
2434
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
24352589 {
24362590 LiveLeaves(true);
24372591 } else
2438
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
24392593 {
24402594 LiveLeaves(false);
24412595 } else
2442
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
24432597 {
24442598 SupportLeaves(true);
24452599 } else
2446
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
24472601 {
24482602 SupportLeaves(false);
24492603 } else
2450
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
24512605 {
24522606 HideLeaves(true);
24532607 } else
2454
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
24552609 {
24562610 HideLeaves(false);
24572611 } else
2458
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
24592613 {
24602614 MarkLeaves(true);
24612615 } else
2462
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
24632617 {
24642618 MarkLeaves(false);
24652619 } else
2466
- if (event.getSource() == flipVItem)
2620
+ if (source == rewindleavesItem)
2621
+ {
2622
+ RewindLeaves(true);
2623
+ } else
2624
+ if (source == unrewindleavesItem)
2625
+ {
2626
+ RewindLeaves(false);
2627
+ } else
2628
+ if (source == randomleavesItem)
2629
+ {
2630
+ RandomLeaves(true);
2631
+ } else
2632
+ if (source == unrandomleavesItem)
2633
+ {
2634
+ RandomLeaves(false);
2635
+ } else
2636
+ if (source == flipVItem)
24672637 {
24682638 FlipV(true);
24692639 } else
2470
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
24712641 {
24722642 FlipV(false);
24732643 } else
2474
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
24752645 {
24762646 SetTexRes(0);
24772647 } else
2478
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
24792649 {
24802650 SetTexRes(1);
24812651 } else
2482
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
24832653 {
24842654 SetTexRes(2);
24852655 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
24872657 {
24882658 SetTexRes(3);
24892659 } else
2490
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
24912661 {
24922662 SetTexRes(4);
24932663 } else
2494
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
24952665 {
24962666 SetTexRes(5);
24972667 } else
2498
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
24992669 {
25002670 ReverseNormals();
25012671 } else
2502
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
25032673 {
25042674 ParseVertices();
25052675 } else
2506
- if (event.getSource() == textureFieldItem)
2676
+ if (source == textureFieldItem)
25072677 {
25082678 TextureVertices();
25092679 } else
2510
- if (event.getSource() == alignItem)
2680
+ if (source == alignItem)
25112681 {
25122682 Align();
25132683 } else
2514
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
25152685 {
25162686 MirrorPoses();
25172687 } else
2518
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
25192689 {
25202690 MeshReduction(false);
25212691 } else
2522
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
25232693 {
25242694 MeshReduction(true);
25252695 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
25272697 {
25282698 ReverseTriangles();
25292699 } else
2530
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
25312701 {
25322702 ReduceMesh(false);
25332703 } else
2534
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
25352705 {
25362706 ReduceMesh(true);
25372707 } else
2538
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
25392709 {
25402710 IncreaseMesh();
25412711 } else
2542
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
25432713 {
25442714 ClipMesh();
25452715 } else
2546
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
25472717 {
25482718 SmoothMesh();
25492719 } else
2550
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
25512721 {
25522722 TransformGeometry();
25532723 } else
2554
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
25552729 {
25562730 ResetTransform();
25572731 } else
2558
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
25592733 {
2560
- ResetCentroid();
2734
+ ResetCentroid(true);
25612735 } else
2562
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
25632741 {
25642742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652743 {
....@@ -2569,7 +2747,7 @@
25692747
25702748 refreshContents();
25712749 } else
2572
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
25732751 {
25742752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752753 {
....@@ -2583,7 +2761,7 @@
25832761
25842762 refreshContents();
25852763 } else
2586
- if (event.getSource() == repairShadowItem)
2764
+ if (source == repairShadowItem)
25872765 {
25882766 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892767 {
....@@ -2597,7 +2775,7 @@
25972775
25982776 refreshContents();
25992777 } else
2600
- if (event.getSource() == sortbysizeItem)
2778
+ if (source == sortbysizeItem)
26012779 {
26022780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032781 {
....@@ -2609,7 +2787,7 @@
26092787 ResetModel();
26102788 refreshContents();
26112789 } else
2612
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
26132791 {
26142792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152793 {
....@@ -2621,7 +2799,7 @@
26212799 ResetModel();
26222800 refreshContents();
26232801 } else
2624
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
26252803 {
26262804 String texture = GetFile("Attach pigment");
26272805 Object3D obj;
....@@ -2633,7 +2811,7 @@
26332811
26342812 refreshContents();
26352813 } else
2636
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
26372815 {
26382816 Object3D obj;
26392817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2822,7 @@
26442822
26452823 refreshContents();
26462824 } else
2647
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
26482826 {
26492827 String texture = GetFile("Attach bump");
26502828 Object3D obj;
....@@ -2656,7 +2834,7 @@
26562834
26572835 refreshContents();
26582836 } else
2659
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
26602838 {
26612839 Object3D obj;
26622840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2845,7 @@
26672845
26682846 refreshContents();
26692847 } else
2670
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
26712849 {
26722850 Object3D obj;
26732851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2856,195 @@
26782856
26792857 refreshContents();
26802858 } else
2681
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
26822860 {
26832861 CameraPane.flash = true;
26842862 refreshContents();
26852863 } else
2686
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
26872865 {
26882866 } else
2689
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
26902868 {
26912869 radio.layout = twoButton;
26922870 // bug
26932871 //gridPanel.setDividerLocation(1.0);
26942872 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
2873
+// bigThree.remove(scenePanel);
2874
+// bigThree.remove(centralPanel);
2875
+// bigThree.remove(XYZPanel);
2876
+// aWindowConstraints.gridx = 0;
2877
+// aWindowConstraints.gridy = 0;
2878
+// aWindowConstraints.gridwidth = 1;
2879
+// // aConstraints.gridheight = 3;
2880
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2881
+// aWindowConstraints.weightx = 0;
2882
+// aWindowConstraints.weighty = 1;
2883
+// //bigThree.add(jtp, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 1;
2885
+// aWindowConstraints.gridwidth = 3;
2886
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.gridx = 1;
2888
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2889
+// bigThree.add(centralPanel, aWindowConstraints);
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.gridx = 4;
2892
+// aWindowConstraints.gridwidth = 1;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2895
+// //bigThree.add(XYZPanel, aWindowConstraints);
2896
+// scenePanel.setVisible(false);
2897
+// centralPanel.setVisible(true);
2898
+// XYZPanel.setVisible(false);
2899
+ bigThree.ClearUI();
2900
+ bigThree.add(centralPanel);
2901
+ bigThree.FlushUI();
27192902 } else
2720
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
27212904 {
27222905 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
2906
+
2907
+// bigThree.remove(scenePanel);
2908
+// bigThree.remove(centralPanel);
2909
+// bigThree.remove(XYZPanel);
2910
+// aWindowConstraints.gridx = 0;
2911
+// aWindowConstraints.gridy = 0;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// aWindowConstraints.weightx = 0;
2916
+// aWindowConstraints.weighty = 1;
2917
+// //bigThree.add(jtp, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 1;
2919
+// aWindowConstraints.gridwidth = 3;
2920
+// // aConstraints.gridheight = 3;
2921
+// aWindowConstraints.gridx = 1;
2922
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2923
+// bigThree.add(centralPanel, aWindowConstraints);
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.gridx = 4;
2926
+// aWindowConstraints.gridwidth = 1;
2927
+// // aConstraints.gridheight = 3;
2928
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2929
+// bigThree.add(XYZPanel, aWindowConstraints);
2930
+// bigThree.validate();
2931
+// scenePanel.setVisible(false);
2932
+// centralPanel.setVisible(true);
2933
+// XYZPanel.setVisible(true);
2934
+ bigThree.ClearUI();
2935
+ bigThree.add(centralPanel);
2936
+ bigThree.add(XYZPanel);
2937
+ bigThree.FlushUI();
27472938 } else
2748
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
27492940 {
27502941 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
2942
+
2943
+// bigThree.remove(scenePanel);
2944
+// bigThree.remove(centralPanel);
2945
+// bigThree.remove(XYZPanel);
2946
+// aWindowConstraints.gridx = 0;
2947
+// aWindowConstraints.gridy = 0;
2948
+// aWindowConstraints.gridwidth = 1;
2949
+// // aWindowConstraints.gridheight = 3;
2950
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2951
+// aWindowConstraints.weightx = 1;
2952
+// aWindowConstraints.weighty = 1;
2953
+// bigThree.add(scenePanel, aWindowConstraints);
2954
+// aWindowConstraints.weightx = 1;
2955
+// aWindowConstraints.gridwidth = 3;
2956
+// // aConstraints.gridheight = 3;
2957
+// aWindowConstraints.gridx = 1;
2958
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2959
+// //bigThree.add(cameraPanel, aWindowConstraints);
2960
+// aWindowConstraints.weightx = 0;
2961
+// aWindowConstraints.gridx = 4;
2962
+// aWindowConstraints.gridwidth = 1;
2963
+// // aWindowConstraints.gridheight = 3;
2964
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2965
+// //bigThree.add(XYZPanel, aWindowConstraints);
2966
+// bigThree.validate();
2967
+// scenePanel.setVisible(true);
2968
+// centralPanel.setVisible(false);
2969
+// XYZPanel.setVisible(false);
2970
+ bigThree.ClearUI();
2971
+ bigThree.add(scenePanel);
2972
+ bigThree.FlushUI();
27752973 } else
2776
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
27772975 {
27782976 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
2977
+
2978
+// bigThree.remove(scenePanel);
2979
+// bigThree.remove(centralPanel);
2980
+// bigThree.remove(XYZPanel);
2981
+// aWindowConstraints.gridx = 0;
2982
+// aWindowConstraints.gridy = 0;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// aWindowConstraints.weightx = 0;
2987
+// aWindowConstraints.weighty = 1;
2988
+// bigThree.add(scenePanel, aWindowConstraints);
2989
+// aWindowConstraints.weightx = 1;
2990
+// aWindowConstraints.gridwidth = 3;
2991
+// // aWindowConstraints.gridheight = 3;
2992
+// aWindowConstraints.gridx = 1;
2993
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2994
+// bigThree.add(centralPanel, aWindowConstraints);
2995
+// aWindowConstraints.weightx = 0;
2996
+// aWindowConstraints.gridx = 4;
2997
+// aWindowConstraints.gridwidth = 1;
2998
+// // aWindowConstraints.gridheight = 3;
2999
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3000
+// //bigThree.add(XYZPanel, aConstraints);
3001
+// bigThree.validate();
3002
+// scenePanel.setVisible(true);
3003
+// centralPanel.setVisible(true);
3004
+// XYZPanel.setVisible(false);
3005
+ bigThree.ClearUI();
3006
+ bigThree.add(scenePanel);
3007
+ bigThree.add(centralPanel);
3008
+ bigThree.FlushUI();
28033009 } else
2804
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
28053011 {
28063012 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
3013
+
3014
+// bigThree.remove(scenePanel);
3015
+// bigThree.remove(centralPanel);
3016
+// bigThree.remove(XYZPanel);
3017
+// aWindowConstraints.gridx = 0;
3018
+// aWindowConstraints.gridy = 0;
3019
+// aWindowConstraints.gridwidth = 1;
3020
+// // aWindowConstraints.gridheight = 3;
3021
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3022
+// aWindowConstraints.weightx = 0;
3023
+// aWindowConstraints.weighty = 1;
3024
+// bigThree.add(scenePanel, aWindowConstraints);
3025
+// aWindowConstraints.weightx = 1;
3026
+// aWindowConstraints.gridwidth = 3;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.gridx = 1;
3029
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3030
+// bigThree.add(centralPanel, aWindowConstraints);
3031
+// aWindowConstraints.weightx = 0;
3032
+// aWindowConstraints.gridx = 4;
3033
+// aWindowConstraints.gridwidth = 1;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3036
+// bigThree.add(XYZPanel, aWindowConstraints);
3037
+// bigThree.validate();
3038
+// scenePanel.setVisible(true);
3039
+// centralPanel.setVisible(true);
3040
+// XYZPanel.setVisible(true);
3041
+ bigThree.ClearUI();
3042
+ bigThree.add(scenePanel);
3043
+ bigThree.add(centralPanel);
3044
+ bigThree.add(XYZPanel);
3045
+ bigThree.FlushUI();
28313046 } else
2832
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
28333048 {
28343049 Object3D obj;
28353050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +3056,7 @@
28413056
28423057 refreshContents(true);
28433058 } else
2844
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
28453060 {
28463061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473062 cRadio ab;
....@@ -2862,11 +3077,11 @@
28623077 }
28633078 refreshContents(true);
28643079 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
28663081 {
28673082 EditSelection(false);
28683083 } else
2869
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
28703085 {
28713086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723087 {
....@@ -2876,14 +3091,14 @@
28763091 child.CloseUI();
28773092 listUI.remove(child);
28783093
2879
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
28803095 }
2881
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
28823097 //objEditor.jTree.clearSelection();
28833098 //objEditor.ResetSliders();
28843099 refreshContents(true);
28853100 } else
2886
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
28873102 {
28883103 assert(copy == group);
28893104 //copy.ClearUI();
....@@ -2894,7 +3109,7 @@
28943109 listUI.clear();
28953110 refreshContents(true);
28963111 } else
2897
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
28983113 {
28993114 assert(copy == group);
29003115
....@@ -2915,19 +3130,19 @@
29153130
29163131 refreshContents(true);
29173132 } else
2918
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
29193134 {
29203135 objEditor.jTree.clearSelection();
29213136 // ?? oct 2012 GrafreeD.clipboard.clear();
29223137 objEditor.ResetSliders();
29233138 refreshContents(true);
29243139 } else
2925
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
29263141 {
29273142 group.parent = keepparent;
29283143 group.attributes = 0;
29293144 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
29313146 Object3D obj = radio.GetObject();
29323147 System.out.println("Edit " + obj);
29333148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3177,10 @@
29623177 frontView.object = group;
29633178 sideView.object = group;
29643179 }
3180
+
3181
+// fix "+" issue
29653182 group.editWindow = this;
3183
+
29663184 /*
29673185 currentLayout = radio.layout;
29683186 if (currentLayout == null)
....@@ -2975,7 +3193,20 @@
29753193 //group.attributes = -1;
29763194 ResetModel();
29773195 refreshContents(true);
2978
- }
3196
+ } else if (event.getSource() == editCameraItem)
3197
+ {
3198
+ cameraView.ProtectCamera();
3199
+ cameraView.repaint();
3200
+ return;
3201
+ } else if (event.getSource() == revertCameraItem)
3202
+ {
3203
+ cameraView.RevertCamera();
3204
+ cameraView.repaint();
3205
+ return;
3206
+ // } else if (event.getSource() == textureButton)
3207
+ // {
3208
+ // return; // true;
3209
+ }
29793210 else
29803211 {
29813212 //return super.action(event, arg);
....@@ -3036,6 +3267,28 @@
30363267 refreshContents();
30373268 }
30383269
3270
+ void TransformChildren()
3271
+ {
3272
+ Object3D obj;
3273
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3274
+ {
3275
+ obj = (Object3D)e.nextElement();
3276
+ obj.KeepTextureMatrices();
3277
+ obj.TransformChildren();
3278
+ obj.RestoreTextureMatrices();
3279
+
3280
+// if (obj.parent == null)
3281
+// {
3282
+// System.out.println("NULL PARENT!");
3283
+// new Exception().printStackTrace();
3284
+// }
3285
+// else
3286
+// TouchTransform(obj);
3287
+// //obj.parent.Touch();
3288
+ }
3289
+
3290
+ refreshContents();
3291
+ }
30393292
30403293 void ResetTransform()
30413294 {
....@@ -3148,7 +3401,7 @@
31483401 refreshContents();
31493402 }
31503403
3151
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
31523405 {
31533406 Object3D obj;
31543407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3416,16 @@
31633416 LA.matIdentity(Object3D.mat);
31643417 obj.getBounds(minima, maxima, false);
31653418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683422 obj.TransformMesh(Object3D.mat);
3423
+
31693424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
31723429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3454,8 @@
31973454
31983455 int size = obj.MemorySize();
31993456
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
3457
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3458
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32013459 }
32023460 }
32033461 catch (Exception e)
....@@ -3234,9 +3492,9 @@
32343492 obj = (Object3D)e.nextElement();
32353493
32363494 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
32383496 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
32403498
32413499 // System.err.println((size/1024) + " KB is the size of " + obj);
32423500 }
....@@ -3278,6 +3536,13 @@
32783536 void GenNormals(boolean crease)
32793537 {
32803538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
32813546
32823547 refreshContents();
32833548 }
....@@ -3450,8 +3715,8 @@
34503715
34513716 void ParseVertices()
34523717 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
34553720
34563721 for (int i=0; i<group.selection.size(); i++)
34573722 {
....@@ -3476,7 +3741,7 @@
34763741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783743
3479
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
34803745
34813746 buffer.add(g);
34823747 }
....@@ -3491,7 +3756,7 @@
34913756 makeSomething(buffer, i==group.selection.size()-1);
34923757 }
34933758
3494
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
34953760
34963761 refreshContents();
34973762 }
....@@ -3509,7 +3774,16 @@
35093774 String pigment = Object3D.GetPigment(tex);
35103775 //String bump = Object3D.GetBump(tex);
35113776
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3777
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3778
+
3779
+ try
3780
+ {
3781
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3782
+ }
3783
+ catch (Exception e)
3784
+ {
3785
+ System.err.println("FAIL: " + node);
3786
+ }
35133787
35143788 double s = v.s;
35153789
....@@ -3597,11 +3871,11 @@
35973871
35983872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993873
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
36023876 lowres.linkVerticesThis(null);
36033877 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
36053879
36063880 System.err.flush();
36073881
....@@ -3641,7 +3915,7 @@
36413915 return;
36423916
36433917 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
36453919
36463920 Object3D newgroup = new Object3D("Po:" + poses.name);
36473921
....@@ -3835,9 +4109,9 @@
38354109
38364110 void ClipMesh()
38374111 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394113 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
38414115
38424116 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434117 content = ((cGroup)content).get(0);
....@@ -3846,7 +4120,7 @@
38464120 // {
38474121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484122 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
38504124 }
38514125 // group.selection.ClipMesh(GrafreeD.clipboard);
38524126 System.out.println("DONE.");
....@@ -3893,6 +4167,18 @@
38934167 void MarkLeaves(boolean hide)
38944168 {
38954169 group.selection.MarkLeaves(hide);
4170
+ refreshContents();
4171
+ }
4172
+
4173
+ void RewindLeaves(boolean hide)
4174
+ {
4175
+ group.selection.RewindLeaves(hide);
4176
+ refreshContents();
4177
+ }
4178
+
4179
+ void RandomLeaves(boolean hide)
4180
+ {
4181
+ group.selection.RandomLeaves(hide);
38964182 refreshContents();
38974183 }
38984184
....@@ -3981,7 +4267,7 @@
39814267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824268
39834269 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4270
+ if(elem != group || !newWindow)
39854271 {
39864272 // if (!(elem instanceof Composite))
39874273 // newWindow = false;
....@@ -4071,7 +4357,6 @@
40714357 //case 702: // Event.LIST_DESELECT
40724358 group.deselectAll();
40734359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754360 if (tps != null)
40764361 {
40774362 for (int i=0; i < tps.length; i++)
....@@ -4080,29 +4365,28 @@
40804365
40814366 //if (child.parent != null)
40824367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
40834369 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874370 }
40884371 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
40954378
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4379
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40994380 CameraPane.flash = true;
41004381
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024383 // a camera
41034384 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4385
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4386
+ {
4387
+ CameraPane.camerachangeframe = 0; // don't refuse it
4388
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4389
+ }
41064390 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074391 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084392 }
....@@ -4115,6 +4399,26 @@
41154399
41164400 freezemodel = false;
41174401 }
4402
+
4403
+ void refreshContents(boolean cp)
4404
+ {
4405
+ if (!Globals.MOUSEDRAGGED)
4406
+ {
4407
+ objEditor.ClearInfo(); // .GetMaterial());
4408
+
4409
+ for (int i=0; i < group.selection.Size(); i++)
4410
+ {
4411
+ Object3D child = (Object3D) group.selection.get(i);
4412
+
4413
+ objEditor.AddInfo(child, this, true);
4414
+ System.err.println("info : " + child.GetPath());
4415
+ }
4416
+
4417
+ objEditor.SetText(); // jan 2014
4418
+ }
4419
+
4420
+ super.refreshContents(cp);
4421
+ }
41184422
41194423 void linkSomething(Object3D thing)
41204424 {
....@@ -4186,16 +4490,18 @@
41864490 {
41874491 if (group.selection.isEmpty())
41884492 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
41904495 Composite tGroup = null;
41914496 if (group.selection.size() > 0) // 1)
41924497 {
41934498 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
41954500 }
41964501
41974502 if (cut)
41984503 {
4504
+ Save();
41994505 //int indices[] = jList.getSelectedIndices();
42004506 //for (int i = indices.length - 1; i >= 0; i--)
42014507 //jList.remove(indices[i]);
....@@ -4231,16 +4537,16 @@
42314537 //System.out.println("cut " + child);
42324538 //System.out.println("parent = " + child.parent);
42334539 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
42354541 tGroup.add/*Child*/(tmp);
42364542 else
4237
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
42384544 }
42394545 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
42414547 tGroup.add/*Child*/(child);
42424548 else
4243
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
42444550 }
42454551
42464552 //ResetModel();
....@@ -4272,21 +4578,23 @@
42724578 //System.out.println("cut " + elem);
42734579 //System.out.println("parent = " + elem.parent);
42744580 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
42764582 tGroup.add/*Child*/(tmp);
42774583 else
4278
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
42794585 }
42804586 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
42824588 tGroup.add/*Child*/(child);
42834589 else
4284
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
42854591 }
42864592
42874593 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
42904598 if (cut)
42914599 {
42924600 ResetModel();
....@@ -4300,7 +4608,7 @@
43004608 // return;
43014609 boolean first = true;
43024610
4303
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
43044612 {
43054613 Composite temp;
43064614
....@@ -4311,7 +4619,7 @@
43114619 temp = (Composite)Applet3D.clipboard.deepCopy();
43124620 */
43134621 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4622
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154623 {
43164624 Object3D child = (Object3D)e.nextElement();
43174625
....@@ -4345,21 +4653,21 @@
43454653 //Object3D cb = Applet3D.clipboard;
43464654 //temp.addChild(cb);
43474655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4348
- assert(GrafreeD.clipboard.parent == null);
4349
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4350
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4351
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4352
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4656
+ assert(Grafreed.clipboard.parent == null);
4657
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4658
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4659
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4660
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534661 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
43564664 }
43574665
43584666 ResetModel();
43594667 refreshContents();
43604668 }
43614669
4362
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
43634671 {
43644672 // if (GrafreeD.clipboard == null)
43654673 // return;
....@@ -4388,15 +4696,22 @@
43884696 if (copyit)
43894697 {
43904698 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
43924707 }
43934708 else
43944709 {
43954710 boolean first = true;
43964711
4397
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
43984713 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
44004715 Object3D copy;
44014716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024717 {
....@@ -4406,7 +4721,7 @@
44064721 }
44074722 } else
44084723 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
44104725 }
44114726 }
44124727 }
....@@ -4811,21 +5126,6 @@
48115126 }
48125127 */
48135128
4814
- void ImportGFD()
4815
- {
4816
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4817
- browser.show();
4818
- String filename = browser.getFile();
4819
- if (filename != null && filename.length() > 0)
4820
- {
4821
- String fullname = browser.getDirectory() + filename;
4822
-
4823
- //Object3D readobj =
4824
- objEditor.ReadGFD(fullname, objEditor);
4825
- //makeSomething(readobj);
4826
- }
4827
- }
4828
-
48295129 /*
48305130 public void Callback(Object obj)
48315131 {
....@@ -4849,26 +5149,9 @@
48495149 }
48505150 */
48515151
4852
- void ImportVRMLX3D()
4853
- {
4854
- if (GrafreeD.standAlone)
4855
- {
4856
- /**/
4857
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4858
- browser.show();
4859
- String filename = browser.getFile();
4860
- if (filename != null && filename.length() > 0)
4861
- {
4862
- String fullname = browser.getDirectory() + filename;
4863
- LoadVRMLX3D(fullname);
4864
- }
4865
- /**/
4866
- }
4867
- }
4868
-
48695152 String GetFile(String dialogName)
48705153 {
4871
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
48725155 {
48735156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745157 browser.show();
....@@ -4932,10 +5215,15 @@
49325215 cButton flashSelectionButton;
49335216 cButton editButton;
49345217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
49355219 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375220 cButton unselectButton;
49385221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
49395227 cButton screenfitButton;
49405228 cButton screenfitpointButton;
49415229 cButton snapobjectButton;
....@@ -4966,6 +5254,8 @@
49665254 private MenuItem lookFromItem;
49675255 private MenuItem switchItem;
49685256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
49695259 private MenuItem duplicateItem;
49705260 private MenuItem cloneItem;
49715261 private MenuItem cloneSupportItem;
....@@ -4979,7 +5269,7 @@
49795269 private MenuItem linkverticesItem;
49805270 private MenuItem relinkverticesItem;
49815271 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
49835273 private MenuItem stepAllItem;
49845274 private MenuItem revertMeshItem;
49855275 private MenuItem poseMeshItem;
....@@ -4990,6 +5280,7 @@
49905280 private MenuItem mergeGeometriesItem;
49915281 private MenuItem copyItem;
49925282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
49935284 private MenuItem pasteLinkItem;
49945285 private MenuItem pasteCloneItem;
49955286 private MenuItem pasteExpandItem;
....@@ -5028,6 +5319,10 @@
50285319 private MenuItem showleavesItem;
50295320 private MenuItem markleavesItem;
50305321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
50315326
50325327 private MenuItem flipVItem;
50335328 private MenuItem unflipVItem;
....@@ -5039,8 +5334,10 @@
50395334 private MenuItem panoTexturesItem;
50405335
50415336 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
50435338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
50445341 private MenuItem hideItem;
50455342 private MenuItem grabItem;
50465343 private MenuItem backItem;
....@@ -5087,7 +5384,7 @@
50875384 private MenuItem blobItem;
50885385 private MenuItem latheItem;
50895386 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
50915388 private MenuItem meshItem;
50925389 // private MenuItem meshGroupItem;
50935390 private MenuItem springItem;
....@@ -5109,11 +5406,6 @@
51095406 private MenuItem doubleItem;
51105407 private MenuItem tripleItem;
51115408
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175409 private MenuItem computeAOItem;
51185410 private MenuItem recompileItem;
51195411 private MenuItem editScriptItem;
....@@ -5123,4 +5415,8 @@
51235415 private MenuItem analyzeItem;
51245416 private MenuItem dumpItem;
51255417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
51265422 }