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,153 +575,122 @@
433575 oe.radioPanel.add(dummyButton);
434576 oe.buttonGroup.add(dummyButton);
435577 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
578
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439579
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
580
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
581
+ //minButton.setToolTipText("Minimize window");
582
+ //minButton.addActionListener(this);
583
+
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");
441606 liveCB.addItemListener(this);
442607
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
461614 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
615
+
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
617
+ trackCB.setToolTipText("Enable tracking");
503618 trackCB.addItemListener(this);
504619
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ screenfitButton.setToolTipText("Screen fit");
507622 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
623
+
509624 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510625 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515626
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
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);
635
+ flashSelectionButton.setToolTipText("Show selection");
522636 flashSelectionButton.addActionListener(this);
523637
524
- oe.toolbarPanel.add(new cButton(" ", false));
638
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525639
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
640
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ twoButton.setToolTipText("Show center view only");
532642 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
643
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534644 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
645
+ fourButton.setToolTipText("Show left panel only");
646
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ sixButton.setToolTipText("2-column layout left");
536648 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ threeButton.setToolTipText("2-column layout right");
538651 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
652
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
653
+ sevenButton.setToolTipText("3-column layout");
540654 sevenButton.addActionListener(this);
541655 //
542656
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ rootButton.setToolTipText("Edit selection in new tab");
544659 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
660
+
661
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ closeButton.setToolTipText("Close tab");
547663 closeButton.addActionListener(this);
548664 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549665 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551666
552
- oe.aConstraints.gridx = 1; //
553
- 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");
554671 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558672
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
673
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ uneditButton.setToolTipText("Unedit selection");
560675 uneditButton.addActionListener(this);
561676
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
677
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
678
+ allParamsButton.setToolTipText("Edit all params");
574679 allParamsButton.addActionListener(this);
575680
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
581687 unselectButton.addActionListener(this);
582688
689
+ commandsPanel.preferredHeight = 1;
690
+
691
+ oe.treePanel.add(commandsPanel);
692
+ oe.treePanel.Return();
693
+
583694 // oe.aConstraints.gridx += 1;
584695 // oe.aConstraints.weighty = 0;
585696 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +702,37 @@
591702 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592703 // gcButton.addActionListener(this);
593704
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
705
+ cGridBag jSPPanel = new cGridBag();
706
+
707
+ JScrollPane jSP;
605708 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
709
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607710 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
711
+
712
+ oe.treePanel.add(jSPPanel);
713
+ oe.treePanel.Return();
612714
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
617719 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620723 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- 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");
623727 textureCB.addItemListener(this);
624728
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
729
+ copyOptionsPanel.preferredHeight = 1;
730
+ oe.treePanel.add(copyOptionsPanel);
731
+ oe.treePanel.Return();
627732
733
+// mainPanel.setDividerLocation(0.5); //1.0);
734
+// mainPanel.setResizeWeight(0.5);
735
+
628736 //jList.addListSelectionListener(this);
629737 oe.jTree.addTreeSelectionListener(this);
630738 //jTree.setRootVisible(false);
....@@ -646,6 +754,78 @@
646754 radio.layout = sevenButton;
647755 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648756 }
757
+
758
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
759
+ {
760
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
761
+ boxCB.setToolTipText("Display bounding boxes");
762
+ boxCB.addItemListener(this);
763
+
764
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
765
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
766
+ zoomBoxCB.addItemListener(this);
767
+
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
+
789
+// constraints.gridy += 1;
790
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
791
+// speakerMocapCB.addItemListener(this);
792
+
793
+ if (false)
794
+ {
795
+ // handled in scripts
796
+ //constraints.gridy += 1;
797
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
798
+ speakerCameraCB.addItemListener(this);
799
+
800
+ //constraints.gridy += 1;
801
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
802
+ speakerFocusCB.addItemListener(this);
803
+
804
+ //constraints.gridy += 1;
805
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
806
+ smoothfocusCB.addItemListener(this);
807
+ }
808
+
809
+//constraints.gridx += 1;
810
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
811
+// debugCB.addItemListener(this);
812
+
813
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
814
+ oeilCB.addItemListener(this);
815
+
816
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
817
+ lookAtCB.setToolTipText("Look-at target");
818
+ lookAtCB.addItemListener(this);
819
+
820
+ }
821
+
822
+ cGridBag fill = new cGridBag();
823
+
824
+ fill.preferredHeight = 200;
825
+
826
+ panel.add(fill);
827
+
828
+ }
649829
650830 void EditObject(Object3D obj)
651831 {
....@@ -658,8 +838,11 @@
658838 buttonGroup.add(radioButton);
659839 radioButton.doClick();
660840 }
841
+
661842 void SetupViews(ObjEditor oe)
662843 {
844
+ theFrame = this;
845
+
663846 oe.SetupViews();
664847
665848 System.out.println("SetupViews");
....@@ -676,6 +859,7 @@
676859 JCheckBox fastCB;
677860 JCheckBox slowCB;
678861 JCheckBox boxCB;
862
+ JCheckBox zoomBoxCB;
679863 JCheckBox trackCB;
680864 JCheckBox smoothfocusCB;
681865 // JCheckBox speakerMocapCB;
....@@ -721,6 +905,7 @@
721905 } else if(e.getSource() == liveCB)
722906 {
723907 cameraView.ToggleLive();
908
+ refreshContents(false);
724909 }
725910 else if(e.getSource() == supportCB)
726911 {
....@@ -755,6 +940,10 @@
755940 Recompile();
756941 cameraView.repaint();
757942 // refreshContents();
943
+ }
944
+ else if(e.getSource() == zoomBoxCB)
945
+ {
946
+ cameraView.ToggleZoomBoxMode();
758947 }
759948 else if(e.getSource() == smoothfocusCB)
760949 {
....@@ -869,7 +1058,9 @@
8691058 // objEditor.DropFile((java.io.File[]) object, true);
8701059 // return;
8711060 // }
872
- if (string.charAt(0) == '/')
1061
+
1062
+ // File path for Mac and Windows
1063
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731064 {
8741065 // file(s)
8751066 String[] names = string.split("\n");
....@@ -896,7 +1087,7 @@
8961087
8971088 flashIt = false;
8981089 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1090
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001091 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011092
9021093 if (group.selection.size() == 1)
....@@ -923,11 +1114,11 @@
9231114 {
9241115 loadClipboard(true);
9251116 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1117
+ pasteInto(false, false);
9271118 } else {
9281119 loadClipboard(false);
9291120 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1121
+ pasteInto(false, false); // true); // ???
9311122 }
9321123 }
9331124 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1240,33 @@
10491240 kleinItem.addActionListener(this);
10501241 particleItem = menu.add(new MenuItem("Particle system"));
10511242 particleItem.addActionListener(this);
1243
+ if (Globals.ADVANCED)
1244
+ {
10521245 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531246 ragdollItem.addActionListener(this);
10541247 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551248 ragdoll2Item.addActionListener(this);
1249
+ }
10561250 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1251
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581252 meshItem.addActionListener(this);
10591253 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601254 // meshGroupItem.addActionListener(this);
1255
+ if (Globals.ADVANCED)
1256
+ {
10611257 springItem = menu.add(new MenuItem("Spring"));
10621258 springItem.addActionListener(this);
10631259 flagItem = menu.add(new MenuItem("Flag"));
10641260 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691261 blobItem = menu.add(new MenuItem("Blob"));
10701262 blobItem.addActionListener(this);
10711263 latheItem = menu.add(new MenuItem("Lathe"));
10721264 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);
10731270 lightItem = menu.add(new MenuItem("Light"));
10741271 lightItem.addActionListener(this);
10751272 menu.add("-");
....@@ -1079,39 +1276,44 @@
10791276 loopItem.addActionListener(this);
10801277 doubleItem = menu.add(new MenuItem("Fork"));
10811278 doubleItem.addActionListener(this);
1279
+ if (Globals.ADVANCED)
1280
+ {
10821281 tripleItem = menu.add(new MenuItem("Trident"));
10831282 tripleItem.addActionListener(this);
1283
+ }
10841284 }
10851285
10861286 void buildToolsMenu(Menu menu)
10871287 {
10881288 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891289 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1290
+ animationItem.setState(Globals.ANIMATION);
10911291
10921292 menu.add("-");
10931293 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941294 parseverticesItem.addActionListener(this);
10951295 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961296 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1297
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981298 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011299 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021300 reduceMorphItem.addActionListener(this);
11031301 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041302 reduce34MorphItem.addActionListener(this);
1105
-
1303
+ menu.add("-");
11061304 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071305 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091306
1307
+ if (Globals.ADVANCED)
1308
+ {
1309
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1310
+ mirrorItem.addActionListener(this);
1311
+ menu.add("-");
11101312 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111313 memoryItem.addActionListener(this);
11121314 menu.add(analyzeItem = new MenuItem("Analyze"));
11131315 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1316
+ menu.add(dumpItem = new MenuItem("Print"));
11151317 dumpItem.addActionListener(this);
11161318 // menu.add(pathItem = new MenuItem("From-to path"));
11171319 // pathItem.addActionListener(this);
....@@ -1129,6 +1331,7 @@
11291331 menu.add("-");
11301332 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311333 editScriptItem.addActionListener(this);
1334
+ }
11321335 }
11331336
11341337 void ScreenFit()
....@@ -1457,9 +1660,9 @@
14571660
14581661 void Overwrite(int mask)
14591662 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1663
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14611664 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
1665
+ Object3D content = Grafreed.clipboard.get(0);
14631666
14641667 if (content instanceof cGroup && ((cGroup)content).transientlink )
14651668 content = ((cGroup)content).get(0);
....@@ -1482,6 +1685,7 @@
14821685 //
14831686 public void actionPerformed(ActionEvent event) // , Object arg)
14841687 {
1688
+ Object source = event.getSource();
14851689 /*
14861690 if (event.getSource() == nameField)
14871691 {
....@@ -1493,11 +1697,11 @@
14931697 }
14941698 else
14951699 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1700
+ if (source == lookAtItem || source == lookFromItem)
14971701 {
14981702 ScreenFit();
14991703 } else
1500
- if (event.getSource() == switchItem)
1704
+ if (source == switchItem)
15011705 {
15021706 cVector v1 = new cVector();
15031707 cVector v2 = new cVector();
....@@ -1506,11 +1710,11 @@
15061710 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071711 objEditor.cameraView.repaint();
15081712 } else
1509
- if (event.getSource() == rectoidItem)
1713
+ if (source == rectoidItem)
15101714 {
15111715 makeSomething(new Box());
15121716 } else
1513
- if (event.getSource() == particleItem)
1717
+ if (source == particleItem)
15141718 {
15151719 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161720 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1735,9 @@
15311735 applyExample(particleGeom, "SMOKE");
15321736 makeSomething(particleGeom);
15331737 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1738
+ if (source == ragdollItem || source == ragdoll2Item)
15351739 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1740
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371741
15381742 ragdoll.toParent = LA.newMatrix();
15391743 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1755,7 @@
15511755 } else
15521756 /*
15531757 */
1554
- if (event.getSource() == heightFieldItem)
1758
+ if (source == heightFieldItem)
15551759 {
15561760 Object3D obj = new Object3D();
15571761
....@@ -1589,31 +1793,31 @@
15891793
15901794 makeSomething(obj);
15911795 } else
1592
- if (event.getSource() == gridItem)
1796
+ if (source == gridItem)
15931797 {
15941798 makeSomething(new Grid());
15951799 } else
1596
- if (event.getSource() == ellipsoidItem)
1800
+ if (source == ellipsoidItem)
15971801 {
15981802 makeSomething(new Sphere());
15991803 } else
1600
- if (event.getSource() == coneItem)
1804
+ if (source == coneItem)
16011805 {
16021806 makeSomething(new Cone());
16031807 } else
1604
- if (event.getSource() == torusItem)
1808
+ if (source == torusItem)
16051809 {
16061810 makeSomething(new Torus());
16071811 } else
1608
- if (event.getSource() == superItem)
1812
+ if (source == superItem)
16091813 {
16101814 makeSomething(new Superellipsoid());
16111815 } else
1612
- if (event.getSource() == kleinItem)
1816
+ if (source == kleinItem)
16131817 {
16141818 makeSomething(new Klein());
16151819 } else
1616
- if (event.getSource() == blobItem)
1820
+ if (source == blobItem)
16171821 {
16181822 Blob blob = new Blob();
16191823 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1825,15 @@
16211825 //blob.retile();
16221826 makeSomething(blob);
16231827 } else
1624
- if (event.getSource() == latheItem)
1828
+ if (source == latheItem)
16251829 {
16261830 makeSomething(new Lathe());
16271831 } else
1628
- if (event.getSource() == bezierItem)
1832
+ if (source == bezierItem)
16291833 {
16301834 makeSomething(new BezierSurface());
16311835 } else
1632
- if (event.getSource() == checkerItem)
1836
+ if (source == overlayItem)
16331837 {
16341838 /*
16351839 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1848,7 @@
16441848 */
16451849 makeSomething(new Checker());
16461850 } else
1647
- if (event.getSource() == meshItem)
1851
+ if (source == meshItem)
16481852 {
16491853 Object3D itemtomake = new Object3D();
16501854 Object3D child;
....@@ -1665,35 +1869,35 @@
16651869 makeSomething(child);
16661870 }
16671871 } else
1668
- if (event.getSource() == springItem)
1872
+ if (source == springItem)
16691873 {
16701874 cSpring s = new cSpring();
16711875 s.setup();
16721876 makeSomething(s);
16731877 } else
1674
- if (event.getSource() == flagItem)
1878
+ if (source == flagItem)
16751879 {
16761880 cSpring s = new cFlag();
16771881 s.setup();
16781882 makeSomething(s);
16791883 } else
1680
- if (event.getSource() == lightItem)
1884
+ if (source == lightItem)
16811885 {
16821886 makeSomething(new Light());
16831887 } else
1684
- if (event.getSource() == csgItem)
1888
+ if (source == csgItem)
16851889 {
16861890 group(new CSG());
16871891 } else
1688
- if (event.getSource() == templateItem)
1892
+ if (source == templateItem)
16891893 {
16901894 group(new cTemplate());
16911895 } else
1692
- if (event.getSource() == attributeItem)
1896
+ if (source == attributeItem)
16931897 {
16941898 makeSomething(new Attribute());
16951899 } else
1696
- if (event.getSource() == pointflowItem)
1900
+ if (source == pointflowItem)
16971901 {
16981902 makeSomething(new PointFlow());
16991903 } else
....@@ -1705,7 +1909,7 @@
17051909 } else
17061910 */
17071911
1708
- if (event.getSource() == superLoopItem)
1912
+ if (source == superLoopItem)
17091913 {
17101914 Composite g = new cGroup();
17111915 for (int i=0; i<15; i++)
....@@ -1727,7 +1931,7 @@
17271931
17281932 group(g);
17291933 } else
1730
- if (event.getSource() == loopItem)
1934
+ if (source == loopItem)
17311935 {
17321936 Composite csg = new GroupLeaf();
17331937 csg.count = 5;
....@@ -1736,7 +1940,7 @@
17361940 csg.addChild(child);
17371941 child.addChild(csg);
17381942 } else
1739
- if (event.getSource() == doubleItem)
1943
+ if (source == doubleItem)
17401944 {
17411945 Composite csg = new GroupLeaf();
17421946 csg.count = 5;
....@@ -1748,7 +1952,7 @@
17481952 csg.addChild(child);
17491953 child.addChild(csg);
17501954 } else
1751
- if (event.getSource() == tripleItem)
1955
+ if (source == tripleItem)
17521956 {
17531957 Composite csg = new GroupLeaf();
17541958 csg.count = 4;
....@@ -1763,71 +1967,83 @@
17631967 csg.addChild(child);
17641968 child.addChild(csg);
17651969 } else
1766
-
1767
- if (event.getSource() == importGFDItem)
1768
- {
1769
- ImportGFD();
1770
- } else
1771
- if (event.getSource() == importVRMLX3DItem)
1772
- {
1773
- ImportVRMLX3D();
1774
- } else
1775
- if (event.getSource() == import3DSItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1778
- } else
1779
- if (event.getSource() == importOBJItem)
1780
- {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1782
- } else
1783
- if (event.getSource() == computeAOItem)
1970
+ if (source == computeAOItem)
17841971 {
17851972 Globals.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1973
+ Globals.theRenderer.repaint();
17871974 } else
1788
- if (event.getSource() == recompileItem)
1975
+ if (source == recompileItem)
17891976 {
17901977 Recompile();
17911978 refreshContents();
17921979 } else
1793
- if (event.getSource() == editScriptItem)
1980
+ if (source == editScriptItem)
17941981 {
17951982 OpenDialog();
17961983 refreshContents();
17971984 } else
1798
- if (event.getSource() == invariantsItem)
1985
+ if (source == invariantsItem)
17991986 {
18001987 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
1988
+ Grafreed.grafreeD.universe.invariants();
18021989 } else
1803
- if (event.getSource() == memoryItem)
1990
+ if (source == memoryItem)
18041991 {
18051992 //System.out.println("Invariants:");
18061993 PrintMemory();
18071994 } else
1808
- if (event.getSource() == pathItem)
1995
+ if (source == pathItem)
18091996 {
18101997 PrintPath();
18111998 } else
1812
- if (event.getSource() == analyzeItem)
1999
+ if (source == analyzeItem)
18132000 {
18142001 AnalyzeObject();
18152002 } else
1816
- if (event.getSource() == dumpItem)
2003
+ if (source == dumpItem)
18172004 {
18182005 DumpObject();
18192006 } else
1820
- 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)
18212037 {
18222038 //Reload(lastConverter, lastFilename, true);
18232039 ScreenFit();
18242040 } else
1825
- if (event.getSource() == screenfitpointButton)
2041
+ if (source == screenfitpointButton)
18262042 {
18272043 //Reload(lastConverter, lastFilename, true);
18282044 ScreenFitPoint();
18292045 } else
1830
- if (event.getSource() == snapobjectButton)
2046
+ if (source == snapobjectButton)
18312047 {
18322048 //Reload(lastConverter, lastFilename, true);
18332049 SnapObject();
....@@ -1838,13 +2054,13 @@
18382054 // Recompile();
18392055 // refreshContents();
18402056 // } else
1841
- if (event.getSource() == gcButton)
2057
+ if (source == gcButton)
18422058 {
18432059 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442060 System.gc();
18452061 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462062 } else
1847
- if (event.getSource() == editLeafItem)
2063
+ if (source == editLeafItem)
18482064 {
18492065 Object3D obj;
18502066 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2074,74 @@
18582074 }
18592075 refreshContents(true);
18602076 } else
1861
- if (event.getSource() == openWindowItem)
2077
+ if (source == openWindowItem)
18622078 {
18632079 EditSelection(true);
18642080 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2081
+ if (source == cutItem || source == clearButton)
18662082 {
18672083 loadClipboard(true);
18682084 } else
1869
- if (event.getSource() == duplicateItem)
2085
+ if (source == undoItem)
18702086 {
1871
- 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;
18722096 loadClipboard(false);
18732097 paste(false);
1874
- GrafreeD.clipboard = keep;
2098
+ Grafreed.clipboard = keep;
18752099 } else
1876
- if (event.getSource() == cloneItem)
2100
+ if (source == cloneItem)
18772101 {
18782102 CloneSelection(false);
18792103 } else
1880
- if (event.getSource() == cloneSupportItem)
2104
+ if (source == cloneSupportItem)
18812105 {
18822106 CloneSelection(true);
18832107 } else
1884
- if (event.getSource() == copyItem)
2108
+ if (source == copyItem)
18852109 {
18862110 loadClipboard(false);
18872111 } else
1888
- if (event.getSource() == pasteItem)
2112
+ if (source == pasteItem)
18892113 {
18902114 paste(false);
18912115 } else
1892
- if (event.getSource() == pasteLinkItem)
2116
+ if (source == pasteIntoItem)
18932117 {
1894
- pasteInto(false);
2118
+ pasteInto(true, false);
18952119 } else
1896
- if (event.getSource() == pasteCloneItem)
2120
+ if (source == pasteLinkItem)
18972121 {
1898
- pasteInto(true);
2122
+ pasteInto(false, false);
18992123 } else
1900
- if (event.getSource() == pasteExpandItem)
2124
+ if (source == pasteCloneItem)
2125
+ {
2126
+ pasteInto(true, true);
2127
+ } else
2128
+ if (source == pasteExpandItem)
19012129 {
19022130 paste(true);
19032131 } else
1904
- if (event.getSource() == synchronizeItem)
2132
+ if (source == synchronizeItem)
19052133 {
19062134 Overwrite(Object3D.TRANSFORM);
19072135 } else
1908
- if (event.getSource() == overwriteNameItem)
2136
+ if (source == overwriteNameItem)
19092137 {
19102138 Overwrite(Object3D.NAME);
19112139 } else
1912
- if (event.getSource() == overwriteUVItem)
2140
+ if (source == overwriteUVItem)
19132141 {
19142142 Overwrite(Object3D.UV);
19152143 } else
1916
- if (event.getSource() == overwriteMatItem)
2144
+ if (source == overwriteMatItem)
19172145 {
19182146 /* july 2015
19192147 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2161,7 @@
19332161
19342162 Overwrite(dropAttributes);
19352163 }
1936
- if (event.getSource() == overwriteGeoItem)
2164
+ if (source == overwriteGeoItem)
19372165 {
19382166 Overwrite(Object3D.GEOMETRY);
19392167 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2178,7 @@
19502178 // refreshContents();
19512179 // }
19522180 } else
1953
- if (event.getSource() == generateMeshItem)
2181
+ if (source == generateMeshItem)
19542182 {
19552183 //if (group.selection.size() == 1)
19562184 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2189,7 @@
19612189 ResetModel();
19622190 refreshContents();
19632191 } else
1964
- if (event.getSource() == extractGeometriesItem)
2192
+ if (source == extractGeometriesItem)
19652193 {
19662194 boolean one = false;
19672195
....@@ -1988,7 +2216,7 @@
19882216 ResetModel();
19892217 refreshContents();
19902218 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2219
+ if (source == cloneGeometriesItem)
19922220 {
19932221 boolean one = false;
19942222
....@@ -2014,7 +2242,7 @@
20142242 ResetModel();
20152243 refreshContents();
20162244 } else
2017
- if (event.getSource() == shareGeometriesItem)
2245
+ if (source == shareGeometriesItem)
20182246 {
20192247 boolean one = false;
20202248
....@@ -2044,7 +2272,7 @@
20442272 refreshContents();
20452273 }
20462274 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2275
+ if (source == mergeGeometriesItem)
20482276 {
20492277 boolean one = false;
20502278
....@@ -2074,7 +2302,7 @@
20742302 ResetModel();
20752303 refreshContents();
20762304 } else
2077
- if (event.getSource() == linkverticesItem)
2305
+ if (source == linkverticesItem)
20782306 {
20792307 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802308 // {
....@@ -2087,48 +2315,48 @@
20872315 // group.selection.get(0).setMasterThis(content); // should be identity
20882316 // refreshContents();
20892317 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2318
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912319 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2320
+ Object3D content = Grafreed.clipboard.get(0);
20932321
20942322 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952323 content = ((cGroup)content).get(0);
20962324
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2325
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982326 for (int i=0; i<group.selection.size(); i++)
20992327 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2328
+ boolean random = CameraPane.SWITCH;
2329
+ CameraPane.SWITCH = false; // parse all random nodes
21022330 group.selection.get(i).linkVerticesThis(content);
21032331 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2332
+ CameraPane.SWITCH = random;
21052333 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2334
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072335 refreshContents();
21082336 }
21092337 } else
2110
- if (event.getSource() == resetsupportItem)
2338
+ if (source == resetsupportItem)
21112339 {
21122340 for (int i=0; i<group.selection.size(); i++)
21132341 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2342
+ boolean random = CameraPane.SWITCH;
2343
+ CameraPane.SWITCH = false; // parse all random nodes
21162344 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2345
+ CameraPane.SWITCH = random;
21182346 }
21192347
21202348 refreshContents();
21212349 } else
2122
- if (event.getSource() == relinkverticesItem)
2350
+ if (source == relinkverticesItem)
21232351 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2352
+ boolean random = CameraPane.SWITCH;
2353
+ CameraPane.SWITCH = false; // parse all random nodes
21262354 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2355
+ CameraPane.SWITCH = random;
21282356
21292357 refreshContents();
21302358 } else
2131
- if (event.getSource() == resetreferencesItem)
2359
+ if (source == resetreferencesItem)
21322360 {
21332361 for (int i=0; i<group.selection.size(); i++)
21342362 {
....@@ -2137,11 +2365,11 @@
21372365
21382366 refreshContents();
21392367 } else
2140
- if (event.getSource() == setMasterItem)
2368
+ if (source == setMasterItem)
21412369 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2370
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432371 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2372
+ Object3D content = Grafreed.clipboard.get(0);
21452373
21462374 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472375 content = ((cGroup)content).get(0);
....@@ -2150,13 +2378,13 @@
21502378 refreshContents();
21512379 }
21522380 } else
2153
- if (event.getSource() == poseMeshItem)
2381
+ if (source == poseMeshItem)
21542382 {
21552383 if (group.selection.size() == 1)
21562384 {
2157
- if (GrafreeD.clipboard.size() == 1)
2385
+ if (Grafreed.clipboard.size() == 1)
21582386 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2387
+ Object3D content = Grafreed.clipboard.get(0);
21602388
21612389 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622390 content = ((cGroup)content).get(0);
....@@ -2169,19 +2397,19 @@
21692397 }
21702398
21712399 } else
2172
- if (event.getSource() == revertMeshItem)
2400
+ if (source == revertMeshItem)
21732401 {
21742402 RevertMeshes();
21752403 } else
2176
- if (event.getSource() == resetMeshItem)
2404
+ if (source == resetAllItem)
21772405 {
21782406 ResetAll();
21792407 } else
2180
- if (event.getSource() == stepAllItem)
2408
+ if (source == stepAllItem)
21812409 {
21822410 StepAll();
21832411 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2412
+ if (source == clearItem) // || event.getSource() == clearButton)
21852413 {
21862414 //int indices[] = jList.getSelectedIndices();
21872415 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2417,46 @@
21892417
21902418 ClearSelection(false);
21912419 } else
2192
- if (event.getSource() == clearAllItem)
2420
+ if (source == clearAllItem)
21932421 {
21942422 ClearSelection(true);
21952423 } else
2196
- if (event.getSource() == grabItem)
2424
+ if (source == grabItem)
21972425 {
21982426 group(new cGroup(), true);
21992427 } else
2200
- if (event.getSource() == hideItem)
2428
+ if (source == hideItem)
22012429 {
22022430 group(new HiddenObject());
22032431 } else
2204
- if (event.getSource() == frontItem)
2432
+ if (source == frontItem)
22052433 {
22062434 front();
22072435 } else
2208
- if (event.getSource() == backItem)
2436
+ if (source == backItem)
22092437 {
22102438 back();
22112439 } else
2212
- if (event.getSource() == cameraItem)
2440
+ if (source == cameraItem)
22132441 {
22142442 makeSomething(new Camera());
22152443 } else
2216
- if (event.getSource() == compositeItem)
2444
+ if (source == compositeItem)
22172445 {
22182446 group(new Composite());
22192447 } else
2220
- if (event.getSource() == randomItem)
2448
+ if (source == randomItem)
22212449 {
22222450 RandomNode random = new RandomNode();
22232451 group(random);
22242452 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2453
+ random.name = random.get(0).name + "Switch";
22262454 } else
2227
- if (event.getSource() == physicsItem)
2455
+ if (source == physicsItem)
22282456 {
22292457 group(new PhysicsNode());
22302458 } else
2231
- if (event.getSource() == frameselectorItem)
2459
+ if (source == frameselectorItem)
22322460 {
22332461 for (int i=0; i<group.selection.size(); i++)
22342462 {
....@@ -2240,7 +2468,7 @@
22402468 ResetModel();
22412469 refreshContents();
22422470 } else
2243
- if (event.getSource() == switchGeoItem)
2471
+ if (source == switchGeoItem)
22442472 {
22452473 for (int i=0; i<group.selection.size(); i++)
22462474 {
....@@ -2252,7 +2480,7 @@
22522480 ResetModel();
22532481 refreshContents();
22542482 } else
2255
- if (event.getSource() == switchTransfoItem)
2483
+ if (source == switchTransfoItem)
22562484 {
22572485 for (int i=0; i<group.selection.size(); i++)
22582486 {
....@@ -2264,7 +2492,7 @@
22642492 ResetModel();
22652493 refreshContents();
22662494 } else
2267
- if (event.getSource() == morphItem)
2495
+ if (source == morphItem)
22682496 {
22692497 for (int i=0; i<group.selection.size(); i++)
22702498 {
....@@ -2276,7 +2504,7 @@
22762504 ResetModel();
22772505 refreshContents();
22782506 } else
2279
- if (event.getSource() == scriptNodeItem)
2507
+ if (source == scriptNodeItem)
22802508 {
22812509 boolean atleastone = false;
22822510
....@@ -2315,31 +2543,31 @@
23152543 }
23162544 }
23172545 } else
2318
- if (event.getSource() == linkerItem)
2546
+ if (source == linkerItem)
23192547 {
23202548 group(new cLinker());
23212549 } else
2322
- if (event.getSource() == textureItem)
2550
+ if (source == textureItem)
23232551 {
23242552 group(new TextureNode());
23252553 } else
2326
- if (event.getSource() == billboardItem)
2554
+ if (source == billboardItem)
23272555 {
23282556 group(new BillboardNode());
23292557 } else
2330
- if (event.getSource() == shadowXItem)
2558
+ if (source == shadowXItem)
23312559 {
23322560 CastShadow(0);
23332561 } else
2334
- if (event.getSource() == shadowYItem)
2562
+ if (source == shadowYItem)
23352563 {
23362564 CastShadow(1);
23372565 } else
2338
- if (event.getSource() == shadowZItem)
2566
+ if (source == shadowZItem)
23392567 {
23402568 CastShadow(2);
23412569 } else
2342
- if (event.getSource() == ungroupItem)
2570
+ if (source == ungroupItem)
23432571 {
23442572 //ungroup();
23452573 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2579,203 @@
23512579
23522580 refreshContents();
23532581 } else
2354
- if (event.getSource() == genUVItem)
2582
+ if (source == genUVItem)
23552583 {
23562584 GenUV();
23572585 } else
2358
- if (event.getSource() == genNormalsCADItem)
2586
+ if (source == genNormalsCADItem)
23592587 {
23602588 GenNormals(true);
23612589 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2590
+ if (source == genNormalsMESHItem)
23632591 {
2364
- GenNormals(true); // TODO
2592
+ GenNormalsMESH();
23652593 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2594
+ if (source == genNormalsORGANItem)
23672595 {
23682596 GenNormals(false);
23692597 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2598
+ if (source == genNormalsMINEItem)
23712599 {
23722600 GenNormalsMINE();
23732601 } else
2374
- if (event.getSource() == stripifyItem)
2602
+ if (source == stripifyItem)
23752603 {
23762604 Stripify();
23772605 } else
2378
- if (event.getSource() == unstripifyItem)
2606
+ if (source == unstripifyItem)
23792607 {
23802608 Unstripify();
23812609 } else
2382
- if (event.getSource() == trimItem)
2610
+ if (source == trimItem)
23832611 {
23842612 Trim();
23852613 } else
2386
- if (event.getSource() == untrimItem)
2614
+ if (source == untrimItem)
23872615 {
23882616 Untrim();
23892617 } else
2390
- if (event.getSource() == clearColorsItem)
2618
+ if (source == clearColorsItem)
23912619 {
23922620 ClearColors();
23932621 } else
2394
- if (event.getSource() == clearMaterialsItem)
2622
+ if (source == clearMaterialsItem)
23952623 {
23962624 ClearMaterials();
23972625 } else
2398
- if (event.getSource() == liveleavesItem)
2626
+ if (source == liveleavesItem)
23992627 {
24002628 LiveLeaves(true);
24012629 } else
2402
- if (event.getSource() == unliveleavesItem)
2630
+ if (source == unliveleavesItem)
24032631 {
24042632 LiveLeaves(false);
24052633 } else
2406
- if (event.getSource() == supportleavesItem)
2634
+ if (source == supportleavesItem)
24072635 {
24082636 SupportLeaves(true);
24092637 } else
2410
- if (event.getSource() == unsupportleavesItem)
2638
+ if (source == unsupportleavesItem)
24112639 {
24122640 SupportLeaves(false);
24132641 } else
2414
- if (event.getSource() == hideleavesItem)
2642
+ if (source == hideleavesItem)
24152643 {
24162644 HideLeaves(true);
24172645 } else
2418
- if (event.getSource() == showleavesItem)
2646
+ if (source == showleavesItem)
24192647 {
24202648 HideLeaves(false);
24212649 } else
2422
- if (event.getSource() == markleavesItem)
2650
+ if (source == markleavesItem)
24232651 {
24242652 MarkLeaves(true);
24252653 } else
2426
- if (event.getSource() == unmarkleavesItem)
2654
+ if (source == unmarkleavesItem)
24272655 {
24282656 MarkLeaves(false);
24292657 } else
2430
- 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)
24312675 {
24322676 FlipV(true);
24332677 } else
2434
- if (event.getSource() == unflipVItem)
2678
+ if (source == unflipVItem)
24352679 {
24362680 FlipV(false);
24372681 } else
2438
- if (event.getSource() == lowTexturesItem)
2682
+ if (source == lowTexturesItem)
24392683 {
24402684 SetTexRes(0);
24412685 } else
2442
- if (event.getSource() == normalTexturesItem)
2686
+ if (source == normalTexturesItem)
24432687 {
24442688 SetTexRes(1);
24452689 } else
2446
- if (event.getSource() == highTexturesItem)
2690
+ if (source == highTexturesItem)
24472691 {
24482692 SetTexRes(2);
24492693 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2694
+ if (source == veryhighTexturesItem)
24512695 {
24522696 SetTexRes(3);
24532697 } else
2454
- if (event.getSource() == maxTexturesItem)
2698
+ if (source == maxTexturesItem)
24552699 {
24562700 SetTexRes(4);
24572701 } else
2458
- if (event.getSource() == panoTexturesItem)
2702
+ if (source == panoTexturesItem)
24592703 {
24602704 SetTexRes(5);
24612705 } else
2462
- if (event.getSource() == reverseNormalsItem)
2706
+ if (source == reverseNormalsItem)
24632707 {
24642708 ReverseNormals();
24652709 } else
2466
- if (event.getSource() == parseverticesItem)
2710
+ if (source == parseverticesItem)
24672711 {
24682712 ParseVertices();
24692713 } else
2470
- if (event.getSource() == textureFieldItem)
2714
+ if (source == textureFieldItem)
24712715 {
24722716 TextureVertices();
24732717 } else
2474
- if (event.getSource() == alignItem)
2718
+ if (source == alignItem)
24752719 {
24762720 Align();
24772721 } else
2478
- if (event.getSource() == mirrorItem)
2722
+ if (source == mirrorItem)
24792723 {
24802724 MirrorPoses();
24812725 } else
2482
- if (event.getSource() == reduceMorphItem)
2726
+ if (source == reduceMorphItem)
24832727 {
24842728 MeshReduction(false);
24852729 } else
2486
- if (event.getSource() == reduce34MorphItem)
2730
+ if (source == reduce34MorphItem)
24872731 {
24882732 MeshReduction(true);
24892733 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2734
+ if (source == reverseTrianglesItem)
24912735 {
24922736 ReverseTriangles();
24932737 } else
2494
- if (event.getSource() == reduceMeshItem)
2738
+ if (source == reduceMeshItem)
24952739 {
24962740 ReduceMesh(false);
24972741 } else
2498
- if (event.getSource() == reduce34MeshItem)
2742
+ if (source == reduce34MeshItem)
24992743 {
25002744 ReduceMesh(true);
25012745 } else
2502
- if (event.getSource() == increaseMeshItem)
2746
+ if (source == increaseMeshItem)
25032747 {
25042748 IncreaseMesh();
25052749 } else
2506
- if (event.getSource() == clipMeshItem)
2750
+ if (source == clipMeshItem)
25072751 {
25082752 ClipMesh();
25092753 } else
2510
- if (event.getSource() == smoothMeshItem)
2754
+ if (source == smoothMeshItem)
25112755 {
25122756 SmoothMesh();
25132757 } else
2514
- if (event.getSource() == transformgeometryItem)
2758
+ if (source == transformGeometryItem)
25152759 {
25162760 TransformGeometry();
25172761 } else
2518
- if (event.getSource() == resetTransformItem)
2762
+ if (source == transformChildrenItem)
2763
+ {
2764
+ TransformChildren();
2765
+ } else
2766
+ if (source == resetTransformItem)
25192767 {
25202768 ResetTransform();
25212769 } else
2522
- if (event.getSource() == resetCentroidItem)
2770
+ if (source == resetCentroidItem)
25232771 {
2524
- ResetCentroid();
2772
+ ResetCentroid(true);
25252773 } else
2526
- if (event.getSource() == resetParentItem)
2774
+ if (source == resetCentroidXZItem)
2775
+ {
2776
+ ResetCentroid(false);
2777
+ } else
2778
+ if (source == resetParentItem)
25272779 {
25282780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292781 {
....@@ -2533,7 +2785,7 @@
25332785
25342786 refreshContents();
25352787 } else
2536
- if (event.getSource() == repairParentItem)
2788
+ if (source == repairParentItem)
25372789 {
25382790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392791 {
....@@ -2547,7 +2799,7 @@
25472799
25482800 refreshContents();
25492801 } else
2550
- if (event.getSource() == repairShadowItem)
2802
+ if (source == repairShadowItem)
25512803 {
25522804 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532805 {
....@@ -2561,7 +2813,7 @@
25612813
25622814 refreshContents();
25632815 } else
2564
- if (event.getSource() == sortbysizeItem)
2816
+ if (source == sortbysizeItem)
25652817 {
25662818 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672819 {
....@@ -2573,7 +2825,7 @@
25732825 ResetModel();
25742826 refreshContents();
25752827 } else
2576
- if (event.getSource() == sortbynameItem)
2828
+ if (source == sortbynameItem)
25772829 {
25782830 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792831 {
....@@ -2585,7 +2837,7 @@
25852837 ResetModel();
25862838 refreshContents();
25872839 } else
2588
- if (event.getSource() == attachPigmentItem)
2840
+ if (source == attachPigmentItem)
25892841 {
25902842 String texture = GetFile("Attach pigment");
25912843 Object3D obj;
....@@ -2597,7 +2849,7 @@
25972849
25982850 refreshContents();
25992851 } else
2600
- if (event.getSource() == detachPigmentItem)
2852
+ if (source == detachPigmentItem)
26012853 {
26022854 Object3D obj;
26032855 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2860,7 @@
26082860
26092861 refreshContents();
26102862 } else
2611
- if (event.getSource() == attachBumpItem)
2863
+ if (source == attachBumpItem)
26122864 {
26132865 String texture = GetFile("Attach bump");
26142866 Object3D obj;
....@@ -2620,7 +2872,7 @@
26202872
26212873 refreshContents();
26222874 } else
2623
- if (event.getSource() == detachBumpItem)
2875
+ if (source == detachBumpItem)
26242876 {
26252877 Object3D obj;
26262878 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2883,7 @@
26312883
26322884 refreshContents();
26332885 } else
2634
- if (event.getSource() == pigmentBumpItem)
2886
+ if (source == pigmentBumpItem)
26352887 {
26362888 Object3D obj;
26372889 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2894,221 @@
26422894
26432895 refreshContents();
26442896 } else
2645
- if (event.getSource() == flashSelectionButton)
2897
+ if (source == flashSelectionButton)
26462898 {
26472899 CameraPane.flash = true;
26482900 refreshContents();
26492901 } else
2650
- if (event.getSource() == oneButton)
2902
+ if (source == oneButton)
26512903 {
26522904 } else
2653
- if (event.getSource() == twoButton)
2905
+ if (source == twoButton)
26542906 {
26552907 radio.layout = twoButton;
26562908 // bug
26572909 //gridPanel.setDividerLocation(1.0);
26582910 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- bigThree.revalidate();
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
+
26832958 } else
2684
- if (event.getSource() == threeButton)
2959
+ if (source == threeButton)
26852960 {
26862961 radio.layout = threeButton;
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
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();
27112996 } else
2712
- if (event.getSource() == fourButton)
2997
+ if (source == fourButton)
27132998 {
27142999 radio.layout = fourButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- //bigThree.add(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
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();
27393033 } else
2740
- if (event.getSource() == sixButton)
3034
+ if (source == sixButton)
27413035 {
27423036 radio.layout = sixButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aConstraints);
2766
- bigThree.revalidate();
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();
27673071 } else
2768
- if (event.getSource() == sevenButton)
3072
+ if (source == sevenButton)
27693073 {
27703074 radio.layout = sevenButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aWindowConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- bigThree.revalidate();
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();
27953110 } else
2796
- if (event.getSource() == rootButton)
3111
+ if (source == rootButton)
27973112 {
27983113 Object3D obj;
27993114 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2803,9 +3118,10 @@
28033118 EditObject(obj);
28043119 }
28053120
3121
+ cameraView.requestFocusInWindow();
28063122 refreshContents(true);
28073123 } else
2808
- if (event.getSource() == closeButton)
3124
+ if (source == closeButton)
28093125 {
28103126 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113127 cRadio ab;
....@@ -2824,13 +3140,15 @@
28243140 break;
28253141 }
28263142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
28273145 refreshContents(true);
28283146 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3147
+ if (source == editItem || source == editButton)
28303148 {
28313149 EditSelection(false);
28323150 } else
2833
- if (event.getSource() == uneditButton)
3151
+ if (source == uneditButton)
28343152 {
28353153 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363154 {
....@@ -2840,14 +3158,14 @@
28403158 child.CloseUI();
28413159 listUI.remove(child);
28423160
2843
- child.editWindow = null; // ???????????
3161
+ //child.editWindow = null; // ???????????
28443162 }
2845
- objEditor.ctrlPanel.revalidate();
3163
+ objEditor.ctrlPanel.FlushUI();
28463164 //objEditor.jTree.clearSelection();
28473165 //objEditor.ResetSliders();
28483166 refreshContents(true);
28493167 } else
2850
- if (event.getSource() == clearPanelButton)
3168
+ if (source == clearPanelButton)
28513169 {
28523170 assert(copy == group);
28533171 //copy.ClearUI();
....@@ -2858,7 +3176,7 @@
28583176 listUI.clear();
28593177 refreshContents(true);
28603178 } else
2861
- if (event.getSource() == allParamsButton)
3179
+ if (source == allParamsButton)
28623180 {
28633181 assert(copy == group);
28643182
....@@ -2879,19 +3197,19 @@
28793197
28803198 refreshContents(true);
28813199 } else
2882
- if (event.getSource() == unselectButton)
3200
+ if (source == unselectButton)
28833201 {
28843202 objEditor.jTree.clearSelection();
28853203 // ?? oct 2012 GrafreeD.clipboard.clear();
28863204 objEditor.ResetSliders();
28873205 refreshContents(true);
28883206 } else
2889
- if(event.getSource() instanceof cRadio)
3207
+ if(source instanceof cRadio)
28903208 {
28913209 group.parent = keepparent;
28923210 group.attributes = 0;
28933211 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3212
+ /*cRadio*/ radio = (cRadio)source;
28953213 Object3D obj = radio.GetObject();
28963214 System.out.println("Edit " + obj);
28973215 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3229,7 @@
29113229 }
29123230
29133231 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3232
+ //Globals.theRenderer.object = group;
29153233 if(!useclient)
29163234 {
29173235 cameraView.renderCamera = radio.camera;
....@@ -2926,7 +3244,10 @@
29263244 frontView.object = group;
29273245 sideView.object = group;
29283246 }
2929
- group.editWindow = this;
3247
+
3248
+// fix "+" issue
3249
+ //group.editWindow = this;
3250
+
29303251 /*
29313252 currentLayout = radio.layout;
29323253 if (currentLayout == null)
....@@ -2938,8 +3259,23 @@
29383259 //group.parent = null; // ROOT
29393260 //group.attributes = -1;
29403261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
29413264 refreshContents(true);
2942
- }
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
+ }
29433279 else
29443280 {
29453281 //return super.action(event, arg);
....@@ -2948,7 +3284,6 @@
29483284 }
29493285
29503286 boolean useclient = false;
2951
- cRadio radio;
29523287
29533288 void ToggleRoot()
29543289 {
....@@ -3000,6 +3335,28 @@
30003335 refreshContents();
30013336 }
30023337
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
+ }
30033360
30043361 void ResetTransform()
30053362 {
....@@ -3112,7 +3469,7 @@
31123469 refreshContents();
31133470 }
31143471
3115
- void ResetCentroid()
3472
+ void ResetCentroid(boolean full)
31163473 {
31173474 Object3D obj;
31183475 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3127,12 +3484,16 @@
31273484 LA.matIdentity(Object3D.mat);
31283485 obj.getBounds(minima, maxima, false);
31293486 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3130
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3487
+ if (full)
3488
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31313489 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31323490 obj.TransformMesh(Object3D.mat);
3491
+
31333492 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3134
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3493
+ if (full)
3494
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31353495 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3496
+
31363497 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31373498 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31383499 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3161,7 +3522,8 @@
31613522
31623523 int size = obj.MemorySize();
31633524
3164
- 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)");
31653527 }
31663528 }
31673529 catch (Exception e)
....@@ -3198,9 +3560,9 @@
31983560 obj = (Object3D)e.nextElement();
31993561
32003562 System.out.println("Object is: " + obj);
3201
- GrafreeD.AnalyzeObject(obj);
3563
+ Grafreed.AnalyzeObject(obj);
32023564 System.out.println("Boundary rep: " + obj.bRep);
3203
- GrafreeD.AnalyzeObject(obj.bRep);
3565
+ Grafreed.AnalyzeObject(obj.bRep);
32043566
32053567 // System.err.println((size/1024) + " KB is the size of " + obj);
32063568 }
....@@ -3242,6 +3604,13 @@
32423604 void GenNormals(boolean crease)
32433605 {
32443606 group.GenNormalsS(crease);
3607
+
3608
+ refreshContents();
3609
+ }
3610
+
3611
+ void GenNormalsMESH()
3612
+ {
3613
+ group.GenNormalsMeshS();
32453614
32463615 refreshContents();
32473616 }
....@@ -3414,8 +3783,8 @@
34143783
34153784 void ParseVertices()
34163785 {
3417
- boolean epsequal = GrafreeD.epsequal;
3418
- GrafreeD.epsequal = true;
3786
+ boolean epsequal = Grafreed.epsequal;
3787
+ Grafreed.epsequal = true;
34193788
34203789 for (int i=0; i<group.selection.size(); i++)
34213790 {
....@@ -3440,7 +3809,7 @@
34403809 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34413810 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34423811
3443
- g.add(GrafreeD.clipboard);
3812
+ g.add(Grafreed.clipboard);
34443813
34453814 buffer.add(g);
34463815 }
....@@ -3455,7 +3824,7 @@
34553824 makeSomething(buffer, i==group.selection.size()-1);
34563825 }
34573826
3458
- GrafreeD.epsequal = epsequal;
3827
+ Grafreed.epsequal = epsequal;
34593828
34603829 refreshContents();
34613830 }
....@@ -3473,7 +3842,16 @@
34733842 String pigment = Object3D.GetPigment(tex);
34743843 //String bump = Object3D.GetBump(tex);
34753844
3476
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.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
+ }
34773855
34783856 double s = v.s;
34793857
....@@ -3561,11 +3939,11 @@
35613939
35623940 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35633941
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
3942
+ boolean random = CameraPane.SWITCH;
3943
+ CameraPane.SWITCH = false; // parse all random nodes
35663944 lowres.linkVerticesThis(null);
35673945 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
3946
+ CameraPane.SWITCH = random;
35693947
35703948 System.err.flush();
35713949
....@@ -3605,7 +3983,7 @@
36053983 return;
36063984
36073985 Object3D poses = group.selection.get(0);
3608
- Object3D ref = GrafreeD.clipboard.get(0);
3986
+ Object3D ref = Grafreed.clipboard.get(0);
36093987
36103988 Object3D newgroup = new Object3D("Po:" + poses.name);
36113989
....@@ -3774,7 +4152,7 @@
37744152 group.selection.RelinkToSupport(); // july 2014
37754153 System.out.println("DONE.");
37764154 refreshContents();
3777
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4155
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37784156 }
37794157
37804158 void ReduceMesh(boolean reduction34)
....@@ -3799,9 +4177,9 @@
37994177
38004178 void ClipMesh()
38014179 {
3802
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4180
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38034181 {
3804
- Object3D content = GrafreeD.clipboard.get(0);
4182
+ Object3D content = Grafreed.clipboard.get(0);
38054183
38064184 if (content instanceof cGroup && ((cGroup)content).transientlink )
38074185 content = ((cGroup)content).get(0);
....@@ -3810,7 +4188,7 @@
38104188 // {
38114189 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38124190 // }
3813
- group.selection.ClipMesh(GrafreeD.clipboard);
4191
+ group.selection.ClipMesh(Grafreed.clipboard);
38144192 }
38154193 // group.selection.ClipMesh(GrafreeD.clipboard);
38164194 System.out.println("DONE.");
....@@ -3857,6 +4235,18 @@
38574235 void MarkLeaves(boolean hide)
38584236 {
38594237 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);
38604250 refreshContents();
38614251 }
38624252
....@@ -3945,7 +4335,7 @@
39454335 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39464336
39474337 Object3D elem = (Object3D)group.selection.elementAt(i);
3948
- if(elem != group)
4338
+ if(elem != group || !newWindow)
39494339 {
39504340 // if (!(elem instanceof Composite))
39514341 // newWindow = false;
....@@ -4035,7 +4425,6 @@
40354425 //case 702: // Event.LIST_DESELECT
40364426 group.deselectAll();
40374427 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4038
- objEditor.ClearInfo(); // .GetMaterial());
40394428 if (tps != null)
40404429 {
40414430 for (int i=0; i < tps.length; i++)
....@@ -4044,31 +4433,30 @@
40444433
40454434 //if (child.parent != null)
40464435 //child.parent.addSelectee(child);
4436
+ objEditor.SetMaterial(child);
40474437 group.addSelectee(child);
4048
- objEditor.SetMaterial(child); // .GetMaterial());
4049
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4050
- System.err.println("info : " + child.GetPath());
40514438 }
40524439 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
4440
+// else
4441
+// {
4442
+// objEditor.SetMaterial(group); // .GetMaterial());
4443
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4444
+// System.err.println("info : " + group.GetPath());
4445
+// }
40594446
4060
- objEditor.SetText(); // jan 2014
4061
-
4062
- 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))
40634448 CameraPane.flash = true;
40644449
4065
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4450
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40664451 // a camera
40674452 {
4068
- CameraPane.camerachangeframe = 0; // don't refuse it
4069
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4070
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4071
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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
+ }
4458
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4459
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40724460 }
40734461
40744462 refreshContents();
....@@ -4079,6 +4467,26 @@
40794467
40804468 freezemodel = false;
40814469 }
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
+ }
40824490
40834491 void linkSomething(Object3D thing)
40844492 {
....@@ -4150,16 +4558,18 @@
41504558 {
41514559 if (group.selection.isEmpty())
41524560 return;
4153
- GrafreeD.clipboardIsTempGroup = false;
4561
+
4562
+ Grafreed.clipboardIsTempGroup = false;
41544563 Composite tGroup = null;
41554564 if (group.selection.size() > 0) // 1)
41564565 {
41574566 tGroup = new cGroup();
4158
- GrafreeD.clipboardIsTempGroup = true;
4567
+ Grafreed.clipboardIsTempGroup = true;
41594568 }
41604569
41614570 if (cut)
41624571 {
4572
+ Save();
41634573 //int indices[] = jList.getSelectedIndices();
41644574 //for (int i = indices.length - 1; i >= 0; i--)
41654575 //jList.remove(indices[i]);
....@@ -4195,16 +4605,16 @@
41954605 //System.out.println("cut " + child);
41964606 //System.out.println("parent = " + child.parent);
41974607 // tmp.addChild(child);
4198
- if (GrafreeD.clipboardIsTempGroup)
4608
+ if (Grafreed.clipboardIsTempGroup)
41994609 tGroup.add/*Child*/(tmp);
42004610 else
4201
- GrafreeD.clipboard = tmp;
4611
+ Grafreed.clipboard = tmp;
42024612 }
42034613 else
4204
- if (GrafreeD.clipboardIsTempGroup)
4614
+ if (Grafreed.clipboardIsTempGroup)
42054615 tGroup.add/*Child*/(child);
42064616 else
4207
- GrafreeD.clipboard = child;
4617
+ Grafreed.clipboard = child;
42084618 }
42094619
42104620 //ResetModel();
....@@ -4236,21 +4646,23 @@
42364646 //System.out.println("cut " + elem);
42374647 //System.out.println("parent = " + elem.parent);
42384648 // tmp.addChild(elem);
4239
- if (GrafreeD.clipboardIsTempGroup)
4649
+ if (Grafreed.clipboardIsTempGroup)
42404650 tGroup.add/*Child*/(tmp);
42414651 else
4242
- GrafreeD.clipboard = tmp;
4652
+ Grafreed.clipboard = tmp;
42434653 }
42444654 else
4245
- if (GrafreeD.clipboardIsTempGroup)
4655
+ if (Grafreed.clipboardIsTempGroup)
42464656 tGroup.add/*Child*/(child);
42474657 else
4248
- GrafreeD.clipboard = child;
4658
+ Grafreed.clipboard = child;
42494659 }
42504660
42514661 }
4252
- if (GrafreeD.clipboardIsTempGroup)
4253
- GrafreeD.clipboard = tGroup;
4662
+
4663
+ if (Grafreed.clipboardIsTempGroup)
4664
+ Grafreed.clipboard = tGroup;
4665
+
42544666 if (cut)
42554667 {
42564668 ResetModel();
....@@ -4264,7 +4676,7 @@
42644676 // return;
42654677 boolean first = true;
42664678
4267
- if (GrafreeD.clipboardIsTempGroup)
4679
+ if (Grafreed.clipboardIsTempGroup)
42684680 {
42694681 Composite temp;
42704682
....@@ -4275,7 +4687,7 @@
42754687 temp = (Composite)Applet3D.clipboard.deepCopy();
42764688 */
42774689 Object3D elem;
4278
- 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))
42794691 {
42804692 Object3D child = (Object3D)e.nextElement();
42814693
....@@ -4309,21 +4721,21 @@
43094721 //Object3D cb = Applet3D.clipboard;
43104722 //temp.addChild(cb);
43114723 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4312
- assert(GrafreeD.clipboard.parent == null);
4313
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4314
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4315
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4316
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
43174729 else
4318
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4319
- GrafreeD.clipboard.get(0).parent = keepparent;
4730
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4731
+ Grafreed.clipboard.get(0).parent = keepparent;
43204732 }
43214733
43224734 ResetModel();
43234735 refreshContents();
43244736 }
43254737
4326
- void pasteInto(boolean copyit)
4738
+ void pasteInto(boolean copyit, boolean clone)
43274739 {
43284740 // if (GrafreeD.clipboard == null)
43294741 // return;
....@@ -4352,15 +4764,22 @@
43524764 if (copyit)
43534765 {
43544766 // paste(false);
4355
- CloneClipboard(false); // sept 2014
4767
+ if (clone)
4768
+ {
4769
+ CloneClipboard(false); // sept 2014
4770
+ }
4771
+ else
4772
+ {
4773
+ paste(false);
4774
+ }
43564775 }
43574776 else
43584777 {
43594778 boolean first = true;
43604779
4361
- if (GrafreeD.clipboardIsTempGroup)
4780
+ if (Grafreed.clipboardIsTempGroup)
43624781 {
4363
- Composite temp = (Composite)GrafreeD.clipboard;
4782
+ Composite temp = (Composite)Grafreed.clipboard;
43644783 Object3D copy;
43654784 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43664785 {
....@@ -4370,7 +4789,7 @@
43704789 }
43714790 } else
43724791 {
4373
- linkSomething(GrafreeD.clipboard); //.get(0));
4792
+ linkSomething(Grafreed.clipboard); //.get(0));
43744793 }
43754794 }
43764795 }
....@@ -4775,21 +5194,6 @@
47755194 }
47765195 */
47775196
4778
- void ImportGFD()
4779
- {
4780
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4781
- browser.show();
4782
- String filename = browser.getFile();
4783
- if (filename != null && filename.length() > 0)
4784
- {
4785
- String fullname = browser.getDirectory() + filename;
4786
-
4787
- //Object3D readobj =
4788
- objEditor.ReadGFD(fullname, objEditor);
4789
- //makeSomething(readobj);
4790
- }
4791
- }
4792
-
47935197 /*
47945198 public void Callback(Object obj)
47955199 {
....@@ -4813,26 +5217,9 @@
48135217 }
48145218 */
48155219
4816
- void ImportVRMLX3D()
4817
- {
4818
- if (GrafreeD.standAlone)
4819
- {
4820
- /**/
4821
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4822
- browser.show();
4823
- String filename = browser.getFile();
4824
- if (filename != null && filename.length() > 0)
4825
- {
4826
- String fullname = browser.getDirectory() + filename;
4827
- LoadVRMLX3D(fullname);
4828
- }
4829
- /**/
4830
- }
4831
- }
4832
-
48335220 String GetFile(String dialogName)
48345221 {
4835
- if (GrafreeD.standAlone)
5222
+ if (Grafreed.standAlone)
48365223 {
48375224 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48385225 browser.show();
....@@ -4896,10 +5283,18 @@
48965283 cButton flashSelectionButton;
48975284 cButton editButton;
48985285 cButton uneditButton;
5286
+ JCheckBox allParamsButton;
48995287 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015288 cButton unselectButton;
49025289
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
5293
+ cButton undoButton;
5294
+ cButton redoButton;
5295
+ cButton saveButton;
5296
+ cButton oneStepButton;
5297
+
49035298 cButton screenfitButton;
49045299 cButton screenfitpointButton;
49055300 cButton snapobjectButton;
....@@ -4910,14 +5305,6 @@
49105305 cButton closeButton;
49115306
49125307 cButton setsupportButton;
4913
-
4914
- cButton twoButton;
4915
- cButton sixButton;
4916
- cButton threeButton;
4917
- cButton sevenButton;
4918
- cButton fourButton; // full panel
4919
- cButton oneButton; // full XYZ
4920
- //cButton currentLayout;
49215308
49225309 //
49235310 //Composite
....@@ -4930,6 +5317,8 @@
49305317 private MenuItem lookFromItem;
49315318 private MenuItem switchItem;
49325319 private MenuItem cutItem;
5320
+ private MenuItem undoItem;
5321
+ private MenuItem redoItem;
49335322 private MenuItem duplicateItem;
49345323 private MenuItem cloneItem;
49355324 private MenuItem cloneSupportItem;
....@@ -4943,7 +5332,7 @@
49435332 private MenuItem linkverticesItem;
49445333 private MenuItem relinkverticesItem;
49455334 private MenuItem setMasterItem;
4946
- private MenuItem resetMeshItem;
5335
+ private MenuItem resetAllItem;
49475336 private MenuItem stepAllItem;
49485337 private MenuItem revertMeshItem;
49495338 private MenuItem poseMeshItem;
....@@ -4954,6 +5343,7 @@
49545343 private MenuItem mergeGeometriesItem;
49555344 private MenuItem copyItem;
49565345 private MenuItem pasteItem;
5346
+ private MenuItem pasteIntoItem;
49575347 private MenuItem pasteLinkItem;
49585348 private MenuItem pasteCloneItem;
49595349 private MenuItem pasteExpandItem;
....@@ -4992,6 +5382,10 @@
49925382 private MenuItem showleavesItem;
49935383 private MenuItem markleavesItem;
49945384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
49955389
49965390 private MenuItem flipVItem;
49975391 private MenuItem unflipVItem;
....@@ -5003,8 +5397,10 @@
50035397 private MenuItem panoTexturesItem;
50045398
50055399 private MenuItem resetCentroidItem;
5006
- private MenuItem transformgeometryItem;
5400
+ private MenuItem resetCentroidXZItem;
50075401 private MenuItem resetTransformItem;
5402
+ private MenuItem transformGeometryItem;
5403
+ private MenuItem transformChildrenItem;
50085404 private MenuItem hideItem;
50095405 private MenuItem grabItem;
50105406 private MenuItem backItem;
....@@ -5051,7 +5447,7 @@
50515447 private MenuItem blobItem;
50525448 private MenuItem latheItem;
50535449 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
5450
+ private MenuItem overlayItem;
50555451 private MenuItem meshItem;
50565452 // private MenuItem meshGroupItem;
50575453 private MenuItem springItem;
....@@ -5073,11 +5469,6 @@
50735469 private MenuItem doubleItem;
50745470 private MenuItem tripleItem;
50755471
5076
- private MenuItem importGFDItem;
5077
- private MenuItem importVRMLX3DItem;
5078
- private MenuItem import3DSItem;
5079
- private MenuItem importOBJItem;
5080
-
50815472 private MenuItem computeAOItem;
50825473 private MenuItem recompileItem;
50835474 private MenuItem editScriptItem;
....@@ -5087,4 +5478,8 @@
50875478 private MenuItem analyzeItem;
50885479 private MenuItem dumpItem;
50895480 //boolean freezemodel = false;
5481
+
5482
+ Menu cameraMenu;
5483
+ MenuItem editCameraItem;
5484
+ MenuItem revertCameraItem;
50905485 }