Normand Briere
2019-06-25 26b24f5b623e709a88e91e9bce0864f9d5e8f084
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,30 +148,29 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
163155 Menu menu;
164156 oe.menuBar.add(menu = new Menu("Edit"));
165157 //editItem = menu.add(new MenuItem("Edit"));
166158 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168166 duplicateItem.addActionListener(this);
169
- menu.add("-");
170167 cloneItem = menu.add(new MenuItem("Clone"));
171168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
172171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173172 cloneSupportItem.addActionListener(this);
173
+ }
174174 menu.add("-");
175175 cutItem = menu.add(new MenuItem("Cut"));
176176 cutItem.addActionListener(this);
....@@ -178,27 +178,123 @@
178178 copyItem.addActionListener(this);
179179 pasteItem = menu.add(new MenuItem("Paste"));
180180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
181185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182186 pasteLinkItem.addActionListener(this);
183187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184188 pasteCloneItem.addActionListener(this);
185189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
187192 clearItem = menu.add(new MenuItem("Clear"));
188193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
189198 clearAllItem = menu.add(new MenuItem("Clear All"));
190199 clearAllItem.addActionListener(this);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209
+
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
191237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
192289 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);
290
+ if (Globals.ADVANCED)
291
+ {
197292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198293 revertMeshItem.addActionListener(this);
199294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200295 resetreferencesItem.addActionListener(this);
201296 menu.add("-");
297
+ }
202298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203299 overwriteGeoItem.addActionListener(this);
204300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +306,103 @@
210306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211307 overwriteUVItem.addActionListener(this);
212308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
213311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214312 generateMeshItem.addActionListener(this);
215313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216314 poseMeshItem.addActionListener(this);
217315 menu.add("-");
316
+ }
218317 resetsupportItem = menu.add(new MenuItem("Reset support"));
219318 resetsupportItem.addActionListener(this);
220319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221320 linkverticesItem.addActionListener(this);
222321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
224326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225327 setMasterItem.addActionListener(this);
328
+ }
226329
227330 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
230333 backItem = menu.add(new MenuItem("Back"));
231334 backItem.addActionListener(this);
232335 frontItem = menu.add(new MenuItem("Front"));
233336 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237343 hideItem.addActionListener(this);
344
+ }
238345 ungroupItem = menu.add(new MenuItem("Ungroup"));
239346 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- 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);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
247354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248355 switchGeoItem.addActionListener(this);
249356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250357 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
252359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
253366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254367 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
368
+ }
257369
258370 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
261373 billboardItem = menu.add(new MenuItem("Billboard"));
262374 billboardItem.addActionListener(this);
263375 csgItem = menu.add(new MenuItem("CSG"));
264376 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266378 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268380 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
271386 linkerItem = menu.add(new MenuItem("Linker"));
272387 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275388 attributeItem = menu.add(new MenuItem("Attribute"));
276389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
277392 pointflowItem = menu.add(new MenuItem("Point Flow"));
278393 pointflowItem.addActionListener(this);
394
+ }
279395 menu.add("-");
280396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281397 resetTransformItem.addActionListener(this);
282398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283399 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
286406
287407 oe.menuBar.add(menu = new Menu("Geometry"));
288408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +413,11 @@
293413 genNormalsCADItem.addActionListener(this);
294414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
296418 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297419 genNormalsMINEItem.addActionListener(this);
420
+ }
298421 stripifyItem = menu.add(new MenuItem("Stripify"));
299422 stripifyItem.addActionListener(this);
300423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +439,34 @@
316439 reduce34MeshItem.addActionListener(this);
317440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318441 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
323450
324451 oe.menuBar.add(menu = new Menu("Attributes"));
325452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326453 clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
327458 menu.add("-");
328459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329460 liveleavesItem.addActionListener(this);
330461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
332465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333466 supportleavesItem.addActionListener(this);
334467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335468 unsupportleavesItem.addActionListener(this);
469
+ }
336470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337471 hideleavesItem.addActionListener(this);
338472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +475,14 @@
341475 markleavesItem.addActionListener(this);
342476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
344486 menu.add("-");
345487 flipVItem = menu.add(new MenuItem("Flip V"));
346488 flipVItem.addActionListener(this);
....@@ -376,35 +518,40 @@
376518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377519 sortbynameItem.addActionListener(this);
378520 menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
379528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380529 extractGeometriesItem.addActionListener(this);
381530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382531 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);
532
+ }
387533
388534 oe.menuBar.add(menu = new Menu("Insert"));
389535 buildCreateMenu(menu);
390536
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
-
402537 oe.menuBar.add(menu = new Menu("Tools"));
403538 buildToolsMenu(menu);
404539 }
405540
406541 void SetupUI2(ObjEditor oe)
407542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
408555 //new Exception().printStackTrace();
409556
410557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,150 +580,199 @@
433580 oe.radioPanel.add(dummyButton);
434581 oe.buttonGroup.add(dummyButton);
435582 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
439586
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588
+
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ redoButton.setToolTipText("Redo changes");
611
+ redoButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ saveButton.setToolTipText("Save changes");
615
+ saveButton.addActionListener(this);
616
+
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618
+ liveCB.setToolTipText("Enable animation");
441619 liveCB.addItemListener(this);
442620
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", CameraPane.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);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ oneStepButton.setToolTipText("Animate one step forward");
623
+ oneStepButton.addActionListener(this);
624
+
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626
+ fastCB.setToolTipText("Fast mode");
461627 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);
503
- trackCB.addItemListener(this);
504
-
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
628
+
629
+ //oe.toolboxPanel.Return();
630
+
631
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ screenfitButton.setToolTipText("Screen fit");
507633 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
634
+
635
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636
+// trackCB.setToolTipText("Enable tracking");
637
+// trackCB.addItemListener(this);
638
+
509639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510640 // 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;
515641
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);
522
- flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
642
+ if (Globals.ADVANCED)
643
+ {
644
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ snapobjectButton.addActionListener(this);
646
+ snapobjectButton.setToolTipText("Snap Object");
647
+ }
648
+
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
526650
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ twoButton.setToolTipText("Show center view only");
529653 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
654
+ this.fullscreenLayout = twoButton;
655
+
656
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531657 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
658
+ fourButton.setToolTipText("Show left panel only");
659
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
+ sixButton.setToolTipText("2-column layout left");
533661 sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
+ threeButton.setToolTipText("2-column layout right");
535664 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
665
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ sevenButton.setToolTipText("3-column layout");
537667 sevenButton.addActionListener(this);
538668 //
539669
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ rootButton.setToolTipText("Edit selection in new tab");
541672 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
673
+
674
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
675
+ closeButton.setToolTipText("Close tab");
544676 closeButton.addActionListener(this);
545677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546678 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548
-
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
551
- editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555679
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
680
+ // INSERT
681
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ gridButton.setToolTipText("Create grid");
683
+ gridButton.addActionListener(this);
684
+
685
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ boxButton.setToolTipText("Create box");
687
+ boxButton.addActionListener(this);
688
+
689
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ sphereButton.setToolTipText("Create sphere");
691
+ sphereButton.addActionListener(this);
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.Return();
717
+
718
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ groupButton.setToolTipText("Create group");
720
+ groupButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ compositeButton.setToolTipText("Create composite");
724
+ compositeButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ switchButton.setToolTipText("Create switch");
728
+ switchButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ loopButton.setToolTipText("Create loop");
732
+ loopButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ textureButton.setToolTipText("Create texture");
736
+ textureButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ overlayButton.setToolTipText("Create overlay");
740
+ overlayButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ lightButton.setToolTipText("Create light");
744
+ lightButton.addActionListener(this);
745
+
746
+ // EDIT panel
747
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ editButton.setToolTipText("Edit selection");
749
+ editButton.addActionListener(this);
750
+
751
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ uneditButton.setToolTipText("Unedit selection");
557753 uneditButton.addActionListener(this);
558754
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
755
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
+ allParamsButton.setToolTipText("Edit all params");
571757 allParamsButton.addActionListener(this);
572758
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
759
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ clearPanelButton.setToolTipText("Clear edit panel");
761
+ clearPanelButton.addActionListener(this);
762
+
763
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ unselectButton.setToolTipText("Unselect");
578765 unselectButton.addActionListener(this);
579766
767
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ flashSelectionButton.setToolTipText("Highlight selection");
769
+ flashSelectionButton.addActionListener(this);
770
+
771
+ editCommandsPanel.preferredHeight = 1;
772
+
773
+// oe.treePanel.add(commandsPanel);
774
+// oe.treePanel.Return();
775
+
580776 // oe.aConstraints.gridx += 1;
581777 // oe.aConstraints.weighty = 0;
582778 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +784,22 @@
588784 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589785 // gcButton.addActionListener(this);
590786
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
787
+ cGridBag jSPPanel = new cGridBag();
788
+
789
+ JScrollPane jSP;
602790 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
604792 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
609
-
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
614
- colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
617
- materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
620
- textureCB.addItemListener(this);
621
-
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
624793
794
+ oe.treePanel.add(jSPPanel);
795
+ oe.treePanel.Return();
796
+
797
+ oe.treePanel.add(copyOptionsPanel);
798
+ oe.treePanel.Return();
799
+
800
+// mainPanel.setDividerLocation(0.5); //1.0);
801
+// mainPanel.setResizeWeight(0.5);
802
+
625803 //jList.addListSelectionListener(this);
626804 oe.jTree.addTreeSelectionListener(this);
627805 //jTree.setRootVisible(false);
....@@ -643,20 +821,153 @@
643821 radio.layout = sevenButton;
644822 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645823 }
824
+
825
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
826
+ {
827
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
828
+ colorCB.setToolTipText("Copy color when dropped");
829
+ colorCB.addItemListener(this);
830
+
831
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
832
+ materialCB.setToolTipText("Copy material when dropped");
833
+ materialCB.addItemListener(this);
834
+
835
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
836
+ textureCB.setToolTipText("Copy texture when dropped");
837
+ textureCB.addItemListener(this);
838
+
839
+ panel.Return();
840
+
841
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
842
+ boxCB.setToolTipText("Display bounding boxes");
843
+ boxCB.addItemListener(this);
844
+
845
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
847
+ zoomBoxCB.addItemListener(this);
848
+
849
+ if (true) // Globals.ADVANCED)
850
+ {
851
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
+ supportCB.setToolTipText("Enable rigging");
853
+ supportCB.addItemListener(this);
854
+
855
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
856
+ // localCB.addItemListener(this);
857
+
858
+ panel.Return();
859
+
860
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
861
+ crowdCB.setToolTipText("Used for crowds");
862
+ crowdCB.addItemListener(this);
863
+
864
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
865
+ smoothCB.setToolTipText("Snapping delay");
866
+ smoothCB.addItemListener(this);
867
+
868
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
869
+ slowCB.setToolTipText("Smooth interpolation");
870
+ slowCB.addItemListener(this);
871
+
872
+// constraints.gridy += 1;
873
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
874
+// speakerMocapCB.addItemListener(this);
875
+
876
+ panel.Return();
877
+
878
+ if (false)
879
+ {
880
+ // handled in scripts
881
+ //constraints.gridy += 1;
882
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
883
+ speakerCameraCB.addItemListener(this);
884
+
885
+ //constraints.gridy += 1;
886
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
887
+ speakerFocusCB.addItemListener(this);
888
+
889
+ //constraints.gridy += 1;
890
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
891
+ smoothfocusCB.addItemListener(this);
892
+ panel.Return();
893
+ }
894
+
895
+//constraints.gridx += 1;
896
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
897
+// debugCB.addItemListener(this);
898
+
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
903
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
905
+ oeilCB.addItemListener(this);
906
+
907
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
+ shadowCB.setToolTipText("Compute shadows when live");
909
+ shadowCB.addItemListener(this);
910
+
911
+ panel.Return();
912
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
913
+ toggleTextureCB.setToolTipText("Load textures");
914
+ toggleTextureCB.addItemListener(this);
915
+
916
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
+ toggleSwitchCB.setToolTipText("Use switch");
918
+ toggleSwitchCB.addItemListener(this);
919
+
920
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
+ autosaveCB.setToolTipText("Auto-save on structure change");
922
+ autosaveCB.addItemListener(this);
923
+
924
+ panel.Return();
925
+ if (Globals.ADVANCED)
926
+ {
927
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
928
+ lookAtCB.setToolTipText("Look-at target");
929
+ lookAtCB.addItemListener(this);
930
+ }
931
+
932
+ }
933
+
934
+ cGridBag fill = new cGridBag();
935
+ fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
940
+
941
+ panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
944
+
945
+ }
646946
647947 void EditObject(Object3D obj)
648948 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
949
+ cRadio radioButton = new cRadio(obj.name);
950
+
951
+ // Patch to avoid bug with transparency.
952
+ radioButton.hadMaterial = obj.material != null;
953
+ if (!radioButton.hadMaterial)
954
+ {
955
+ obj.material = new cMaterial();
956
+ }
957
+
958
+ radioButton.SetObject(obj);
959
+ radioButton.layout = sevenButton;
960
+ radioButton.SetCamera(cameraView.renderCamera, false);
961
+ radioButton.addActionListener(this);
962
+ radioPanel.add(radioButton);
963
+ buttonGroup.add(radioButton);
964
+ radioButton.doClick();
657965 }
966
+
658967 void SetupViews(ObjEditor oe)
659968 {
969
+ theFrame = this;
970
+
660971 oe.SetupViews();
661972
662973 System.out.println("SetupViews");
....@@ -665,22 +976,27 @@
665976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
666977 }
667978
668
- JCheckBox liveCB;
669
- JCheckBox supportCB;
670
- JCheckBox localCB;
671
- JCheckBox crowdCB;
672
- JCheckBox smoothCB;
673
- JCheckBox fastCB;
674
- JCheckBox slowCB;
675
- JCheckBox boxCB;
676
- JCheckBox trackCB;
677
- JCheckBox smoothfocusCB;
979
+ cToggleButton liveCB;
980
+ cCheckBox supportCB;
981
+ cCheckBox localCB;
982
+ cCheckBox crowdCB;
983
+ cCheckBox smoothCB;
984
+ cToggleButton fastCB;
985
+ cCheckBox slowCB;
986
+ cCheckBox boxCB;
987
+ cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
989
+ cCheckBox trackCB;
990
+ cCheckBox smoothfocusCB;
678991 // JCheckBox speakerMocapCB;
679
- JCheckBox speakerCameraCB;
680
- JCheckBox speakerFocusCB;
681
- JCheckBox debugCB;
682
- JCheckBox oeilCB;
683
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
6841000
6851001 // static int COLOR = 1;
6861002 // static int MATERIAL = 2;
....@@ -688,9 +1004,9 @@
6881004
6891005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6901006
691
- JCheckBox colorCB;
692
- JCheckBox materialCB;
693
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
6941010
6951011 public void itemStateChanged(ItemEvent e)
6961012 {
....@@ -715,10 +1031,10 @@
7151031 dropAttributes |= Object3D.TEXTURE;
7161032 else
7171033 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
1034
+ } else if(e.getSource() == liveCB)
7201035 {
7211036 cameraView.ToggleLive();
1037
+ refreshContents(false);
7221038 }
7231039 else if(e.getSource() == supportCB)
7241040 {
....@@ -754,6 +1070,10 @@
7541070 cameraView.repaint();
7551071 // refreshContents();
7561072 }
1073
+ else if(e.getSource() == zoomBoxCB)
1074
+ {
1075
+ cameraView.ToggleZoomBoxMode();
1076
+ }
7571077 else if(e.getSource() == smoothfocusCB)
7581078 {
7591079 cameraView.ToggleSmoothFocus();
....@@ -779,6 +1099,14 @@
7791099 {
7801100 cameraView.ToggleOeil();
7811101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
7821110 else if(e.getSource() == lookAtCB)
7831111 {
7841112 cameraView.ToggleLookAt();
....@@ -795,7 +1123,8 @@
7951123
7961124 /**/
7971125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
798
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
7991128 if ((path == null) || (path.getPathCount() <= 1)) {
8001129 // We can't move the root node or an empty selection
8011130 return;
....@@ -867,7 +1196,9 @@
8671196 // objEditor.DropFile((java.io.File[]) object, true);
8681197 // return;
8691198 // }
870
- if (string.charAt(0) == '/')
1199
+
1200
+ // File path for Mac and Windows
1201
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711202 {
8721203 // file(s)
8731204 String[] names = string.split("\n");
....@@ -894,7 +1225,7 @@
8941225
8951226 flashIt = false;
8961227 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1228
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981229 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991230
9001231 if (group.selection.size() == 1)
....@@ -910,23 +1241,33 @@
9101241
9111242 assert target == objEditor.jTree;
9121243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
9131245 try {
914
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9151247 } catch (Exception e) {
9161248 System.out.println("destinationPath : " + destinationPath);
9171249 return;
9181250 }
9191251
920
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
9211253 {
1254
+ Object3D child = (Object3D)group.selection.elementAt(i);
1255
+
1256
+ // Cannot move into itself
1257
+ if (child == destinationLeaf)
1258
+ return;
1259
+ }
1260
+
1261
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1262
+// {
9221263 loadClipboard(true);
9231264 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
925
- } else {
926
- loadClipboard(false);
927
- objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
929
- }
1265
+ pasteInto(false, false);
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
9301271 }
9311272 public void dropActionChanged(DropTargetDragEvent dtde)
9321273 // Called if the user has modified the current drop gesture
....@@ -1031,85 +1372,104 @@
10311372 {
10321373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10331374 //heightFieldItem.addActionListener(this);
1034
- gridItem = menu.add(new MenuItem("Grid"));
1035
- gridItem.addActionListener(this);
1036
- rectoidItem = menu.add(new MenuItem("Box"));
1037
- rectoidItem.addActionListener(this);
1038
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1039
- ellipsoidItem.addActionListener(this);
1040
- coneItem = menu.add(new MenuItem("Cone"));
1041
- coneItem.addActionListener(this);
1042
- torusItem = menu.add(new MenuItem("Torus"));
1043
- torusItem.addActionListener(this);
1044
- superItem = menu.add(new MenuItem("Superellipsoid"));
1045
- superItem.addActionListener(this);
1375
+// gridItem = menu.add(new MenuItem("Grid"));
1376
+// gridItem.addActionListener(this);
1377
+// rectoidItem = menu.add(new MenuItem("Box"));
1378
+// rectoidItem.addActionListener(this);
1379
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1380
+// ellipsoidItem.addActionListener(this);
1381
+// coneItem = menu.add(new MenuItem("Cone"));
1382
+// coneItem.addActionListener(this);
1383
+// torusItem = menu.add(new MenuItem("Torus"));
1384
+// torusItem.addActionListener(this);
1385
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1386
+// superItem.addActionListener(this);
1387
+
1388
+ cameraItem = menu.add(new MenuItem("Camera"));
1389
+ cameraItem.addActionListener(this);
1390
+
1391
+ if (!Globals.ADVANCED)
1392
+ {
10461393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10471394 kleinItem.addActionListener(this);
1048
- particleItem = menu.add(new MenuItem("Particle system"));
1049
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
1399
+ if (Globals.ADVANCED)
1400
+ {
10501401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511402 ragdollItem.addActionListener(this);
10521403 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531404 ragdoll2Item.addActionListener(this);
1405
+ }
10541406 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1407
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561408 meshItem.addActionListener(this);
10571409 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581410 // meshGroupItem.addActionListener(this);
1411
+ if (Globals.ADVANCED)
1412
+ {
10591413 springItem = menu.add(new MenuItem("Spring"));
10601414 springItem.addActionListener(this);
10611415 flagItem = menu.add(new MenuItem("Flag"));
10621416 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671417 blobItem = menu.add(new MenuItem("Blob"));
10681418 blobItem.addActionListener(this);
10691419 latheItem = menu.add(new MenuItem("Lathe"));
10701420 latheItem.addActionListener(this);
1071
- lightItem = menu.add(new MenuItem("Light"));
1072
- lightItem.addActionListener(this);
1421
+ }
1422
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1423
+ bezierItem.addActionListener(this);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
10731428 menu.add("-");
10741429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10751430 //superLoopItem.addActionListener(this);
1076
- loopItem = menu.add(new MenuItem("Loop"));
1077
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
10781433 doubleItem = menu.add(new MenuItem("Fork"));
10791434 doubleItem.addActionListener(this);
1435
+ if (Globals.ADVANCED)
1436
+ {
10801437 tripleItem = menu.add(new MenuItem("Trident"));
10811438 tripleItem.addActionListener(this);
1439
+ }
10821440 }
10831441
10841442 void buildToolsMenu(Menu menu)
10851443 {
10861444 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871445 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1446
+ animationItem.setState(Globals.ANIMATION);
10891447
10901448 menu.add("-");
10911449 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921450 parseverticesItem.addActionListener(this);
10931451 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941452 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1453
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961454 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991455 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001456 reduceMorphItem.addActionListener(this);
11011457 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021458 reduce34MorphItem.addActionListener(this);
1103
-
1459
+ menu.add("-");
11041460 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051461 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071462
1463
+ if (Globals.ADVANCED)
1464
+ {
1465
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1466
+ mirrorItem.addActionListener(this);
1467
+ menu.add("-");
11081468 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091469 memoryItem.addActionListener(this);
11101470 menu.add(analyzeItem = new MenuItem("Analyze"));
11111471 analyzeItem.addActionListener(this);
1112
- menu.add(dumpItem = new MenuItem("Dump"));
1472
+ menu.add(dumpItem = new MenuItem("Print"));
11131473 dumpItem.addActionListener(this);
11141474 // menu.add(pathItem = new MenuItem("From-to path"));
11151475 // pathItem.addActionListener(this);
....@@ -1118,6 +1478,8 @@
11181478 resetParentItem.addActionListener(this);
11191479 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201480 repairParentItem.addActionListener(this);
1481
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1482
+ repairShadowItem.addActionListener(this);
11211483 menu.add(invariantsItem = new MenuItem("Invariants"));
11221484 invariantsItem.addActionListener(this);
11231485 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1487,7 @@
11251487 menu.add("-");
11261488 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271489 editScriptItem.addActionListener(this);
1490
+ }
11281491 }
11291492
11301493 void ScreenFit()
....@@ -1247,6 +1610,7 @@
12471610 shadow.material = new cMaterial(obj.material);
12481611 shadow.material.diffuse = 0.0001f;
12491612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
12501614
12511615 makeSomething(shadow);
12521616 }
....@@ -1453,9 +1817,9 @@
14531817
14541818 void Overwrite(int mask)
14551819 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1820
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571821 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1822
+ Object3D content = Grafreed.clipboard.get(0);
14591823
14601824 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611825 content = ((cGroup)content).get(0);
....@@ -1478,6 +1842,7 @@
14781842 //
14791843 public void actionPerformed(ActionEvent event) // , Object arg)
14801844 {
1845
+ Object source = event.getSource();
14811846 /*
14821847 if (event.getSource() == nameField)
14831848 {
....@@ -1489,11 +1854,11 @@
14891854 }
14901855 else
14911856 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1857
+ if (source == lookAtItem || source == lookFromItem)
14931858 {
14941859 ScreenFit();
14951860 } else
1496
- if (event.getSource() == switchItem)
1861
+ if (source == switchViewItem)
14971862 {
14981863 cVector v1 = new cVector();
14991864 cVector v2 = new cVector();
....@@ -1502,11 +1867,11 @@
15021867 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031868 objEditor.cameraView.repaint();
15041869 } else
1505
- if (event.getSource() == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
15061871 {
15071872 makeSomething(new Box());
15081873 } else
1509
- if (event.getSource() == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
15101875 {
15111876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1892,9 @@
15271892 applyExample(particleGeom, "SMOKE");
15281893 makeSomething(particleGeom);
15291894 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1895
+ if (source == ragdollItem || source == ragdoll2Item)
15311896 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1897
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331898
15341899 ragdoll.toParent = LA.newMatrix();
15351900 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1912,7 @@
15471912 } else
15481913 /*
15491914 */
1550
- if (event.getSource() == heightFieldItem)
1915
+ if (source == heightFieldItem)
15511916 {
15521917 Object3D obj = new Object3D();
15531918
....@@ -1585,31 +1950,31 @@
15851950
15861951 makeSomething(obj);
15871952 } else
1588
- if (event.getSource() == gridItem)
1953
+ if (source == gridItem || source == gridButton)
15891954 {
15901955 makeSomething(new Grid());
15911956 } else
1592
- if (event.getSource() == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
15931958 {
15941959 makeSomething(new Sphere());
15951960 } else
1596
- if (event.getSource() == coneItem)
1961
+ if (source == coneItem || source == coneButton)
15971962 {
15981963 makeSomething(new Cone());
15991964 } else
1600
- if (event.getSource() == torusItem)
1965
+ if (source == torusItem || source == torusButton)
16011966 {
16021967 makeSomething(new Torus());
16031968 } else
1604
- if (event.getSource() == superItem)
1969
+ if (source == superItem || source == superButton)
16051970 {
16061971 makeSomething(new Superellipsoid());
16071972 } else
1608
- if (event.getSource() == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
16091974 {
16101975 makeSomething(new Klein());
16111976 } else
1612
- if (event.getSource() == blobItem)
1977
+ if (source == blobItem)
16131978 {
16141979 Blob blob = new Blob();
16151980 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1982,15 @@
16171982 //blob.retile();
16181983 makeSomething(blob);
16191984 } else
1620
- if (event.getSource() == latheItem)
1985
+ if (source == latheItem)
16211986 {
16221987 makeSomething(new Lathe());
16231988 } else
1624
- if (event.getSource() == bezierItem)
1989
+ if (source == bezierItem)
16251990 {
16261991 makeSomething(new BezierSurface());
16271992 } else
1628
- if (event.getSource() == checkerItem)
1993
+ if (source == overlayItem || source == overlayButton)
16291994 {
16301995 /*
16311996 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +2005,7 @@
16402005 */
16412006 makeSomething(new Checker());
16422007 } else
1643
- if (event.getSource() == meshItem)
2008
+ if (source == meshItem)
16442009 {
16452010 Object3D itemtomake = new Object3D();
16462011 Object3D child;
....@@ -1661,35 +2026,35 @@
16612026 makeSomething(child);
16622027 }
16632028 } else
1664
- if (event.getSource() == springItem)
2029
+ if (source == springItem)
16652030 {
16662031 cSpring s = new cSpring();
16672032 s.setup();
16682033 makeSomething(s);
16692034 } else
1670
- if (event.getSource() == flagItem)
2035
+ if (source == flagItem)
16712036 {
16722037 cSpring s = new cFlag();
16732038 s.setup();
16742039 makeSomething(s);
16752040 } else
1676
- if (event.getSource() == lightItem)
2041
+ if (source == lightItem || source == lightButton)
16772042 {
16782043 makeSomething(new Light());
16792044 } else
1680
- if (event.getSource() == csgItem)
2045
+ if (source == csgItem)
16812046 {
16822047 group(new CSG());
16832048 } else
1684
- if (event.getSource() == templateItem)
2049
+ if (source == templateItem)
16852050 {
16862051 group(new cTemplate());
16872052 } else
1688
- if (event.getSource() == attributeItem)
2053
+ if (source == attributeItem)
16892054 {
16902055 makeSomething(new Attribute());
16912056 } else
1692
- if (event.getSource() == pointflowItem)
2057
+ if (source == pointflowItem)
16932058 {
16942059 makeSomething(new PointFlow());
16952060 } else
....@@ -1701,7 +2066,7 @@
17012066 } else
17022067 */
17032068
1704
- if (event.getSource() == superLoopItem)
2069
+ if (source == superLoopItem)
17052070 {
17062071 Composite g = new cGroup();
17072072 for (int i=0; i<15; i++)
....@@ -1723,7 +2088,7 @@
17232088
17242089 group(g);
17252090 } else
1726
- if (event.getSource() == loopItem)
2091
+ if (source == loopItem || source == loopButton)
17272092 {
17282093 Composite csg = new GroupLeaf();
17292094 csg.count = 5;
....@@ -1732,7 +2097,7 @@
17322097 csg.addChild(child);
17332098 child.addChild(csg);
17342099 } else
1735
- if (event.getSource() == doubleItem)
2100
+ if (source == doubleItem)
17362101 {
17372102 Composite csg = new GroupLeaf();
17382103 csg.count = 5;
....@@ -1744,7 +2109,7 @@
17442109 csg.addChild(child);
17452110 child.addChild(csg);
17462111 } else
1747
- if (event.getSource() == tripleItem)
2112
+ if (source == tripleItem)
17482113 {
17492114 Composite csg = new GroupLeaf();
17502115 csg.count = 4;
....@@ -1759,71 +2124,83 @@
17592124 csg.addChild(child);
17602125 child.addChild(csg);
17612126 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
2127
+ if (source == computeAOItem)
17642128 {
1765
- ImportGFD();
2129
+ Globals.drawMode = CameraPane.OCCLUSION;
2130
+ Globals.theRenderer.repaint();
17662131 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
2132
+ if (source == recompileItem)
17852133 {
17862134 Recompile();
17872135 refreshContents();
17882136 } else
1789
- if (event.getSource() == editScriptItem)
2137
+ if (source == editScriptItem)
17902138 {
17912139 OpenDialog();
17922140 refreshContents();
17932141 } else
1794
- if (event.getSource() == invariantsItem)
2142
+ if (source == invariantsItem)
17952143 {
17962144 System.out.println("Invariants:");
1797
- GrafreeD.grafreeD.universe.invariants();
2145
+ Grafreed.grafreeD.universe.invariants();
17982146 } else
1799
- if (event.getSource() == memoryItem)
2147
+ if (source == memoryItem)
18002148 {
18012149 //System.out.println("Invariants:");
18022150 PrintMemory();
18032151 } else
1804
- if (event.getSource() == pathItem)
2152
+ if (source == pathItem)
18052153 {
18062154 PrintPath();
18072155 } else
1808
- if (event.getSource() == analyzeItem)
2156
+ if (source == analyzeItem)
18092157 {
18102158 AnalyzeObject();
18112159 } else
1812
- if (event.getSource() == dumpItem)
2160
+ if (source == dumpItem)
18132161 {
18142162 DumpObject();
18152163 } else
1816
- if (event.getSource() == screenfitButton)
2164
+ if (source == minButton)
2165
+ {
2166
+ Minimize();
2167
+ } else
2168
+ if (source == maxButton)
2169
+ {
2170
+ Maximize();
2171
+ } else
2172
+ if (source == fullButton)
2173
+ {
2174
+ ToggleFullScreen();
2175
+ } else
2176
+ if (source == undoButton)
2177
+ {
2178
+ Undo();
2179
+ } else
2180
+ if (source == redoButton)
2181
+ {
2182
+ Redo();
2183
+ } else
2184
+ if (source == saveButton)
2185
+ {
2186
+ Save();
2187
+ } else
2188
+ if (source == oneStepButton)
2189
+ {
2190
+ Globals.ONESTEP = true;
2191
+ cameraView.repaint();
2192
+ } else
2193
+ if (source == screenfitButton)
18172194 {
18182195 //Reload(lastConverter, lastFilename, true);
18192196 ScreenFit();
18202197 } else
1821
- if (event.getSource() == screenfitpointButton)
2198
+ if (source == screenfitpointButton)
18222199 {
18232200 //Reload(lastConverter, lastFilename, true);
18242201 ScreenFitPoint();
18252202 } else
1826
- if (event.getSource() == snapobjectButton)
2203
+ if (source == snapobjectButton)
18272204 {
18282205 //Reload(lastConverter, lastFilename, true);
18292206 SnapObject();
....@@ -1834,13 +2211,13 @@
18342211 // Recompile();
18352212 // refreshContents();
18362213 // } else
1837
- if (event.getSource() == gcButton)
2214
+ if (source == gcButton)
18382215 {
18392216 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402217 System.gc();
18412218 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422219 } else
1843
- if (event.getSource() == editLeafItem)
2220
+ if (source == editLeafItem)
18442221 {
18452222 Object3D obj;
18462223 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2231,74 @@
18542231 }
18552232 refreshContents(true);
18562233 } else
1857
- if (event.getSource() == openWindowItem)
2234
+ if (source == openWindowItem)
18582235 {
18592236 EditSelection(true);
18602237 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2238
+ if (source == cutItem || source == clearButton)
18622239 {
18632240 loadClipboard(true);
18642241 } else
1865
- if (event.getSource() == duplicateItem)
2242
+ if (source == undoItem)
18662243 {
1867
- Object3D keep = GrafreeD.clipboard;
2244
+ Undo();
2245
+ } else
2246
+ if (source == redoItem)
2247
+ {
2248
+ Redo();
2249
+ } else
2250
+ if (source == duplicateItem)
2251
+ {
2252
+ Object3D keep = Grafreed.clipboard;
18682253 loadClipboard(false);
18692254 paste(false);
1870
- GrafreeD.clipboard = keep;
2255
+ Grafreed.clipboard = keep;
18712256 } else
1872
- if (event.getSource() == cloneItem)
2257
+ if (source == cloneItem)
18732258 {
18742259 CloneSelection(false);
18752260 } else
1876
- if (event.getSource() == cloneSupportItem)
2261
+ if (source == cloneSupportItem)
18772262 {
18782263 CloneSelection(true);
18792264 } else
1880
- if (event.getSource() == copyItem)
2265
+ if (source == copyItem)
18812266 {
18822267 loadClipboard(false);
18832268 } else
1884
- if (event.getSource() == pasteItem)
2269
+ if (source == pasteItem)
18852270 {
18862271 paste(false);
18872272 } else
1888
- if (event.getSource() == pasteLinkItem)
2273
+ if (source == pasteIntoItem)
18892274 {
1890
- pasteInto(false);
2275
+ pasteInto(true, false);
18912276 } else
1892
- if (event.getSource() == pasteCloneItem)
2277
+ if (source == pasteLinkItem)
18932278 {
1894
- pasteInto(true);
2279
+ pasteInto(false, false);
18952280 } else
1896
- if (event.getSource() == pasteExpandItem)
2281
+ if (source == pasteCloneItem)
2282
+ {
2283
+ pasteInto(true, true);
2284
+ } else
2285
+ if (source == pasteExpandItem)
18972286 {
18982287 paste(true);
18992288 } else
1900
- if (event.getSource() == synchronizeItem)
2289
+ if (source == synchronizeItem)
19012290 {
19022291 Overwrite(Object3D.TRANSFORM);
19032292 } else
1904
- if (event.getSource() == overwriteNameItem)
2293
+ if (source == overwriteNameItem)
19052294 {
19062295 Overwrite(Object3D.NAME);
19072296 } else
1908
- if (event.getSource() == overwriteUVItem)
2297
+ if (source == overwriteUVItem)
19092298 {
19102299 Overwrite(Object3D.UV);
19112300 } else
1912
- if (event.getSource() == overwriteMatItem)
2301
+ if (source == overwriteMatItem)
19132302 {
19142303 /* july 2015
19152304 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2318,7 @@
19292318
19302319 Overwrite(dropAttributes);
19312320 }
1932
- if (event.getSource() == overwriteGeoItem)
2321
+ if (source == overwriteGeoItem)
19332322 {
19342323 Overwrite(Object3D.GEOMETRY);
19352324 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2335,7 @@
19462335 // refreshContents();
19472336 // }
19482337 } else
1949
- if (event.getSource() == generateMeshItem)
2338
+ if (source == generateMeshItem)
19502339 {
19512340 //if (group.selection.size() == 1)
19522341 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2346,7 @@
19572346 ResetModel();
19582347 refreshContents();
19592348 } else
1960
- if (event.getSource() == extractGeometriesItem)
2349
+ if (source == extractGeometriesItem)
19612350 {
19622351 boolean one = false;
19632352
....@@ -1984,7 +2373,7 @@
19842373 ResetModel();
19852374 refreshContents();
19862375 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2376
+ if (source == cloneGeometriesItem)
19882377 {
19892378 boolean one = false;
19902379
....@@ -2010,7 +2399,7 @@
20102399 ResetModel();
20112400 refreshContents();
20122401 } else
2013
- if (event.getSource() == shareGeometriesItem)
2402
+ if (source == shareGeometriesItem)
20142403 {
20152404 boolean one = false;
20162405
....@@ -2040,7 +2429,7 @@
20402429 refreshContents();
20412430 }
20422431 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2432
+ if (source == mergeGeometriesItem)
20442433 {
20452434 boolean one = false;
20462435
....@@ -2070,7 +2459,7 @@
20702459 ResetModel();
20712460 refreshContents();
20722461 } else
2073
- if (event.getSource() == linkverticesItem)
2462
+ if (source == linkverticesItem)
20742463 {
20752464 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762465 // {
....@@ -2083,48 +2472,48 @@
20832472 // group.selection.get(0).setMasterThis(content); // should be identity
20842473 // refreshContents();
20852474 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2475
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872476 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2477
+ Object3D content = Grafreed.clipboard.get(0);
20892478
20902479 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912480 content = ((cGroup)content).get(0);
20922481
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2482
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942483 for (int i=0; i<group.selection.size(); i++)
20952484 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2485
+ boolean random = CameraPane.SWITCH;
2486
+ CameraPane.SWITCH = false; // parse all random nodes
20982487 group.selection.get(i).linkVerticesThis(content);
20992488 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2489
+ CameraPane.SWITCH = random;
21012490 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2491
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032492 refreshContents();
21042493 }
21052494 } else
2106
- if (event.getSource() == resetsupportItem)
2495
+ if (source == resetsupportItem)
21072496 {
21082497 for (int i=0; i<group.selection.size(); i++)
21092498 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21122501 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2502
+ CameraPane.SWITCH = random;
21142503 }
21152504
21162505 refreshContents();
21172506 } else
2118
- if (event.getSource() == relinkverticesItem)
2507
+ if (source == relinkverticesItem)
21192508 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2509
+ boolean random = CameraPane.SWITCH;
2510
+ CameraPane.SWITCH = false; // parse all random nodes
21222511 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2512
+ CameraPane.SWITCH = random;
21242513
21252514 refreshContents();
21262515 } else
2127
- if (event.getSource() == resetreferencesItem)
2516
+ if (source == resetreferencesItem)
21282517 {
21292518 for (int i=0; i<group.selection.size(); i++)
21302519 {
....@@ -2133,11 +2522,11 @@
21332522
21342523 refreshContents();
21352524 } else
2136
- if (event.getSource() == setMasterItem)
2525
+ if (source == setMasterItem)
21372526 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2527
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392528 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2529
+ Object3D content = Grafreed.clipboard.get(0);
21412530
21422531 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432532 content = ((cGroup)content).get(0);
....@@ -2146,13 +2535,13 @@
21462535 refreshContents();
21472536 }
21482537 } else
2149
- if (event.getSource() == poseMeshItem)
2538
+ if (source == poseMeshItem)
21502539 {
21512540 if (group.selection.size() == 1)
21522541 {
2153
- if (GrafreeD.clipboard.size() == 1)
2542
+ if (Grafreed.clipboard.size() == 1)
21542543 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2544
+ Object3D content = Grafreed.clipboard.get(0);
21562545
21572546 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582547 content = ((cGroup)content).get(0);
....@@ -2165,19 +2554,19 @@
21652554 }
21662555
21672556 } else
2168
- if (event.getSource() == revertMeshItem)
2557
+ if (source == revertMeshItem)
21692558 {
21702559 RevertMeshes();
21712560 } else
2172
- if (event.getSource() == resetMeshItem)
2561
+ if (source == resetAllItem)
21732562 {
21742563 ResetAll();
21752564 } else
2176
- if (event.getSource() == stepAllItem)
2565
+ if (source == stepAllItem)
21772566 {
21782567 StepAll();
21792568 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2569
+ if (source == clearItem) // || event.getSource() == clearButton)
21812570 {
21822571 //int indices[] = jList.getSelectedIndices();
21832572 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2574,46 @@
21852574
21862575 ClearSelection(false);
21872576 } else
2188
- if (event.getSource() == clearAllItem)
2577
+ if (source == clearAllItem)
21892578 {
21902579 ClearSelection(true);
21912580 } else
2192
- if (event.getSource() == grabItem)
2581
+ if (source == grabItem || source == groupButton)
21932582 {
2194
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
21952584 } else
2196
- if (event.getSource() == hideItem)
2585
+ if (source == hideItem)
21972586 {
21982587 group(new HiddenObject());
21992588 } else
2200
- if (event.getSource() == frontItem)
2589
+ if (source == frontItem)
22012590 {
22022591 front();
22032592 } else
2204
- if (event.getSource() == backItem)
2593
+ if (source == backItem)
22052594 {
22062595 back();
22072596 } else
2208
- if (event.getSource() == cameraItem)
2597
+ if (source == cameraItem)
22092598 {
22102599 makeSomething(new Camera());
22112600 } else
2212
- if (event.getSource() == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
22132602 {
22142603 group(new Composite());
22152604 } else
2216
- if (event.getSource() == randomItem)
2605
+ if (source == switchItem || source == switchButton)
22172606 {
22182607 RandomNode random = new RandomNode();
22192608 group(random);
22202609 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2610
+ random.name = random.get(0).name + "Switch";
22222611 } else
2223
- if (event.getSource() == physicsItem)
2612
+ if (source == physicsItem)
22242613 {
22252614 group(new PhysicsNode());
22262615 } else
2227
- if (event.getSource() == frameselectorItem)
2616
+ if (source == frameselectorItem)
22282617 {
22292618 for (int i=0; i<group.selection.size(); i++)
22302619 {
....@@ -2236,7 +2625,7 @@
22362625 ResetModel();
22372626 refreshContents();
22382627 } else
2239
- if (event.getSource() == switchGeoItem)
2628
+ if (source == switchGeoItem)
22402629 {
22412630 for (int i=0; i<group.selection.size(); i++)
22422631 {
....@@ -2248,7 +2637,7 @@
22482637 ResetModel();
22492638 refreshContents();
22502639 } else
2251
- if (event.getSource() == switchTransfoItem)
2640
+ if (source == switchTransfoItem)
22522641 {
22532642 for (int i=0; i<group.selection.size(); i++)
22542643 {
....@@ -2260,7 +2649,7 @@
22602649 ResetModel();
22612650 refreshContents();
22622651 } else
2263
- if (event.getSource() == morphItem)
2652
+ if (source == morphItem)
22642653 {
22652654 for (int i=0; i<group.selection.size(); i++)
22662655 {
....@@ -2272,7 +2661,7 @@
22722661 ResetModel();
22732662 refreshContents();
22742663 } else
2275
- if (event.getSource() == scriptNodeItem)
2664
+ if (source == scriptNodeItem)
22762665 {
22772666 boolean atleastone = false;
22782667
....@@ -2311,31 +2700,31 @@
23112700 }
23122701 }
23132702 } else
2314
- if (event.getSource() == linkerItem)
2703
+ if (source == linkerItem)
23152704 {
23162705 group(new cLinker());
23172706 } else
2318
- if (event.getSource() == textureItem)
2707
+ if (source == textureItem || source == textureButton)
23192708 {
23202709 group(new TextureNode());
23212710 } else
2322
- if (event.getSource() == billboardItem)
2711
+ if (source == billboardItem)
23232712 {
23242713 group(new BillboardNode());
23252714 } else
2326
- if (event.getSource() == shadowXItem)
2715
+ if (source == shadowXItem)
23272716 {
23282717 CastShadow(0);
23292718 } else
2330
- if (event.getSource() == shadowYItem)
2719
+ if (source == shadowYItem)
23312720 {
23322721 CastShadow(1);
23332722 } else
2334
- if (event.getSource() == shadowZItem)
2723
+ if (source == shadowZItem)
23352724 {
23362725 CastShadow(2);
23372726 } else
2338
- if (event.getSource() == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
23392728 {
23402729 //ungroup();
23412730 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2736,203 @@
23472736
23482737 refreshContents();
23492738 } else
2350
- if (event.getSource() == genUVItem)
2739
+ if (source == genUVItem)
23512740 {
23522741 GenUV();
23532742 } else
2354
- if (event.getSource() == genNormalsCADItem)
2743
+ if (source == genNormalsCADItem)
23552744 {
23562745 GenNormals(true);
23572746 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2747
+ if (source == genNormalsMESHItem)
23592748 {
2360
- GenNormals(true); // TODO
2749
+ GenNormalsMESH();
23612750 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2751
+ if (source == genNormalsORGANItem)
23632752 {
23642753 GenNormals(false);
23652754 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2755
+ if (source == genNormalsMINEItem)
23672756 {
23682757 GenNormalsMINE();
23692758 } else
2370
- if (event.getSource() == stripifyItem)
2759
+ if (source == stripifyItem)
23712760 {
23722761 Stripify();
23732762 } else
2374
- if (event.getSource() == unstripifyItem)
2763
+ if (source == unstripifyItem)
23752764 {
23762765 Unstripify();
23772766 } else
2378
- if (event.getSource() == trimItem)
2767
+ if (source == trimItem)
23792768 {
23802769 Trim();
23812770 } else
2382
- if (event.getSource() == untrimItem)
2771
+ if (source == untrimItem)
23832772 {
23842773 Untrim();
23852774 } else
2386
- if (event.getSource() == clearColorsItem)
2775
+ if (source == clearColorsItem)
23872776 {
23882777 ClearColors();
23892778 } else
2390
- if (event.getSource() == clearMaterialsItem)
2779
+ if (source == clearMaterialsItem)
23912780 {
23922781 ClearMaterials();
23932782 } else
2394
- if (event.getSource() == liveleavesItem)
2783
+ if (source == liveleavesItem)
23952784 {
23962785 LiveLeaves(true);
23972786 } else
2398
- if (event.getSource() == unliveleavesItem)
2787
+ if (source == unliveleavesItem)
23992788 {
24002789 LiveLeaves(false);
24012790 } else
2402
- if (event.getSource() == supportleavesItem)
2791
+ if (source == supportleavesItem)
24032792 {
24042793 SupportLeaves(true);
24052794 } else
2406
- if (event.getSource() == unsupportleavesItem)
2795
+ if (source == unsupportleavesItem)
24072796 {
24082797 SupportLeaves(false);
24092798 } else
2410
- if (event.getSource() == hideleavesItem)
2799
+ if (source == hideleavesItem)
24112800 {
24122801 HideLeaves(true);
24132802 } else
2414
- if (event.getSource() == showleavesItem)
2803
+ if (source == showleavesItem)
24152804 {
24162805 HideLeaves(false);
24172806 } else
2418
- if (event.getSource() == markleavesItem)
2807
+ if (source == markleavesItem)
24192808 {
24202809 MarkLeaves(true);
24212810 } else
2422
- if (event.getSource() == unmarkleavesItem)
2811
+ if (source == unmarkleavesItem)
24232812 {
24242813 MarkLeaves(false);
24252814 } else
2426
- if (event.getSource() == flipVItem)
2815
+ if (source == rewindleavesItem)
2816
+ {
2817
+ RewindLeaves(true);
2818
+ } else
2819
+ if (source == unrewindleavesItem)
2820
+ {
2821
+ RewindLeaves(false);
2822
+ } else
2823
+ if (source == randomleavesItem)
2824
+ {
2825
+ RandomLeaves(true);
2826
+ } else
2827
+ if (source == unrandomleavesItem)
2828
+ {
2829
+ RandomLeaves(false);
2830
+ } else
2831
+ if (source == flipVItem)
24272832 {
24282833 FlipV(true);
24292834 } else
2430
- if (event.getSource() == unflipVItem)
2835
+ if (source == unflipVItem)
24312836 {
24322837 FlipV(false);
24332838 } else
2434
- if (event.getSource() == lowTexturesItem)
2839
+ if (source == lowTexturesItem)
24352840 {
24362841 SetTexRes(0);
24372842 } else
2438
- if (event.getSource() == normalTexturesItem)
2843
+ if (source == normalTexturesItem)
24392844 {
24402845 SetTexRes(1);
24412846 } else
2442
- if (event.getSource() == highTexturesItem)
2847
+ if (source == highTexturesItem)
24432848 {
24442849 SetTexRes(2);
24452850 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2851
+ if (source == veryhighTexturesItem)
24472852 {
24482853 SetTexRes(3);
24492854 } else
2450
- if (event.getSource() == maxTexturesItem)
2855
+ if (source == maxTexturesItem)
24512856 {
24522857 SetTexRes(4);
24532858 } else
2454
- if (event.getSource() == panoTexturesItem)
2859
+ if (source == panoTexturesItem)
24552860 {
24562861 SetTexRes(5);
24572862 } else
2458
- if (event.getSource() == reverseNormalsItem)
2863
+ if (source == reverseNormalsItem)
24592864 {
24602865 ReverseNormals();
24612866 } else
2462
- if (event.getSource() == parseverticesItem)
2867
+ if (source == parseverticesItem)
24632868 {
24642869 ParseVertices();
24652870 } else
2466
- if (event.getSource() == textureFieldItem)
2871
+ if (source == textureFieldItem)
24672872 {
24682873 TextureVertices();
24692874 } else
2470
- if (event.getSource() == alignItem)
2875
+ if (source == alignItem)
24712876 {
24722877 Align();
24732878 } else
2474
- if (event.getSource() == mirrorItem)
2879
+ if (source == mirrorItem)
24752880 {
24762881 MirrorPoses();
24772882 } else
2478
- if (event.getSource() == reduceMorphItem)
2883
+ if (source == reduceMorphItem)
24792884 {
24802885 MeshReduction(false);
24812886 } else
2482
- if (event.getSource() == reduce34MorphItem)
2887
+ if (source == reduce34MorphItem)
24832888 {
24842889 MeshReduction(true);
24852890 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2891
+ if (source == reverseTrianglesItem)
24872892 {
24882893 ReverseTriangles();
24892894 } else
2490
- if (event.getSource() == reduceMeshItem)
2895
+ if (source == reduceMeshItem)
24912896 {
24922897 ReduceMesh(false);
24932898 } else
2494
- if (event.getSource() == reduce34MeshItem)
2899
+ if (source == reduce34MeshItem)
24952900 {
24962901 ReduceMesh(true);
24972902 } else
2498
- if (event.getSource() == increaseMeshItem)
2903
+ if (source == increaseMeshItem)
24992904 {
25002905 IncreaseMesh();
25012906 } else
2502
- if (event.getSource() == clipMeshItem)
2907
+ if (source == clipMeshItem)
25032908 {
25042909 ClipMesh();
25052910 } else
2506
- if (event.getSource() == smoothMeshItem)
2911
+ if (source == smoothMeshItem)
25072912 {
25082913 SmoothMesh();
25092914 } else
2510
- if (event.getSource() == transformgeometryItem)
2915
+ if (source == transformGeometryItem)
25112916 {
25122917 TransformGeometry();
25132918 } else
2514
- if (event.getSource() == resetTransformItem)
2919
+ if (source == transformChildrenItem)
2920
+ {
2921
+ TransformChildren();
2922
+ } else
2923
+ if (source == resetTransformItem)
25152924 {
25162925 ResetTransform();
25172926 } else
2518
- if (event.getSource() == resetCentroidItem)
2927
+ if (source == resetCentroidItem)
25192928 {
2520
- ResetCentroid();
2929
+ ResetCentroid(true);
25212930 } else
2522
- if (event.getSource() == resetParentItem)
2931
+ if (source == resetCentroidXZItem)
2932
+ {
2933
+ ResetCentroid(false);
2934
+ } else
2935
+ if (source == resetParentItem)
25232936 {
25242937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252938 {
....@@ -2529,7 +2942,7 @@
25292942
25302943 refreshContents();
25312944 } else
2532
- if (event.getSource() == repairParentItem)
2945
+ if (source == repairParentItem)
25332946 {
25342947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352948 {
....@@ -2543,7 +2956,21 @@
25432956
25442957 refreshContents();
25452958 } else
2546
- if (event.getSource() == sortbysizeItem)
2959
+ if (source == repairShadowItem)
2960
+ {
2961
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2962
+ {
2963
+ Object3D obj = (Object3D)e.nextElement();
2964
+ obj.RepairShadow();
2965
+// for (int i=0; i<obj.size(); i++)
2966
+// {
2967
+// obj.get(i).parent = obj;
2968
+// }
2969
+ }
2970
+
2971
+ refreshContents();
2972
+ } else
2973
+ if (source == sortbysizeItem)
25472974 {
25482975 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492976 {
....@@ -2555,7 +2982,7 @@
25552982 ResetModel();
25562983 refreshContents();
25572984 } else
2558
- if (event.getSource() == sortbynameItem)
2985
+ if (source == sortbynameItem)
25592986 {
25602987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612988 {
....@@ -2567,7 +2994,7 @@
25672994 ResetModel();
25682995 refreshContents();
25692996 } else
2570
- if (event.getSource() == attachPigmentItem)
2997
+ if (source == attachPigmentItem)
25712998 {
25722999 String texture = GetFile("Attach pigment");
25733000 Object3D obj;
....@@ -2579,7 +3006,7 @@
25793006
25803007 refreshContents();
25813008 } else
2582
- if (event.getSource() == detachPigmentItem)
3009
+ if (source == detachPigmentItem)
25833010 {
25843011 Object3D obj;
25853012 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +3017,7 @@
25903017
25913018 refreshContents();
25923019 } else
2593
- if (event.getSource() == attachBumpItem)
3020
+ if (source == attachBumpItem)
25943021 {
25953022 String texture = GetFile("Attach bump");
25963023 Object3D obj;
....@@ -2602,7 +3029,7 @@
26023029
26033030 refreshContents();
26043031 } else
2605
- if (event.getSource() == detachBumpItem)
3032
+ if (source == detachBumpItem)
26063033 {
26073034 Object3D obj;
26083035 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +3040,7 @@
26133040
26143041 refreshContents();
26153042 } else
2616
- if (event.getSource() == pigmentBumpItem)
3043
+ if (source == pigmentBumpItem)
26173044 {
26183045 Object3D obj;
26193046 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +3051,237 @@
26243051
26253052 refreshContents();
26263053 } else
2627
- if (event.getSource() == flashSelectionButton)
3054
+ if (source == flashSelectionButton)
26283055 {
26293056 CameraPane.flash = true;
26303057 refreshContents();
26313058 } else
2632
- if (event.getSource() == oneButton)
3059
+ if (source == oneButton)
26333060 {
26343061 } else
2635
- if (event.getSource() == twoButton)
3062
+ if (source == twoButton)
26363063 {
26373064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
26383069 // bug
26393070 //gridPanel.setDividerLocation(1.0);
26403071 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
3072
+// bigThree.remove(scenePanel);
3073
+// bigThree.remove(centralPanel);
3074
+// bigThree.remove(XYZPanel);
3075
+// aWindowConstraints.gridx = 0;
3076
+// aWindowConstraints.gridy = 0;
3077
+// aWindowConstraints.gridwidth = 1;
3078
+// // aConstraints.gridheight = 3;
3079
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3080
+// aWindowConstraints.weightx = 0;
3081
+// aWindowConstraints.weighty = 1;
3082
+// //bigThree.add(jtp, aWindowConstraints);
3083
+// aWindowConstraints.weightx = 1;
3084
+// aWindowConstraints.gridwidth = 3;
3085
+// // aConstraints.gridheight = 3;
3086
+// aWindowConstraints.gridx = 1;
3087
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3088
+// bigThree.add(centralPanel, aWindowConstraints);
3089
+// aWindowConstraints.weightx = 0;
3090
+// aWindowConstraints.gridx = 4;
3091
+// aWindowConstraints.gridwidth = 1;
3092
+// // aConstraints.gridheight = 3;
3093
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3094
+// //bigThree.add(XYZPanel, aWindowConstraints);
3095
+// scenePanel.setVisible(false);
3096
+// centralPanel.setVisible(true);
3097
+// XYZPanel.setVisible(false);
3098
+ bigThree.ClearUI();
3099
+ bigThree.add(centralPanel);
3100
+ bigThree.FlushUI();
3101
+
3102
+ cameraView.requestFocusInWindow();
3103
+
3104
+// refreshContents(true);
3105
+//
3106
+// try
3107
+// {
3108
+// java.awt.Robot bot = new java.awt.Robot();
3109
+// int mask = InputEvent.BUTTON1_MASK;
3110
+// bot.mouseMove(100, 100);
3111
+// bot.mousePress(mask);
3112
+// bot.mouseRelease(mask);
3113
+// }
3114
+// catch (Exception e)
3115
+// {
3116
+//
3117
+// }
3118
+
26653119 } else
2666
- if (event.getSource() == threeButton)
3120
+ if (source == threeButton)
26673121 {
26683122 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
3123
+
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
3126
+
3127
+// bigThree.remove(scenePanel);
3128
+// bigThree.remove(centralPanel);
3129
+// bigThree.remove(XYZPanel);
3130
+// aWindowConstraints.gridx = 0;
3131
+// aWindowConstraints.gridy = 0;
3132
+// aWindowConstraints.gridwidth = 1;
3133
+// // aConstraints.gridheight = 3;
3134
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3135
+// aWindowConstraints.weightx = 0;
3136
+// aWindowConstraints.weighty = 1;
3137
+// //bigThree.add(jtp, aWindowConstraints);
3138
+// aWindowConstraints.weightx = 1;
3139
+// aWindowConstraints.gridwidth = 3;
3140
+// // aConstraints.gridheight = 3;
3141
+// aWindowConstraints.gridx = 1;
3142
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3143
+// bigThree.add(centralPanel, aWindowConstraints);
3144
+// aWindowConstraints.weightx = 0;
3145
+// aWindowConstraints.gridx = 4;
3146
+// aWindowConstraints.gridwidth = 1;
3147
+// // aConstraints.gridheight = 3;
3148
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3149
+// bigThree.add(XYZPanel, aWindowConstraints);
3150
+// bigThree.validate();
3151
+// scenePanel.setVisible(false);
3152
+// centralPanel.setVisible(true);
3153
+// XYZPanel.setVisible(true);
3154
+ bigThree.ClearUI();
3155
+ bigThree.add(centralPanel);
3156
+ bigThree.add(XYZPanel);
3157
+ bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
26933160 } else
2694
- if (event.getSource() == fourButton)
3161
+ if (source == fourButton)
26953162 {
26963163 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
3164
+
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
3167
+
3168
+// bigThree.remove(scenePanel);
3169
+// bigThree.remove(centralPanel);
3170
+// bigThree.remove(XYZPanel);
3171
+// aWindowConstraints.gridx = 0;
3172
+// aWindowConstraints.gridy = 0;
3173
+// aWindowConstraints.gridwidth = 1;
3174
+// // aWindowConstraints.gridheight = 3;
3175
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3176
+// aWindowConstraints.weightx = 1;
3177
+// aWindowConstraints.weighty = 1;
3178
+// bigThree.add(scenePanel, aWindowConstraints);
3179
+// aWindowConstraints.weightx = 1;
3180
+// aWindowConstraints.gridwidth = 3;
3181
+// // aConstraints.gridheight = 3;
3182
+// aWindowConstraints.gridx = 1;
3183
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3184
+// //bigThree.add(cameraPanel, aWindowConstraints);
3185
+// aWindowConstraints.weightx = 0;
3186
+// aWindowConstraints.gridx = 4;
3187
+// aWindowConstraints.gridwidth = 1;
3188
+// // aWindowConstraints.gridheight = 3;
3189
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3190
+// //bigThree.add(XYZPanel, aWindowConstraints);
3191
+// bigThree.validate();
3192
+// scenePanel.setVisible(true);
3193
+// centralPanel.setVisible(false);
3194
+// XYZPanel.setVisible(false);
3195
+ bigThree.ClearUI();
3196
+ bigThree.add(scenePanel);
3197
+ bigThree.FlushUI();
3198
+
3199
+ cameraView.requestFocusInWindow();
27213200 } else
2722
- if (event.getSource() == sixButton)
3201
+ if (source == sixButton)
27233202 {
27243203 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
3207
+
3208
+// bigThree.remove(scenePanel);
3209
+// bigThree.remove(centralPanel);
3210
+// bigThree.remove(XYZPanel);
3211
+// aWindowConstraints.gridx = 0;
3212
+// aWindowConstraints.gridy = 0;
3213
+// aWindowConstraints.gridwidth = 1;
3214
+// // aConstraints.gridheight = 3;
3215
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3216
+// aWindowConstraints.weightx = 0;
3217
+// aWindowConstraints.weighty = 1;
3218
+// bigThree.add(scenePanel, aWindowConstraints);
3219
+// aWindowConstraints.weightx = 1;
3220
+// aWindowConstraints.gridwidth = 3;
3221
+// // aWindowConstraints.gridheight = 3;
3222
+// aWindowConstraints.gridx = 1;
3223
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3224
+// bigThree.add(centralPanel, aWindowConstraints);
3225
+// aWindowConstraints.weightx = 0;
3226
+// aWindowConstraints.gridx = 4;
3227
+// aWindowConstraints.gridwidth = 1;
3228
+// // aWindowConstraints.gridheight = 3;
3229
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3230
+// //bigThree.add(XYZPanel, aConstraints);
3231
+// bigThree.validate();
3232
+// scenePanel.setVisible(true);
3233
+// centralPanel.setVisible(true);
3234
+// XYZPanel.setVisible(false);
3235
+ bigThree.ClearUI();
3236
+ bigThree.add(scenePanel);
3237
+ bigThree.add(centralPanel);
3238
+ bigThree.FlushUI();
3239
+
3240
+ cameraView.requestFocusInWindow();
27493241 } else
2750
- if (event.getSource() == sevenButton)
3242
+ if (source == sevenButton)
27513243 {
27523244 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
3248
+
3249
+// bigThree.remove(scenePanel);
3250
+// bigThree.remove(centralPanel);
3251
+// bigThree.remove(XYZPanel);
3252
+// aWindowConstraints.gridx = 0;
3253
+// aWindowConstraints.gridy = 0;
3254
+// aWindowConstraints.gridwidth = 1;
3255
+// // aWindowConstraints.gridheight = 3;
3256
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3257
+// aWindowConstraints.weightx = 0;
3258
+// aWindowConstraints.weighty = 1;
3259
+// bigThree.add(scenePanel, aWindowConstraints);
3260
+// aWindowConstraints.weightx = 1;
3261
+// aWindowConstraints.gridwidth = 3;
3262
+// // aWindowConstraints.gridheight = 3;
3263
+// aWindowConstraints.gridx = 1;
3264
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3265
+// bigThree.add(centralPanel, aWindowConstraints);
3266
+// aWindowConstraints.weightx = 0;
3267
+// aWindowConstraints.gridx = 4;
3268
+// aWindowConstraints.gridwidth = 1;
3269
+// // aConstraints.gridheight = 3;
3270
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3271
+// bigThree.add(XYZPanel, aWindowConstraints);
3272
+// bigThree.validate();
3273
+// scenePanel.setVisible(true);
3274
+// centralPanel.setVisible(true);
3275
+// XYZPanel.setVisible(true);
3276
+ bigThree.ClearUI();
3277
+ bigThree.add(scenePanel);
3278
+ bigThree.add(centralPanel);
3279
+ bigThree.add(XYZPanel);
3280
+ bigThree.FlushUI();
3281
+
3282
+ cameraView.requestFocusInWindow();
27773283 } else
2778
- if (event.getSource() == rootButton)
3284
+ if (source == rootButton)
27793285 {
27803286 Object3D obj;
27813287 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2785,34 +3291,44 @@
27853291 EditObject(obj);
27863292 }
27873293
3294
+ cameraView.requestFocusInWindow();
27883295 refreshContents(true);
27893296 } else
2790
- if (event.getSource() == closeButton)
3297
+ if (source == closeButton)
27913298 {
27923299 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933300 cRadio ab;
27943301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27953302 {
27963303 ab = (cRadio)e.nextElement();
2797
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27983305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
27993312 buttonGroup.remove(ab);
28003313 radioPanel.remove(ab);
28013314
2802
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
28033317 // ab.GetObject().objectUI = null; // ?????????
28043318
28053319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28063320 break;
28073321 }
28083322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
28093325 refreshContents(true);
28103326 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3327
+ if (source == editItem || source == editButton)
28123328 {
28133329 EditSelection(false);
28143330 } else
2815
- if (event.getSource() == uneditButton)
3331
+ if (source == uneditButton)
28163332 {
28173333 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183334 {
....@@ -2822,14 +3338,14 @@
28223338 child.CloseUI();
28233339 listUI.remove(child);
28243340
2825
- child.editWindow = null; // ???????????
3341
+ //child.editWindow = null; // ???????????
28263342 }
2827
- objEditor.ctrlPanel.revalidate();
3343
+ objEditor.ctrlPanel.FlushUI();
28283344 //objEditor.jTree.clearSelection();
28293345 //objEditor.ResetSliders();
28303346 refreshContents(true);
28313347 } else
2832
- if (event.getSource() == clearPanelButton)
3348
+ if (source == clearPanelButton)
28333349 {
28343350 assert(copy == group);
28353351 //copy.ClearUI();
....@@ -2840,7 +3356,7 @@
28403356 listUI.clear();
28413357 refreshContents(true);
28423358 } else
2843
- if (event.getSource() == allParamsButton)
3359
+ if (source == allParamsButton)
28443360 {
28453361 assert(copy == group);
28463362
....@@ -2861,19 +3377,19 @@
28613377
28623378 refreshContents(true);
28633379 } else
2864
- if (event.getSource() == unselectButton)
3380
+ if (source == unselectButton)
28653381 {
28663382 objEditor.jTree.clearSelection();
28673383 // ?? oct 2012 GrafreeD.clipboard.clear();
28683384 objEditor.ResetSliders();
28693385 refreshContents(true);
28703386 } else
2871
- if(event.getSource() instanceof cRadio)
3387
+ if(source instanceof cRadio)
28723388 {
28733389 group.parent = keepparent;
28743390 group.attributes = 0;
28753391 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3392
+ /*cRadio*/ radio = (cRadio)source;
28773393 Object3D obj = radio.GetObject();
28783394 System.out.println("Edit " + obj);
28793395 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3409,7 @@
28933409 }
28943410
28953411 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3412
+ //Globals.theRenderer.object = group;
28973413 if(!useclient)
28983414 {
28993415 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3418,17 @@
29023418 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033419 cameraView.targetLookAt.set(radio.camera.lookAt);
29043420 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3421
+ //cameraView.lighttouched = true;
3422
+ Globals.lighttouched = true;
29063423 topView.object = group;
29073424 frontView.object = group;
29083425 sideView.object = group;
29093426 }
2910
- group.editWindow = this;
3427
+
3428
+// fix "+" issue
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
3431
+
29113432 /*
29123433 currentLayout = radio.layout;
29133434 if (currentLayout == null)
....@@ -2919,8 +3440,23 @@
29193440 //group.parent = null; // ROOT
29203441 //group.attributes = -1;
29213442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
29223445 refreshContents(true);
2923
- }
3446
+ } else if (event.getSource() == editCameraItem)
3447
+ {
3448
+ cameraView.ProtectCamera();
3449
+ cameraView.repaint();
3450
+ return;
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3452
+ {
3453
+ cameraView.RevertCamera();
3454
+ cameraView.repaint();
3455
+ return;
3456
+ // } else if (event.getSource() == textureButton)
3457
+ // {
3458
+ // return; // true;
3459
+ }
29243460 else
29253461 {
29263462 //return super.action(event, arg);
....@@ -2929,7 +3465,6 @@
29293465 }
29303466
29313467 boolean useclient = false;
2932
- cRadio radio;
29333468
29343469 void ToggleRoot()
29353470 {
....@@ -2938,7 +3473,7 @@
29383473 if (useclient)
29393474 {
29403475 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3476
+ Globals.lighttouched = true;
29423477 //topView.object = client;
29433478 //frontView.object = client;
29443479 //sideView.object = client;
....@@ -2946,7 +3481,7 @@
29463481 else
29473482 {
29483483 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3484
+ Globals.lighttouched = true;
29503485 //topView.object = group;
29513486 //frontView.object = group;
29523487 //sideView.object = group;
....@@ -2981,6 +3516,28 @@
29813516 refreshContents();
29823517 }
29833518
3519
+ void TransformChildren()
3520
+ {
3521
+ Object3D obj;
3522
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3523
+ {
3524
+ obj = (Object3D)e.nextElement();
3525
+ obj.KeepTextureMatrices();
3526
+ obj.TransformChildren();
3527
+ obj.RestoreTextureMatrices();
3528
+
3529
+// if (obj.parent == null)
3530
+// {
3531
+// System.out.println("NULL PARENT!");
3532
+// new Exception().printStackTrace();
3533
+// }
3534
+// else
3535
+// TouchTransform(obj);
3536
+// //obj.parent.Touch();
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
29843541
29853542 void ResetTransform()
29863543 {
....@@ -3093,7 +3650,7 @@
30933650 refreshContents();
30943651 }
30953652
3096
- void ResetCentroid()
3653
+ void ResetCentroid(boolean full)
30973654 {
30983655 Object3D obj;
30993656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3665,16 @@
31083665 LA.matIdentity(Object3D.mat);
31093666 obj.getBounds(minima, maxima, false);
31103667 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3668
+ if (full)
3669
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123670 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133671 obj.TransformMesh(Object3D.mat);
3672
+
31143673 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3674
+ if (full)
3675
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163676 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3677
+
31173678 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183679 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193680 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +3703,8 @@
31423703
31433704 int size = obj.MemorySize();
31443705
3145
- System.err.println((size/1024) + " KB is the size of " + obj);
3706
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3707
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31463708 }
31473709 }
31483710 catch (Exception e)
....@@ -3179,9 +3741,9 @@
31793741 obj = (Object3D)e.nextElement();
31803742
31813743 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3744
+ Grafreed.AnalyzeObject(obj);
31833745 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3746
+ Grafreed.AnalyzeObject(obj.bRep);
31853747
31863748 // System.err.println((size/1024) + " KB is the size of " + obj);
31873749 }
....@@ -3223,6 +3785,13 @@
32233785 void GenNormals(boolean crease)
32243786 {
32253787 group.GenNormalsS(crease);
3788
+
3789
+ refreshContents();
3790
+ }
3791
+
3792
+ void GenNormalsMESH()
3793
+ {
3794
+ group.GenNormalsMeshS();
32263795
32273796 refreshContents();
32283797 }
....@@ -3395,8 +3964,8 @@
33953964
33963965 void ParseVertices()
33973966 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3967
+ boolean epsequal = Grafreed.epsequal;
3968
+ Grafreed.epsequal = true;
34003969
34013970 for (int i=0; i<group.selection.size(); i++)
34023971 {
....@@ -3421,7 +3990,7 @@
34213990 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223991 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233992
3424
- g.add(GrafreeD.clipboard);
3993
+ g.add(Grafreed.clipboard);
34253994
34263995 buffer.add(g);
34273996 }
....@@ -3436,7 +4005,7 @@
34364005 makeSomething(buffer, i==group.selection.size()-1);
34374006 }
34384007
3439
- GrafreeD.epsequal = epsequal;
4008
+ Grafreed.epsequal = epsequal;
34404009
34414010 refreshContents();
34424011 }
....@@ -3454,7 +4023,16 @@
34544023 String pigment = Object3D.GetPigment(tex);
34554024 //String bump = Object3D.GetBump(tex);
34564025
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4026
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4027
+
4028
+ try
4029
+ {
4030
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4031
+ }
4032
+ catch (Exception e)
4033
+ {
4034
+ System.err.println("FAIL: " + node);
4035
+ }
34584036
34594037 double s = v.s;
34604038
....@@ -3542,11 +4120,11 @@
35424120
35434121 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35444122
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
4123
+ boolean random = CameraPane.SWITCH;
4124
+ CameraPane.SWITCH = false; // parse all random nodes
35474125 lowres.linkVerticesThis(null);
35484126 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
4127
+ CameraPane.SWITCH = random;
35504128
35514129 System.err.flush();
35524130
....@@ -3586,7 +4164,7 @@
35864164 return;
35874165
35884166 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
4167
+ Object3D ref = Grafreed.clipboard.get(0);
35904168
35914169 Object3D newgroup = new Object3D("Po:" + poses.name);
35924170
....@@ -3755,7 +4333,7 @@
37554333 group.selection.RelinkToSupport(); // july 2014
37564334 System.out.println("DONE.");
37574335 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4336
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37594337 }
37604338
37614339 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4358,9 @@
37804358
37814359 void ClipMesh()
37824360 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4361
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844362 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4363
+ Object3D content = Grafreed.clipboard.get(0);
37864364
37874365 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884366 content = ((cGroup)content).get(0);
....@@ -3791,7 +4369,7 @@
37914369 // {
37924370 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934371 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4372
+ group.selection.ClipMesh(Grafreed.clipboard);
37954373 }
37964374 // group.selection.ClipMesh(GrafreeD.clipboard);
37974375 System.out.println("DONE.");
....@@ -3838,6 +4416,18 @@
38384416 void MarkLeaves(boolean hide)
38394417 {
38404418 group.selection.MarkLeaves(hide);
4419
+ refreshContents();
4420
+ }
4421
+
4422
+ void RewindLeaves(boolean hide)
4423
+ {
4424
+ group.selection.RewindLeaves(hide);
4425
+ refreshContents();
4426
+ }
4427
+
4428
+ void RandomLeaves(boolean hide)
4429
+ {
4430
+ group.selection.RandomLeaves(hide);
38414431 refreshContents();
38424432 }
38434433
....@@ -3923,10 +4513,10 @@
39234513 {
39244514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39254515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3926
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274517
39284518 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4519
+ if(elem != group || !newWindow)
39304520 {
39314521 // if (!(elem instanceof Composite))
39324522 // newWindow = false;
....@@ -4016,7 +4606,6 @@
40164606 //case 702: // Event.LIST_DESELECT
40174607 group.deselectAll();
40184608 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4019
- objEditor.ClearInfo(); // .GetMaterial());
40204609 if (tps != null)
40214610 {
40224611 for (int i=0; i < tps.length; i++)
....@@ -4025,31 +4614,30 @@
40254614
40264615 //if (child.parent != null)
40274616 //child.parent.addSelectee(child);
4617
+ objEditor.SetMaterial(child);
40284618 group.addSelectee(child);
4029
- objEditor.SetMaterial(child); // .GetMaterial());
4030
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4031
- System.err.println("info : " + child.GetPath());
40324619 }
40334620 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4621
+// else
4622
+// {
4623
+// objEditor.SetMaterial(group); // .GetMaterial());
4624
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4625
+// System.err.println("info : " + group.GetPath());
4626
+// }
40404627
4041
- objEditor.SetText(); // jan 2014
4042
-
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4628
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40444629 CameraPane.flash = true;
40454630
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4631
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474632 // a camera
40484633 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4634
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4635
+ {
4636
+ CameraPane.camerachangeframe = 0; // don't refuse it
4637
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4638
+ }
4639
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4640
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534641 }
40544642
40554643 refreshContents();
....@@ -4060,6 +4648,27 @@
40604648
40614649 freezemodel = false;
40624650 }
4651
+
4652
+ void refreshContents(boolean cp)
4653
+ {
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4656
+ {
4657
+ objEditor.ClearInfo(); // .GetMaterial());
4658
+
4659
+ for (int i=0; i < group.selection.Size(); i++)
4660
+ {
4661
+ Object3D child = (Object3D) group.selection.get(i);
4662
+
4663
+ objEditor.AddInfo(child, this, true);
4664
+ System.err.println("info : " + child.GetPath());
4665
+ }
4666
+
4667
+ objEditor.SetText(); // jan 2014
4668
+ }
4669
+
4670
+ super.refreshContents(cp);
4671
+ }
40634672
40644673 void linkSomething(Object3D thing)
40654674 {
....@@ -4131,16 +4740,19 @@
41314740 {
41324741 if (group.selection.isEmpty())
41334742 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4743
+
4744
+ Grafreed.clipboardIsTempGroup = false;
41354745 Composite tGroup = null;
41364746 if (group.selection.size() > 0) // 1)
41374747 {
41384748 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4749
+ Grafreed.clipboardIsTempGroup = true;
41404750 }
41414751
41424752 if (cut)
41434753 {
4754
+ if (Globals.SAVEONMAKE)
4755
+ Save();
41444756 //int indices[] = jList.getSelectedIndices();
41454757 //for (int i = indices.length - 1; i >= 0; i--)
41464758 //jList.remove(indices[i]);
....@@ -4176,16 +4788,16 @@
41764788 //System.out.println("cut " + child);
41774789 //System.out.println("parent = " + child.parent);
41784790 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4791
+ if (Grafreed.clipboardIsTempGroup)
41804792 tGroup.add/*Child*/(tmp);
41814793 else
4182
- GrafreeD.clipboard = tmp;
4794
+ Grafreed.clipboard = tmp;
41834795 }
41844796 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4797
+ if (Grafreed.clipboardIsTempGroup)
41864798 tGroup.add/*Child*/(child);
41874799 else
4188
- GrafreeD.clipboard = child;
4800
+ Grafreed.clipboard = child;
41894801 }
41904802
41914803 //ResetModel();
....@@ -4217,21 +4829,23 @@
42174829 //System.out.println("cut " + elem);
42184830 //System.out.println("parent = " + elem.parent);
42194831 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4832
+ if (Grafreed.clipboardIsTempGroup)
42214833 tGroup.add/*Child*/(tmp);
42224834 else
4223
- GrafreeD.clipboard = tmp;
4835
+ Grafreed.clipboard = tmp;
42244836 }
42254837 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4838
+ if (Grafreed.clipboardIsTempGroup)
42274839 tGroup.add/*Child*/(child);
42284840 else
4229
- GrafreeD.clipboard = child;
4841
+ Grafreed.clipboard = child;
42304842 }
42314843
42324844 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4845
+
4846
+ if (Grafreed.clipboardIsTempGroup)
4847
+ Grafreed.clipboard = tGroup;
4848
+
42354849 if (cut)
42364850 {
42374851 ResetModel();
....@@ -4245,7 +4859,7 @@
42454859 // return;
42464860 boolean first = true;
42474861
4248
- if (GrafreeD.clipboardIsTempGroup)
4862
+ if (Grafreed.clipboardIsTempGroup)
42494863 {
42504864 Composite temp;
42514865
....@@ -4256,7 +4870,7 @@
42564870 temp = (Composite)Applet3D.clipboard.deepCopy();
42574871 */
42584872 Object3D elem;
4259
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4873
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42604874 {
42614875 Object3D child = (Object3D)e.nextElement();
42624876
....@@ -4290,21 +4904,21 @@
42904904 //Object3D cb = Applet3D.clipboard;
42914905 //temp.addChild(cb);
42924906 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4907
+ assert(Grafreed.clipboard.parent == null);
4908
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4909
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4910
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4911
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42984912 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4913
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4914
+ Grafreed.clipboard.get(0).parent = keepparent;
43014915 }
43024916
43034917 ResetModel();
43044918 refreshContents();
43054919 }
43064920
4307
- void pasteInto(boolean copyit)
4921
+ void pasteInto(boolean copyit, boolean clone)
43084922 {
43094923 // if (GrafreeD.clipboard == null)
43104924 // return;
....@@ -4333,15 +4947,22 @@
43334947 if (copyit)
43344948 {
43354949 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4950
+ if (clone)
4951
+ {
4952
+ CloneClipboard(false); // sept 2014
4953
+ }
4954
+ else
4955
+ {
4956
+ paste(false);
4957
+ }
43374958 }
43384959 else
43394960 {
43404961 boolean first = true;
43414962
4342
- if (GrafreeD.clipboardIsTempGroup)
4963
+ if (Grafreed.clipboardIsTempGroup)
43434964 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4965
+ Composite temp = (Composite)Grafreed.clipboard;
43454966 Object3D copy;
43464967 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474968 {
....@@ -4351,7 +4972,7 @@
43514972 }
43524973 } else
43534974 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4975
+ linkSomething(Grafreed.clipboard); //.get(0));
43554976 }
43564977 }
43574978 }
....@@ -4756,21 +5377,6 @@
47565377 }
47575378 */
47585379
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745380 /*
47755381 public void Callback(Object obj)
47765382 {
....@@ -4794,26 +5400,9 @@
47945400 }
47955401 */
47965402
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145403 String GetFile(String dialogName)
48155404 {
4816
- if (GrafreeD.standAlone)
5405
+ if (Grafreed.standAlone)
48175406 {
48185407 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195408 browser.show();
....@@ -4877,10 +5466,38 @@
48775466 cButton flashSelectionButton;
48785467 cButton editButton;
48795468 cButton uneditButton;
5469
+ JCheckBox allParamsButton;
48805470 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825471 cButton unselectButton;
48835472
5473
+ cButton restoreCameraButton;
5474
+
5475
+ cButton minButton;
5476
+ cButton maxButton;
5477
+ cButton fullButton;
5478
+ cButton undoButton;
5479
+ cButton redoButton;
5480
+ cButton saveButton;
5481
+ cButton oneStepButton;
5482
+
5483
+ cButton groupButton;
5484
+ cButton ungroupButton;
5485
+ cButton compositeButton;
5486
+ cButton switchButton;
5487
+ cButton loopButton;
5488
+ cButton textureButton;
5489
+
5490
+ cButton gridButton;
5491
+ cButton boxButton;
5492
+ cButton sphereButton;
5493
+ cButton coneButton;
5494
+ cButton torusButton;
5495
+ cButton superButton;
5496
+ cButton kleinButton;
5497
+ cButton particlesButton;
5498
+ cButton overlayButton;
5499
+ cButton lightButton;
5500
+
48845501 cButton screenfitButton;
48855502 cButton screenfitpointButton;
48865503 cButton snapobjectButton;
....@@ -4892,14 +5509,6 @@
48925509
48935510 cButton setsupportButton;
48945511
4895
- cButton twoButton;
4896
- cButton sixButton;
4897
- cButton threeButton;
4898
- cButton sevenButton;
4899
- cButton fourButton; // full panel
4900
- cButton oneButton; // full XYZ
4901
- //cButton currentLayout;
4902
-
49035512 //
49045513 //Composite
49055514 Object3D // to do !!
....@@ -4909,9 +5518,11 @@
49095518 //JTree jTree;
49105519 private MenuItem lookAtItem;
49115520 private MenuItem lookFromItem;
4912
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
49135522 private MenuItem cutItem;
4914
- private MenuItem duplicateItem;
5523
+ private MenuItem undoItem;
5524
+ private MenuItem redoItem;
5525
+ private JMenuItem duplicateItem;
49155526 private MenuItem cloneItem;
49165527 private MenuItem cloneSupportItem;
49175528 private MenuItem overwriteGeoItem;
....@@ -4924,7 +5535,7 @@
49245535 private MenuItem linkverticesItem;
49255536 private MenuItem relinkverticesItem;
49265537 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5538
+ private MenuItem resetAllItem;
49285539 private MenuItem stepAllItem;
49295540 private MenuItem revertMeshItem;
49305541 private MenuItem poseMeshItem;
....@@ -4935,6 +5546,7 @@
49355546 private MenuItem mergeGeometriesItem;
49365547 private MenuItem copyItem;
49375548 private MenuItem pasteItem;
5549
+ private MenuItem pasteIntoItem;
49385550 private MenuItem pasteLinkItem;
49395551 private MenuItem pasteCloneItem;
49405552 private MenuItem pasteExpandItem;
....@@ -4973,6 +5585,10 @@
49735585 private MenuItem showleavesItem;
49745586 private MenuItem markleavesItem;
49755587 private MenuItem unmarkleavesItem;
5588
+ private MenuItem rewindleavesItem;
5589
+ private MenuItem unrewindleavesItem;
5590
+ private MenuItem randomleavesItem;
5591
+ private MenuItem unrandomleavesItem;
49765592
49775593 private MenuItem flipVItem;
49785594 private MenuItem unflipVItem;
....@@ -4984,15 +5600,17 @@
49845600 private MenuItem panoTexturesItem;
49855601
49865602 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5603
+ private MenuItem resetCentroidXZItem;
49885604 private MenuItem resetTransformItem;
5605
+ private MenuItem transformGeometryItem;
5606
+ private MenuItem transformChildrenItem;
49895607 private MenuItem hideItem;
49905608 private MenuItem grabItem;
49915609 private MenuItem backItem;
49925610 private MenuItem frontItem;
49935611 private MenuItem cameraItem;
49945612 private MenuItem compositeItem;
4995
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
49965614 private MenuItem physicsItem;
49975615 private MenuItem frameselectorItem;
49985616 private MenuItem scriptNodeItem;
....@@ -5007,6 +5625,7 @@
50075625
50085626 private MenuItem resetParentItem;
50095627 private MenuItem repairParentItem;
5628
+ private MenuItem repairShadowItem;
50105629 private MenuItem sortbysizeItem;
50115630 private MenuItem sortbynameItem;
50125631
....@@ -5031,7 +5650,7 @@
50315650 private MenuItem blobItem;
50325651 private MenuItem latheItem;
50335652 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5653
+ private MenuItem overlayItem;
50355654 private MenuItem meshItem;
50365655 // private MenuItem meshGroupItem;
50375656 private MenuItem springItem;
....@@ -5053,11 +5672,6 @@
50535672 private MenuItem doubleItem;
50545673 private MenuItem tripleItem;
50555674
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615675 private MenuItem computeAOItem;
50625676 private MenuItem recompileItem;
50635677 private MenuItem editScriptItem;
....@@ -5067,4 +5681,8 @@
50675681 private MenuItem analyzeItem;
50685682 private MenuItem dumpItem;
50695683 //boolean freezemodel = false;
5684
+
5685
+ Menu cameraMenu;
5686
+ MenuItem editCameraItem;
5687
+ MenuItem restoreCameraItem;
50705688 }