Normand Briere
2019-06-23 8088590686a45e71278f9a52bb9cc37943dc0c37
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(Globals.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
286
+ }
287
+
192288 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
222320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
224325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225326 setMasterItem.addActionListener(this);
327
+ }
226328
227329 oe.menuBar.add(menu = new Menu("Group"));
228330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +335,32 @@
233335 frontItem.addActionListener(this);
234336 compositeItem = menu.add(new MenuItem("Composite"));
235337 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237339 hideItem.addActionListener(this);
238340 ungroupItem = menu.add(new MenuItem("Ungroup"));
239341 ungroupItem.addActionListener(this);
240342 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
242344 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248346 switchGeoItem.addActionListener(this);
249347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250348 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
252350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
253359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254360 scriptNodeItem.addActionListener(this);
255361 cameraItem = menu.add(new MenuItem("Camera"));
256362 cameraItem.addActionListener(this);
363
+ }
257364
258365 oe.menuBar.add(menu = new Menu("Object"));
259366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +375,29 @@
268375 shadowYItem.addActionListener(this);
269376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
271381 linkerItem = menu.add(new MenuItem("Linker"));
272382 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275383 attributeItem = menu.add(new MenuItem("Attribute"));
276384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
277387 pointflowItem = menu.add(new MenuItem("Point Flow"));
278388 pointflowItem.addActionListener(this);
389
+ }
279390 menu.add("-");
280391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281392 resetTransformItem.addActionListener(this);
282393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283394 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
286401
287402 oe.menuBar.add(menu = new Menu("Geometry"));
288403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +408,11 @@
293408 genNormalsCADItem.addActionListener(this);
294409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
296413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297414 genNormalsMINEItem.addActionListener(this);
415
+ }
298416 stripifyItem = menu.add(new MenuItem("Stripify"));
299417 stripifyItem.addActionListener(this);
300418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +434,34 @@
316434 reduce34MeshItem.addActionListener(this);
317435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318436 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
323445
324446 oe.menuBar.add(menu = new Menu("Attributes"));
325447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
327453 menu.add("-");
328454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329455 liveleavesItem.addActionListener(this);
330456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
332460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333461 supportleavesItem.addActionListener(this);
334462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335463 unsupportleavesItem.addActionListener(this);
464
+ }
336465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337466 hideleavesItem.addActionListener(this);
338467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +470,14 @@
341470 markleavesItem.addActionListener(this);
342471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
344481 menu.add("-");
345482 flipVItem = menu.add(new MenuItem("Flip V"));
346483 flipVItem.addActionListener(this);
....@@ -376,35 +513,40 @@
376513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377514 sortbynameItem.addActionListener(this);
378515 menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
520
+ if (Globals.ADVANCED)
521
+ {
522
+ // Pretty much the same as duplicate and clone.
379523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380524 extractGeometriesItem.addActionListener(this);
381525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382526 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
527
+ }
387528
388529 oe.menuBar.add(menu = new Menu("Insert"));
389530 buildCreateMenu(menu);
390531
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402532 oe.menuBar.add(menu = new Menu("Tools"));
403533 buildToolsMenu(menu);
404534 }
405535
406536 void SetupUI2(ObjEditor oe)
407537 {
538
+ // June 2019
539
+ if (oe == null)
540
+ {
541
+ //super.SetupUI2(this);
542
+ //return;
543
+ }
544
+
545
+ if (copy != group)
546
+ {
547
+ //super.SetupUI2(this);
548
+ }
549
+
408550 //new Exception().printStackTrace();
409551
410552 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +575,122 @@
433575 oe.radioPanel.add(dummyButton);
434576 oe.buttonGroup.add(dummyButton);
435577 */
436
- aConstraints.gridy += 1;
437
-
438578 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439579
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
580
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
581
+ //minButton.setToolTipText("Minimize window");
582
+ //minButton.addActionListener(this);
442583
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
584
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ maxButton.setToolTipText("Maximize window");
586
+ maxButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ fullButton.setToolTipText("Full-screen window");
590
+ fullButton.addActionListener(this);
591
+
592
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
593
+ undoButton.setToolTipText("Undo changes");
594
+ undoButton.addActionListener(this);
595
+
596
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ redoButton.setToolTipText("Redo changes");
598
+ redoButton.addActionListener(this);
599
+
600
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
601
+ saveButton.setToolTipText("Save changes");
602
+ saveButton.addActionListener(this);
603
+
604
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
605
+ liveCB.setToolTipText("Enable animation");
445606 liveCB.addItemListener(this);
446607
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
608
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ oneStepButton.setToolTipText("Animate one step forward");
610
+ oneStepButton.addActionListener(this);
611
+
612
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
+ fastCB.setToolTipText("Fast mode");
614
+ fastCB.addItemListener(this);
615
+
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
449617 trackCB.setToolTipText("Enable tracking");
450618 trackCB.addItemListener(this);
451619
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454621 screenfitButton.setToolTipText("Screen fit");
455622 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
623
+
457624 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458625 // 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;
464626
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);
627
+ if (Globals.ADVANCED)
628
+ {
629
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ snapobjectButton.addActionListener(this);
631
+ snapobjectButton.setToolTipText("Snap Object");
632
+ }
633
+
634
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471635 flashSelectionButton.setToolTipText("Show selection");
472636 flashSelectionButton.addActionListener(this);
473637
474
- oe.toolbarPanel.add(new cButton(" ", false));
638
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475639
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);
640
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482641 twoButton.setToolTipText("Show center view only");
483642 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
643
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485644 fourButton.addActionListener(this);
486645 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
646
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488647 sixButton.setToolTipText("2-column layout left");
489648 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491650 threeButton.setToolTipText("2-column layout right");
492651 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
652
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494653 sevenButton.setToolTipText("3-column layout");
495654 sevenButton.addActionListener(this);
496655 //
497656
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
657
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ rootButton.setToolTipText("Edit selection in new tab");
500659 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
660
+
661
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503662 closeButton.setToolTipText("Close tab");
504663 closeButton.addActionListener(this);
505664 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506665 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508666
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
667
+ cGridBag commandsPanel = new cGridBag();
668
+
669
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ editButton.setToolTipText("Edit selection");
511671 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515672
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
673
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ uneditButton.setToolTipText("Unedit selection");
517675 uneditButton.addActionListener(this);
518676
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);
677
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
678
+ allParamsButton.setToolTipText("Edit all params");
531679 allParamsButton.addActionListener(this);
532680
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);
681
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ clearPanelButton.setToolTipText("Clear edit panel");
683
+ clearPanelButton.addActionListener(this);
684
+
685
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ unselectButton.setToolTipText("Unselect");
538687 unselectButton.addActionListener(this);
539688
689
+ commandsPanel.preferredHeight = 1;
690
+
691
+ oe.treePanel.add(commandsPanel);
692
+ oe.treePanel.Return();
693
+
540694 // oe.aConstraints.gridx += 1;
541695 // oe.aConstraints.weighty = 0;
542696 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +702,37 @@
548702 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549703 // gcButton.addActionListener(this);
550704
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;
705
+ cGridBag jSPPanel = new cGridBag();
706
+
707
+ JScrollPane jSP;
562708 //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);
709
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564710 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
711
+
712
+ oe.treePanel.add(jSPPanel);
713
+ oe.treePanel.Return();
569714
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);
715
+ cGridBag copyOptionsPanel = new cGridBag();
716
+
717
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
718
+ colorCB.setToolTipText("Copy color when dropped");
574719 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
720
+
721
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
722
+ materialCB.setToolTipText("Copy material when dropped");
577723 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
724
+
725
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
726
+ textureCB.setToolTipText("Copy texture when dropped");
580727 textureCB.addItemListener(this);
581728
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
729
+ copyOptionsPanel.preferredHeight = 1;
730
+ oe.treePanel.add(copyOptionsPanel);
731
+ oe.treePanel.Return();
584732
733
+// mainPanel.setDividerLocation(0.5); //1.0);
734
+// mainPanel.setResizeWeight(0.5);
735
+
585736 //jList.addListSelectionListener(this);
586737 oe.jTree.addTreeSelectionListener(this);
587738 //jTree.setRootVisible(false);
....@@ -604,45 +755,37 @@
604755 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605756 }
606757
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
758
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608759 {
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);
760
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639761 boxCB.setToolTipText("Display bounding boxes");
640762 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
763
+
764
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643765 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644766 zoomBoxCB.addItemListener(this);
645767
768
+ if (true) // Globals.ADVANCED)
769
+ {
770
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
771
+ supportCB.setToolTipText("Enable rigging");
772
+ supportCB.addItemListener(this);
773
+
774
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
775
+ // localCB.addItemListener(this);
776
+
777
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
778
+ crowdCB.setToolTipText("Used for crowds");
779
+ crowdCB.addItemListener(this);
780
+
781
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
782
+ smoothCB.setToolTipText("Snapping delay");
783
+ smoothCB.addItemListener(this);
784
+
785
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
786
+ slowCB.setToolTipText("Smooth interpolation");
787
+ slowCB.addItemListener(this);
788
+
646789 // constraints.gridy += 1;
647790 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648791 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +793,16 @@
650793 if (false)
651794 {
652795 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
796
+ //constraints.gridy += 1;
797
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655798 speakerCameraCB.addItemListener(this);
656799
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
800
+ //constraints.gridy += 1;
801
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659802 speakerFocusCB.addItemListener(this);
660803
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
804
+ //constraints.gridy += 1;
805
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663806 smoothfocusCB.addItemListener(this);
664807 }
665808
....@@ -667,14 +810,20 @@
667810 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668811 // debugCB.addItemListener(this);
669812
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
813
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672814 oeilCB.addItemListener(this);
673815
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
816
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676817 lookAtCB.setToolTipText("Look-at target");
677818 lookAtCB.addItemListener(this);
819
+
820
+ }
821
+
822
+ cGridBag fill = new cGridBag();
823
+
824
+ fill.preferredHeight = 200;
825
+
826
+ panel.add(fill);
678827
679828 }
680829
....@@ -689,8 +838,11 @@
689838 buttonGroup.add(radioButton);
690839 radioButton.doClick();
691840 }
841
+
692842 void SetupViews(ObjEditor oe)
693843 {
844
+ theFrame = this;
845
+
694846 oe.SetupViews();
695847
696848 System.out.println("SetupViews");
....@@ -753,6 +905,7 @@
753905 } else if(e.getSource() == liveCB)
754906 {
755907 cameraView.ToggleLive();
908
+ refreshContents(false);
756909 }
757910 else if(e.getSource() == supportCB)
758911 {
....@@ -905,7 +1058,9 @@
9051058 // objEditor.DropFile((java.io.File[]) object, true);
9061059 // return;
9071060 // }
908
- if (string.charAt(0) == '/')
1061
+
1062
+ // File path for Mac and Windows
1063
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091064 {
9101065 // file(s)
9111066 String[] names = string.split("\n");
....@@ -932,7 +1087,7 @@
9321087
9331088 flashIt = false;
9341089 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1090
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361091 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371092
9381093 if (group.selection.size() == 1)
....@@ -959,11 +1114,11 @@
9591114 {
9601115 loadClipboard(true);
9611116 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1117
+ pasteInto(false, false);
9631118 } else {
9641119 loadClipboard(false);
9651120 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1121
+ pasteInto(false, false); // true); // ???
9671122 }
9681123 }
9691124 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1240,33 @@
10851240 kleinItem.addActionListener(this);
10861241 particleItem = menu.add(new MenuItem("Particle system"));
10871242 particleItem.addActionListener(this);
1243
+ if (Globals.ADVANCED)
1244
+ {
10881245 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891246 ragdollItem.addActionListener(this);
10901247 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911248 ragdoll2Item.addActionListener(this);
1249
+ }
10921250 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1251
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941252 meshItem.addActionListener(this);
10951253 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961254 // meshGroupItem.addActionListener(this);
1255
+ if (Globals.ADVANCED)
1256
+ {
10971257 springItem = menu.add(new MenuItem("Spring"));
10981258 springItem.addActionListener(this);
10991259 flagItem = menu.add(new MenuItem("Flag"));
11001260 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);
11051261 blobItem = menu.add(new MenuItem("Blob"));
11061262 blobItem.addActionListener(this);
11071263 latheItem = menu.add(new MenuItem("Lathe"));
11081264 latheItem.addActionListener(this);
1265
+ }
1266
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1267
+ bezierItem.addActionListener(this);
1268
+ overlayItem = menu.add(new MenuItem("Overlay"));
1269
+ overlayItem.addActionListener(this);
11091270 lightItem = menu.add(new MenuItem("Light"));
11101271 lightItem.addActionListener(this);
11111272 menu.add("-");
....@@ -1115,39 +1276,44 @@
11151276 loopItem.addActionListener(this);
11161277 doubleItem = menu.add(new MenuItem("Fork"));
11171278 doubleItem.addActionListener(this);
1279
+ if (Globals.ADVANCED)
1280
+ {
11181281 tripleItem = menu.add(new MenuItem("Trident"));
11191282 tripleItem.addActionListener(this);
1283
+ }
11201284 }
11211285
11221286 void buildToolsMenu(Menu menu)
11231287 {
11241288 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251289 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1290
+ animationItem.setState(Globals.ANIMATION);
11271291
11281292 menu.add("-");
11291293 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301294 parseverticesItem.addActionListener(this);
11311295 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321296 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1297
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341298 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371299 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381300 reduceMorphItem.addActionListener(this);
11391301 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401302 reduce34MorphItem.addActionListener(this);
1141
-
1303
+ menu.add("-");
11421304 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431305 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451306
1307
+ if (Globals.ADVANCED)
1308
+ {
1309
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1310
+ mirrorItem.addActionListener(this);
1311
+ menu.add("-");
11461312 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471313 memoryItem.addActionListener(this);
11481314 menu.add(analyzeItem = new MenuItem("Analyze"));
11491315 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1316
+ menu.add(dumpItem = new MenuItem("Print"));
11511317 dumpItem.addActionListener(this);
11521318 // menu.add(pathItem = new MenuItem("From-to path"));
11531319 // pathItem.addActionListener(this);
....@@ -1165,6 +1331,7 @@
11651331 menu.add("-");
11661332 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671333 editScriptItem.addActionListener(this);
1334
+ }
11681335 }
11691336
11701337 void ScreenFit()
....@@ -1493,9 +1660,9 @@
14931660
14941661 void Overwrite(int mask)
14951662 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1663
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971664 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1665
+ Object3D content = Grafreed.clipboard.get(0);
14991666
15001667 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011668 content = ((cGroup)content).get(0);
....@@ -1518,6 +1685,7 @@
15181685 //
15191686 public void actionPerformed(ActionEvent event) // , Object arg)
15201687 {
1688
+ Object source = event.getSource();
15211689 /*
15221690 if (event.getSource() == nameField)
15231691 {
....@@ -1529,11 +1697,11 @@
15291697 }
15301698 else
15311699 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1700
+ if (source == lookAtItem || source == lookFromItem)
15331701 {
15341702 ScreenFit();
15351703 } else
1536
- if (event.getSource() == switchItem)
1704
+ if (source == switchItem)
15371705 {
15381706 cVector v1 = new cVector();
15391707 cVector v2 = new cVector();
....@@ -1542,11 +1710,11 @@
15421710 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431711 objEditor.cameraView.repaint();
15441712 } else
1545
- if (event.getSource() == rectoidItem)
1713
+ if (source == rectoidItem)
15461714 {
15471715 makeSomething(new Box());
15481716 } else
1549
- if (event.getSource() == particleItem)
1717
+ if (source == particleItem)
15501718 {
15511719 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521720 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1735,9 @@
15671735 applyExample(particleGeom, "SMOKE");
15681736 makeSomething(particleGeom);
15691737 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1738
+ if (source == ragdollItem || source == ragdoll2Item)
15711739 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1740
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731741
15741742 ragdoll.toParent = LA.newMatrix();
15751743 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1755,7 @@
15871755 } else
15881756 /*
15891757 */
1590
- if (event.getSource() == heightFieldItem)
1758
+ if (source == heightFieldItem)
15911759 {
15921760 Object3D obj = new Object3D();
15931761
....@@ -1625,31 +1793,31 @@
16251793
16261794 makeSomething(obj);
16271795 } else
1628
- if (event.getSource() == gridItem)
1796
+ if (source == gridItem)
16291797 {
16301798 makeSomething(new Grid());
16311799 } else
1632
- if (event.getSource() == ellipsoidItem)
1800
+ if (source == ellipsoidItem)
16331801 {
16341802 makeSomething(new Sphere());
16351803 } else
1636
- if (event.getSource() == coneItem)
1804
+ if (source == coneItem)
16371805 {
16381806 makeSomething(new Cone());
16391807 } else
1640
- if (event.getSource() == torusItem)
1808
+ if (source == torusItem)
16411809 {
16421810 makeSomething(new Torus());
16431811 } else
1644
- if (event.getSource() == superItem)
1812
+ if (source == superItem)
16451813 {
16461814 makeSomething(new Superellipsoid());
16471815 } else
1648
- if (event.getSource() == kleinItem)
1816
+ if (source == kleinItem)
16491817 {
16501818 makeSomething(new Klein());
16511819 } else
1652
- if (event.getSource() == blobItem)
1820
+ if (source == blobItem)
16531821 {
16541822 Blob blob = new Blob();
16551823 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1825,15 @@
16571825 //blob.retile();
16581826 makeSomething(blob);
16591827 } else
1660
- if (event.getSource() == latheItem)
1828
+ if (source == latheItem)
16611829 {
16621830 makeSomething(new Lathe());
16631831 } else
1664
- if (event.getSource() == bezierItem)
1832
+ if (source == bezierItem)
16651833 {
16661834 makeSomething(new BezierSurface());
16671835 } else
1668
- if (event.getSource() == checkerItem)
1836
+ if (source == overlayItem)
16691837 {
16701838 /*
16711839 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1848,7 @@
16801848 */
16811849 makeSomething(new Checker());
16821850 } else
1683
- if (event.getSource() == meshItem)
1851
+ if (source == meshItem)
16841852 {
16851853 Object3D itemtomake = new Object3D();
16861854 Object3D child;
....@@ -1701,35 +1869,35 @@
17011869 makeSomething(child);
17021870 }
17031871 } else
1704
- if (event.getSource() == springItem)
1872
+ if (source == springItem)
17051873 {
17061874 cSpring s = new cSpring();
17071875 s.setup();
17081876 makeSomething(s);
17091877 } else
1710
- if (event.getSource() == flagItem)
1878
+ if (source == flagItem)
17111879 {
17121880 cSpring s = new cFlag();
17131881 s.setup();
17141882 makeSomething(s);
17151883 } else
1716
- if (event.getSource() == lightItem)
1884
+ if (source == lightItem)
17171885 {
17181886 makeSomething(new Light());
17191887 } else
1720
- if (event.getSource() == csgItem)
1888
+ if (source == csgItem)
17211889 {
17221890 group(new CSG());
17231891 } else
1724
- if (event.getSource() == templateItem)
1892
+ if (source == templateItem)
17251893 {
17261894 group(new cTemplate());
17271895 } else
1728
- if (event.getSource() == attributeItem)
1896
+ if (source == attributeItem)
17291897 {
17301898 makeSomething(new Attribute());
17311899 } else
1732
- if (event.getSource() == pointflowItem)
1900
+ if (source == pointflowItem)
17331901 {
17341902 makeSomething(new PointFlow());
17351903 } else
....@@ -1741,7 +1909,7 @@
17411909 } else
17421910 */
17431911
1744
- if (event.getSource() == superLoopItem)
1912
+ if (source == superLoopItem)
17451913 {
17461914 Composite g = new cGroup();
17471915 for (int i=0; i<15; i++)
....@@ -1763,7 +1931,7 @@
17631931
17641932 group(g);
17651933 } else
1766
- if (event.getSource() == loopItem)
1934
+ if (source == loopItem)
17671935 {
17681936 Composite csg = new GroupLeaf();
17691937 csg.count = 5;
....@@ -1772,7 +1940,7 @@
17721940 csg.addChild(child);
17731941 child.addChild(csg);
17741942 } else
1775
- if (event.getSource() == doubleItem)
1943
+ if (source == doubleItem)
17761944 {
17771945 Composite csg = new GroupLeaf();
17781946 csg.count = 5;
....@@ -1784,7 +1952,7 @@
17841952 csg.addChild(child);
17851953 child.addChild(csg);
17861954 } else
1787
- if (event.getSource() == tripleItem)
1955
+ if (source == tripleItem)
17881956 {
17891957 Composite csg = new GroupLeaf();
17901958 csg.count = 4;
....@@ -1799,71 +1967,83 @@
17991967 csg.addChild(child);
18001968 child.addChild(csg);
18011969 } 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)
1970
+ if (source == computeAOItem)
18201971 {
18211972 Globals.drawMode = CameraPane.OCCLUSION;
18221973 Globals.theRenderer.repaint();
18231974 } else
1824
- if (event.getSource() == recompileItem)
1975
+ if (source == recompileItem)
18251976 {
18261977 Recompile();
18271978 refreshContents();
18281979 } else
1829
- if (event.getSource() == editScriptItem)
1980
+ if (source == editScriptItem)
18301981 {
18311982 OpenDialog();
18321983 refreshContents();
18331984 } else
1834
- if (event.getSource() == invariantsItem)
1985
+ if (source == invariantsItem)
18351986 {
18361987 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
1988
+ Grafreed.grafreeD.universe.invariants();
18381989 } else
1839
- if (event.getSource() == memoryItem)
1990
+ if (source == memoryItem)
18401991 {
18411992 //System.out.println("Invariants:");
18421993 PrintMemory();
18431994 } else
1844
- if (event.getSource() == pathItem)
1995
+ if (source == pathItem)
18451996 {
18461997 PrintPath();
18471998 } else
1848
- if (event.getSource() == analyzeItem)
1999
+ if (source == analyzeItem)
18492000 {
18502001 AnalyzeObject();
18512002 } else
1852
- if (event.getSource() == dumpItem)
2003
+ if (source == dumpItem)
18532004 {
18542005 DumpObject();
18552006 } else
1856
- if (event.getSource() == screenfitButton)
2007
+ if (source == minButton)
2008
+ {
2009
+ Minimize();
2010
+ } else
2011
+ if (source == maxButton)
2012
+ {
2013
+ Maximize();
2014
+ } else
2015
+ if (source == fullButton)
2016
+ {
2017
+ ToggleFullScreen();
2018
+ } else
2019
+ if (source == undoButton)
2020
+ {
2021
+ Undo();
2022
+ } else
2023
+ if (source == redoButton)
2024
+ {
2025
+ Redo();
2026
+ } else
2027
+ if (source == saveButton)
2028
+ {
2029
+ Save();
2030
+ } else
2031
+ if (source == oneStepButton)
2032
+ {
2033
+ Globals.ONESTEP = true;
2034
+ cameraView.repaint();
2035
+ } else
2036
+ if (source == screenfitButton)
18572037 {
18582038 //Reload(lastConverter, lastFilename, true);
18592039 ScreenFit();
18602040 } else
1861
- if (event.getSource() == screenfitpointButton)
2041
+ if (source == screenfitpointButton)
18622042 {
18632043 //Reload(lastConverter, lastFilename, true);
18642044 ScreenFitPoint();
18652045 } else
1866
- if (event.getSource() == snapobjectButton)
2046
+ if (source == snapobjectButton)
18672047 {
18682048 //Reload(lastConverter, lastFilename, true);
18692049 SnapObject();
....@@ -1874,13 +2054,13 @@
18742054 // Recompile();
18752055 // refreshContents();
18762056 // } else
1877
- if (event.getSource() == gcButton)
2057
+ if (source == gcButton)
18782058 {
18792059 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802060 System.gc();
18812061 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822062 } else
1883
- if (event.getSource() == editLeafItem)
2063
+ if (source == editLeafItem)
18842064 {
18852065 Object3D obj;
18862066 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2074,74 @@
18942074 }
18952075 refreshContents(true);
18962076 } else
1897
- if (event.getSource() == openWindowItem)
2077
+ if (source == openWindowItem)
18982078 {
18992079 EditSelection(true);
19002080 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2081
+ if (source == cutItem || source == clearButton)
19022082 {
19032083 loadClipboard(true);
19042084 } else
1905
- if (event.getSource() == duplicateItem)
2085
+ if (source == undoItem)
19062086 {
1907
- Object3D keep = GrafreeD.clipboard;
2087
+ Undo();
2088
+ } else
2089
+ if (source == redoItem)
2090
+ {
2091
+ Redo();
2092
+ } else
2093
+ if (source == duplicateItem)
2094
+ {
2095
+ Object3D keep = Grafreed.clipboard;
19082096 loadClipboard(false);
19092097 paste(false);
1910
- GrafreeD.clipboard = keep;
2098
+ Grafreed.clipboard = keep;
19112099 } else
1912
- if (event.getSource() == cloneItem)
2100
+ if (source == cloneItem)
19132101 {
19142102 CloneSelection(false);
19152103 } else
1916
- if (event.getSource() == cloneSupportItem)
2104
+ if (source == cloneSupportItem)
19172105 {
19182106 CloneSelection(true);
19192107 } else
1920
- if (event.getSource() == copyItem)
2108
+ if (source == copyItem)
19212109 {
19222110 loadClipboard(false);
19232111 } else
1924
- if (event.getSource() == pasteItem)
2112
+ if (source == pasteItem)
19252113 {
19262114 paste(false);
19272115 } else
1928
- if (event.getSource() == pasteLinkItem)
2116
+ if (source == pasteIntoItem)
19292117 {
1930
- pasteInto(false);
2118
+ pasteInto(true, false);
19312119 } else
1932
- if (event.getSource() == pasteCloneItem)
2120
+ if (source == pasteLinkItem)
19332121 {
1934
- pasteInto(true);
2122
+ pasteInto(false, false);
19352123 } else
1936
- if (event.getSource() == pasteExpandItem)
2124
+ if (source == pasteCloneItem)
2125
+ {
2126
+ pasteInto(true, true);
2127
+ } else
2128
+ if (source == pasteExpandItem)
19372129 {
19382130 paste(true);
19392131 } else
1940
- if (event.getSource() == synchronizeItem)
2132
+ if (source == synchronizeItem)
19412133 {
19422134 Overwrite(Object3D.TRANSFORM);
19432135 } else
1944
- if (event.getSource() == overwriteNameItem)
2136
+ if (source == overwriteNameItem)
19452137 {
19462138 Overwrite(Object3D.NAME);
19472139 } else
1948
- if (event.getSource() == overwriteUVItem)
2140
+ if (source == overwriteUVItem)
19492141 {
19502142 Overwrite(Object3D.UV);
19512143 } else
1952
- if (event.getSource() == overwriteMatItem)
2144
+ if (source == overwriteMatItem)
19532145 {
19542146 /* july 2015
19552147 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2161,7 @@
19692161
19702162 Overwrite(dropAttributes);
19712163 }
1972
- if (event.getSource() == overwriteGeoItem)
2164
+ if (source == overwriteGeoItem)
19732165 {
19742166 Overwrite(Object3D.GEOMETRY);
19752167 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2178,7 @@
19862178 // refreshContents();
19872179 // }
19882180 } else
1989
- if (event.getSource() == generateMeshItem)
2181
+ if (source == generateMeshItem)
19902182 {
19912183 //if (group.selection.size() == 1)
19922184 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2189,7 @@
19972189 ResetModel();
19982190 refreshContents();
19992191 } else
2000
- if (event.getSource() == extractGeometriesItem)
2192
+ if (source == extractGeometriesItem)
20012193 {
20022194 boolean one = false;
20032195
....@@ -2024,7 +2216,7 @@
20242216 ResetModel();
20252217 refreshContents();
20262218 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2219
+ if (source == cloneGeometriesItem)
20282220 {
20292221 boolean one = false;
20302222
....@@ -2050,7 +2242,7 @@
20502242 ResetModel();
20512243 refreshContents();
20522244 } else
2053
- if (event.getSource() == shareGeometriesItem)
2245
+ if (source == shareGeometriesItem)
20542246 {
20552247 boolean one = false;
20562248
....@@ -2080,7 +2272,7 @@
20802272 refreshContents();
20812273 }
20822274 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2275
+ if (source == mergeGeometriesItem)
20842276 {
20852277 boolean one = false;
20862278
....@@ -2110,7 +2302,7 @@
21102302 ResetModel();
21112303 refreshContents();
21122304 } else
2113
- if (event.getSource() == linkverticesItem)
2305
+ if (source == linkverticesItem)
21142306 {
21152307 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162308 // {
....@@ -2123,9 +2315,9 @@
21232315 // group.selection.get(0).setMasterThis(content); // should be identity
21242316 // refreshContents();
21252317 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2318
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272319 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2320
+ Object3D content = Grafreed.clipboard.get(0);
21292321
21302322 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312323 content = ((cGroup)content).get(0);
....@@ -2133,38 +2325,38 @@
21332325 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342326 for (int i=0; i<group.selection.size(); i++)
21352327 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2328
+ boolean random = CameraPane.SWITCH;
2329
+ CameraPane.SWITCH = false; // parse all random nodes
21382330 group.selection.get(i).linkVerticesThis(content);
21392331 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2332
+ CameraPane.SWITCH = random;
21412333 }
21422334 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432335 refreshContents();
21442336 }
21452337 } else
2146
- if (event.getSource() == resetsupportItem)
2338
+ if (source == resetsupportItem)
21472339 {
21482340 for (int i=0; i<group.selection.size(); i++)
21492341 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2342
+ boolean random = CameraPane.SWITCH;
2343
+ CameraPane.SWITCH = false; // parse all random nodes
21522344 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2345
+ CameraPane.SWITCH = random;
21542346 }
21552347
21562348 refreshContents();
21572349 } else
2158
- if (event.getSource() == relinkverticesItem)
2350
+ if (source == relinkverticesItem)
21592351 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2352
+ boolean random = CameraPane.SWITCH;
2353
+ CameraPane.SWITCH = false; // parse all random nodes
21622354 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2355
+ CameraPane.SWITCH = random;
21642356
21652357 refreshContents();
21662358 } else
2167
- if (event.getSource() == resetreferencesItem)
2359
+ if (source == resetreferencesItem)
21682360 {
21692361 for (int i=0; i<group.selection.size(); i++)
21702362 {
....@@ -2173,11 +2365,11 @@
21732365
21742366 refreshContents();
21752367 } else
2176
- if (event.getSource() == setMasterItem)
2368
+ if (source == setMasterItem)
21772369 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2370
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792371 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2372
+ Object3D content = Grafreed.clipboard.get(0);
21812373
21822374 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832375 content = ((cGroup)content).get(0);
....@@ -2186,13 +2378,13 @@
21862378 refreshContents();
21872379 }
21882380 } else
2189
- if (event.getSource() == poseMeshItem)
2381
+ if (source == poseMeshItem)
21902382 {
21912383 if (group.selection.size() == 1)
21922384 {
2193
- if (GrafreeD.clipboard.size() == 1)
2385
+ if (Grafreed.clipboard.size() == 1)
21942386 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2387
+ Object3D content = Grafreed.clipboard.get(0);
21962388
21972389 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982390 content = ((cGroup)content).get(0);
....@@ -2205,19 +2397,19 @@
22052397 }
22062398
22072399 } else
2208
- if (event.getSource() == revertMeshItem)
2400
+ if (source == revertMeshItem)
22092401 {
22102402 RevertMeshes();
22112403 } else
2212
- if (event.getSource() == resetMeshItem)
2404
+ if (source == resetAllItem)
22132405 {
22142406 ResetAll();
22152407 } else
2216
- if (event.getSource() == stepAllItem)
2408
+ if (source == stepAllItem)
22172409 {
22182410 StepAll();
22192411 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2412
+ if (source == clearItem) // || event.getSource() == clearButton)
22212413 {
22222414 //int indices[] = jList.getSelectedIndices();
22232415 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2417,46 @@
22252417
22262418 ClearSelection(false);
22272419 } else
2228
- if (event.getSource() == clearAllItem)
2420
+ if (source == clearAllItem)
22292421 {
22302422 ClearSelection(true);
22312423 } else
2232
- if (event.getSource() == grabItem)
2424
+ if (source == grabItem)
22332425 {
22342426 group(new cGroup(), true);
22352427 } else
2236
- if (event.getSource() == hideItem)
2428
+ if (source == hideItem)
22372429 {
22382430 group(new HiddenObject());
22392431 } else
2240
- if (event.getSource() == frontItem)
2432
+ if (source == frontItem)
22412433 {
22422434 front();
22432435 } else
2244
- if (event.getSource() == backItem)
2436
+ if (source == backItem)
22452437 {
22462438 back();
22472439 } else
2248
- if (event.getSource() == cameraItem)
2440
+ if (source == cameraItem)
22492441 {
22502442 makeSomething(new Camera());
22512443 } else
2252
- if (event.getSource() == compositeItem)
2444
+ if (source == compositeItem)
22532445 {
22542446 group(new Composite());
22552447 } else
2256
- if (event.getSource() == randomItem)
2448
+ if (source == randomItem)
22572449 {
22582450 RandomNode random = new RandomNode();
22592451 group(random);
22602452 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2453
+ random.name = random.get(0).name + "Switch";
22622454 } else
2263
- if (event.getSource() == physicsItem)
2455
+ if (source == physicsItem)
22642456 {
22652457 group(new PhysicsNode());
22662458 } else
2267
- if (event.getSource() == frameselectorItem)
2459
+ if (source == frameselectorItem)
22682460 {
22692461 for (int i=0; i<group.selection.size(); i++)
22702462 {
....@@ -2276,7 +2468,7 @@
22762468 ResetModel();
22772469 refreshContents();
22782470 } else
2279
- if (event.getSource() == switchGeoItem)
2471
+ if (source == switchGeoItem)
22802472 {
22812473 for (int i=0; i<group.selection.size(); i++)
22822474 {
....@@ -2288,7 +2480,7 @@
22882480 ResetModel();
22892481 refreshContents();
22902482 } else
2291
- if (event.getSource() == switchTransfoItem)
2483
+ if (source == switchTransfoItem)
22922484 {
22932485 for (int i=0; i<group.selection.size(); i++)
22942486 {
....@@ -2300,7 +2492,7 @@
23002492 ResetModel();
23012493 refreshContents();
23022494 } else
2303
- if (event.getSource() == morphItem)
2495
+ if (source == morphItem)
23042496 {
23052497 for (int i=0; i<group.selection.size(); i++)
23062498 {
....@@ -2312,7 +2504,7 @@
23122504 ResetModel();
23132505 refreshContents();
23142506 } else
2315
- if (event.getSource() == scriptNodeItem)
2507
+ if (source == scriptNodeItem)
23162508 {
23172509 boolean atleastone = false;
23182510
....@@ -2351,31 +2543,31 @@
23512543 }
23522544 }
23532545 } else
2354
- if (event.getSource() == linkerItem)
2546
+ if (source == linkerItem)
23552547 {
23562548 group(new cLinker());
23572549 } else
2358
- if (event.getSource() == textureItem)
2550
+ if (source == textureItem)
23592551 {
23602552 group(new TextureNode());
23612553 } else
2362
- if (event.getSource() == billboardItem)
2554
+ if (source == billboardItem)
23632555 {
23642556 group(new BillboardNode());
23652557 } else
2366
- if (event.getSource() == shadowXItem)
2558
+ if (source == shadowXItem)
23672559 {
23682560 CastShadow(0);
23692561 } else
2370
- if (event.getSource() == shadowYItem)
2562
+ if (source == shadowYItem)
23712563 {
23722564 CastShadow(1);
23732565 } else
2374
- if (event.getSource() == shadowZItem)
2566
+ if (source == shadowZItem)
23752567 {
23762568 CastShadow(2);
23772569 } else
2378
- if (event.getSource() == ungroupItem)
2570
+ if (source == ungroupItem)
23792571 {
23802572 //ungroup();
23812573 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2579,203 @@
23872579
23882580 refreshContents();
23892581 } else
2390
- if (event.getSource() == genUVItem)
2582
+ if (source == genUVItem)
23912583 {
23922584 GenUV();
23932585 } else
2394
- if (event.getSource() == genNormalsCADItem)
2586
+ if (source == genNormalsCADItem)
23952587 {
23962588 GenNormals(true);
23972589 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2590
+ if (source == genNormalsMESHItem)
23992591 {
2400
- GenNormals(true); // TODO
2592
+ GenNormalsMESH();
24012593 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2594
+ if (source == genNormalsORGANItem)
24032595 {
24042596 GenNormals(false);
24052597 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2598
+ if (source == genNormalsMINEItem)
24072599 {
24082600 GenNormalsMINE();
24092601 } else
2410
- if (event.getSource() == stripifyItem)
2602
+ if (source == stripifyItem)
24112603 {
24122604 Stripify();
24132605 } else
2414
- if (event.getSource() == unstripifyItem)
2606
+ if (source == unstripifyItem)
24152607 {
24162608 Unstripify();
24172609 } else
2418
- if (event.getSource() == trimItem)
2610
+ if (source == trimItem)
24192611 {
24202612 Trim();
24212613 } else
2422
- if (event.getSource() == untrimItem)
2614
+ if (source == untrimItem)
24232615 {
24242616 Untrim();
24252617 } else
2426
- if (event.getSource() == clearColorsItem)
2618
+ if (source == clearColorsItem)
24272619 {
24282620 ClearColors();
24292621 } else
2430
- if (event.getSource() == clearMaterialsItem)
2622
+ if (source == clearMaterialsItem)
24312623 {
24322624 ClearMaterials();
24332625 } else
2434
- if (event.getSource() == liveleavesItem)
2626
+ if (source == liveleavesItem)
24352627 {
24362628 LiveLeaves(true);
24372629 } else
2438
- if (event.getSource() == unliveleavesItem)
2630
+ if (source == unliveleavesItem)
24392631 {
24402632 LiveLeaves(false);
24412633 } else
2442
- if (event.getSource() == supportleavesItem)
2634
+ if (source == supportleavesItem)
24432635 {
24442636 SupportLeaves(true);
24452637 } else
2446
- if (event.getSource() == unsupportleavesItem)
2638
+ if (source == unsupportleavesItem)
24472639 {
24482640 SupportLeaves(false);
24492641 } else
2450
- if (event.getSource() == hideleavesItem)
2642
+ if (source == hideleavesItem)
24512643 {
24522644 HideLeaves(true);
24532645 } else
2454
- if (event.getSource() == showleavesItem)
2646
+ if (source == showleavesItem)
24552647 {
24562648 HideLeaves(false);
24572649 } else
2458
- if (event.getSource() == markleavesItem)
2650
+ if (source == markleavesItem)
24592651 {
24602652 MarkLeaves(true);
24612653 } else
2462
- if (event.getSource() == unmarkleavesItem)
2654
+ if (source == unmarkleavesItem)
24632655 {
24642656 MarkLeaves(false);
24652657 } else
2466
- if (event.getSource() == flipVItem)
2658
+ if (source == rewindleavesItem)
2659
+ {
2660
+ RewindLeaves(true);
2661
+ } else
2662
+ if (source == unrewindleavesItem)
2663
+ {
2664
+ RewindLeaves(false);
2665
+ } else
2666
+ if (source == randomleavesItem)
2667
+ {
2668
+ RandomLeaves(true);
2669
+ } else
2670
+ if (source == unrandomleavesItem)
2671
+ {
2672
+ RandomLeaves(false);
2673
+ } else
2674
+ if (source == flipVItem)
24672675 {
24682676 FlipV(true);
24692677 } else
2470
- if (event.getSource() == unflipVItem)
2678
+ if (source == unflipVItem)
24712679 {
24722680 FlipV(false);
24732681 } else
2474
- if (event.getSource() == lowTexturesItem)
2682
+ if (source == lowTexturesItem)
24752683 {
24762684 SetTexRes(0);
24772685 } else
2478
- if (event.getSource() == normalTexturesItem)
2686
+ if (source == normalTexturesItem)
24792687 {
24802688 SetTexRes(1);
24812689 } else
2482
- if (event.getSource() == highTexturesItem)
2690
+ if (source == highTexturesItem)
24832691 {
24842692 SetTexRes(2);
24852693 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2694
+ if (source == veryhighTexturesItem)
24872695 {
24882696 SetTexRes(3);
24892697 } else
2490
- if (event.getSource() == maxTexturesItem)
2698
+ if (source == maxTexturesItem)
24912699 {
24922700 SetTexRes(4);
24932701 } else
2494
- if (event.getSource() == panoTexturesItem)
2702
+ if (source == panoTexturesItem)
24952703 {
24962704 SetTexRes(5);
24972705 } else
2498
- if (event.getSource() == reverseNormalsItem)
2706
+ if (source == reverseNormalsItem)
24992707 {
25002708 ReverseNormals();
25012709 } else
2502
- if (event.getSource() == parseverticesItem)
2710
+ if (source == parseverticesItem)
25032711 {
25042712 ParseVertices();
25052713 } else
2506
- if (event.getSource() == textureFieldItem)
2714
+ if (source == textureFieldItem)
25072715 {
25082716 TextureVertices();
25092717 } else
2510
- if (event.getSource() == alignItem)
2718
+ if (source == alignItem)
25112719 {
25122720 Align();
25132721 } else
2514
- if (event.getSource() == mirrorItem)
2722
+ if (source == mirrorItem)
25152723 {
25162724 MirrorPoses();
25172725 } else
2518
- if (event.getSource() == reduceMorphItem)
2726
+ if (source == reduceMorphItem)
25192727 {
25202728 MeshReduction(false);
25212729 } else
2522
- if (event.getSource() == reduce34MorphItem)
2730
+ if (source == reduce34MorphItem)
25232731 {
25242732 MeshReduction(true);
25252733 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2734
+ if (source == reverseTrianglesItem)
25272735 {
25282736 ReverseTriangles();
25292737 } else
2530
- if (event.getSource() == reduceMeshItem)
2738
+ if (source == reduceMeshItem)
25312739 {
25322740 ReduceMesh(false);
25332741 } else
2534
- if (event.getSource() == reduce34MeshItem)
2742
+ if (source == reduce34MeshItem)
25352743 {
25362744 ReduceMesh(true);
25372745 } else
2538
- if (event.getSource() == increaseMeshItem)
2746
+ if (source == increaseMeshItem)
25392747 {
25402748 IncreaseMesh();
25412749 } else
2542
- if (event.getSource() == clipMeshItem)
2750
+ if (source == clipMeshItem)
25432751 {
25442752 ClipMesh();
25452753 } else
2546
- if (event.getSource() == smoothMeshItem)
2754
+ if (source == smoothMeshItem)
25472755 {
25482756 SmoothMesh();
25492757 } else
2550
- if (event.getSource() == transformgeometryItem)
2758
+ if (source == transformGeometryItem)
25512759 {
25522760 TransformGeometry();
25532761 } else
2554
- if (event.getSource() == resetTransformItem)
2762
+ if (source == transformChildrenItem)
2763
+ {
2764
+ TransformChildren();
2765
+ } else
2766
+ if (source == resetTransformItem)
25552767 {
25562768 ResetTransform();
25572769 } else
2558
- if (event.getSource() == resetCentroidItem)
2770
+ if (source == resetCentroidItem)
25592771 {
2560
- ResetCentroid();
2772
+ ResetCentroid(true);
25612773 } else
2562
- if (event.getSource() == resetParentItem)
2774
+ if (source == resetCentroidXZItem)
2775
+ {
2776
+ ResetCentroid(false);
2777
+ } else
2778
+ if (source == resetParentItem)
25632779 {
25642780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652781 {
....@@ -2569,7 +2785,7 @@
25692785
25702786 refreshContents();
25712787 } else
2572
- if (event.getSource() == repairParentItem)
2788
+ if (source == repairParentItem)
25732789 {
25742790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752791 {
....@@ -2583,7 +2799,7 @@
25832799
25842800 refreshContents();
25852801 } else
2586
- if (event.getSource() == repairShadowItem)
2802
+ if (source == repairShadowItem)
25872803 {
25882804 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892805 {
....@@ -2597,7 +2813,7 @@
25972813
25982814 refreshContents();
25992815 } else
2600
- if (event.getSource() == sortbysizeItem)
2816
+ if (source == sortbysizeItem)
26012817 {
26022818 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032819 {
....@@ -2609,7 +2825,7 @@
26092825 ResetModel();
26102826 refreshContents();
26112827 } else
2612
- if (event.getSource() == sortbynameItem)
2828
+ if (source == sortbynameItem)
26132829 {
26142830 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152831 {
....@@ -2621,7 +2837,7 @@
26212837 ResetModel();
26222838 refreshContents();
26232839 } else
2624
- if (event.getSource() == attachPigmentItem)
2840
+ if (source == attachPigmentItem)
26252841 {
26262842 String texture = GetFile("Attach pigment");
26272843 Object3D obj;
....@@ -2633,7 +2849,7 @@
26332849
26342850 refreshContents();
26352851 } else
2636
- if (event.getSource() == detachPigmentItem)
2852
+ if (source == detachPigmentItem)
26372853 {
26382854 Object3D obj;
26392855 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2860,7 @@
26442860
26452861 refreshContents();
26462862 } else
2647
- if (event.getSource() == attachBumpItem)
2863
+ if (source == attachBumpItem)
26482864 {
26492865 String texture = GetFile("Attach bump");
26502866 Object3D obj;
....@@ -2656,7 +2872,7 @@
26562872
26572873 refreshContents();
26582874 } else
2659
- if (event.getSource() == detachBumpItem)
2875
+ if (source == detachBumpItem)
26602876 {
26612877 Object3D obj;
26622878 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2883,7 @@
26672883
26682884 refreshContents();
26692885 } else
2670
- if (event.getSource() == pigmentBumpItem)
2886
+ if (source == pigmentBumpItem)
26712887 {
26722888 Object3D obj;
26732889 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2894,221 @@
26782894
26792895 refreshContents();
26802896 } else
2681
- if (event.getSource() == flashSelectionButton)
2897
+ if (source == flashSelectionButton)
26822898 {
26832899 CameraPane.flash = true;
26842900 refreshContents();
26852901 } else
2686
- if (event.getSource() == oneButton)
2902
+ if (source == oneButton)
26872903 {
26882904 } else
2689
- if (event.getSource() == twoButton)
2905
+ if (source == twoButton)
26902906 {
26912907 radio.layout = twoButton;
26922908 // bug
26932909 //gridPanel.setDividerLocation(1.0);
26942910 //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();
2911
+// bigThree.remove(scenePanel);
2912
+// bigThree.remove(centralPanel);
2913
+// bigThree.remove(XYZPanel);
2914
+// aWindowConstraints.gridx = 0;
2915
+// aWindowConstraints.gridy = 0;
2916
+// aWindowConstraints.gridwidth = 1;
2917
+// // aConstraints.gridheight = 3;
2918
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2919
+// aWindowConstraints.weightx = 0;
2920
+// aWindowConstraints.weighty = 1;
2921
+// //bigThree.add(jtp, aWindowConstraints);
2922
+// aWindowConstraints.weightx = 1;
2923
+// aWindowConstraints.gridwidth = 3;
2924
+// // aConstraints.gridheight = 3;
2925
+// aWindowConstraints.gridx = 1;
2926
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2927
+// bigThree.add(centralPanel, aWindowConstraints);
2928
+// aWindowConstraints.weightx = 0;
2929
+// aWindowConstraints.gridx = 4;
2930
+// aWindowConstraints.gridwidth = 1;
2931
+// // aConstraints.gridheight = 3;
2932
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2933
+// //bigThree.add(XYZPanel, aWindowConstraints);
2934
+// scenePanel.setVisible(false);
2935
+// centralPanel.setVisible(true);
2936
+// XYZPanel.setVisible(false);
2937
+ bigThree.ClearUI();
2938
+ bigThree.add(centralPanel);
2939
+ bigThree.FlushUI();
2940
+
2941
+ cameraView.requestFocusInWindow();
2942
+
2943
+// refreshContents(true);
2944
+//
2945
+// try
2946
+// {
2947
+// java.awt.Robot bot = new java.awt.Robot();
2948
+// int mask = InputEvent.BUTTON1_MASK;
2949
+// bot.mouseMove(100, 100);
2950
+// bot.mousePress(mask);
2951
+// bot.mouseRelease(mask);
2952
+// }
2953
+// catch (Exception e)
2954
+// {
2955
+//
2956
+// }
2957
+
27192958 } else
2720
- if (event.getSource() == threeButton)
2959
+ if (source == threeButton)
27212960 {
27222961 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();
2962
+
2963
+// bigThree.remove(scenePanel);
2964
+// bigThree.remove(centralPanel);
2965
+// bigThree.remove(XYZPanel);
2966
+// aWindowConstraints.gridx = 0;
2967
+// aWindowConstraints.gridy = 0;
2968
+// aWindowConstraints.gridwidth = 1;
2969
+// // aConstraints.gridheight = 3;
2970
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2971
+// aWindowConstraints.weightx = 0;
2972
+// aWindowConstraints.weighty = 1;
2973
+// //bigThree.add(jtp, aWindowConstraints);
2974
+// aWindowConstraints.weightx = 1;
2975
+// aWindowConstraints.gridwidth = 3;
2976
+// // aConstraints.gridheight = 3;
2977
+// aWindowConstraints.gridx = 1;
2978
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2979
+// bigThree.add(centralPanel, aWindowConstraints);
2980
+// aWindowConstraints.weightx = 0;
2981
+// aWindowConstraints.gridx = 4;
2982
+// aWindowConstraints.gridwidth = 1;
2983
+// // aConstraints.gridheight = 3;
2984
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2985
+// bigThree.add(XYZPanel, aWindowConstraints);
2986
+// bigThree.validate();
2987
+// scenePanel.setVisible(false);
2988
+// centralPanel.setVisible(true);
2989
+// XYZPanel.setVisible(true);
2990
+ bigThree.ClearUI();
2991
+ bigThree.add(centralPanel);
2992
+ bigThree.add(XYZPanel);
2993
+ bigThree.FlushUI();
2994
+
2995
+ cameraView.requestFocusInWindow();
27472996 } else
2748
- if (event.getSource() == fourButton)
2997
+ if (source == fourButton)
27492998 {
27502999 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();
3000
+
3001
+// bigThree.remove(scenePanel);
3002
+// bigThree.remove(centralPanel);
3003
+// bigThree.remove(XYZPanel);
3004
+// aWindowConstraints.gridx = 0;
3005
+// aWindowConstraints.gridy = 0;
3006
+// aWindowConstraints.gridwidth = 1;
3007
+// // aWindowConstraints.gridheight = 3;
3008
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3009
+// aWindowConstraints.weightx = 1;
3010
+// aWindowConstraints.weighty = 1;
3011
+// bigThree.add(scenePanel, aWindowConstraints);
3012
+// aWindowConstraints.weightx = 1;
3013
+// aWindowConstraints.gridwidth = 3;
3014
+// // aConstraints.gridheight = 3;
3015
+// aWindowConstraints.gridx = 1;
3016
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3017
+// //bigThree.add(cameraPanel, aWindowConstraints);
3018
+// aWindowConstraints.weightx = 0;
3019
+// aWindowConstraints.gridx = 4;
3020
+// aWindowConstraints.gridwidth = 1;
3021
+// // aWindowConstraints.gridheight = 3;
3022
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3023
+// //bigThree.add(XYZPanel, aWindowConstraints);
3024
+// bigThree.validate();
3025
+// scenePanel.setVisible(true);
3026
+// centralPanel.setVisible(false);
3027
+// XYZPanel.setVisible(false);
3028
+ bigThree.ClearUI();
3029
+ bigThree.add(scenePanel);
3030
+ bigThree.FlushUI();
3031
+
3032
+ cameraView.requestFocusInWindow();
27753033 } else
2776
- if (event.getSource() == sixButton)
3034
+ if (source == sixButton)
27773035 {
27783036 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();
3037
+
3038
+// bigThree.remove(scenePanel);
3039
+// bigThree.remove(centralPanel);
3040
+// bigThree.remove(XYZPanel);
3041
+// aWindowConstraints.gridx = 0;
3042
+// aWindowConstraints.gridy = 0;
3043
+// aWindowConstraints.gridwidth = 1;
3044
+// // aConstraints.gridheight = 3;
3045
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3046
+// aWindowConstraints.weightx = 0;
3047
+// aWindowConstraints.weighty = 1;
3048
+// bigThree.add(scenePanel, aWindowConstraints);
3049
+// aWindowConstraints.weightx = 1;
3050
+// aWindowConstraints.gridwidth = 3;
3051
+// // aWindowConstraints.gridheight = 3;
3052
+// aWindowConstraints.gridx = 1;
3053
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3054
+// bigThree.add(centralPanel, aWindowConstraints);
3055
+// aWindowConstraints.weightx = 0;
3056
+// aWindowConstraints.gridx = 4;
3057
+// aWindowConstraints.gridwidth = 1;
3058
+// // aWindowConstraints.gridheight = 3;
3059
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3060
+// //bigThree.add(XYZPanel, aConstraints);
3061
+// bigThree.validate();
3062
+// scenePanel.setVisible(true);
3063
+// centralPanel.setVisible(true);
3064
+// XYZPanel.setVisible(false);
3065
+ bigThree.ClearUI();
3066
+ bigThree.add(scenePanel);
3067
+ bigThree.add(centralPanel);
3068
+ bigThree.FlushUI();
3069
+
3070
+ cameraView.requestFocusInWindow();
28033071 } else
2804
- if (event.getSource() == sevenButton)
3072
+ if (source == sevenButton)
28053073 {
28063074 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();
3075
+
3076
+// bigThree.remove(scenePanel);
3077
+// bigThree.remove(centralPanel);
3078
+// bigThree.remove(XYZPanel);
3079
+// aWindowConstraints.gridx = 0;
3080
+// aWindowConstraints.gridy = 0;
3081
+// aWindowConstraints.gridwidth = 1;
3082
+// // aWindowConstraints.gridheight = 3;
3083
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3084
+// aWindowConstraints.weightx = 0;
3085
+// aWindowConstraints.weighty = 1;
3086
+// bigThree.add(scenePanel, aWindowConstraints);
3087
+// aWindowConstraints.weightx = 1;
3088
+// aWindowConstraints.gridwidth = 3;
3089
+// // aWindowConstraints.gridheight = 3;
3090
+// aWindowConstraints.gridx = 1;
3091
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3092
+// bigThree.add(centralPanel, aWindowConstraints);
3093
+// aWindowConstraints.weightx = 0;
3094
+// aWindowConstraints.gridx = 4;
3095
+// aWindowConstraints.gridwidth = 1;
3096
+// // aConstraints.gridheight = 3;
3097
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3098
+// bigThree.add(XYZPanel, aWindowConstraints);
3099
+// bigThree.validate();
3100
+// scenePanel.setVisible(true);
3101
+// centralPanel.setVisible(true);
3102
+// XYZPanel.setVisible(true);
3103
+ bigThree.ClearUI();
3104
+ bigThree.add(scenePanel);
3105
+ bigThree.add(centralPanel);
3106
+ bigThree.add(XYZPanel);
3107
+ bigThree.FlushUI();
3108
+
3109
+ cameraView.requestFocusInWindow();
28313110 } else
2832
- if (event.getSource() == rootButton)
3111
+ if (source == rootButton)
28333112 {
28343113 Object3D obj;
28353114 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,9 +3118,10 @@
28393118 EditObject(obj);
28403119 }
28413120
3121
+ cameraView.requestFocusInWindow();
28423122 refreshContents(true);
28433123 } else
2844
- if (event.getSource() == closeButton)
3124
+ if (source == closeButton)
28453125 {
28463126 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473127 cRadio ab;
....@@ -2860,13 +3140,15 @@
28603140 break;
28613141 }
28623142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
28633145 refreshContents(true);
28643146 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3147
+ if (source == editItem || source == editButton)
28663148 {
28673149 EditSelection(false);
28683150 } else
2869
- if (event.getSource() == uneditButton)
3151
+ if (source == uneditButton)
28703152 {
28713153 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723154 {
....@@ -2876,14 +3158,14 @@
28763158 child.CloseUI();
28773159 listUI.remove(child);
28783160
2879
- child.editWindow = null; // ???????????
3161
+ //child.editWindow = null; // ???????????
28803162 }
2881
- objEditor.ctrlPanel.revalidate();
3163
+ objEditor.ctrlPanel.FlushUI();
28823164 //objEditor.jTree.clearSelection();
28833165 //objEditor.ResetSliders();
28843166 refreshContents(true);
28853167 } else
2886
- if (event.getSource() == clearPanelButton)
3168
+ if (source == clearPanelButton)
28873169 {
28883170 assert(copy == group);
28893171 //copy.ClearUI();
....@@ -2894,7 +3176,7 @@
28943176 listUI.clear();
28953177 refreshContents(true);
28963178 } else
2897
- if (event.getSource() == allParamsButton)
3179
+ if (source == allParamsButton)
28983180 {
28993181 assert(copy == group);
29003182
....@@ -2915,19 +3197,19 @@
29153197
29163198 refreshContents(true);
29173199 } else
2918
- if (event.getSource() == unselectButton)
3200
+ if (source == unselectButton)
29193201 {
29203202 objEditor.jTree.clearSelection();
29213203 // ?? oct 2012 GrafreeD.clipboard.clear();
29223204 objEditor.ResetSliders();
29233205 refreshContents(true);
29243206 } else
2925
- if(event.getSource() instanceof cRadio)
3207
+ if(source instanceof cRadio)
29263208 {
29273209 group.parent = keepparent;
29283210 group.attributes = 0;
29293211 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3212
+ /*cRadio*/ radio = (cRadio)source;
29313213 Object3D obj = radio.GetObject();
29323214 System.out.println("Edit " + obj);
29333215 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3244,10 @@
29623244 frontView.object = group;
29633245 sideView.object = group;
29643246 }
2965
- group.editWindow = this;
3247
+
3248
+// fix "+" issue
3249
+ //group.editWindow = this;
3250
+
29663251 /*
29673252 currentLayout = radio.layout;
29683253 if (currentLayout == null)
....@@ -2974,8 +3259,23 @@
29743259 //group.parent = null; // ROOT
29753260 //group.attributes = -1;
29763261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
29773264 refreshContents(true);
2978
- }
3265
+ } else if (event.getSource() == editCameraItem)
3266
+ {
3267
+ cameraView.ProtectCamera();
3268
+ cameraView.repaint();
3269
+ return;
3270
+ } else if (event.getSource() == revertCameraItem)
3271
+ {
3272
+ cameraView.RevertCamera();
3273
+ cameraView.repaint();
3274
+ return;
3275
+ // } else if (event.getSource() == textureButton)
3276
+ // {
3277
+ // return; // true;
3278
+ }
29793279 else
29803280 {
29813281 //return super.action(event, arg);
....@@ -2984,7 +3284,6 @@
29843284 }
29853285
29863286 boolean useclient = false;
2987
- cRadio radio;
29883287
29893288 void ToggleRoot()
29903289 {
....@@ -3036,6 +3335,28 @@
30363335 refreshContents();
30373336 }
30383337
3338
+ void TransformChildren()
3339
+ {
3340
+ Object3D obj;
3341
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3342
+ {
3343
+ obj = (Object3D)e.nextElement();
3344
+ obj.KeepTextureMatrices();
3345
+ obj.TransformChildren();
3346
+ obj.RestoreTextureMatrices();
3347
+
3348
+// if (obj.parent == null)
3349
+// {
3350
+// System.out.println("NULL PARENT!");
3351
+// new Exception().printStackTrace();
3352
+// }
3353
+// else
3354
+// TouchTransform(obj);
3355
+// //obj.parent.Touch();
3356
+ }
3357
+
3358
+ refreshContents();
3359
+ }
30393360
30403361 void ResetTransform()
30413362 {
....@@ -3148,7 +3469,7 @@
31483469 refreshContents();
31493470 }
31503471
3151
- void ResetCentroid()
3472
+ void ResetCentroid(boolean full)
31523473 {
31533474 Object3D obj;
31543475 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3484,16 @@
31633484 LA.matIdentity(Object3D.mat);
31643485 obj.getBounds(minima, maxima, false);
31653486 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3487
+ if (full)
3488
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673489 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683490 obj.TransformMesh(Object3D.mat);
3491
+
31693492 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3493
+ if (full)
3494
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713495 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3496
+
31723497 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733498 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743499 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3522,8 @@
31973522
31983523 int size = obj.MemorySize();
31993524
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
3525
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3526
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32013527 }
32023528 }
32033529 catch (Exception e)
....@@ -3234,9 +3560,9 @@
32343560 obj = (Object3D)e.nextElement();
32353561
32363562 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3563
+ Grafreed.AnalyzeObject(obj);
32383564 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3565
+ Grafreed.AnalyzeObject(obj.bRep);
32403566
32413567 // System.err.println((size/1024) + " KB is the size of " + obj);
32423568 }
....@@ -3278,6 +3604,13 @@
32783604 void GenNormals(boolean crease)
32793605 {
32803606 group.GenNormalsS(crease);
3607
+
3608
+ refreshContents();
3609
+ }
3610
+
3611
+ void GenNormalsMESH()
3612
+ {
3613
+ group.GenNormalsMeshS();
32813614
32823615 refreshContents();
32833616 }
....@@ -3450,8 +3783,8 @@
34503783
34513784 void ParseVertices()
34523785 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3786
+ boolean epsequal = Grafreed.epsequal;
3787
+ Grafreed.epsequal = true;
34553788
34563789 for (int i=0; i<group.selection.size(); i++)
34573790 {
....@@ -3476,7 +3809,7 @@
34763809 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773810 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783811
3479
- g.add(GrafreeD.clipboard);
3812
+ g.add(Grafreed.clipboard);
34803813
34813814 buffer.add(g);
34823815 }
....@@ -3491,7 +3824,7 @@
34913824 makeSomething(buffer, i==group.selection.size()-1);
34923825 }
34933826
3494
- GrafreeD.epsequal = epsequal;
3827
+ Grafreed.epsequal = epsequal;
34953828
34963829 refreshContents();
34973830 }
....@@ -3509,7 +3842,16 @@
35093842 String pigment = Object3D.GetPigment(tex);
35103843 //String bump = Object3D.GetBump(tex);
35113844
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3845
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3846
+
3847
+ try
3848
+ {
3849
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3850
+ }
3851
+ catch (Exception e)
3852
+ {
3853
+ System.err.println("FAIL: " + node);
3854
+ }
35133855
35143856 double s = v.s;
35153857
....@@ -3597,11 +3939,11 @@
35973939
35983940 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993941
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3942
+ boolean random = CameraPane.SWITCH;
3943
+ CameraPane.SWITCH = false; // parse all random nodes
36023944 lowres.linkVerticesThis(null);
36033945 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3946
+ CameraPane.SWITCH = random;
36053947
36063948 System.err.flush();
36073949
....@@ -3641,7 +3983,7 @@
36413983 return;
36423984
36433985 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
3986
+ Object3D ref = Grafreed.clipboard.get(0);
36453987
36463988 Object3D newgroup = new Object3D("Po:" + poses.name);
36473989
....@@ -3835,9 +4177,9 @@
38354177
38364178 void ClipMesh()
38374179 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4180
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394181 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4182
+ Object3D content = Grafreed.clipboard.get(0);
38414183
38424184 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434185 content = ((cGroup)content).get(0);
....@@ -3846,7 +4188,7 @@
38464188 // {
38474189 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484190 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4191
+ group.selection.ClipMesh(Grafreed.clipboard);
38504192 }
38514193 // group.selection.ClipMesh(GrafreeD.clipboard);
38524194 System.out.println("DONE.");
....@@ -3893,6 +4235,18 @@
38934235 void MarkLeaves(boolean hide)
38944236 {
38954237 group.selection.MarkLeaves(hide);
4238
+ refreshContents();
4239
+ }
4240
+
4241
+ void RewindLeaves(boolean hide)
4242
+ {
4243
+ group.selection.RewindLeaves(hide);
4244
+ refreshContents();
4245
+ }
4246
+
4247
+ void RandomLeaves(boolean hide)
4248
+ {
4249
+ group.selection.RandomLeaves(hide);
38964250 refreshContents();
38974251 }
38984252
....@@ -3981,7 +4335,7 @@
39814335 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824336
39834337 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4338
+ if(elem != group || !newWindow)
39854339 {
39864340 // if (!(elem instanceof Composite))
39874341 // newWindow = false;
....@@ -4071,7 +4425,6 @@
40714425 //case 702: // Event.LIST_DESELECT
40724426 group.deselectAll();
40734427 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754428 if (tps != null)
40764429 {
40774430 for (int i=0; i < tps.length; i++)
....@@ -4080,29 +4433,28 @@
40804433
40814434 //if (child.parent != null)
40824435 //child.parent.addSelectee(child);
4436
+ objEditor.SetMaterial(child);
40834437 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874438 }
40884439 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4440
+// else
4441
+// {
4442
+// objEditor.SetMaterial(group); // .GetMaterial());
4443
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4444
+// System.err.println("info : " + group.GetPath());
4445
+// }
40954446
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4447
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40994448 CameraPane.flash = true;
41004449
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4450
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024451 // a camera
41034452 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4453
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4454
+ {
4455
+ CameraPane.camerachangeframe = 0; // don't refuse it
4456
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4457
+ }
41064458 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074459 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084460 }
....@@ -4115,6 +4467,26 @@
41154467
41164468 freezemodel = false;
41174469 }
4470
+
4471
+ void refreshContents(boolean cp)
4472
+ {
4473
+ if (!Globals.MOUSEDRAGGED)
4474
+ {
4475
+ objEditor.ClearInfo(); // .GetMaterial());
4476
+
4477
+ for (int i=0; i < group.selection.Size(); i++)
4478
+ {
4479
+ Object3D child = (Object3D) group.selection.get(i);
4480
+
4481
+ objEditor.AddInfo(child, this, true);
4482
+ System.err.println("info : " + child.GetPath());
4483
+ }
4484
+
4485
+ objEditor.SetText(); // jan 2014
4486
+ }
4487
+
4488
+ super.refreshContents(cp);
4489
+ }
41184490
41194491 void linkSomething(Object3D thing)
41204492 {
....@@ -4186,16 +4558,18 @@
41864558 {
41874559 if (group.selection.isEmpty())
41884560 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4561
+
4562
+ Grafreed.clipboardIsTempGroup = false;
41904563 Composite tGroup = null;
41914564 if (group.selection.size() > 0) // 1)
41924565 {
41934566 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4567
+ Grafreed.clipboardIsTempGroup = true;
41954568 }
41964569
41974570 if (cut)
41984571 {
4572
+ Save();
41994573 //int indices[] = jList.getSelectedIndices();
42004574 //for (int i = indices.length - 1; i >= 0; i--)
42014575 //jList.remove(indices[i]);
....@@ -4231,16 +4605,16 @@
42314605 //System.out.println("cut " + child);
42324606 //System.out.println("parent = " + child.parent);
42334607 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4608
+ if (Grafreed.clipboardIsTempGroup)
42354609 tGroup.add/*Child*/(tmp);
42364610 else
4237
- GrafreeD.clipboard = tmp;
4611
+ Grafreed.clipboard = tmp;
42384612 }
42394613 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4614
+ if (Grafreed.clipboardIsTempGroup)
42414615 tGroup.add/*Child*/(child);
42424616 else
4243
- GrafreeD.clipboard = child;
4617
+ Grafreed.clipboard = child;
42444618 }
42454619
42464620 //ResetModel();
....@@ -4272,21 +4646,23 @@
42724646 //System.out.println("cut " + elem);
42734647 //System.out.println("parent = " + elem.parent);
42744648 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4649
+ if (Grafreed.clipboardIsTempGroup)
42764650 tGroup.add/*Child*/(tmp);
42774651 else
4278
- GrafreeD.clipboard = tmp;
4652
+ Grafreed.clipboard = tmp;
42794653 }
42804654 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4655
+ if (Grafreed.clipboardIsTempGroup)
42824656 tGroup.add/*Child*/(child);
42834657 else
4284
- GrafreeD.clipboard = child;
4658
+ Grafreed.clipboard = child;
42854659 }
42864660
42874661 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4662
+
4663
+ if (Grafreed.clipboardIsTempGroup)
4664
+ Grafreed.clipboard = tGroup;
4665
+
42904666 if (cut)
42914667 {
42924668 ResetModel();
....@@ -4300,7 +4676,7 @@
43004676 // return;
43014677 boolean first = true;
43024678
4303
- if (GrafreeD.clipboardIsTempGroup)
4679
+ if (Grafreed.clipboardIsTempGroup)
43044680 {
43054681 Composite temp;
43064682
....@@ -4311,7 +4687,7 @@
43114687 temp = (Composite)Applet3D.clipboard.deepCopy();
43124688 */
43134689 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4690
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154691 {
43164692 Object3D child = (Object3D)e.nextElement();
43174693
....@@ -4345,21 +4721,21 @@
43454721 //Object3D cb = Applet3D.clipboard;
43464722 //temp.addChild(cb);
43474723 //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());
4724
+ assert(Grafreed.clipboard.parent == null);
4725
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4726
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4727
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4728
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534729 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4730
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4731
+ Grafreed.clipboard.get(0).parent = keepparent;
43564732 }
43574733
43584734 ResetModel();
43594735 refreshContents();
43604736 }
43614737
4362
- void pasteInto(boolean copyit)
4738
+ void pasteInto(boolean copyit, boolean clone)
43634739 {
43644740 // if (GrafreeD.clipboard == null)
43654741 // return;
....@@ -4388,15 +4764,22 @@
43884764 if (copyit)
43894765 {
43904766 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4767
+ if (clone)
4768
+ {
4769
+ CloneClipboard(false); // sept 2014
4770
+ }
4771
+ else
4772
+ {
4773
+ paste(false);
4774
+ }
43924775 }
43934776 else
43944777 {
43954778 boolean first = true;
43964779
4397
- if (GrafreeD.clipboardIsTempGroup)
4780
+ if (Grafreed.clipboardIsTempGroup)
43984781 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4782
+ Composite temp = (Composite)Grafreed.clipboard;
44004783 Object3D copy;
44014784 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024785 {
....@@ -4406,7 +4789,7 @@
44064789 }
44074790 } else
44084791 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4792
+ linkSomething(Grafreed.clipboard); //.get(0));
44104793 }
44114794 }
44124795 }
....@@ -4811,21 +5194,6 @@
48115194 }
48125195 */
48135196
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
-
48295197 /*
48305198 public void Callback(Object obj)
48315199 {
....@@ -4849,26 +5217,9 @@
48495217 }
48505218 */
48515219
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
-
48695220 String GetFile(String dialogName)
48705221 {
4871
- if (GrafreeD.standAlone)
5222
+ if (Grafreed.standAlone)
48725223 {
48735224 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745225 browser.show();
....@@ -4932,10 +5283,18 @@
49325283 cButton flashSelectionButton;
49335284 cButton editButton;
49345285 cButton uneditButton;
5286
+ JCheckBox allParamsButton;
49355287 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375288 cButton unselectButton;
49385289
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
5293
+ cButton undoButton;
5294
+ cButton redoButton;
5295
+ cButton saveButton;
5296
+ cButton oneStepButton;
5297
+
49395298 cButton screenfitButton;
49405299 cButton screenfitpointButton;
49415300 cButton snapobjectButton;
....@@ -4946,14 +5305,6 @@
49465305 cButton closeButton;
49475306
49485307 cButton setsupportButton;
4949
-
4950
- cButton twoButton;
4951
- cButton sixButton;
4952
- cButton threeButton;
4953
- cButton sevenButton;
4954
- cButton fourButton; // full panel
4955
- cButton oneButton; // full XYZ
4956
- //cButton currentLayout;
49575308
49585309 //
49595310 //Composite
....@@ -4966,6 +5317,8 @@
49665317 private MenuItem lookFromItem;
49675318 private MenuItem switchItem;
49685319 private MenuItem cutItem;
5320
+ private MenuItem undoItem;
5321
+ private MenuItem redoItem;
49695322 private MenuItem duplicateItem;
49705323 private MenuItem cloneItem;
49715324 private MenuItem cloneSupportItem;
....@@ -4979,7 +5332,7 @@
49795332 private MenuItem linkverticesItem;
49805333 private MenuItem relinkverticesItem;
49815334 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5335
+ private MenuItem resetAllItem;
49835336 private MenuItem stepAllItem;
49845337 private MenuItem revertMeshItem;
49855338 private MenuItem poseMeshItem;
....@@ -4990,6 +5343,7 @@
49905343 private MenuItem mergeGeometriesItem;
49915344 private MenuItem copyItem;
49925345 private MenuItem pasteItem;
5346
+ private MenuItem pasteIntoItem;
49935347 private MenuItem pasteLinkItem;
49945348 private MenuItem pasteCloneItem;
49955349 private MenuItem pasteExpandItem;
....@@ -5028,6 +5382,10 @@
50285382 private MenuItem showleavesItem;
50295383 private MenuItem markleavesItem;
50305384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
50315389
50325390 private MenuItem flipVItem;
50335391 private MenuItem unflipVItem;
....@@ -5039,8 +5397,10 @@
50395397 private MenuItem panoTexturesItem;
50405398
50415399 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5400
+ private MenuItem resetCentroidXZItem;
50435401 private MenuItem resetTransformItem;
5402
+ private MenuItem transformGeometryItem;
5403
+ private MenuItem transformChildrenItem;
50445404 private MenuItem hideItem;
50455405 private MenuItem grabItem;
50465406 private MenuItem backItem;
....@@ -5087,7 +5447,7 @@
50875447 private MenuItem blobItem;
50885448 private MenuItem latheItem;
50895449 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5450
+ private MenuItem overlayItem;
50915451 private MenuItem meshItem;
50925452 // private MenuItem meshGroupItem;
50935453 private MenuItem springItem;
....@@ -5109,11 +5469,6 @@
51095469 private MenuItem doubleItem;
51105470 private MenuItem tripleItem;
51115471
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175472 private MenuItem computeAOItem;
51185473 private MenuItem recompileItem;
51195474 private MenuItem editScriptItem;
....@@ -5123,4 +5478,8 @@
51235478 private MenuItem analyzeItem;
51245479 private MenuItem dumpItem;
51255480 //boolean freezemodel = false;
5481
+
5482
+ Menu cameraMenu;
5483
+ MenuItem editCameraItem;
5484
+ MenuItem revertCameraItem;
51265485 }