Normand Briere
2019-06-17 26b49d8e26625491f4a407a05e9bc9d72037f938
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"));
....@@ -376,29 +505,22 @@
376505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377506 sortbynameItem.addActionListener(this);
378507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
379515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380516 extractGeometriesItem.addActionListener(this);
381517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382518 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);
519
+ }
387520
388521 oe.menuBar.add(menu = new Menu("Insert"));
389522 buildCreateMenu(menu);
390523
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
-
402524 oe.menuBar.add(menu = new Menu("Tools"));
403525 buildToolsMenu(menu);
404526 }
....@@ -433,110 +555,110 @@
433555 oe.radioPanel.add(dummyButton);
434556 oe.buttonGroup.add(dummyButton);
435557 */
436
- aConstraints.gridy += 1;
437
-
438558 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439559
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
442563
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
445574 liveCB.addItemListener(this);
446575
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
582
+ fastCB.addItemListener(this);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449585 trackCB.setToolTipText("Enable tracking");
450586 trackCB.addItemListener(this);
451587
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454589 screenfitButton.setToolTipText("Screen fit");
455590 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
591
+
457592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458593 // 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;
464594
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);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471603 flashSelectionButton.setToolTipText("Show selection");
472604 flashSelectionButton.addActionListener(this);
473605
474
- oe.toolbarPanel.add(new cButton(" ", false));
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475607
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);
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482609 twoButton.setToolTipText("Show center view only");
483610 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485612 fourButton.addActionListener(this);
486613 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488615 sixButton.setToolTipText("2-column layout left");
489616 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491618 threeButton.setToolTipText("2-column layout right");
492619 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494621 sevenButton.setToolTipText("3-column layout");
495622 sevenButton.addActionListener(this);
496623 //
497624
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
500627 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503630 closeButton.setToolTipText("Close tab");
504631 closeButton.addActionListener(this);
505632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506633 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508634
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
511639 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515640
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
517643 uneditButton.addActionListener(this);
518644
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);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
531647 allParamsButton.addActionListener(this);
532648
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);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
538655 unselectButton.addActionListener(this);
539656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
540662 // oe.aConstraints.gridx += 1;
541663 // oe.aConstraints.weighty = 0;
542664 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +670,37 @@
548670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549671 // gcButton.addActionListener(this);
550672
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;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
562676 //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);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564678 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
569682
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);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
574687 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
577691 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
580695 textureCB.addItemListener(this);
581696
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
584700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
585704 //jList.addListSelectionListener(this);
586705 oe.jTree.addTreeSelectionListener(this);
587706 //jTree.setRootVisible(false);
....@@ -604,45 +723,37 @@
604723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605724 }
606725
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608727 {
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);
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639729 boxCB.setToolTipText("Display bounding boxes");
640730 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643733 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644734 zoomBoxCB.addItemListener(this);
645735
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
646757 // constraints.gridy += 1;
647758 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648759 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +761,16 @@
650761 if (false)
651762 {
652763 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655766 speakerCameraCB.addItemListener(this);
656767
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659770 speakerFocusCB.addItemListener(this);
660771
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663774 smoothfocusCB.addItemListener(this);
664775 }
665776
....@@ -667,14 +778,20 @@
667778 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668779 // debugCB.addItemListener(this);
669780
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672782 oeilCB.addItemListener(this);
673783
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676785 lookAtCB.setToolTipText("Look-at target");
677786 lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
678795
679796 }
680797
....@@ -689,6 +806,7 @@
689806 buttonGroup.add(radioButton);
690807 radioButton.doClick();
691808 }
809
+
692810 void SetupViews(ObjEditor oe)
693811 {
694812 oe.SetupViews();
....@@ -753,6 +871,7 @@
753871 } else if(e.getSource() == liveCB)
754872 {
755873 cameraView.ToggleLive();
874
+ refreshContents(false);
756875 }
757876 else if(e.getSource() == supportCB)
758877 {
....@@ -905,7 +1024,9 @@
9051024 // objEditor.DropFile((java.io.File[]) object, true);
9061025 // return;
9071026 // }
908
- if (string.charAt(0) == '/')
1027
+
1028
+ // File path for Mac and Windows
1029
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091030 {
9101031 // file(s)
9111032 String[] names = string.split("\n");
....@@ -932,7 +1053,7 @@
9321053
9331054 flashIt = false;
9341055 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1056
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361057 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371058
9381059 if (group.selection.size() == 1)
....@@ -959,11 +1080,11 @@
9591080 {
9601081 loadClipboard(true);
9611082 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1083
+ pasteInto(false, false);
9631084 } else {
9641085 loadClipboard(false);
9651086 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1087
+ pasteInto(false, false); // true); // ???
9671088 }
9681089 }
9691090 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1206,33 @@
10851206 kleinItem.addActionListener(this);
10861207 particleItem = menu.add(new MenuItem("Particle system"));
10871208 particleItem.addActionListener(this);
1209
+ if (Globals.ADVANCED)
1210
+ {
10881211 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891212 ragdollItem.addActionListener(this);
10901213 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911214 ragdoll2Item.addActionListener(this);
1215
+ }
10921216 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1217
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941218 meshItem.addActionListener(this);
10951219 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961220 // meshGroupItem.addActionListener(this);
1221
+ if (Globals.ADVANCED)
1222
+ {
10971223 springItem = menu.add(new MenuItem("Spring"));
10981224 springItem.addActionListener(this);
10991225 flagItem = menu.add(new MenuItem("Flag"));
11001226 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);
11051227 blobItem = menu.add(new MenuItem("Blob"));
11061228 blobItem.addActionListener(this);
11071229 latheItem = menu.add(new MenuItem("Lathe"));
11081230 latheItem.addActionListener(this);
1231
+ }
1232
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1233
+ bezierItem.addActionListener(this);
1234
+ overlayItem = menu.add(new MenuItem("Overlay"));
1235
+ overlayItem.addActionListener(this);
11091236 lightItem = menu.add(new MenuItem("Light"));
11101237 lightItem.addActionListener(this);
11111238 menu.add("-");
....@@ -1115,39 +1242,44 @@
11151242 loopItem.addActionListener(this);
11161243 doubleItem = menu.add(new MenuItem("Fork"));
11171244 doubleItem.addActionListener(this);
1245
+ if (Globals.ADVANCED)
1246
+ {
11181247 tripleItem = menu.add(new MenuItem("Trident"));
11191248 tripleItem.addActionListener(this);
1249
+ }
11201250 }
11211251
11221252 void buildToolsMenu(Menu menu)
11231253 {
11241254 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251255 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1256
+ animationItem.setState(Globals.ANIMATION);
11271257
11281258 menu.add("-");
11291259 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301260 parseverticesItem.addActionListener(this);
11311261 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321262 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1263
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341264 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371265 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381266 reduceMorphItem.addActionListener(this);
11391267 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401268 reduce34MorphItem.addActionListener(this);
1141
-
1269
+ menu.add("-");
11421270 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431271 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451272
1273
+ if (Globals.ADVANCED)
1274
+ {
1275
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1276
+ mirrorItem.addActionListener(this);
1277
+ menu.add("-");
11461278 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471279 memoryItem.addActionListener(this);
11481280 menu.add(analyzeItem = new MenuItem("Analyze"));
11491281 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
11511283 dumpItem.addActionListener(this);
11521284 // menu.add(pathItem = new MenuItem("From-to path"));
11531285 // pathItem.addActionListener(this);
....@@ -1165,6 +1297,7 @@
11651297 menu.add("-");
11661298 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671299 editScriptItem.addActionListener(this);
1300
+ }
11681301 }
11691302
11701303 void ScreenFit()
....@@ -1493,9 +1626,9 @@
14931626
14941627 void Overwrite(int mask)
14951628 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1629
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971630 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1631
+ Object3D content = Grafreed.clipboard.get(0);
14991632
15001633 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011634 content = ((cGroup)content).get(0);
....@@ -1518,6 +1651,7 @@
15181651 //
15191652 public void actionPerformed(ActionEvent event) // , Object arg)
15201653 {
1654
+ Object source = event.getSource();
15211655 /*
15221656 if (event.getSource() == nameField)
15231657 {
....@@ -1529,11 +1663,11 @@
15291663 }
15301664 else
15311665 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1666
+ if (source == lookAtItem || source == lookFromItem)
15331667 {
15341668 ScreenFit();
15351669 } else
1536
- if (event.getSource() == switchItem)
1670
+ if (source == switchItem)
15371671 {
15381672 cVector v1 = new cVector();
15391673 cVector v2 = new cVector();
....@@ -1542,11 +1676,11 @@
15421676 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431677 objEditor.cameraView.repaint();
15441678 } else
1545
- if (event.getSource() == rectoidItem)
1679
+ if (source == rectoidItem)
15461680 {
15471681 makeSomething(new Box());
15481682 } else
1549
- if (event.getSource() == particleItem)
1683
+ if (source == particleItem)
15501684 {
15511685 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521686 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1701,9 @@
15671701 applyExample(particleGeom, "SMOKE");
15681702 makeSomething(particleGeom);
15691703 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1704
+ if (source == ragdollItem || source == ragdoll2Item)
15711705 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1706
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731707
15741708 ragdoll.toParent = LA.newMatrix();
15751709 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1721,7 @@
15871721 } else
15881722 /*
15891723 */
1590
- if (event.getSource() == heightFieldItem)
1724
+ if (source == heightFieldItem)
15911725 {
15921726 Object3D obj = new Object3D();
15931727
....@@ -1625,31 +1759,31 @@
16251759
16261760 makeSomething(obj);
16271761 } else
1628
- if (event.getSource() == gridItem)
1762
+ if (source == gridItem)
16291763 {
16301764 makeSomething(new Grid());
16311765 } else
1632
- if (event.getSource() == ellipsoidItem)
1766
+ if (source == ellipsoidItem)
16331767 {
16341768 makeSomething(new Sphere());
16351769 } else
1636
- if (event.getSource() == coneItem)
1770
+ if (source == coneItem)
16371771 {
16381772 makeSomething(new Cone());
16391773 } else
1640
- if (event.getSource() == torusItem)
1774
+ if (source == torusItem)
16411775 {
16421776 makeSomething(new Torus());
16431777 } else
1644
- if (event.getSource() == superItem)
1778
+ if (source == superItem)
16451779 {
16461780 makeSomething(new Superellipsoid());
16471781 } else
1648
- if (event.getSource() == kleinItem)
1782
+ if (source == kleinItem)
16491783 {
16501784 makeSomething(new Klein());
16511785 } else
1652
- if (event.getSource() == blobItem)
1786
+ if (source == blobItem)
16531787 {
16541788 Blob blob = new Blob();
16551789 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1791,15 @@
16571791 //blob.retile();
16581792 makeSomething(blob);
16591793 } else
1660
- if (event.getSource() == latheItem)
1794
+ if (source == latheItem)
16611795 {
16621796 makeSomething(new Lathe());
16631797 } else
1664
- if (event.getSource() == bezierItem)
1798
+ if (source == bezierItem)
16651799 {
16661800 makeSomething(new BezierSurface());
16671801 } else
1668
- if (event.getSource() == checkerItem)
1802
+ if (source == overlayItem)
16691803 {
16701804 /*
16711805 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1814,7 @@
16801814 */
16811815 makeSomething(new Checker());
16821816 } else
1683
- if (event.getSource() == meshItem)
1817
+ if (source == meshItem)
16841818 {
16851819 Object3D itemtomake = new Object3D();
16861820 Object3D child;
....@@ -1701,35 +1835,35 @@
17011835 makeSomething(child);
17021836 }
17031837 } else
1704
- if (event.getSource() == springItem)
1838
+ if (source == springItem)
17051839 {
17061840 cSpring s = new cSpring();
17071841 s.setup();
17081842 makeSomething(s);
17091843 } else
1710
- if (event.getSource() == flagItem)
1844
+ if (source == flagItem)
17111845 {
17121846 cSpring s = new cFlag();
17131847 s.setup();
17141848 makeSomething(s);
17151849 } else
1716
- if (event.getSource() == lightItem)
1850
+ if (source == lightItem)
17171851 {
17181852 makeSomething(new Light());
17191853 } else
1720
- if (event.getSource() == csgItem)
1854
+ if (source == csgItem)
17211855 {
17221856 group(new CSG());
17231857 } else
1724
- if (event.getSource() == templateItem)
1858
+ if (source == templateItem)
17251859 {
17261860 group(new cTemplate());
17271861 } else
1728
- if (event.getSource() == attributeItem)
1862
+ if (source == attributeItem)
17291863 {
17301864 makeSomething(new Attribute());
17311865 } else
1732
- if (event.getSource() == pointflowItem)
1866
+ if (source == pointflowItem)
17331867 {
17341868 makeSomething(new PointFlow());
17351869 } else
....@@ -1741,7 +1875,7 @@
17411875 } else
17421876 */
17431877
1744
- if (event.getSource() == superLoopItem)
1878
+ if (source == superLoopItem)
17451879 {
17461880 Composite g = new cGroup();
17471881 for (int i=0; i<15; i++)
....@@ -1763,7 +1897,7 @@
17631897
17641898 group(g);
17651899 } else
1766
- if (event.getSource() == loopItem)
1900
+ if (source == loopItem)
17671901 {
17681902 Composite csg = new GroupLeaf();
17691903 csg.count = 5;
....@@ -1772,7 +1906,7 @@
17721906 csg.addChild(child);
17731907 child.addChild(csg);
17741908 } else
1775
- if (event.getSource() == doubleItem)
1909
+ if (source == doubleItem)
17761910 {
17771911 Composite csg = new GroupLeaf();
17781912 csg.count = 5;
....@@ -1784,7 +1918,7 @@
17841918 csg.addChild(child);
17851919 child.addChild(csg);
17861920 } else
1787
- if (event.getSource() == tripleItem)
1921
+ if (source == tripleItem)
17881922 {
17891923 Composite csg = new GroupLeaf();
17901924 csg.count = 4;
....@@ -1799,71 +1933,71 @@
17991933 csg.addChild(child);
18001934 child.addChild(csg);
18011935 } 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)
1936
+ if (source == computeAOItem)
18201937 {
18211938 Globals.drawMode = CameraPane.OCCLUSION;
18221939 Globals.theRenderer.repaint();
18231940 } else
1824
- if (event.getSource() == recompileItem)
1941
+ if (source == recompileItem)
18251942 {
18261943 Recompile();
18271944 refreshContents();
18281945 } else
1829
- if (event.getSource() == editScriptItem)
1946
+ if (source == editScriptItem)
18301947 {
18311948 OpenDialog();
18321949 refreshContents();
18331950 } else
1834
- if (event.getSource() == invariantsItem)
1951
+ if (source == invariantsItem)
18351952 {
18361953 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
1954
+ Grafreed.grafreeD.universe.invariants();
18381955 } else
1839
- if (event.getSource() == memoryItem)
1956
+ if (source == memoryItem)
18401957 {
18411958 //System.out.println("Invariants:");
18421959 PrintMemory();
18431960 } else
1844
- if (event.getSource() == pathItem)
1961
+ if (source == pathItem)
18451962 {
18461963 PrintPath();
18471964 } else
1848
- if (event.getSource() == analyzeItem)
1965
+ if (source == analyzeItem)
18491966 {
18501967 AnalyzeObject();
18511968 } else
1852
- if (event.getSource() == dumpItem)
1969
+ if (source == dumpItem)
18531970 {
18541971 DumpObject();
18551972 } else
1856
- if (event.getSource() == screenfitButton)
1973
+ if (source == undoButton)
1974
+ {
1975
+ Undo();
1976
+ } else
1977
+ if (source == redoButton)
1978
+ {
1979
+ Redo();
1980
+ } else
1981
+ if (source == saveButton)
1982
+ {
1983
+ Save();
1984
+ } else
1985
+ if (source == oneStepButton)
1986
+ {
1987
+ Globals.ONESTEP = true;
1988
+ cameraView.repaint();
1989
+ } else
1990
+ if (source == screenfitButton)
18571991 {
18581992 //Reload(lastConverter, lastFilename, true);
18591993 ScreenFit();
18601994 } else
1861
- if (event.getSource() == screenfitpointButton)
1995
+ if (source == screenfitpointButton)
18621996 {
18631997 //Reload(lastConverter, lastFilename, true);
18641998 ScreenFitPoint();
18651999 } else
1866
- if (event.getSource() == snapobjectButton)
2000
+ if (source == snapobjectButton)
18672001 {
18682002 //Reload(lastConverter, lastFilename, true);
18692003 SnapObject();
....@@ -1874,13 +2008,13 @@
18742008 // Recompile();
18752009 // refreshContents();
18762010 // } else
1877
- if (event.getSource() == gcButton)
2011
+ if (source == gcButton)
18782012 {
18792013 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802014 System.gc();
18812015 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822016 } else
1883
- if (event.getSource() == editLeafItem)
2017
+ if (source == editLeafItem)
18842018 {
18852019 Object3D obj;
18862020 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2028,74 @@
18942028 }
18952029 refreshContents(true);
18962030 } else
1897
- if (event.getSource() == openWindowItem)
2031
+ if (source == openWindowItem)
18982032 {
18992033 EditSelection(true);
19002034 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2035
+ if (source == cutItem || source == clearButton)
19022036 {
19032037 loadClipboard(true);
19042038 } else
1905
- if (event.getSource() == duplicateItem)
2039
+ if (source == undoItem)
19062040 {
1907
- Object3D keep = GrafreeD.clipboard;
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoItem)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == duplicateItem)
2048
+ {
2049
+ Object3D keep = Grafreed.clipboard;
19082050 loadClipboard(false);
19092051 paste(false);
1910
- GrafreeD.clipboard = keep;
2052
+ Grafreed.clipboard = keep;
19112053 } else
1912
- if (event.getSource() == cloneItem)
2054
+ if (source == cloneItem)
19132055 {
19142056 CloneSelection(false);
19152057 } else
1916
- if (event.getSource() == cloneSupportItem)
2058
+ if (source == cloneSupportItem)
19172059 {
19182060 CloneSelection(true);
19192061 } else
1920
- if (event.getSource() == copyItem)
2062
+ if (source == copyItem)
19212063 {
19222064 loadClipboard(false);
19232065 } else
1924
- if (event.getSource() == pasteItem)
2066
+ if (source == pasteItem)
19252067 {
19262068 paste(false);
19272069 } else
1928
- if (event.getSource() == pasteLinkItem)
2070
+ if (source == pasteIntoItem)
19292071 {
1930
- pasteInto(false);
2072
+ pasteInto(true, false);
19312073 } else
1932
- if (event.getSource() == pasteCloneItem)
2074
+ if (source == pasteLinkItem)
19332075 {
1934
- pasteInto(true);
2076
+ pasteInto(false, false);
19352077 } else
1936
- if (event.getSource() == pasteExpandItem)
2078
+ if (source == pasteCloneItem)
2079
+ {
2080
+ pasteInto(true, true);
2081
+ } else
2082
+ if (source == pasteExpandItem)
19372083 {
19382084 paste(true);
19392085 } else
1940
- if (event.getSource() == synchronizeItem)
2086
+ if (source == synchronizeItem)
19412087 {
19422088 Overwrite(Object3D.TRANSFORM);
19432089 } else
1944
- if (event.getSource() == overwriteNameItem)
2090
+ if (source == overwriteNameItem)
19452091 {
19462092 Overwrite(Object3D.NAME);
19472093 } else
1948
- if (event.getSource() == overwriteUVItem)
2094
+ if (source == overwriteUVItem)
19492095 {
19502096 Overwrite(Object3D.UV);
19512097 } else
1952
- if (event.getSource() == overwriteMatItem)
2098
+ if (source == overwriteMatItem)
19532099 {
19542100 /* july 2015
19552101 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2115,7 @@
19692115
19702116 Overwrite(dropAttributes);
19712117 }
1972
- if (event.getSource() == overwriteGeoItem)
2118
+ if (source == overwriteGeoItem)
19732119 {
19742120 Overwrite(Object3D.GEOMETRY);
19752121 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2132,7 @@
19862132 // refreshContents();
19872133 // }
19882134 } else
1989
- if (event.getSource() == generateMeshItem)
2135
+ if (source == generateMeshItem)
19902136 {
19912137 //if (group.selection.size() == 1)
19922138 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2143,7 @@
19972143 ResetModel();
19982144 refreshContents();
19992145 } else
2000
- if (event.getSource() == extractGeometriesItem)
2146
+ if (source == extractGeometriesItem)
20012147 {
20022148 boolean one = false;
20032149
....@@ -2024,7 +2170,7 @@
20242170 ResetModel();
20252171 refreshContents();
20262172 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2173
+ if (source == cloneGeometriesItem)
20282174 {
20292175 boolean one = false;
20302176
....@@ -2050,7 +2196,7 @@
20502196 ResetModel();
20512197 refreshContents();
20522198 } else
2053
- if (event.getSource() == shareGeometriesItem)
2199
+ if (source == shareGeometriesItem)
20542200 {
20552201 boolean one = false;
20562202
....@@ -2080,7 +2226,7 @@
20802226 refreshContents();
20812227 }
20822228 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2229
+ if (source == mergeGeometriesItem)
20842230 {
20852231 boolean one = false;
20862232
....@@ -2110,7 +2256,7 @@
21102256 ResetModel();
21112257 refreshContents();
21122258 } else
2113
- if (event.getSource() == linkverticesItem)
2259
+ if (source == linkverticesItem)
21142260 {
21152261 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162262 // {
....@@ -2123,9 +2269,9 @@
21232269 // group.selection.get(0).setMasterThis(content); // should be identity
21242270 // refreshContents();
21252271 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2272
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272273 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2274
+ Object3D content = Grafreed.clipboard.get(0);
21292275
21302276 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312277 content = ((cGroup)content).get(0);
....@@ -2133,38 +2279,38 @@
21332279 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342280 for (int i=0; i<group.selection.size(); i++)
21352281 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2282
+ boolean random = CameraPane.SWITCH;
2283
+ CameraPane.SWITCH = false; // parse all random nodes
21382284 group.selection.get(i).linkVerticesThis(content);
21392285 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2286
+ CameraPane.SWITCH = random;
21412287 }
21422288 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432289 refreshContents();
21442290 }
21452291 } else
2146
- if (event.getSource() == resetsupportItem)
2292
+ if (source == resetsupportItem)
21472293 {
21482294 for (int i=0; i<group.selection.size(); i++)
21492295 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2296
+ boolean random = CameraPane.SWITCH;
2297
+ CameraPane.SWITCH = false; // parse all random nodes
21522298 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2299
+ CameraPane.SWITCH = random;
21542300 }
21552301
21562302 refreshContents();
21572303 } else
2158
- if (event.getSource() == relinkverticesItem)
2304
+ if (source == relinkverticesItem)
21592305 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2306
+ boolean random = CameraPane.SWITCH;
2307
+ CameraPane.SWITCH = false; // parse all random nodes
21622308 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2309
+ CameraPane.SWITCH = random;
21642310
21652311 refreshContents();
21662312 } else
2167
- if (event.getSource() == resetreferencesItem)
2313
+ if (source == resetreferencesItem)
21682314 {
21692315 for (int i=0; i<group.selection.size(); i++)
21702316 {
....@@ -2173,11 +2319,11 @@
21732319
21742320 refreshContents();
21752321 } else
2176
- if (event.getSource() == setMasterItem)
2322
+ if (source == setMasterItem)
21772323 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2324
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792325 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2326
+ Object3D content = Grafreed.clipboard.get(0);
21812327
21822328 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832329 content = ((cGroup)content).get(0);
....@@ -2186,13 +2332,13 @@
21862332 refreshContents();
21872333 }
21882334 } else
2189
- if (event.getSource() == poseMeshItem)
2335
+ if (source == poseMeshItem)
21902336 {
21912337 if (group.selection.size() == 1)
21922338 {
2193
- if (GrafreeD.clipboard.size() == 1)
2339
+ if (Grafreed.clipboard.size() == 1)
21942340 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
21962342
21972343 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982344 content = ((cGroup)content).get(0);
....@@ -2205,19 +2351,19 @@
22052351 }
22062352
22072353 } else
2208
- if (event.getSource() == revertMeshItem)
2354
+ if (source == revertMeshItem)
22092355 {
22102356 RevertMeshes();
22112357 } else
2212
- if (event.getSource() == resetMeshItem)
2358
+ if (source == resetAllItem)
22132359 {
22142360 ResetAll();
22152361 } else
2216
- if (event.getSource() == stepAllItem)
2362
+ if (source == stepAllItem)
22172363 {
22182364 StepAll();
22192365 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2366
+ if (source == clearItem) // || event.getSource() == clearButton)
22212367 {
22222368 //int indices[] = jList.getSelectedIndices();
22232369 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2371,46 @@
22252371
22262372 ClearSelection(false);
22272373 } else
2228
- if (event.getSource() == clearAllItem)
2374
+ if (source == clearAllItem)
22292375 {
22302376 ClearSelection(true);
22312377 } else
2232
- if (event.getSource() == grabItem)
2378
+ if (source == grabItem)
22332379 {
22342380 group(new cGroup(), true);
22352381 } else
2236
- if (event.getSource() == hideItem)
2382
+ if (source == hideItem)
22372383 {
22382384 group(new HiddenObject());
22392385 } else
2240
- if (event.getSource() == frontItem)
2386
+ if (source == frontItem)
22412387 {
22422388 front();
22432389 } else
2244
- if (event.getSource() == backItem)
2390
+ if (source == backItem)
22452391 {
22462392 back();
22472393 } else
2248
- if (event.getSource() == cameraItem)
2394
+ if (source == cameraItem)
22492395 {
22502396 makeSomething(new Camera());
22512397 } else
2252
- if (event.getSource() == compositeItem)
2398
+ if (source == compositeItem)
22532399 {
22542400 group(new Composite());
22552401 } else
2256
- if (event.getSource() == randomItem)
2402
+ if (source == randomItem)
22572403 {
22582404 RandomNode random = new RandomNode();
22592405 group(random);
22602406 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2407
+ random.name = random.get(0).name + "Switch";
22622408 } else
2263
- if (event.getSource() == physicsItem)
2409
+ if (source == physicsItem)
22642410 {
22652411 group(new PhysicsNode());
22662412 } else
2267
- if (event.getSource() == frameselectorItem)
2413
+ if (source == frameselectorItem)
22682414 {
22692415 for (int i=0; i<group.selection.size(); i++)
22702416 {
....@@ -2276,7 +2422,7 @@
22762422 ResetModel();
22772423 refreshContents();
22782424 } else
2279
- if (event.getSource() == switchGeoItem)
2425
+ if (source == switchGeoItem)
22802426 {
22812427 for (int i=0; i<group.selection.size(); i++)
22822428 {
....@@ -2288,7 +2434,7 @@
22882434 ResetModel();
22892435 refreshContents();
22902436 } else
2291
- if (event.getSource() == switchTransfoItem)
2437
+ if (source == switchTransfoItem)
22922438 {
22932439 for (int i=0; i<group.selection.size(); i++)
22942440 {
....@@ -2300,7 +2446,7 @@
23002446 ResetModel();
23012447 refreshContents();
23022448 } else
2303
- if (event.getSource() == morphItem)
2449
+ if (source == morphItem)
23042450 {
23052451 for (int i=0; i<group.selection.size(); i++)
23062452 {
....@@ -2312,7 +2458,7 @@
23122458 ResetModel();
23132459 refreshContents();
23142460 } else
2315
- if (event.getSource() == scriptNodeItem)
2461
+ if (source == scriptNodeItem)
23162462 {
23172463 boolean atleastone = false;
23182464
....@@ -2351,31 +2497,31 @@
23512497 }
23522498 }
23532499 } else
2354
- if (event.getSource() == linkerItem)
2500
+ if (source == linkerItem)
23552501 {
23562502 group(new cLinker());
23572503 } else
2358
- if (event.getSource() == textureItem)
2504
+ if (source == textureItem)
23592505 {
23602506 group(new TextureNode());
23612507 } else
2362
- if (event.getSource() == billboardItem)
2508
+ if (source == billboardItem)
23632509 {
23642510 group(new BillboardNode());
23652511 } else
2366
- if (event.getSource() == shadowXItem)
2512
+ if (source == shadowXItem)
23672513 {
23682514 CastShadow(0);
23692515 } else
2370
- if (event.getSource() == shadowYItem)
2516
+ if (source == shadowYItem)
23712517 {
23722518 CastShadow(1);
23732519 } else
2374
- if (event.getSource() == shadowZItem)
2520
+ if (source == shadowZItem)
23752521 {
23762522 CastShadow(2);
23772523 } else
2378
- if (event.getSource() == ungroupItem)
2524
+ if (source == ungroupItem)
23792525 {
23802526 //ungroup();
23812527 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2533,187 @@
23872533
23882534 refreshContents();
23892535 } else
2390
- if (event.getSource() == genUVItem)
2536
+ if (source == genUVItem)
23912537 {
23922538 GenUV();
23932539 } else
2394
- if (event.getSource() == genNormalsCADItem)
2540
+ if (source == genNormalsCADItem)
23952541 {
23962542 GenNormals(true);
23972543 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2544
+ if (source == genNormalsMESHItem)
23992545 {
2400
- GenNormals(true); // TODO
2546
+ GenNormalsMESH();
24012547 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2548
+ if (source == genNormalsORGANItem)
24032549 {
24042550 GenNormals(false);
24052551 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2552
+ if (source == genNormalsMINEItem)
24072553 {
24082554 GenNormalsMINE();
24092555 } else
2410
- if (event.getSource() == stripifyItem)
2556
+ if (source == stripifyItem)
24112557 {
24122558 Stripify();
24132559 } else
2414
- if (event.getSource() == unstripifyItem)
2560
+ if (source == unstripifyItem)
24152561 {
24162562 Unstripify();
24172563 } else
2418
- if (event.getSource() == trimItem)
2564
+ if (source == trimItem)
24192565 {
24202566 Trim();
24212567 } else
2422
- if (event.getSource() == untrimItem)
2568
+ if (source == untrimItem)
24232569 {
24242570 Untrim();
24252571 } else
2426
- if (event.getSource() == clearColorsItem)
2572
+ if (source == clearColorsItem)
24272573 {
24282574 ClearColors();
24292575 } else
2430
- if (event.getSource() == clearMaterialsItem)
2576
+ if (source == clearMaterialsItem)
24312577 {
24322578 ClearMaterials();
24332579 } else
2434
- if (event.getSource() == liveleavesItem)
2580
+ if (source == liveleavesItem)
24352581 {
24362582 LiveLeaves(true);
24372583 } else
2438
- if (event.getSource() == unliveleavesItem)
2584
+ if (source == unliveleavesItem)
24392585 {
24402586 LiveLeaves(false);
24412587 } else
2442
- if (event.getSource() == supportleavesItem)
2588
+ if (source == supportleavesItem)
24432589 {
24442590 SupportLeaves(true);
24452591 } else
2446
- if (event.getSource() == unsupportleavesItem)
2592
+ if (source == unsupportleavesItem)
24472593 {
24482594 SupportLeaves(false);
24492595 } else
2450
- if (event.getSource() == hideleavesItem)
2596
+ if (source == hideleavesItem)
24512597 {
24522598 HideLeaves(true);
24532599 } else
2454
- if (event.getSource() == showleavesItem)
2600
+ if (source == showleavesItem)
24552601 {
24562602 HideLeaves(false);
24572603 } else
2458
- if (event.getSource() == markleavesItem)
2604
+ if (source == markleavesItem)
24592605 {
24602606 MarkLeaves(true);
24612607 } else
2462
- if (event.getSource() == unmarkleavesItem)
2608
+ if (source == unmarkleavesItem)
24632609 {
24642610 MarkLeaves(false);
24652611 } else
2466
- if (event.getSource() == flipVItem)
2612
+ if (source == flipVItem)
24672613 {
24682614 FlipV(true);
24692615 } else
2470
- if (event.getSource() == unflipVItem)
2616
+ if (source == unflipVItem)
24712617 {
24722618 FlipV(false);
24732619 } else
2474
- if (event.getSource() == lowTexturesItem)
2620
+ if (source == lowTexturesItem)
24752621 {
24762622 SetTexRes(0);
24772623 } else
2478
- if (event.getSource() == normalTexturesItem)
2624
+ if (source == normalTexturesItem)
24792625 {
24802626 SetTexRes(1);
24812627 } else
2482
- if (event.getSource() == highTexturesItem)
2628
+ if (source == highTexturesItem)
24832629 {
24842630 SetTexRes(2);
24852631 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2632
+ if (source == veryhighTexturesItem)
24872633 {
24882634 SetTexRes(3);
24892635 } else
2490
- if (event.getSource() == maxTexturesItem)
2636
+ if (source == maxTexturesItem)
24912637 {
24922638 SetTexRes(4);
24932639 } else
2494
- if (event.getSource() == panoTexturesItem)
2640
+ if (source == panoTexturesItem)
24952641 {
24962642 SetTexRes(5);
24972643 } else
2498
- if (event.getSource() == reverseNormalsItem)
2644
+ if (source == reverseNormalsItem)
24992645 {
25002646 ReverseNormals();
25012647 } else
2502
- if (event.getSource() == parseverticesItem)
2648
+ if (source == parseverticesItem)
25032649 {
25042650 ParseVertices();
25052651 } else
2506
- if (event.getSource() == textureFieldItem)
2652
+ if (source == textureFieldItem)
25072653 {
25082654 TextureVertices();
25092655 } else
2510
- if (event.getSource() == alignItem)
2656
+ if (source == alignItem)
25112657 {
25122658 Align();
25132659 } else
2514
- if (event.getSource() == mirrorItem)
2660
+ if (source == mirrorItem)
25152661 {
25162662 MirrorPoses();
25172663 } else
2518
- if (event.getSource() == reduceMorphItem)
2664
+ if (source == reduceMorphItem)
25192665 {
25202666 MeshReduction(false);
25212667 } else
2522
- if (event.getSource() == reduce34MorphItem)
2668
+ if (source == reduce34MorphItem)
25232669 {
25242670 MeshReduction(true);
25252671 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2672
+ if (source == reverseTrianglesItem)
25272673 {
25282674 ReverseTriangles();
25292675 } else
2530
- if (event.getSource() == reduceMeshItem)
2676
+ if (source == reduceMeshItem)
25312677 {
25322678 ReduceMesh(false);
25332679 } else
2534
- if (event.getSource() == reduce34MeshItem)
2680
+ if (source == reduce34MeshItem)
25352681 {
25362682 ReduceMesh(true);
25372683 } else
2538
- if (event.getSource() == increaseMeshItem)
2684
+ if (source == increaseMeshItem)
25392685 {
25402686 IncreaseMesh();
25412687 } else
2542
- if (event.getSource() == clipMeshItem)
2688
+ if (source == clipMeshItem)
25432689 {
25442690 ClipMesh();
25452691 } else
2546
- if (event.getSource() == smoothMeshItem)
2692
+ if (source == smoothMeshItem)
25472693 {
25482694 SmoothMesh();
25492695 } else
2550
- if (event.getSource() == transformgeometryItem)
2696
+ if (source == transformGeometryItem)
25512697 {
25522698 TransformGeometry();
25532699 } else
2554
- if (event.getSource() == resetTransformItem)
2700
+ if (source == transformChildrenItem)
2701
+ {
2702
+ TransformChildren();
2703
+ } else
2704
+ if (source == resetTransformItem)
25552705 {
25562706 ResetTransform();
25572707 } else
2558
- if (event.getSource() == resetCentroidItem)
2708
+ if (source == resetCentroidItem)
25592709 {
2560
- ResetCentroid();
2710
+ ResetCentroid(true);
25612711 } else
2562
- if (event.getSource() == resetParentItem)
2712
+ if (source == resetCentroidXZItem)
2713
+ {
2714
+ ResetCentroid(false);
2715
+ } else
2716
+ if (source == resetParentItem)
25632717 {
25642718 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652719 {
....@@ -2569,7 +2723,7 @@
25692723
25702724 refreshContents();
25712725 } else
2572
- if (event.getSource() == repairParentItem)
2726
+ if (source == repairParentItem)
25732727 {
25742728 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752729 {
....@@ -2583,7 +2737,7 @@
25832737
25842738 refreshContents();
25852739 } else
2586
- if (event.getSource() == repairShadowItem)
2740
+ if (source == repairShadowItem)
25872741 {
25882742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892743 {
....@@ -2597,7 +2751,7 @@
25972751
25982752 refreshContents();
25992753 } else
2600
- if (event.getSource() == sortbysizeItem)
2754
+ if (source == sortbysizeItem)
26012755 {
26022756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032757 {
....@@ -2609,7 +2763,7 @@
26092763 ResetModel();
26102764 refreshContents();
26112765 } else
2612
- if (event.getSource() == sortbynameItem)
2766
+ if (source == sortbynameItem)
26132767 {
26142768 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152769 {
....@@ -2621,7 +2775,7 @@
26212775 ResetModel();
26222776 refreshContents();
26232777 } else
2624
- if (event.getSource() == attachPigmentItem)
2778
+ if (source == attachPigmentItem)
26252779 {
26262780 String texture = GetFile("Attach pigment");
26272781 Object3D obj;
....@@ -2633,7 +2787,7 @@
26332787
26342788 refreshContents();
26352789 } else
2636
- if (event.getSource() == detachPigmentItem)
2790
+ if (source == detachPigmentItem)
26372791 {
26382792 Object3D obj;
26392793 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2798,7 @@
26442798
26452799 refreshContents();
26462800 } else
2647
- if (event.getSource() == attachBumpItem)
2801
+ if (source == attachBumpItem)
26482802 {
26492803 String texture = GetFile("Attach bump");
26502804 Object3D obj;
....@@ -2656,7 +2810,7 @@
26562810
26572811 refreshContents();
26582812 } else
2659
- if (event.getSource() == detachBumpItem)
2813
+ if (source == detachBumpItem)
26602814 {
26612815 Object3D obj;
26622816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2821,7 @@
26672821
26682822 refreshContents();
26692823 } else
2670
- if (event.getSource() == pigmentBumpItem)
2824
+ if (source == pigmentBumpItem)
26712825 {
26722826 Object3D obj;
26732827 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2832,195 @@
26782832
26792833 refreshContents();
26802834 } else
2681
- if (event.getSource() == flashSelectionButton)
2835
+ if (source == flashSelectionButton)
26822836 {
26832837 CameraPane.flash = true;
26842838 refreshContents();
26852839 } else
2686
- if (event.getSource() == oneButton)
2840
+ if (source == oneButton)
26872841 {
26882842 } else
2689
- if (event.getSource() == twoButton)
2843
+ if (source == twoButton)
26902844 {
26912845 radio.layout = twoButton;
26922846 // bug
26932847 //gridPanel.setDividerLocation(1.0);
26942848 //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();
2849
+// bigThree.remove(scenePanel);
2850
+// bigThree.remove(centralPanel);
2851
+// bigThree.remove(XYZPanel);
2852
+// aWindowConstraints.gridx = 0;
2853
+// aWindowConstraints.gridy = 0;
2854
+// aWindowConstraints.gridwidth = 1;
2855
+// // aConstraints.gridheight = 3;
2856
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2857
+// aWindowConstraints.weightx = 0;
2858
+// aWindowConstraints.weighty = 1;
2859
+// //bigThree.add(jtp, aWindowConstraints);
2860
+// aWindowConstraints.weightx = 1;
2861
+// aWindowConstraints.gridwidth = 3;
2862
+// // aConstraints.gridheight = 3;
2863
+// aWindowConstraints.gridx = 1;
2864
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2865
+// bigThree.add(centralPanel, aWindowConstraints);
2866
+// aWindowConstraints.weightx = 0;
2867
+// aWindowConstraints.gridx = 4;
2868
+// aWindowConstraints.gridwidth = 1;
2869
+// // aConstraints.gridheight = 3;
2870
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2871
+// //bigThree.add(XYZPanel, aWindowConstraints);
2872
+// scenePanel.setVisible(false);
2873
+// centralPanel.setVisible(true);
2874
+// XYZPanel.setVisible(false);
2875
+ bigThree.ClearUI();
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
27192878 } else
2720
- if (event.getSource() == threeButton)
2879
+ if (source == threeButton)
27212880 {
27222881 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();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// //bigThree.add(jtp, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(false);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(centralPanel);
2912
+ bigThree.add(XYZPanel);
2913
+ bigThree.FlushUI();
27472914 } else
2748
- if (event.getSource() == fourButton)
2915
+ if (source == fourButton)
27492916 {
27502917 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();
2918
+
2919
+// bigThree.remove(scenePanel);
2920
+// bigThree.remove(centralPanel);
2921
+// bigThree.remove(XYZPanel);
2922
+// aWindowConstraints.gridx = 0;
2923
+// aWindowConstraints.gridy = 0;
2924
+// aWindowConstraints.gridwidth = 1;
2925
+// // aWindowConstraints.gridheight = 3;
2926
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.weighty = 1;
2929
+// bigThree.add(scenePanel, aWindowConstraints);
2930
+// aWindowConstraints.weightx = 1;
2931
+// aWindowConstraints.gridwidth = 3;
2932
+// // aConstraints.gridheight = 3;
2933
+// aWindowConstraints.gridx = 1;
2934
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2935
+// //bigThree.add(cameraPanel, aWindowConstraints);
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.gridx = 4;
2938
+// aWindowConstraints.gridwidth = 1;
2939
+// // aWindowConstraints.gridheight = 3;
2940
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2941
+// //bigThree.add(XYZPanel, aWindowConstraints);
2942
+// bigThree.validate();
2943
+// scenePanel.setVisible(true);
2944
+// centralPanel.setVisible(false);
2945
+// XYZPanel.setVisible(false);
2946
+ bigThree.ClearUI();
2947
+ bigThree.add(scenePanel);
2948
+ bigThree.FlushUI();
27752949 } else
2776
- if (event.getSource() == sixButton)
2950
+ if (source == sixButton)
27772951 {
27782952 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();
2953
+
2954
+// bigThree.remove(scenePanel);
2955
+// bigThree.remove(centralPanel);
2956
+// bigThree.remove(XYZPanel);
2957
+// aWindowConstraints.gridx = 0;
2958
+// aWindowConstraints.gridy = 0;
2959
+// aWindowConstraints.gridwidth = 1;
2960
+// // aConstraints.gridheight = 3;
2961
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2962
+// aWindowConstraints.weightx = 0;
2963
+// aWindowConstraints.weighty = 1;
2964
+// bigThree.add(scenePanel, aWindowConstraints);
2965
+// aWindowConstraints.weightx = 1;
2966
+// aWindowConstraints.gridwidth = 3;
2967
+// // aWindowConstraints.gridheight = 3;
2968
+// aWindowConstraints.gridx = 1;
2969
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2970
+// bigThree.add(centralPanel, aWindowConstraints);
2971
+// aWindowConstraints.weightx = 0;
2972
+// aWindowConstraints.gridx = 4;
2973
+// aWindowConstraints.gridwidth = 1;
2974
+// // aWindowConstraints.gridheight = 3;
2975
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2976
+// //bigThree.add(XYZPanel, aConstraints);
2977
+// bigThree.validate();
2978
+// scenePanel.setVisible(true);
2979
+// centralPanel.setVisible(true);
2980
+// XYZPanel.setVisible(false);
2981
+ bigThree.ClearUI();
2982
+ bigThree.add(scenePanel);
2983
+ bigThree.add(centralPanel);
2984
+ bigThree.FlushUI();
28032985 } else
2804
- if (event.getSource() == sevenButton)
2986
+ if (source == sevenButton)
28052987 {
28062988 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();
2989
+
2990
+// bigThree.remove(scenePanel);
2991
+// bigThree.remove(centralPanel);
2992
+// bigThree.remove(XYZPanel);
2993
+// aWindowConstraints.gridx = 0;
2994
+// aWindowConstraints.gridy = 0;
2995
+// aWindowConstraints.gridwidth = 1;
2996
+// // aWindowConstraints.gridheight = 3;
2997
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2998
+// aWindowConstraints.weightx = 0;
2999
+// aWindowConstraints.weighty = 1;
3000
+// bigThree.add(scenePanel, aWindowConstraints);
3001
+// aWindowConstraints.weightx = 1;
3002
+// aWindowConstraints.gridwidth = 3;
3003
+// // aWindowConstraints.gridheight = 3;
3004
+// aWindowConstraints.gridx = 1;
3005
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3006
+// bigThree.add(centralPanel, aWindowConstraints);
3007
+// aWindowConstraints.weightx = 0;
3008
+// aWindowConstraints.gridx = 4;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// bigThree.add(XYZPanel, aWindowConstraints);
3013
+// bigThree.validate();
3014
+// scenePanel.setVisible(true);
3015
+// centralPanel.setVisible(true);
3016
+// XYZPanel.setVisible(true);
3017
+ bigThree.ClearUI();
3018
+ bigThree.add(scenePanel);
3019
+ bigThree.add(centralPanel);
3020
+ bigThree.add(XYZPanel);
3021
+ bigThree.FlushUI();
28313022 } else
2832
- if (event.getSource() == rootButton)
3023
+ if (source == rootButton)
28333024 {
28343025 Object3D obj;
28353026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +3032,7 @@
28413032
28423033 refreshContents(true);
28433034 } else
2844
- if (event.getSource() == closeButton)
3035
+ if (source == closeButton)
28453036 {
28463037 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473038 cRadio ab;
....@@ -2862,11 +3053,11 @@
28623053 }
28633054 refreshContents(true);
28643055 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3056
+ if (source == editItem || source == editButton)
28663057 {
28673058 EditSelection(false);
28683059 } else
2869
- if (event.getSource() == uneditButton)
3060
+ if (source == uneditButton)
28703061 {
28713062 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723063 {
....@@ -2876,14 +3067,14 @@
28763067 child.CloseUI();
28773068 listUI.remove(child);
28783069
2879
- child.editWindow = null; // ???????????
3070
+ //child.editWindow = null; // ???????????
28803071 }
2881
- objEditor.ctrlPanel.revalidate();
3072
+ objEditor.ctrlPanel.FlushUI();
28823073 //objEditor.jTree.clearSelection();
28833074 //objEditor.ResetSliders();
28843075 refreshContents(true);
28853076 } else
2886
- if (event.getSource() == clearPanelButton)
3077
+ if (source == clearPanelButton)
28873078 {
28883079 assert(copy == group);
28893080 //copy.ClearUI();
....@@ -2894,7 +3085,7 @@
28943085 listUI.clear();
28953086 refreshContents(true);
28963087 } else
2897
- if (event.getSource() == allParamsButton)
3088
+ if (source == allParamsButton)
28983089 {
28993090 assert(copy == group);
29003091
....@@ -2915,19 +3106,19 @@
29153106
29163107 refreshContents(true);
29173108 } else
2918
- if (event.getSource() == unselectButton)
3109
+ if (source == unselectButton)
29193110 {
29203111 objEditor.jTree.clearSelection();
29213112 // ?? oct 2012 GrafreeD.clipboard.clear();
29223113 objEditor.ResetSliders();
29233114 refreshContents(true);
29243115 } else
2925
- if(event.getSource() instanceof cRadio)
3116
+ if(source instanceof cRadio)
29263117 {
29273118 group.parent = keepparent;
29283119 group.attributes = 0;
29293120 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3121
+ /*cRadio*/ radio = (cRadio)source;
29313122 Object3D obj = radio.GetObject();
29323123 System.out.println("Edit " + obj);
29333124 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3153,10 @@
29623153 frontView.object = group;
29633154 sideView.object = group;
29643155 }
3156
+
3157
+// fix "+" issue
29653158 group.editWindow = this;
3159
+
29663160 /*
29673161 currentLayout = radio.layout;
29683162 if (currentLayout == null)
....@@ -2975,7 +3169,20 @@
29753169 //group.attributes = -1;
29763170 ResetModel();
29773171 refreshContents(true);
2978
- }
3172
+ } else if (event.getSource() == editCameraItem)
3173
+ {
3174
+ cameraView.ProtectCamera();
3175
+ cameraView.repaint();
3176
+ return;
3177
+ } else if (event.getSource() == revertCameraItem)
3178
+ {
3179
+ cameraView.RevertCamera();
3180
+ cameraView.repaint();
3181
+ return;
3182
+ // } else if (event.getSource() == textureButton)
3183
+ // {
3184
+ // return; // true;
3185
+ }
29793186 else
29803187 {
29813188 //return super.action(event, arg);
....@@ -3036,6 +3243,28 @@
30363243 refreshContents();
30373244 }
30383245
3246
+ void TransformChildren()
3247
+ {
3248
+ Object3D obj;
3249
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3250
+ {
3251
+ obj = (Object3D)e.nextElement();
3252
+ obj.KeepTextureMatrices();
3253
+ obj.TransformChildren();
3254
+ obj.RestoreTextureMatrices();
3255
+
3256
+// if (obj.parent == null)
3257
+// {
3258
+// System.out.println("NULL PARENT!");
3259
+// new Exception().printStackTrace();
3260
+// }
3261
+// else
3262
+// TouchTransform(obj);
3263
+// //obj.parent.Touch();
3264
+ }
3265
+
3266
+ refreshContents();
3267
+ }
30393268
30403269 void ResetTransform()
30413270 {
....@@ -3148,7 +3377,7 @@
31483377 refreshContents();
31493378 }
31503379
3151
- void ResetCentroid()
3380
+ void ResetCentroid(boolean full)
31523381 {
31533382 Object3D obj;
31543383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3392,16 @@
31633392 LA.matIdentity(Object3D.mat);
31643393 obj.getBounds(minima, maxima, false);
31653394 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3395
+ if (full)
3396
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673397 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683398 obj.TransformMesh(Object3D.mat);
3399
+
31693400 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3401
+ if (full)
3402
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713403 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3404
+
31723405 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733406 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743407 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3430,8 @@
31973430
31983431 int size = obj.MemorySize();
31993432
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3434
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32013435 }
32023436 }
32033437 catch (Exception e)
....@@ -3234,9 +3468,9 @@
32343468 obj = (Object3D)e.nextElement();
32353469
32363470 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3471
+ Grafreed.AnalyzeObject(obj);
32383472 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3473
+ Grafreed.AnalyzeObject(obj.bRep);
32403474
32413475 // System.err.println((size/1024) + " KB is the size of " + obj);
32423476 }
....@@ -3278,6 +3512,13 @@
32783512 void GenNormals(boolean crease)
32793513 {
32803514 group.GenNormalsS(crease);
3515
+
3516
+ refreshContents();
3517
+ }
3518
+
3519
+ void GenNormalsMESH()
3520
+ {
3521
+ group.GenNormalsMeshS();
32813522
32823523 refreshContents();
32833524 }
....@@ -3450,8 +3691,8 @@
34503691
34513692 void ParseVertices()
34523693 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3694
+ boolean epsequal = Grafreed.epsequal;
3695
+ Grafreed.epsequal = true;
34553696
34563697 for (int i=0; i<group.selection.size(); i++)
34573698 {
....@@ -3476,7 +3717,7 @@
34763717 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773718 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783719
3479
- g.add(GrafreeD.clipboard);
3720
+ g.add(Grafreed.clipboard);
34803721
34813722 buffer.add(g);
34823723 }
....@@ -3491,7 +3732,7 @@
34913732 makeSomething(buffer, i==group.selection.size()-1);
34923733 }
34933734
3494
- GrafreeD.epsequal = epsequal;
3735
+ Grafreed.epsequal = epsequal;
34953736
34963737 refreshContents();
34973738 }
....@@ -3509,7 +3750,16 @@
35093750 String pigment = Object3D.GetPigment(tex);
35103751 //String bump = Object3D.GetBump(tex);
35113752
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3753
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3754
+
3755
+ try
3756
+ {
3757
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3758
+ }
3759
+ catch (Exception e)
3760
+ {
3761
+ System.err.println("FAIL: " + node);
3762
+ }
35133763
35143764 double s = v.s;
35153765
....@@ -3597,11 +3847,11 @@
35973847
35983848 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993849
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3850
+ boolean random = CameraPane.SWITCH;
3851
+ CameraPane.SWITCH = false; // parse all random nodes
36023852 lowres.linkVerticesThis(null);
36033853 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3854
+ CameraPane.SWITCH = random;
36053855
36063856 System.err.flush();
36073857
....@@ -3641,7 +3891,7 @@
36413891 return;
36423892
36433893 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
3894
+ Object3D ref = Grafreed.clipboard.get(0);
36453895
36463896 Object3D newgroup = new Object3D("Po:" + poses.name);
36473897
....@@ -3835,9 +4085,9 @@
38354085
38364086 void ClipMesh()
38374087 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4088
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394089 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4090
+ Object3D content = Grafreed.clipboard.get(0);
38414091
38424092 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434093 content = ((cGroup)content).get(0);
....@@ -3846,7 +4096,7 @@
38464096 // {
38474097 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484098 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4099
+ group.selection.ClipMesh(Grafreed.clipboard);
38504100 }
38514101 // group.selection.ClipMesh(GrafreeD.clipboard);
38524102 System.out.println("DONE.");
....@@ -3981,7 +4231,7 @@
39814231 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824232
39834233 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4234
+ if(elem != group || !newWindow)
39854235 {
39864236 // if (!(elem instanceof Composite))
39874237 // newWindow = false;
....@@ -4071,7 +4321,6 @@
40714321 //case 702: // Event.LIST_DESELECT
40724322 group.deselectAll();
40734323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754324 if (tps != null)
40764325 {
40774326 for (int i=0; i < tps.length; i++)
....@@ -4080,29 +4329,28 @@
40804329
40814330 //if (child.parent != null)
40824331 //child.parent.addSelectee(child);
4332
+ objEditor.SetMaterial(child);
40834333 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874334 }
40884335 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4336
+// else
4337
+// {
4338
+// objEditor.SetMaterial(group); // .GetMaterial());
4339
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4340
+// System.err.println("info : " + group.GetPath());
4341
+// }
40954342
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4343
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40994344 CameraPane.flash = true;
41004345
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4346
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024347 // a camera
41034348 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4349
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4350
+ {
4351
+ CameraPane.camerachangeframe = 0; // don't refuse it
4352
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4353
+ }
41064354 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074355 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084356 }
....@@ -4115,6 +4363,26 @@
41154363
41164364 freezemodel = false;
41174365 }
4366
+
4367
+ void refreshContents(boolean cp)
4368
+ {
4369
+ if (!Globals.MOUSEDRAGGED)
4370
+ {
4371
+ objEditor.ClearInfo(); // .GetMaterial());
4372
+
4373
+ for (int i=0; i < group.selection.Size(); i++)
4374
+ {
4375
+ Object3D child = (Object3D) group.selection.get(i);
4376
+
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+ }
4380
+
4381
+ objEditor.SetText(); // jan 2014
4382
+ }
4383
+
4384
+ super.refreshContents(cp);
4385
+ }
41184386
41194387 void linkSomething(Object3D thing)
41204388 {
....@@ -4186,16 +4454,18 @@
41864454 {
41874455 if (group.selection.isEmpty())
41884456 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4457
+
4458
+ Grafreed.clipboardIsTempGroup = false;
41904459 Composite tGroup = null;
41914460 if (group.selection.size() > 0) // 1)
41924461 {
41934462 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4463
+ Grafreed.clipboardIsTempGroup = true;
41954464 }
41964465
41974466 if (cut)
41984467 {
4468
+ Save();
41994469 //int indices[] = jList.getSelectedIndices();
42004470 //for (int i = indices.length - 1; i >= 0; i--)
42014471 //jList.remove(indices[i]);
....@@ -4231,16 +4501,16 @@
42314501 //System.out.println("cut " + child);
42324502 //System.out.println("parent = " + child.parent);
42334503 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4504
+ if (Grafreed.clipboardIsTempGroup)
42354505 tGroup.add/*Child*/(tmp);
42364506 else
4237
- GrafreeD.clipboard = tmp;
4507
+ Grafreed.clipboard = tmp;
42384508 }
42394509 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4510
+ if (Grafreed.clipboardIsTempGroup)
42414511 tGroup.add/*Child*/(child);
42424512 else
4243
- GrafreeD.clipboard = child;
4513
+ Grafreed.clipboard = child;
42444514 }
42454515
42464516 //ResetModel();
....@@ -4272,21 +4542,23 @@
42724542 //System.out.println("cut " + elem);
42734543 //System.out.println("parent = " + elem.parent);
42744544 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4545
+ if (Grafreed.clipboardIsTempGroup)
42764546 tGroup.add/*Child*/(tmp);
42774547 else
4278
- GrafreeD.clipboard = tmp;
4548
+ Grafreed.clipboard = tmp;
42794549 }
42804550 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4551
+ if (Grafreed.clipboardIsTempGroup)
42824552 tGroup.add/*Child*/(child);
42834553 else
4284
- GrafreeD.clipboard = child;
4554
+ Grafreed.clipboard = child;
42854555 }
42864556
42874557 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4558
+
4559
+ if (Grafreed.clipboardIsTempGroup)
4560
+ Grafreed.clipboard = tGroup;
4561
+
42904562 if (cut)
42914563 {
42924564 ResetModel();
....@@ -4300,7 +4572,7 @@
43004572 // return;
43014573 boolean first = true;
43024574
4303
- if (GrafreeD.clipboardIsTempGroup)
4575
+ if (Grafreed.clipboardIsTempGroup)
43044576 {
43054577 Composite temp;
43064578
....@@ -4311,7 +4583,7 @@
43114583 temp = (Composite)Applet3D.clipboard.deepCopy();
43124584 */
43134585 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4586
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154587 {
43164588 Object3D child = (Object3D)e.nextElement();
43174589
....@@ -4345,21 +4617,21 @@
43454617 //Object3D cb = Applet3D.clipboard;
43464618 //temp.addChild(cb);
43474619 //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());
4620
+ assert(Grafreed.clipboard.parent == null);
4621
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4622
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4623
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4624
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534625 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4626
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4627
+ Grafreed.clipboard.get(0).parent = keepparent;
43564628 }
43574629
43584630 ResetModel();
43594631 refreshContents();
43604632 }
43614633
4362
- void pasteInto(boolean copyit)
4634
+ void pasteInto(boolean copyit, boolean clone)
43634635 {
43644636 // if (GrafreeD.clipboard == null)
43654637 // return;
....@@ -4388,15 +4660,22 @@
43884660 if (copyit)
43894661 {
43904662 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4663
+ if (clone)
4664
+ {
4665
+ CloneClipboard(false); // sept 2014
4666
+ }
4667
+ else
4668
+ {
4669
+ paste(false);
4670
+ }
43924671 }
43934672 else
43944673 {
43954674 boolean first = true;
43964675
4397
- if (GrafreeD.clipboardIsTempGroup)
4676
+ if (Grafreed.clipboardIsTempGroup)
43984677 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4678
+ Composite temp = (Composite)Grafreed.clipboard;
44004679 Object3D copy;
44014680 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024681 {
....@@ -4406,7 +4685,7 @@
44064685 }
44074686 } else
44084687 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4688
+ linkSomething(Grafreed.clipboard); //.get(0));
44104689 }
44114690 }
44124691 }
....@@ -4811,21 +5090,6 @@
48115090 }
48125091 */
48135092
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
-
48295093 /*
48305094 public void Callback(Object obj)
48315095 {
....@@ -4849,26 +5113,9 @@
48495113 }
48505114 */
48515115
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
-
48695116 String GetFile(String dialogName)
48705117 {
4871
- if (GrafreeD.standAlone)
5118
+ if (Grafreed.standAlone)
48725119 {
48735120 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745121 browser.show();
....@@ -4932,10 +5179,15 @@
49325179 cButton flashSelectionButton;
49335180 cButton editButton;
49345181 cButton uneditButton;
5182
+ JCheckBox allParamsButton;
49355183 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375184 cButton unselectButton;
49385185
5186
+ cButton saveButton;
5187
+ cButton undoButton;
5188
+ cButton redoButton;
5189
+ cButton oneStepButton;
5190
+
49395191 cButton screenfitButton;
49405192 cButton screenfitpointButton;
49415193 cButton snapobjectButton;
....@@ -4966,6 +5218,8 @@
49665218 private MenuItem lookFromItem;
49675219 private MenuItem switchItem;
49685220 private MenuItem cutItem;
5221
+ private MenuItem undoItem;
5222
+ private MenuItem redoItem;
49695223 private MenuItem duplicateItem;
49705224 private MenuItem cloneItem;
49715225 private MenuItem cloneSupportItem;
....@@ -4979,7 +5233,7 @@
49795233 private MenuItem linkverticesItem;
49805234 private MenuItem relinkverticesItem;
49815235 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5236
+ private MenuItem resetAllItem;
49835237 private MenuItem stepAllItem;
49845238 private MenuItem revertMeshItem;
49855239 private MenuItem poseMeshItem;
....@@ -4990,6 +5244,7 @@
49905244 private MenuItem mergeGeometriesItem;
49915245 private MenuItem copyItem;
49925246 private MenuItem pasteItem;
5247
+ private MenuItem pasteIntoItem;
49935248 private MenuItem pasteLinkItem;
49945249 private MenuItem pasteCloneItem;
49955250 private MenuItem pasteExpandItem;
....@@ -5039,8 +5294,10 @@
50395294 private MenuItem panoTexturesItem;
50405295
50415296 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5297
+ private MenuItem resetCentroidXZItem;
50435298 private MenuItem resetTransformItem;
5299
+ private MenuItem transformGeometryItem;
5300
+ private MenuItem transformChildrenItem;
50445301 private MenuItem hideItem;
50455302 private MenuItem grabItem;
50465303 private MenuItem backItem;
....@@ -5087,7 +5344,7 @@
50875344 private MenuItem blobItem;
50885345 private MenuItem latheItem;
50895346 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5347
+ private MenuItem overlayItem;
50915348 private MenuItem meshItem;
50925349 // private MenuItem meshGroupItem;
50935350 private MenuItem springItem;
....@@ -5109,11 +5366,6 @@
51095366 private MenuItem doubleItem;
51105367 private MenuItem tripleItem;
51115368
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175369 private MenuItem computeAOItem;
51185370 private MenuItem recompileItem;
51195371 private MenuItem editScriptItem;
....@@ -5123,4 +5375,8 @@
51235375 private MenuItem analyzeItem;
51245376 private MenuItem dumpItem;
51255377 //boolean freezemodel = false;
5378
+
5379
+ Menu cameraMenu;
5380
+ MenuItem editCameraItem;
5381
+ MenuItem revertCameraItem;
51265382 }