Normand Briere
2019-06-25 829f93f305ce15893aada126a98d9068b1cdefed
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,73 +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);
321
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
322
+ relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
222326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223327 setMasterItem.addActionListener(this);
328
+ }
224329
225330 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
228333 backItem = menu.add(new MenuItem("Back"));
229334 backItem.addActionListener(this);
230335 frontItem = menu.add(new MenuItem("Front"));
231336 frontItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
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"));
343
+ hideItem.addActionListener(this);
344
+ }
345
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
346
+ ungroupItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
241354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242355 switchGeoItem.addActionListener(this);
243356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244357 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
246359 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);
247366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248367 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
368
+ }
251369
252370 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
373
+ billboardItem = menu.add(new MenuItem("Billboard"));
374
+ billboardItem.addActionListener(this);
255375 csgItem = menu.add(new MenuItem("CSG"));
256376 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258378 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260380 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
263386 linkerItem = menu.add(new MenuItem("Linker"));
264387 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267388 attributeItem = menu.add(new MenuItem("Attribute"));
268389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
269392 pointflowItem = menu.add(new MenuItem("Point Flow"));
270393 pointflowItem.addActionListener(this);
394
+ }
271395 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275397 resetTransformItem.addActionListener(this);
276398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277399 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.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);
280406
281407 oe.menuBar.add(menu = new Menu("Geometry"));
282408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +413,11 @@
287413 genNormalsCADItem.addActionListener(this);
288414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
418
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
419
+ genNormalsMINEItem.addActionListener(this);
420
+ }
290421 stripifyItem = menu.add(new MenuItem("Stripify"));
291422 stripifyItem.addActionListener(this);
292423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +439,34 @@
308439 reduce34MeshItem.addActionListener(this);
309440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310441 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
315450
316451 oe.menuBar.add(menu = new Menu("Attributes"));
317452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318453 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);
319458 menu.add("-");
320459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321460 liveleavesItem.addActionListener(this);
322461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
324465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325466 supportleavesItem.addActionListener(this);
326467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327468 unsupportleavesItem.addActionListener(this);
469
+ }
328470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329471 hideleavesItem.addActionListener(this);
330472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +475,14 @@
333475 markleavesItem.addActionListener(this);
334476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335477 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);
336486 menu.add("-");
337487 flipVItem = menu.add(new MenuItem("Flip V"));
338488 flipVItem.addActionListener(this);
....@@ -368,35 +518,40 @@
368518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369519 sortbynameItem.addActionListener(this);
370520 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.
371528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372529 extractGeometriesItem.addActionListener(this);
373530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374531 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
532
+ }
379533
380534 oe.menuBar.add(menu = new Menu("Insert"));
381535 buildCreateMenu(menu);
382536
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394537 oe.menuBar.add(menu = new Menu("Tools"));
395538 buildToolsMenu(menu);
396539 }
397540
398541 void SetupUI2(ObjEditor oe)
399542 {
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
+
400555 //new Exception().printStackTrace();
401556
402557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -425,150 +580,199 @@
425580 oe.radioPanel.add(dummyButton);
426581 oe.buttonGroup.add(dummyButton);
427582 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
431586
432
- 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");
433619 liveCB.addItemListener(this);
434620
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- 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");
453627 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
495
- trackCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- 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");
499633 screenfitButton.addActionListener(this);
500
- 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
+
501639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502640 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507641
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
514
- flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- 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));
518650
519
- //
520
- 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");
521653 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
654
+ this.fullscreenLayout = twoButton;
655
+
656
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523657 fourButton.addActionListener(this);
524
- 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");
525661 sixButton.addActionListener(this);
526
- 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");
527664 threeButton.addActionListener(this);
528
- 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");
529667 sevenButton.addActionListener(this);
530668 //
531669
532
- 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");
533672 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- 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");
536676 closeButton.addActionListener(this);
537677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538678 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540
-
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
- editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547679
548
- 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");
549753 uneditButton.addActionListener(this);
550754
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- 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");
563757 allParamsButton.addActionListener(this);
564758
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- 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");
570765 unselectButton.addActionListener(this);
571766
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
+
572776 // oe.aConstraints.gridx += 1;
573777 // oe.aConstraints.weighty = 0;
574778 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +784,22 @@
580784 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581785 // gcButton.addActionListener(this);
582786
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
787
+ cGridBag jSPPanel = new cGridBag();
788
+
789
+ JScrollPane jSP;
594790 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596792 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
601
-
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
- colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
609
- materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
612
- textureCB.addItemListener(this);
613
-
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
616793
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
+
617803 //jList.addListSelectionListener(this);
618804 oe.jTree.addTreeSelectionListener(this);
619805 //jTree.setRootVisible(false);
....@@ -635,20 +821,153 @@
635821 radio.layout = sevenButton;
636822 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637823 }
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
+ }
638946
639947 void EditObject(Object3D obj)
640948 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- 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();
649965 }
966
+
650967 void SetupViews(ObjEditor oe)
651968 {
969
+ theFrame = this;
970
+
652971 oe.SetupViews();
653972
654973 System.out.println("SetupViews");
....@@ -657,22 +976,27 @@
657976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
658977 }
659978
660
- JCheckBox liveCB;
661
- JCheckBox supportCB;
662
- JCheckBox localCB;
663
- JCheckBox crowdCB;
664
- JCheckBox smoothCB;
665
- JCheckBox fastCB;
666
- JCheckBox slowCB;
667
- JCheckBox boxCB;
668
- JCheckBox trackCB;
669
- 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;
670991 // JCheckBox speakerMocapCB;
671
- JCheckBox speakerCameraCB;
672
- JCheckBox speakerFocusCB;
673
- JCheckBox debugCB;
674
- JCheckBox oeilCB;
675
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
6761000
6771001 // static int COLOR = 1;
6781002 // static int MATERIAL = 2;
....@@ -680,9 +1004,9 @@
6801004
6811005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6821006
683
- JCheckBox colorCB;
684
- JCheckBox materialCB;
685
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
6861010
6871011 public void itemStateChanged(ItemEvent e)
6881012 {
....@@ -707,10 +1031,10 @@
7071031 dropAttributes |= Object3D.TEXTURE;
7081032 else
7091033 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
1034
+ } else if(e.getSource() == liveCB)
7121035 {
7131036 cameraView.ToggleLive();
1037
+ refreshContents(false);
7141038 }
7151039 else if(e.getSource() == supportCB)
7161040 {
....@@ -746,6 +1070,10 @@
7461070 cameraView.repaint();
7471071 // refreshContents();
7481072 }
1073
+ else if(e.getSource() == zoomBoxCB)
1074
+ {
1075
+ cameraView.ToggleZoomBoxMode();
1076
+ }
7491077 else if(e.getSource() == smoothfocusCB)
7501078 {
7511079 cameraView.ToggleSmoothFocus();
....@@ -771,6 +1099,14 @@
7711099 {
7721100 cameraView.ToggleOeil();
7731101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
7741110 else if(e.getSource() == lookAtCB)
7751111 {
7761112 cameraView.ToggleLookAt();
....@@ -787,7 +1123,8 @@
7871123
7881124 /**/
7891125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
790
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
7911128 if ((path == null) || (path.getPathCount() <= 1)) {
7921129 // We can't move the root node or an empty selection
7931130 return;
....@@ -859,7 +1196,9 @@
8591196 // objEditor.DropFile((java.io.File[]) object, true);
8601197 // return;
8611198 // }
862
- if (string.charAt(0) == '/')
1199
+
1200
+ // File path for Mac and Windows
1201
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631202 {
8641203 // file(s)
8651204 String[] names = string.split("\n");
....@@ -886,7 +1225,7 @@
8861225
8871226 flashIt = false;
8881227 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1228
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901229 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911230
8921231 if (group.selection.size() == 1)
....@@ -902,23 +1241,33 @@
9021241
9031242 assert target == objEditor.jTree;
9041243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
9051245 try {
906
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9071247 } catch (Exception e) {
9081248 System.out.println("destinationPath : " + destinationPath);
9091249 return;
9101250 }
9111251
912
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
9131253 {
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
+// {
9141263 loadClipboard(true);
9151264 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
917
- } else {
918
- loadClipboard(false);
919
- objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
921
- }
1265
+ pasteInto(false, false);
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
9221271 }
9231272 public void dropActionChanged(DropTargetDragEvent dtde)
9241273 // Called if the user has modified the current drop gesture
....@@ -1023,83 +1372,104 @@
10231372 {
10241373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10251374 //heightFieldItem.addActionListener(this);
1026
- gridItem = menu.add(new MenuItem("Grid"));
1027
- gridItem.addActionListener(this);
1028
- rectoidItem = menu.add(new MenuItem("Box"));
1029
- rectoidItem.addActionListener(this);
1030
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1031
- ellipsoidItem.addActionListener(this);
1032
- coneItem = menu.add(new MenuItem("Cone"));
1033
- coneItem.addActionListener(this);
1034
- torusItem = menu.add(new MenuItem("Torus"));
1035
- torusItem.addActionListener(this);
1036
- superItem = menu.add(new MenuItem("Superellipsoid"));
1037
- superItem.addActionListener(this);
1038
- particleItem = menu.add(new MenuItem("Particle system"));
1039
- particleItem.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
+ {
1393
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1394
+ kleinItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
1399
+ if (Globals.ADVANCED)
1400
+ {
10401401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411402 ragdollItem.addActionListener(this);
10421403 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431404 ragdoll2Item.addActionListener(this);
1405
+ }
10441406 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1407
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461408 meshItem.addActionListener(this);
10471409 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481410 // meshGroupItem.addActionListener(this);
1411
+ if (Globals.ADVANCED)
1412
+ {
10491413 springItem = menu.add(new MenuItem("Spring"));
10501414 springItem.addActionListener(this);
10511415 flagItem = menu.add(new MenuItem("Flag"));
10521416 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571417 blobItem = menu.add(new MenuItem("Blob"));
10581418 blobItem.addActionListener(this);
10591419 latheItem = menu.add(new MenuItem("Lathe"));
10601420 latheItem.addActionListener(this);
1061
- lightItem = menu.add(new MenuItem("Light"));
1062
- 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);
10631428 menu.add("-");
10641429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10651430 //superLoopItem.addActionListener(this);
1066
- loopItem = menu.add(new MenuItem("Loop"));
1067
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
10681433 doubleItem = menu.add(new MenuItem("Fork"));
10691434 doubleItem.addActionListener(this);
1435
+ if (Globals.ADVANCED)
1436
+ {
10701437 tripleItem = menu.add(new MenuItem("Trident"));
10711438 tripleItem.addActionListener(this);
1439
+ }
10721440 }
10731441
10741442 void buildToolsMenu(Menu menu)
10751443 {
10761444 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771445 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1446
+ animationItem.setState(Globals.ANIMATION);
10791447
10801448 menu.add("-");
10811449 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821450 parseverticesItem.addActionListener(this);
10831451 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841452 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1453
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861454 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891455 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901456 reduceMorphItem.addActionListener(this);
10911457 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921458 reduce34MorphItem.addActionListener(this);
1093
-
1459
+ menu.add("-");
10941460 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951461 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971462
1463
+ if (Globals.ADVANCED)
1464
+ {
1465
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1466
+ mirrorItem.addActionListener(this);
1467
+ menu.add("-");
10981468 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991469 memoryItem.addActionListener(this);
11001470 menu.add(analyzeItem = new MenuItem("Analyze"));
11011471 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1472
+ menu.add(dumpItem = new MenuItem("Print"));
11031473 dumpItem.addActionListener(this);
11041474 // menu.add(pathItem = new MenuItem("From-to path"));
11051475 // pathItem.addActionListener(this);
....@@ -1108,6 +1478,8 @@
11081478 resetParentItem.addActionListener(this);
11091479 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101480 repairParentItem.addActionListener(this);
1481
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1482
+ repairShadowItem.addActionListener(this);
11111483 menu.add(invariantsItem = new MenuItem("Invariants"));
11121484 invariantsItem.addActionListener(this);
11131485 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1487,7 @@
11151487 menu.add("-");
11161488 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171489 editScriptItem.addActionListener(this);
1490
+ }
11181491 }
11191492
11201493 void ScreenFit()
....@@ -1237,6 +1610,7 @@
12371610 shadow.material = new cMaterial(obj.material);
12381611 shadow.material.diffuse = 0.0001f;
12391612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
12401614
12411615 makeSomething(shadow);
12421616 }
....@@ -1443,9 +1817,9 @@
14431817
14441818 void Overwrite(int mask)
14451819 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1820
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471821 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1822
+ Object3D content = Grafreed.clipboard.get(0);
14491823
14501824 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511825 content = ((cGroup)content).get(0);
....@@ -1468,6 +1842,7 @@
14681842 //
14691843 public void actionPerformed(ActionEvent event) // , Object arg)
14701844 {
1845
+ Object source = event.getSource();
14711846 /*
14721847 if (event.getSource() == nameField)
14731848 {
....@@ -1479,11 +1854,11 @@
14791854 }
14801855 else
14811856 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1857
+ if (source == lookAtItem || source == lookFromItem)
14831858 {
14841859 ScreenFit();
14851860 } else
1486
- if (event.getSource() == switchItem)
1861
+ if (source == switchViewItem)
14871862 {
14881863 cVector v1 = new cVector();
14891864 cVector v2 = new cVector();
....@@ -1492,11 +1867,11 @@
14921867 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931868 objEditor.cameraView.repaint();
14941869 } else
1495
- if (event.getSource() == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
14961871 {
14971872 makeSomething(new Box());
14981873 } else
1499
- if (event.getSource() == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
15001875 {
15011876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1892,9 @@
15171892 applyExample(particleGeom, "SMOKE");
15181893 makeSomething(particleGeom);
15191894 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1895
+ if (source == ragdollItem || source == ragdoll2Item)
15211896 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1897
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231898
15241899 ragdoll.toParent = LA.newMatrix();
15251900 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1912,7 @@
15371912 } else
15381913 /*
15391914 */
1540
- if (event.getSource() == heightFieldItem)
1915
+ if (source == heightFieldItem)
15411916 {
15421917 Object3D obj = new Object3D();
15431918
....@@ -1575,27 +1950,31 @@
15751950
15761951 makeSomething(obj);
15771952 } else
1578
- if (event.getSource() == gridItem)
1953
+ if (source == gridItem || source == gridButton)
15791954 {
15801955 makeSomething(new Grid());
15811956 } else
1582
- if (event.getSource() == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
15831958 {
15841959 makeSomething(new Sphere());
15851960 } else
1586
- if (event.getSource() == coneItem)
1961
+ if (source == coneItem || source == coneButton)
15871962 {
15881963 makeSomething(new Cone());
15891964 } else
1590
- if (event.getSource() == torusItem)
1965
+ if (source == torusItem || source == torusButton)
15911966 {
15921967 makeSomething(new Torus());
15931968 } else
1594
- if (event.getSource() == superItem)
1969
+ if (source == superItem || source == superButton)
15951970 {
15961971 makeSomething(new Superellipsoid());
15971972 } else
1598
- if (event.getSource() == blobItem)
1973
+ if (source == kleinItem || source == kleinButton)
1974
+ {
1975
+ makeSomething(new Klein());
1976
+ } else
1977
+ if (source == blobItem)
15991978 {
16001979 Blob blob = new Blob();
16011980 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1982,15 @@
16031982 //blob.retile();
16041983 makeSomething(blob);
16051984 } else
1606
- if (event.getSource() == latheItem)
1985
+ if (source == latheItem)
16071986 {
16081987 makeSomething(new Lathe());
16091988 } else
1610
- if (event.getSource() == bezierItem)
1989
+ if (source == bezierItem)
16111990 {
16121991 makeSomething(new BezierSurface());
16131992 } else
1614
- if (event.getSource() == checkerItem)
1993
+ if (source == overlayItem || source == overlayButton)
16151994 {
16161995 /*
16171996 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +2005,7 @@
16262005 */
16272006 makeSomething(new Checker());
16282007 } else
1629
- if (event.getSource() == meshItem)
2008
+ if (source == meshItem)
16302009 {
16312010 Object3D itemtomake = new Object3D();
16322011 Object3D child;
....@@ -1647,35 +2026,35 @@
16472026 makeSomething(child);
16482027 }
16492028 } else
1650
- if (event.getSource() == springItem)
2029
+ if (source == springItem)
16512030 {
16522031 cSpring s = new cSpring();
16532032 s.setup();
16542033 makeSomething(s);
16552034 } else
1656
- if (event.getSource() == flagItem)
2035
+ if (source == flagItem)
16572036 {
16582037 cSpring s = new cFlag();
16592038 s.setup();
16602039 makeSomething(s);
16612040 } else
1662
- if (event.getSource() == lightItem)
2041
+ if (source == lightItem || source == lightButton)
16632042 {
16642043 makeSomething(new Light());
16652044 } else
1666
- if (event.getSource() == csgItem)
2045
+ if (source == csgItem)
16672046 {
16682047 group(new CSG());
16692048 } else
1670
- if (event.getSource() == templateItem)
2049
+ if (source == templateItem)
16712050 {
16722051 group(new cTemplate());
16732052 } else
1674
- if (event.getSource() == attributeItem)
2053
+ if (source == attributeItem)
16752054 {
16762055 makeSomething(new Attribute());
16772056 } else
1678
- if (event.getSource() == pointflowItem)
2057
+ if (source == pointflowItem)
16792058 {
16802059 makeSomething(new PointFlow());
16812060 } else
....@@ -1687,7 +2066,7 @@
16872066 } else
16882067 */
16892068
1690
- if (event.getSource() == superLoopItem)
2069
+ if (source == superLoopItem)
16912070 {
16922071 Composite g = new cGroup();
16932072 for (int i=0; i<15; i++)
....@@ -1709,7 +2088,7 @@
17092088
17102089 group(g);
17112090 } else
1712
- if (event.getSource() == loopItem)
2091
+ if (source == loopItem || source == loopButton)
17132092 {
17142093 Composite csg = new GroupLeaf();
17152094 csg.count = 5;
....@@ -1718,7 +2097,7 @@
17182097 csg.addChild(child);
17192098 child.addChild(csg);
17202099 } else
1721
- if (event.getSource() == doubleItem)
2100
+ if (source == doubleItem)
17222101 {
17232102 Composite csg = new GroupLeaf();
17242103 csg.count = 5;
....@@ -1730,7 +2109,7 @@
17302109 csg.addChild(child);
17312110 child.addChild(csg);
17322111 } else
1733
- if (event.getSource() == tripleItem)
2112
+ if (source == tripleItem)
17342113 {
17352114 Composite csg = new GroupLeaf();
17362115 csg.count = 4;
....@@ -1745,71 +2124,83 @@
17452124 csg.addChild(child);
17462125 child.addChild(csg);
17472126 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
2127
+ if (source == computeAOItem)
17502128 {
1751
- ImportGFD();
2129
+ Globals.drawMode = CameraPane.OCCLUSION;
2130
+ Globals.theRenderer.repaint();
17522131 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
2132
+ if (source == recompileItem)
17712133 {
17722134 Recompile();
17732135 refreshContents();
17742136 } else
1775
- if (event.getSource() == editScriptItem)
2137
+ if (source == editScriptItem)
17762138 {
17772139 OpenDialog();
17782140 refreshContents();
17792141 } else
1780
- if (event.getSource() == invariantsItem)
2142
+ if (source == invariantsItem)
17812143 {
17822144 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
2145
+ Grafreed.grafreeD.universe.invariants();
17842146 } else
1785
- if (event.getSource() == memoryItem)
2147
+ if (source == memoryItem)
17862148 {
17872149 //System.out.println("Invariants:");
17882150 PrintMemory();
17892151 } else
1790
- if (event.getSource() == pathItem)
2152
+ if (source == pathItem)
17912153 {
17922154 PrintPath();
17932155 } else
1794
- if (event.getSource() == analyzeItem)
2156
+ if (source == analyzeItem)
17952157 {
17962158 AnalyzeObject();
17972159 } else
1798
- if (event.getSource() == dumpItem)
2160
+ if (source == dumpItem)
17992161 {
18002162 DumpObject();
18012163 } else
1802
- 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)
18032194 {
18042195 //Reload(lastConverter, lastFilename, true);
18052196 ScreenFit();
18062197 } else
1807
- if (event.getSource() == screenfitpointButton)
2198
+ if (source == screenfitpointButton)
18082199 {
18092200 //Reload(lastConverter, lastFilename, true);
18102201 ScreenFitPoint();
18112202 } else
1812
- if (event.getSource() == snapobjectButton)
2203
+ if (source == snapobjectButton)
18132204 {
18142205 //Reload(lastConverter, lastFilename, true);
18152206 SnapObject();
....@@ -1820,13 +2211,13 @@
18202211 // Recompile();
18212212 // refreshContents();
18222213 // } else
1823
- if (event.getSource() == gcButton)
2214
+ if (source == gcButton)
18242215 {
18252216 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262217 System.gc();
18272218 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282219 } else
1829
- if (event.getSource() == editLeafItem)
2220
+ if (source == editLeafItem)
18302221 {
18312222 Object3D obj;
18322223 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2231,74 @@
18402231 }
18412232 refreshContents(true);
18422233 } else
1843
- if (event.getSource() == openWindowItem)
2234
+ if (source == openWindowItem)
18442235 {
18452236 EditSelection(true);
18462237 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2238
+ if (source == cutItem || source == clearButton)
18482239 {
18492240 loadClipboard(true);
18502241 } else
1851
- if (event.getSource() == duplicateItem)
2242
+ if (source == undoItem)
18522243 {
1853
- 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;
18542253 loadClipboard(false);
18552254 paste(false);
1856
- GrafreeD.clipboard = keep;
2255
+ Grafreed.clipboard = keep;
18572256 } else
1858
- if (event.getSource() == cloneItem)
2257
+ if (source == cloneItem)
18592258 {
18602259 CloneSelection(false);
18612260 } else
1862
- if (event.getSource() == cloneSupportItem)
2261
+ if (source == cloneSupportItem)
18632262 {
18642263 CloneSelection(true);
18652264 } else
1866
- if (event.getSource() == copyItem)
2265
+ if (source == copyItem)
18672266 {
18682267 loadClipboard(false);
18692268 } else
1870
- if (event.getSource() == pasteItem)
2269
+ if (source == pasteItem)
18712270 {
18722271 paste(false);
18732272 } else
1874
- if (event.getSource() == pasteLinkItem)
2273
+ if (source == pasteIntoItem)
18752274 {
1876
- pasteInto(false);
2275
+ pasteInto(true, false);
18772276 } else
1878
- if (event.getSource() == pasteCloneItem)
2277
+ if (source == pasteLinkItem)
18792278 {
1880
- pasteInto(true);
2279
+ pasteInto(false, false);
18812280 } else
1882
- if (event.getSource() == pasteExpandItem)
2281
+ if (source == pasteCloneItem)
2282
+ {
2283
+ pasteInto(true, true);
2284
+ } else
2285
+ if (source == pasteExpandItem)
18832286 {
18842287 paste(true);
18852288 } else
1886
- if (event.getSource() == synchronizeItem)
2289
+ if (source == synchronizeItem)
18872290 {
18882291 Overwrite(Object3D.TRANSFORM);
18892292 } else
1890
- if (event.getSource() == overwriteNameItem)
2293
+ if (source == overwriteNameItem)
18912294 {
18922295 Overwrite(Object3D.NAME);
18932296 } else
1894
- if (event.getSource() == overwriteUVItem)
2297
+ if (source == overwriteUVItem)
18952298 {
18962299 Overwrite(Object3D.UV);
18972300 } else
1898
- if (event.getSource() == overwriteMatItem)
2301
+ if (source == overwriteMatItem)
18992302 {
19002303 /* july 2015
19012304 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2318,7 @@
19152318
19162319 Overwrite(dropAttributes);
19172320 }
1918
- if (event.getSource() == overwriteGeoItem)
2321
+ if (source == overwriteGeoItem)
19192322 {
19202323 Overwrite(Object3D.GEOMETRY);
19212324 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2335,7 @@
19322335 // refreshContents();
19332336 // }
19342337 } else
1935
- if (event.getSource() == generateMeshItem)
2338
+ if (source == generateMeshItem)
19362339 {
19372340 //if (group.selection.size() == 1)
19382341 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2346,7 @@
19432346 ResetModel();
19442347 refreshContents();
19452348 } else
1946
- if (event.getSource() == extractGeometriesItem)
2349
+ if (source == extractGeometriesItem)
19472350 {
19482351 boolean one = false;
19492352
....@@ -1970,7 +2373,7 @@
19702373 ResetModel();
19712374 refreshContents();
19722375 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2376
+ if (source == cloneGeometriesItem)
19742377 {
19752378 boolean one = false;
19762379
....@@ -1996,32 +2399,37 @@
19962399 ResetModel();
19972400 refreshContents();
19982401 } else
1999
- if (event.getSource() == shareGeometriesItem)
2402
+ if (source == shareGeometriesItem)
20002403 {
20012404 boolean one = false;
20022405
20032406 if (group.selection.size() == 1)
20042407 one = true;
20052408
2409
+ Object3D merge = null;
2410
+
20062411 Object3D content = new cGroup();
20072412
20082413 for (int i=0; i<group.selection.size(); i++)
20092414 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2415
+ merge = new Merge(group.selection.get(i));
20112416
20122417 if (one)
2013
- makeSomething(sel, false);
2418
+ makeSomething(merge, false);
20142419 else
2015
- content.addChild(sel);
2420
+ content.addChild(merge);
20162421 }
20172422
20182423 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2424
+ makeSomething(content, true);
2425
+ else
2426
+ {
2427
+ ResetModel();
2428
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2429
+ refreshContents();
2430
+ }
20232431 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2432
+ if (source == mergeGeometriesItem)
20252433 {
20262434 boolean one = false;
20272435
....@@ -2051,7 +2459,7 @@
20512459 ResetModel();
20522460 refreshContents();
20532461 } else
2054
- if (event.getSource() == linkverticesItem)
2462
+ if (source == linkverticesItem)
20552463 {
20562464 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572465 // {
....@@ -2064,39 +2472,48 @@
20642472 // group.selection.get(0).setMasterThis(content); // should be identity
20652473 // refreshContents();
20662474 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2475
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682476 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2477
+ Object3D content = Grafreed.clipboard.get(0);
20702478
20712479 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722480 content = ((cGroup)content).get(0);
20732481
2074
- 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));
20752483 for (int i=0; i<group.selection.size(); i++)
20762484 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2485
+ boolean random = CameraPane.SWITCH;
2486
+ CameraPane.SWITCH = false; // parse all random nodes
20792487 group.selection.get(i).linkVerticesThis(content);
20802488 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2489
+ CameraPane.SWITCH = random;
20822490 }
2083
- 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));
20842492 refreshContents();
20852493 }
20862494 } else
2087
- if (event.getSource() == resetsupportItem)
2495
+ if (source == resetsupportItem)
20882496 {
20892497 for (int i=0; i<group.selection.size(); i++)
20902498 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
20932501 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2502
+ CameraPane.SWITCH = random;
20952503 }
20962504
20972505 refreshContents();
20982506 } else
2099
- if (event.getSource() == resetreferencesItem)
2507
+ if (source == relinkverticesItem)
2508
+ {
2509
+ boolean random = CameraPane.SWITCH;
2510
+ CameraPane.SWITCH = false; // parse all random nodes
2511
+ group.selection.RelinkToSupport();
2512
+ CameraPane.SWITCH = random;
2513
+
2514
+ refreshContents();
2515
+ } else
2516
+ if (source == resetreferencesItem)
21002517 {
21012518 for (int i=0; i<group.selection.size(); i++)
21022519 {
....@@ -2105,11 +2522,11 @@
21052522
21062523 refreshContents();
21072524 } else
2108
- if (event.getSource() == setMasterItem)
2525
+ if (source == setMasterItem)
21092526 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2527
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112528 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2529
+ Object3D content = Grafreed.clipboard.get(0);
21132530
21142531 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152532 content = ((cGroup)content).get(0);
....@@ -2118,13 +2535,13 @@
21182535 refreshContents();
21192536 }
21202537 } else
2121
- if (event.getSource() == poseMeshItem)
2538
+ if (source == poseMeshItem)
21222539 {
21232540 if (group.selection.size() == 1)
21242541 {
2125
- if (GrafreeD.clipboard.size() == 1)
2542
+ if (Grafreed.clipboard.size() == 1)
21262543 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2544
+ Object3D content = Grafreed.clipboard.get(0);
21282545
21292546 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302547 content = ((cGroup)content).get(0);
....@@ -2137,19 +2554,19 @@
21372554 }
21382555
21392556 } else
2140
- if (event.getSource() == revertMeshItem)
2557
+ if (source == revertMeshItem)
21412558 {
21422559 RevertMeshes();
21432560 } else
2144
- if (event.getSource() == resetMeshItem)
2561
+ if (source == resetAllItem)
21452562 {
21462563 ResetAll();
21472564 } else
2148
- if (event.getSource() == stepAllItem)
2565
+ if (source == stepAllItem)
21492566 {
21502567 StepAll();
21512568 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2569
+ if (source == clearItem) // || event.getSource() == clearButton)
21532570 {
21542571 //int indices[] = jList.getSelectedIndices();
21552572 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2574,46 @@
21572574
21582575 ClearSelection(false);
21592576 } else
2160
- if (event.getSource() == clearAllItem)
2577
+ if (source == clearAllItem)
21612578 {
21622579 ClearSelection(true);
21632580 } else
2164
- if (event.getSource() == grabItem)
2581
+ if (source == grabItem || source == groupButton)
21652582 {
2166
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
21672584 } else
2168
- if (event.getSource() == frontItem)
2585
+ if (source == hideItem)
2586
+ {
2587
+ group(new HiddenObject());
2588
+ } else
2589
+ if (source == frontItem)
21692590 {
21702591 front();
21712592 } else
2172
- if (event.getSource() == backItem)
2593
+ if (source == backItem)
21732594 {
21742595 back();
21752596 } else
2176
- if (event.getSource() == cameraItem)
2597
+ if (source == cameraItem)
21772598 {
21782599 makeSomething(new Camera());
21792600 } else
2180
- if (event.getSource() == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
21812602 {
21822603 group(new Composite());
21832604 } else
2184
- if (event.getSource() == randomItem)
2605
+ if (source == switchItem || source == switchButton)
21852606 {
21862607 RandomNode random = new RandomNode();
21872608 group(random);
21882609 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2610
+ random.name = random.get(0).name + "Switch";
21902611 } else
2191
- if (event.getSource() == physicsItem)
2612
+ if (source == physicsItem)
21922613 {
21932614 group(new PhysicsNode());
21942615 } else
2195
- if (event.getSource() == frameselectorItem)
2616
+ if (source == frameselectorItem)
21962617 {
21972618 for (int i=0; i<group.selection.size(); i++)
21982619 {
....@@ -2204,7 +2625,7 @@
22042625 ResetModel();
22052626 refreshContents();
22062627 } else
2207
- if (event.getSource() == switchGeoItem)
2628
+ if (source == switchGeoItem)
22082629 {
22092630 for (int i=0; i<group.selection.size(); i++)
22102631 {
....@@ -2216,7 +2637,7 @@
22162637 ResetModel();
22172638 refreshContents();
22182639 } else
2219
- if (event.getSource() == switchTransfoItem)
2640
+ if (source == switchTransfoItem)
22202641 {
22212642 for (int i=0; i<group.selection.size(); i++)
22222643 {
....@@ -2228,7 +2649,7 @@
22282649 ResetModel();
22292650 refreshContents();
22302651 } else
2231
- if (event.getSource() == morphItem)
2652
+ if (source == morphItem)
22322653 {
22332654 for (int i=0; i<group.selection.size(); i++)
22342655 {
....@@ -2240,7 +2661,7 @@
22402661 ResetModel();
22412662 refreshContents();
22422663 } else
2243
- if (event.getSource() == scriptNodeItem)
2664
+ if (source == scriptNodeItem)
22442665 {
22452666 boolean atleastone = false;
22462667
....@@ -2279,199 +2700,239 @@
22792700 }
22802701 }
22812702 } else
2282
- if (event.getSource() == linkerItem)
2703
+ if (source == linkerItem)
22832704 {
22842705 group(new cLinker());
22852706 } else
2286
- if (event.getSource() == textureItem)
2707
+ if (source == textureItem || source == textureButton)
22872708 {
22882709 group(new TextureNode());
22892710 } else
2290
- if (event.getSource() == shadowXItem)
2711
+ if (source == billboardItem)
2712
+ {
2713
+ group(new BillboardNode());
2714
+ } else
2715
+ if (source == shadowXItem)
22912716 {
22922717 CastShadow(0);
22932718 } else
2294
- if (event.getSource() == shadowYItem)
2719
+ if (source == shadowYItem)
22952720 {
22962721 CastShadow(1);
22972722 } else
2298
- if (event.getSource() == shadowZItem)
2723
+ if (source == shadowZItem)
22992724 {
23002725 CastShadow(2);
23012726 } else
2302
- if (event.getSource() == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
23032728 {
2304
- ungroup();
2729
+ //ungroup();
2730
+ for (int i=0; i<group.selection.size(); i++)
2731
+ {
2732
+ Ungroup(group.selection.get(i));
2733
+ }
2734
+
2735
+ ClearSelection(false);
2736
+
2737
+ refreshContents();
23052738 } else
2306
- if (event.getSource() == genUVItem)
2739
+ if (source == genUVItem)
23072740 {
23082741 GenUV();
23092742 } else
2310
- if (event.getSource() == genNormalsCADItem)
2743
+ if (source == genNormalsCADItem)
23112744 {
23122745 GenNormals(true);
23132746 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2747
+ if (source == genNormalsMESHItem)
23152748 {
2316
- GenNormals(true); // TODO
2749
+ GenNormalsMESH();
23172750 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2751
+ if (source == genNormalsORGANItem)
23192752 {
23202753 GenNormals(false);
23212754 } else
2322
- if (event.getSource() == stripifyItem)
2755
+ if (source == genNormalsMINEItem)
2756
+ {
2757
+ GenNormalsMINE();
2758
+ } else
2759
+ if (source == stripifyItem)
23232760 {
23242761 Stripify();
23252762 } else
2326
- if (event.getSource() == unstripifyItem)
2763
+ if (source == unstripifyItem)
23272764 {
23282765 Unstripify();
23292766 } else
2330
- if (event.getSource() == trimItem)
2767
+ if (source == trimItem)
23312768 {
23322769 Trim();
23332770 } else
2334
- if (event.getSource() == untrimItem)
2771
+ if (source == untrimItem)
23352772 {
23362773 Untrim();
23372774 } else
2338
- if (event.getSource() == clearColorsItem)
2775
+ if (source == clearColorsItem)
23392776 {
23402777 ClearColors();
23412778 } else
2342
- if (event.getSource() == clearMaterialsItem)
2779
+ if (source == clearMaterialsItem)
23432780 {
23442781 ClearMaterials();
23452782 } else
2346
- if (event.getSource() == liveleavesItem)
2783
+ if (source == liveleavesItem)
23472784 {
23482785 LiveLeaves(true);
23492786 } else
2350
- if (event.getSource() == unliveleavesItem)
2787
+ if (source == unliveleavesItem)
23512788 {
23522789 LiveLeaves(false);
23532790 } else
2354
- if (event.getSource() == supportleavesItem)
2791
+ if (source == supportleavesItem)
23552792 {
23562793 SupportLeaves(true);
23572794 } else
2358
- if (event.getSource() == unsupportleavesItem)
2795
+ if (source == unsupportleavesItem)
23592796 {
23602797 SupportLeaves(false);
23612798 } else
2362
- if (event.getSource() == hideleavesItem)
2799
+ if (source == hideleavesItem)
23632800 {
23642801 HideLeaves(true);
23652802 } else
2366
- if (event.getSource() == showleavesItem)
2803
+ if (source == showleavesItem)
23672804 {
23682805 HideLeaves(false);
23692806 } else
2370
- if (event.getSource() == markleavesItem)
2807
+ if (source == markleavesItem)
23712808 {
23722809 MarkLeaves(true);
23732810 } else
2374
- if (event.getSource() == unmarkleavesItem)
2811
+ if (source == unmarkleavesItem)
23752812 {
23762813 MarkLeaves(false);
23772814 } else
2378
- 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)
23792832 {
23802833 FlipV(true);
23812834 } else
2382
- if (event.getSource() == unflipVItem)
2835
+ if (source == unflipVItem)
23832836 {
23842837 FlipV(false);
23852838 } else
2386
- if (event.getSource() == lowTexturesItem)
2839
+ if (source == lowTexturesItem)
23872840 {
23882841 SetTexRes(0);
23892842 } else
2390
- if (event.getSource() == normalTexturesItem)
2843
+ if (source == normalTexturesItem)
23912844 {
23922845 SetTexRes(1);
23932846 } else
2394
- if (event.getSource() == highTexturesItem)
2847
+ if (source == highTexturesItem)
23952848 {
23962849 SetTexRes(2);
23972850 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2851
+ if (source == veryhighTexturesItem)
23992852 {
24002853 SetTexRes(3);
24012854 } else
2402
- if (event.getSource() == maxTexturesItem)
2855
+ if (source == maxTexturesItem)
24032856 {
24042857 SetTexRes(4);
24052858 } else
2406
- if (event.getSource() == panoTexturesItem)
2859
+ if (source == panoTexturesItem)
24072860 {
24082861 SetTexRes(5);
24092862 } else
2410
- if (event.getSource() == reverseNormalsItem)
2863
+ if (source == reverseNormalsItem)
24112864 {
24122865 ReverseNormals();
24132866 } else
2414
- if (event.getSource() == parseverticesItem)
2867
+ if (source == parseverticesItem)
24152868 {
24162869 ParseVertices();
24172870 } else
2418
- if (event.getSource() == textureFieldItem)
2871
+ if (source == textureFieldItem)
24192872 {
24202873 TextureVertices();
24212874 } else
2422
- if (event.getSource() == alignItem)
2875
+ if (source == alignItem)
24232876 {
24242877 Align();
24252878 } else
2426
- if (event.getSource() == mirrorItem)
2879
+ if (source == mirrorItem)
24272880 {
24282881 MirrorPoses();
24292882 } else
2430
- if (event.getSource() == reduceMorphItem)
2883
+ if (source == reduceMorphItem)
24312884 {
24322885 MeshReduction(false);
24332886 } else
2434
- if (event.getSource() == reduce34MorphItem)
2887
+ if (source == reduce34MorphItem)
24352888 {
24362889 MeshReduction(true);
24372890 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2891
+ if (source == reverseTrianglesItem)
24392892 {
24402893 ReverseTriangles();
24412894 } else
2442
- if (event.getSource() == reduceMeshItem)
2895
+ if (source == reduceMeshItem)
24432896 {
24442897 ReduceMesh(false);
24452898 } else
2446
- if (event.getSource() == reduce34MeshItem)
2899
+ if (source == reduce34MeshItem)
24472900 {
24482901 ReduceMesh(true);
24492902 } else
2450
- if (event.getSource() == increaseMeshItem)
2903
+ if (source == increaseMeshItem)
24512904 {
24522905 IncreaseMesh();
24532906 } else
2454
- if (event.getSource() == clipMeshItem)
2907
+ if (source == clipMeshItem)
24552908 {
24562909 ClipMesh();
24572910 } else
2458
- if (event.getSource() == smoothMeshItem)
2911
+ if (source == smoothMeshItem)
24592912 {
24602913 SmoothMesh();
24612914 } else
2462
- if (event.getSource() == transformgeometryItem)
2915
+ if (source == transformGeometryItem)
24632916 {
24642917 TransformGeometry();
24652918 } else
2466
- if (event.getSource() == resetTransformItem)
2919
+ if (source == transformChildrenItem)
2920
+ {
2921
+ TransformChildren();
2922
+ } else
2923
+ if (source == resetTransformItem)
24672924 {
24682925 ResetTransform();
24692926 } else
2470
- if (event.getSource() == resetCentroidItem)
2927
+ if (source == resetCentroidItem)
24712928 {
2472
- ResetCentroid();
2929
+ ResetCentroid(true);
24732930 } else
2474
- if (event.getSource() == resetParentItem)
2931
+ if (source == resetCentroidXZItem)
2932
+ {
2933
+ ResetCentroid(false);
2934
+ } else
2935
+ if (source == resetParentItem)
24752936 {
24762937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772938 {
....@@ -2481,7 +2942,7 @@
24812942
24822943 refreshContents();
24832944 } else
2484
- if (event.getSource() == repairParentItem)
2945
+ if (source == repairParentItem)
24852946 {
24862947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872948 {
....@@ -2495,7 +2956,21 @@
24952956
24962957 refreshContents();
24972958 } else
2498
- 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)
24992974 {
25002975 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012976 {
....@@ -2507,7 +2982,7 @@
25072982 ResetModel();
25082983 refreshContents();
25092984 } else
2510
- if (event.getSource() == sortbynameItem)
2985
+ if (source == sortbynameItem)
25112986 {
25122987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132988 {
....@@ -2519,7 +2994,7 @@
25192994 ResetModel();
25202995 refreshContents();
25212996 } else
2522
- if (event.getSource() == attachPigmentItem)
2997
+ if (source == attachPigmentItem)
25232998 {
25242999 String texture = GetFile("Attach pigment");
25253000 Object3D obj;
....@@ -2531,7 +3006,7 @@
25313006
25323007 refreshContents();
25333008 } else
2534
- if (event.getSource() == detachPigmentItem)
3009
+ if (source == detachPigmentItem)
25353010 {
25363011 Object3D obj;
25373012 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +3017,7 @@
25423017
25433018 refreshContents();
25443019 } else
2545
- if (event.getSource() == attachBumpItem)
3020
+ if (source == attachBumpItem)
25463021 {
25473022 String texture = GetFile("Attach bump");
25483023 Object3D obj;
....@@ -2554,7 +3029,7 @@
25543029
25553030 refreshContents();
25563031 } else
2557
- if (event.getSource() == detachBumpItem)
3032
+ if (source == detachBumpItem)
25583033 {
25593034 Object3D obj;
25603035 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +3040,7 @@
25653040
25663041 refreshContents();
25673042 } else
2568
- if (event.getSource() == pigmentBumpItem)
3043
+ if (source == pigmentBumpItem)
25693044 {
25703045 Object3D obj;
25713046 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +3051,237 @@
25763051
25773052 refreshContents();
25783053 } else
2579
- if (event.getSource() == flashSelectionButton)
3054
+ if (source == flashSelectionButton)
25803055 {
25813056 CameraPane.flash = true;
25823057 refreshContents();
25833058 } else
2584
- if (event.getSource() == oneButton)
3059
+ if (source == oneButton)
25853060 {
25863061 } else
2587
- if (event.getSource() == twoButton)
3062
+ if (source == twoButton)
25883063 {
25893064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
25903069 // bug
25913070 //gridPanel.setDividerLocation(1.0);
25923071 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- 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
+
26173119 } else
2618
- if (event.getSource() == threeButton)
3120
+ if (source == threeButton)
26193121 {
26203122 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- 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();
26453160 } else
2646
- if (event.getSource() == fourButton)
3161
+ if (source == fourButton)
26473162 {
26483163 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- 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();
26733200 } else
2674
- if (event.getSource() == sixButton)
3201
+ if (source == sixButton)
26753202 {
26763203 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- 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();
27013241 } else
2702
- if (event.getSource() == sevenButton)
3242
+ if (source == sevenButton)
27033243 {
27043244 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- 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();
27293283 } else
2730
- if (event.getSource() == rootButton)
3284
+ if (source == rootButton)
27313285 {
27323286 Object3D obj;
27333287 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2737,34 +3291,44 @@
27373291 EditObject(obj);
27383292 }
27393293
3294
+ cameraView.requestFocusInWindow();
27403295 refreshContents(true);
27413296 } else
2742
- if (event.getSource() == closeButton)
3297
+ if (source == closeButton)
27433298 {
27443299 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453300 cRadio ab;
27463301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27473302 {
27483303 ab = (cRadio)e.nextElement();
2749
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27503305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
27513312 buttonGroup.remove(ab);
27523313 radioPanel.remove(ab);
27533314
2754
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
27553317 // ab.GetObject().objectUI = null; // ?????????
27563318
27573319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27583320 break;
27593321 }
27603322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
27613325 refreshContents(true);
27623326 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3327
+ if (source == editItem || source == editButton)
27643328 {
27653329 EditSelection(false);
27663330 } else
2767
- if (event.getSource() == uneditButton)
3331
+ if (source == uneditButton)
27683332 {
27693333 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703334 {
....@@ -2774,14 +3338,14 @@
27743338 child.CloseUI();
27753339 listUI.remove(child);
27763340
2777
- child.editWindow = null; // ???????????
3341
+ //child.editWindow = null; // ???????????
27783342 }
2779
- objEditor.ctrlPanel.revalidate();
3343
+ objEditor.ctrlPanel.FlushUI();
27803344 //objEditor.jTree.clearSelection();
27813345 //objEditor.ResetSliders();
27823346 refreshContents(true);
27833347 } else
2784
- if (event.getSource() == clearPanelButton)
3348
+ if (source == clearPanelButton)
27853349 {
27863350 assert(copy == group);
27873351 //copy.ClearUI();
....@@ -2792,7 +3356,7 @@
27923356 listUI.clear();
27933357 refreshContents(true);
27943358 } else
2795
- if (event.getSource() == allParamsButton)
3359
+ if (source == allParamsButton)
27963360 {
27973361 assert(copy == group);
27983362
....@@ -2813,19 +3377,19 @@
28133377
28143378 refreshContents(true);
28153379 } else
2816
- if (event.getSource() == unselectButton)
3380
+ if (source == unselectButton)
28173381 {
28183382 objEditor.jTree.clearSelection();
28193383 // ?? oct 2012 GrafreeD.clipboard.clear();
28203384 objEditor.ResetSliders();
28213385 refreshContents(true);
28223386 } else
2823
- if(event.getSource() instanceof cRadio)
3387
+ if(source instanceof cRadio)
28243388 {
28253389 group.parent = keepparent;
28263390 group.attributes = 0;
28273391 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3392
+ /*cRadio*/ radio = (cRadio)source;
28293393 Object3D obj = radio.GetObject();
28303394 System.out.println("Edit " + obj);
28313395 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3409,7 @@
28453409 }
28463410
28473411 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3412
+ //Globals.theRenderer.object = group;
28493413 if(!useclient)
28503414 {
28513415 cameraView.renderCamera = radio.camera;
....@@ -2854,12 +3418,17 @@
28543418 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553419 cameraView.targetLookAt.set(radio.camera.lookAt);
28563420 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3421
+ //cameraView.lighttouched = true;
3422
+ Globals.lighttouched = true;
28583423 topView.object = group;
28593424 frontView.object = group;
28603425 sideView.object = group;
28613426 }
2862
- group.editWindow = this;
3427
+
3428
+// fix "+" issue
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
3431
+
28633432 /*
28643433 currentLayout = radio.layout;
28653434 if (currentLayout == null)
....@@ -2871,8 +3440,23 @@
28713440 //group.parent = null; // ROOT
28723441 //group.attributes = -1;
28733442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
28743445 refreshContents(true);
2875
- }
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
+ }
28763460 else
28773461 {
28783462 //return super.action(event, arg);
....@@ -2881,7 +3465,6 @@
28813465 }
28823466
28833467 boolean useclient = false;
2884
- cRadio radio;
28853468
28863469 void ToggleRoot()
28873470 {
....@@ -2890,7 +3473,7 @@
28903473 if (useclient)
28913474 {
28923475 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3476
+ Globals.lighttouched = true;
28943477 //topView.object = client;
28953478 //frontView.object = client;
28963479 //sideView.object = client;
....@@ -2898,7 +3481,7 @@
28983481 else
28993482 {
29003483 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3484
+ Globals.lighttouched = true;
29023485 //topView.object = group;
29033486 //frontView.object = group;
29043487 //sideView.object = group;
....@@ -2933,6 +3516,28 @@
29333516 refreshContents();
29343517 }
29353518
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
+ }
29363541
29373542 void ResetTransform()
29383543 {
....@@ -3045,7 +3650,7 @@
30453650 refreshContents();
30463651 }
30473652
3048
- void ResetCentroid()
3653
+ void ResetCentroid(boolean full)
30493654 {
30503655 Object3D obj;
30513656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3665,16 @@
30603665 LA.matIdentity(Object3D.mat);
30613666 obj.getBounds(minima, maxima, false);
30623667 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3668
+ if (full)
3669
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643670 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653671 obj.TransformMesh(Object3D.mat);
3672
+
30663673 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3674
+ if (full)
3675
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683676 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3677
+
30693678 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703679 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713680 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3703,8 @@
30943703
30953704 int size = obj.MemorySize();
30963705
3097
- 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)");
30983708 }
30993709 }
31003710 catch (Exception e)
....@@ -3131,9 +3741,9 @@
31313741 obj = (Object3D)e.nextElement();
31323742
31333743 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3744
+ Grafreed.AnalyzeObject(obj);
31353745 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3746
+ Grafreed.AnalyzeObject(obj.bRep);
31373747
31383748 // System.err.println((size/1024) + " KB is the size of " + obj);
31393749 }
....@@ -3175,6 +3785,20 @@
31753785 void GenNormals(boolean crease)
31763786 {
31773787 group.GenNormalsS(crease);
3788
+
3789
+ refreshContents();
3790
+ }
3791
+
3792
+ void GenNormalsMESH()
3793
+ {
3794
+ group.GenNormalsMeshS();
3795
+
3796
+ refreshContents();
3797
+ }
3798
+
3799
+ void GenNormalsMINE()
3800
+ {
3801
+ group.selection.GenNormalsMINE();
31783802
31793803 refreshContents();
31803804 }
....@@ -3340,8 +3964,8 @@
33403964
33413965 void ParseVertices()
33423966 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
3967
+ boolean epsequal = Grafreed.epsequal;
3968
+ Grafreed.epsequal = true;
33453969
33463970 for (int i=0; i<group.selection.size(); i++)
33473971 {
....@@ -3366,7 +3990,7 @@
33663990 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33673991 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33683992
3369
- g.add(GrafreeD.clipboard);
3993
+ g.add(Grafreed.clipboard);
33703994
33713995 buffer.add(g);
33723996 }
....@@ -3381,7 +4005,7 @@
33814005 makeSomething(buffer, i==group.selection.size()-1);
33824006 }
33834007
3384
- GrafreeD.epsequal = epsequal;
4008
+ Grafreed.epsequal = epsequal;
33854009
33864010 refreshContents();
33874011 }
....@@ -3399,7 +4023,16 @@
33994023 String pigment = Object3D.GetPigment(tex);
34004024 //String bump = Object3D.GetBump(tex);
34014025
3402
- 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
+ }
34034036
34044037 double s = v.s;
34054038
....@@ -3447,12 +4080,26 @@
34474080
34484081 void Align()
34494082 {
4083
+ if (group.selection.size() == 0)
4084
+ return;
4085
+
4086
+ cVector bbmin = new cVector();
4087
+ cVector bbmax = new cVector();
4088
+
4089
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4090
+
4091
+ double dx = bbmax.x - bbmin.x;
4092
+ double dy = bbmax.y - bbmin.y;
4093
+ double dz = bbmax.z - bbmin.z;
4094
+
4095
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4096
+
34504097 for (int i=0; i<group.selection.size(); i++)
34514098 {
34524099 Object3D obj = group.selection.get(i);
34534100
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4101
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4102
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34564103 }
34574104
34584105 refreshContents();
....@@ -3473,11 +4120,11 @@
34734120
34744121 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34754122
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
4123
+ boolean random = CameraPane.SWITCH;
4124
+ CameraPane.SWITCH = false; // parse all random nodes
34784125 lowres.linkVerticesThis(null);
34794126 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
4127
+ CameraPane.SWITCH = random;
34814128
34824129 System.err.flush();
34834130
....@@ -3517,7 +4164,7 @@
35174164 return;
35184165
35194166 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
4167
+ Object3D ref = Grafreed.clipboard.get(0);
35214168
35224169 Object3D newgroup = new Object3D("Po:" + poses.name);
35234170
....@@ -3686,7 +4333,7 @@
36864333 group.selection.RelinkToSupport(); // july 2014
36874334 System.out.println("DONE.");
36884335 refreshContents();
3689
- 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));
36904337 }
36914338
36924339 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4358,9 @@
37114358
37124359 void ClipMesh()
37134360 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4361
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154362 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4363
+ Object3D content = Grafreed.clipboard.get(0);
37174364
37184365 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194366 content = ((cGroup)content).get(0);
....@@ -3722,7 +4369,7 @@
37224369 // {
37234370 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244371 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4372
+ group.selection.ClipMesh(Grafreed.clipboard);
37264373 }
37274374 // group.selection.ClipMesh(GrafreeD.clipboard);
37284375 System.out.println("DONE.");
....@@ -3769,6 +4416,18 @@
37694416 void MarkLeaves(boolean hide)
37704417 {
37714418 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);
37724431 refreshContents();
37734432 }
37744433
....@@ -3854,10 +4513,10 @@
38544513 {
38554514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38564515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3857
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584517
38594518 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4519
+ if(elem != group || !newWindow)
38614520 {
38624521 // if (!(elem instanceof Composite))
38634522 // newWindow = false;
....@@ -3947,7 +4606,6 @@
39474606 //case 702: // Event.LIST_DESELECT
39484607 group.deselectAll();
39494608 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514609 if (tps != null)
39524610 {
39534611 for (int i=0; i < tps.length; i++)
....@@ -3956,31 +4614,30 @@
39564614
39574615 //if (child.parent != null)
39584616 //child.parent.addSelectee(child);
4617
+ objEditor.SetMaterial(child);
39594618 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634619 }
39644620 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4621
+// else
4622
+// {
4623
+// objEditor.SetMaterial(group); // .GetMaterial());
4624
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4625
+// System.err.println("info : " + group.GetPath());
4626
+// }
39714627
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- 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))
39754629 CameraPane.flash = true;
39764630
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4631
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784632 // a camera
39794633 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // 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;
39844641 }
39854642
39864643 refreshContents();
....@@ -3991,6 +4648,27 @@
39914648
39924649 freezemodel = false;
39934650 }
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
+ }
39944672
39954673 void linkSomething(Object3D thing)
39964674 {
....@@ -4062,16 +4740,19 @@
40624740 {
40634741 if (group.selection.isEmpty())
40644742 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4743
+
4744
+ Grafreed.clipboardIsTempGroup = false;
40664745 Composite tGroup = null;
40674746 if (group.selection.size() > 0) // 1)
40684747 {
40694748 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4749
+ Grafreed.clipboardIsTempGroup = true;
40714750 }
40724751
40734752 if (cut)
40744753 {
4754
+ if (Globals.SAVEONMAKE)
4755
+ Save();
40754756 //int indices[] = jList.getSelectedIndices();
40764757 //for (int i = indices.length - 1; i >= 0; i--)
40774758 //jList.remove(indices[i]);
....@@ -4107,16 +4788,16 @@
41074788 //System.out.println("cut " + child);
41084789 //System.out.println("parent = " + child.parent);
41094790 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4791
+ if (Grafreed.clipboardIsTempGroup)
41114792 tGroup.add/*Child*/(tmp);
41124793 else
4113
- GrafreeD.clipboard = tmp;
4794
+ Grafreed.clipboard = tmp;
41144795 }
41154796 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4797
+ if (Grafreed.clipboardIsTempGroup)
41174798 tGroup.add/*Child*/(child);
41184799 else
4119
- GrafreeD.clipboard = child;
4800
+ Grafreed.clipboard = child;
41204801 }
41214802
41224803 //ResetModel();
....@@ -4148,21 +4829,23 @@
41484829 //System.out.println("cut " + elem);
41494830 //System.out.println("parent = " + elem.parent);
41504831 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4832
+ if (Grafreed.clipboardIsTempGroup)
41524833 tGroup.add/*Child*/(tmp);
41534834 else
4154
- GrafreeD.clipboard = tmp;
4835
+ Grafreed.clipboard = tmp;
41554836 }
41564837 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4838
+ if (Grafreed.clipboardIsTempGroup)
41584839 tGroup.add/*Child*/(child);
41594840 else
4160
- GrafreeD.clipboard = child;
4841
+ Grafreed.clipboard = child;
41614842 }
41624843
41634844 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4845
+
4846
+ if (Grafreed.clipboardIsTempGroup)
4847
+ Grafreed.clipboard = tGroup;
4848
+
41664849 if (cut)
41674850 {
41684851 ResetModel();
....@@ -4176,7 +4859,7 @@
41764859 // return;
41774860 boolean first = true;
41784861
4179
- if (GrafreeD.clipboardIsTempGroup)
4862
+ if (Grafreed.clipboardIsTempGroup)
41804863 {
41814864 Composite temp;
41824865
....@@ -4187,7 +4870,7 @@
41874870 temp = (Composite)Applet3D.clipboard.deepCopy();
41884871 */
41894872 Object3D elem;
4190
- 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))
41914874 {
41924875 Object3D child = (Object3D)e.nextElement();
41934876
....@@ -4221,21 +4904,21 @@
42214904 //Object3D cb = Applet3D.clipboard;
42224905 //temp.addChild(cb);
42234906 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- 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());
42294912 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4913
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4914
+ Grafreed.clipboard.get(0).parent = keepparent;
42324915 }
42334916
42344917 ResetModel();
42354918 refreshContents();
42364919 }
42374920
4238
- void pasteInto(boolean copyit)
4921
+ void pasteInto(boolean copyit, boolean clone)
42394922 {
42404923 // if (GrafreeD.clipboard == null)
42414924 // return;
....@@ -4264,15 +4947,22 @@
42644947 if (copyit)
42654948 {
42664949 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4950
+ if (clone)
4951
+ {
4952
+ CloneClipboard(false); // sept 2014
4953
+ }
4954
+ else
4955
+ {
4956
+ paste(false);
4957
+ }
42684958 }
42694959 else
42704960 {
42714961 boolean first = true;
42724962
4273
- if (GrafreeD.clipboardIsTempGroup)
4963
+ if (Grafreed.clipboardIsTempGroup)
42744964 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
4965
+ Composite temp = (Composite)Grafreed.clipboard;
42764966 Object3D copy;
42774967 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42784968 {
....@@ -4282,7 +4972,7 @@
42824972 }
42834973 } else
42844974 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
4975
+ linkSomething(Grafreed.clipboard); //.get(0));
42864976 }
42874977 }
42884978 }
....@@ -4474,6 +5164,26 @@
44745164 makeSomething(csg);
44755165 }
44765166
5167
+ void Ungroup(Object3D g)
5168
+ {
5169
+ if (g instanceof HiddenObject)
5170
+ {
5171
+ HiddenObject h = (HiddenObject) g;
5172
+
5173
+ for (int i=0; i<h.ActualSize(); i++)
5174
+ {
5175
+ objEditor.makeSomething(h.get(i), false);
5176
+ }
5177
+ }
5178
+ else
5179
+ {
5180
+ for (int i=0; i<g.Size(); i++)
5181
+ {
5182
+ objEditor.makeSomething(g.get(i), false);
5183
+ }
5184
+ }
5185
+ }
5186
+
44775187 void ungroup()
44785188 {
44795189 /*
....@@ -4667,21 +5377,6 @@
46675377 }
46685378 */
46695379
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855380 /*
46865381 public void Callback(Object obj)
46875382 {
....@@ -4705,26 +5400,9 @@
47055400 }
47065401 */
47075402
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255403 String GetFile(String dialogName)
47265404 {
4727
- if (GrafreeD.standAlone)
5405
+ if (Grafreed.standAlone)
47285406 {
47295407 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305408 browser.show();
....@@ -4788,10 +5466,38 @@
47885466 cButton flashSelectionButton;
47895467 cButton editButton;
47905468 cButton uneditButton;
5469
+ JCheckBox allParamsButton;
47915470 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935471 cButton unselectButton;
47945472
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
+
47955501 cButton screenfitButton;
47965502 cButton screenfitpointButton;
47975503 cButton snapobjectButton;
....@@ -4803,14 +5509,6 @@
48035509
48045510 cButton setsupportButton;
48055511
4806
- cButton twoButton;
4807
- cButton sixButton;
4808
- cButton threeButton;
4809
- cButton sevenButton;
4810
- cButton fourButton; // full panel
4811
- cButton oneButton; // full XYZ
4812
- //cButton currentLayout;
4813
-
48145512 //
48155513 //Composite
48165514 Object3D // to do !!
....@@ -4820,9 +5518,11 @@
48205518 //JTree jTree;
48215519 private MenuItem lookAtItem;
48225520 private MenuItem lookFromItem;
4823
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
48245522 private MenuItem cutItem;
4825
- private MenuItem duplicateItem;
5523
+ private MenuItem undoItem;
5524
+ private MenuItem redoItem;
5525
+ private JMenuItem duplicateItem;
48265526 private MenuItem cloneItem;
48275527 private MenuItem cloneSupportItem;
48285528 private MenuItem overwriteGeoItem;
....@@ -4833,8 +5533,9 @@
48335533 private MenuItem resetsupportItem;
48345534 private MenuItem resetreferencesItem;
48355535 private MenuItem linkverticesItem;
5536
+ private MenuItem relinkverticesItem;
48365537 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5538
+ private MenuItem resetAllItem;
48385539 private MenuItem stepAllItem;
48395540 private MenuItem revertMeshItem;
48405541 private MenuItem poseMeshItem;
....@@ -4845,6 +5546,7 @@
48455546 private MenuItem mergeGeometriesItem;
48465547 private MenuItem copyItem;
48475548 private MenuItem pasteItem;
5549
+ private MenuItem pasteIntoItem;
48485550 private MenuItem pasteLinkItem;
48495551 private MenuItem pasteCloneItem;
48505552 private MenuItem pasteExpandItem;
....@@ -4854,6 +5556,7 @@
48545556 private MenuItem genNormalsMESHItem;
48555557 private MenuItem genNormalsCADItem;
48565558 private MenuItem genNormalsORGANItem;
5559
+ private MenuItem genNormalsMINEItem;
48575560 private MenuItem stripifyItem;
48585561 private MenuItem unstripifyItem;
48595562 private MenuItem trimItem;
....@@ -4882,6 +5585,10 @@
48825585 private MenuItem showleavesItem;
48835586 private MenuItem markleavesItem;
48845587 private MenuItem unmarkleavesItem;
5588
+ private MenuItem rewindleavesItem;
5589
+ private MenuItem unrewindleavesItem;
5590
+ private MenuItem randomleavesItem;
5591
+ private MenuItem unrandomleavesItem;
48855592
48865593 private MenuItem flipVItem;
48875594 private MenuItem unflipVItem;
....@@ -4893,14 +5600,17 @@
48935600 private MenuItem panoTexturesItem;
48945601
48955602 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5603
+ private MenuItem resetCentroidXZItem;
48975604 private MenuItem resetTransformItem;
5605
+ private MenuItem transformGeometryItem;
5606
+ private MenuItem transformChildrenItem;
5607
+ private MenuItem hideItem;
48985608 private MenuItem grabItem;
48995609 private MenuItem backItem;
49005610 private MenuItem frontItem;
49015611 private MenuItem cameraItem;
49025612 private MenuItem compositeItem;
4903
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
49045614 private MenuItem physicsItem;
49055615 private MenuItem frameselectorItem;
49065616 private MenuItem scriptNodeItem;
....@@ -4915,6 +5625,7 @@
49155625
49165626 private MenuItem resetParentItem;
49175627 private MenuItem repairParentItem;
5628
+ private MenuItem repairShadowItem;
49185629 private MenuItem sortbysizeItem;
49195630 private MenuItem sortbynameItem;
49205631
....@@ -4935,10 +5646,11 @@
49355646 private MenuItem coneItem;
49365647 private MenuItem torusItem;
49375648 private MenuItem superItem;
5649
+ private MenuItem kleinItem;
49385650 private MenuItem blobItem;
49395651 private MenuItem latheItem;
49405652 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5653
+ private MenuItem overlayItem;
49425654 private MenuItem meshItem;
49435655 // private MenuItem meshGroupItem;
49445656 private MenuItem springItem;
....@@ -4947,6 +5659,7 @@
49475659 private MenuItem csgItem;
49485660 private MenuItem templateItem;
49495661 private MenuItem textureItem;
5662
+ private MenuItem billboardItem;
49505663 private MenuItem shadowXItem;
49515664 private MenuItem shadowYItem;
49525665 private MenuItem shadowZItem;
....@@ -4959,11 +5672,6 @@
49595672 private MenuItem doubleItem;
49605673 private MenuItem tripleItem;
49615674
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675675 private MenuItem computeAOItem;
49685676 private MenuItem recompileItem;
49695677 private MenuItem editScriptItem;
....@@ -4973,4 +5681,8 @@
49735681 private MenuItem analyzeItem;
49745682 private MenuItem dumpItem;
49755683 //boolean freezemodel = false;
5684
+
5685
+ Menu cameraMenu;
5686
+ MenuItem editCameraItem;
5687
+ MenuItem restoreCameraItem;
49765688 }