Normand Briere
2019-06-29 a69bb4474a3264a9a7a7f8b8d8154ea771f167c8
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("Show Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
191237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
192289 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
290
+ if (Globals.ADVANCED)
291
+ {
197292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198293 revertMeshItem.addActionListener(this);
199294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200295 resetreferencesItem.addActionListener(this);
201296 menu.add("-");
297
+ }
202298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203299 overwriteGeoItem.addActionListener(this);
204300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +306,103 @@
210306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211307 overwriteUVItem.addActionListener(this);
212308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
213311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214312 generateMeshItem.addActionListener(this);
215313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216314 poseMeshItem.addActionListener(this);
217315 menu.add("-");
316
+ }
218317 resetsupportItem = menu.add(new MenuItem("Reset support"));
219318 resetsupportItem.addActionListener(this);
220319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221320 linkverticesItem.addActionListener(this);
222321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
224326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225327 setMasterItem.addActionListener(this);
328
+ }
226329
227330 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
230333 backItem = menu.add(new MenuItem("Back"));
231334 backItem.addActionListener(this);
232335 frontItem = menu.add(new MenuItem("Front"));
233336 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237343 hideItem.addActionListener(this);
344
+ }
238345 ungroupItem = menu.add(new MenuItem("Ungroup"));
239346 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
247354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248355 switchGeoItem.addActionListener(this);
249356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250357 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
252359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
253366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254367 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
368
+ }
257369
258370 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
261373 billboardItem = menu.add(new MenuItem("Billboard"));
262374 billboardItem.addActionListener(this);
263375 csgItem = menu.add(new MenuItem("CSG"));
264376 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266378 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268380 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
271386 linkerItem = menu.add(new MenuItem("Linker"));
272387 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275388 attributeItem = menu.add(new MenuItem("Attribute"));
276389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
277392 pointflowItem = menu.add(new MenuItem("Point Flow"));
278393 pointflowItem.addActionListener(this);
394
+ }
279395 menu.add("-");
280396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281397 resetTransformItem.addActionListener(this);
282398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283399 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
286406
287407 oe.menuBar.add(menu = new Menu("Geometry"));
288408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +413,11 @@
293413 genNormalsCADItem.addActionListener(this);
294414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
296418 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297419 genNormalsMINEItem.addActionListener(this);
420
+ }
298421 stripifyItem = menu.add(new MenuItem("Stripify"));
299422 stripifyItem.addActionListener(this);
300423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +439,34 @@
316439 reduce34MeshItem.addActionListener(this);
317440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318441 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
323450
324451 oe.menuBar.add(menu = new Menu("Attributes"));
325452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326453 clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
327458 menu.add("-");
328459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329460 liveleavesItem.addActionListener(this);
330461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
332465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333466 supportleavesItem.addActionListener(this);
334467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335468 unsupportleavesItem.addActionListener(this);
469
+ }
336470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337471 hideleavesItem.addActionListener(this);
338472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +475,14 @@
341475 markleavesItem.addActionListener(this);
342476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
344486 menu.add("-");
345487 flipVItem = menu.add(new MenuItem("Flip V"));
346488 flipVItem.addActionListener(this);
....@@ -376,35 +518,40 @@
376518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377519 sortbynameItem.addActionListener(this);
378520 menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
379528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380529 extractGeometriesItem.addActionListener(this);
381530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382531 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
532
+ }
387533
388534 oe.menuBar.add(menu = new Menu("Insert"));
389535 buildCreateMenu(menu);
390536
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402537 oe.menuBar.add(menu = new Menu("Tools"));
403538 buildToolsMenu(menu);
404539 }
405540
406541 void SetupUI2(ObjEditor oe)
407542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
408555 //new Exception().printStackTrace();
409556
410557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,150 +580,214 @@
433580 oe.radioPanel.add(dummyButton);
434581 oe.buttonGroup.add(dummyButton);
435582 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 1;
439586
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588
+
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+ undoButton.setEnabled(false);
609
+
610
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ redoButton.setToolTipText("Redo changes");
612
+ redoButton.addActionListener(this);
613
+ redoButton.setEnabled(false);
614
+
615
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ saveButton.setToolTipText("Save changes");
617
+ saveButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
620
+ liveCB.setToolTipText("Enable animation");
441621 liveCB.addItemListener(this);
442622
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
623
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ oneStepButton.setToolTipText("Animate one step forward");
625
+ oneStepButton.addActionListener(this);
626
+
627
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
628
+ fastCB.setToolTipText("Fast mode");
461629 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
503
- trackCB.addItemListener(this);
504
-
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
630
+
631
+ //oe.toolboxPanel.Return();
632
+
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ screenfitButton.setToolTipText("Screen fit");
507635 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
636
+
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
640
+
509641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510642 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515643
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522
- flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ snapobjectButton.addActionListener(this);
648
+ snapobjectButton.setToolTipText("Snap Object");
649
+ }
650
+
651
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
526652
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ twoButton.setToolTipText("Show center view only");
529655 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
656
+ this.fullscreenLayout = twoButton;
657
+
658
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531659 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
660
+ fourButton.setToolTipText("Show left panel only");
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ sixButton.setToolTipText("2-column layout left");
533663 sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ threeButton.setToolTipText("2-column layout right");
535666 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
+ sevenButton.setToolTipText("3-column layout");
537669 sevenButton.addActionListener(this);
538670 //
539671
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
672
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ rootButton.setToolTipText("Edit selection in new tab");
541674 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
675
+
676
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
+ closeButton.setToolTipText("Close tab");
544678 closeButton.addActionListener(this);
545679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546680 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548
-
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
551
- editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555681
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
682
+ // INSERT
683
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ gridButton.setToolTipText("Create grid");
685
+ gridButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ boxButton.setToolTipText("Create box");
689
+ boxButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
692
+ sphereButton.setToolTipText("Create sphere");
693
+ sphereButton.addActionListener(this);
694
+
695
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ coneButton.setToolTipText("Create cone");
697
+ coneButton.addActionListener(this);
698
+
699
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ torusButton.setToolTipText("Create torus");
701
+ torusButton.addActionListener(this);
702
+
703
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+ superButton.setToolTipText("Create superellipsoid");
705
+ superButton.addActionListener(this);
706
+
707
+ if (Globals.ADVANCED)
708
+ {
709
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
710
+ kleinButton.setToolTipText("Create Klein bottle");
711
+ kleinButton.addActionListener(this);
712
+ }
713
+
714
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ particlesButton.setToolTipText("Create particle system");
716
+ particlesButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.Return();
719
+
720
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ groupButton.setToolTipText("Create group");
722
+ groupButton.addActionListener(this);
723
+
724
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ compositeButton.setToolTipText("Create composite");
726
+ compositeButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ switchButton.setToolTipText("Create item switcher");
730
+ switchButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ loopButton.setToolTipText("Create loop");
734
+ loopButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ textureButton.setToolTipText("Create texture");
738
+ textureButton.addActionListener(this);
739
+
740
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ overlayButton.setToolTipText("Create overlay");
742
+ overlayButton.addActionListener(this);
743
+
744
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ lightButton.setToolTipText("Create light");
746
+ lightButton.addActionListener(this);
747
+
748
+ for (int i=6; --i>=0;)
749
+ {
750
+ oe.toolboxPanel.Return();
751
+ oe.toolboxPanel.add(new cGridBag());
752
+ oe.toolboxPanel.add(new cGridBag());
753
+ oe.toolboxPanel.add(new cGridBag());
754
+ oe.toolboxPanel.add(new cGridBag());
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ }
759
+
760
+ // EDIT panel
761
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Pin selection controls");
763
+ editButton.addActionListener(this);
764
+
765
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Remove selection controls");
557767 uneditButton.addActionListener(this);
558768
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
769
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
+ allParamsButton.setToolTipText("Show all controle");
571771 allParamsButton.addActionListener(this);
572772
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
773
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
774
+ clearPanelButton.setToolTipText("Clear edit panel");
775
+ clearPanelButton.addActionListener(this);
776
+
777
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
778
+ unselectButton.setToolTipText("Unselect");
578779 unselectButton.addActionListener(this);
579780
781
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ flashSelectionButton.setToolTipText("Highlight selection");
783
+ flashSelectionButton.addActionListener(this);
784
+
785
+ editCommandsPanel.preferredHeight = 1;
786
+
787
+ SetPinStates(false);
788
+// oe.treePanel.add(commandsPanel);
789
+// oe.treePanel.Return();
790
+
580791 // oe.aConstraints.gridx += 1;
581792 // oe.aConstraints.weighty = 0;
582793 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +799,22 @@
588799 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589800 // gcButton.addActionListener(this);
590801
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
802
+ cGridBag jSPPanel = new cGridBag();
803
+
804
+ JScrollPane jSP;
602805 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
806
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
604807 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
609
-
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
614
- colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
617
- materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
620
- textureCB.addItemListener(this);
621
-
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
624808
809
+ oe.treePanel.add(jSPPanel);
810
+ oe.treePanel.Return();
811
+
812
+ oe.treePanel.add(copyOptionsPanel);
813
+ oe.treePanel.Return();
814
+
815
+// mainPanel.setDividerLocation(0.5); //1.0);
816
+// mainPanel.setResizeWeight(0.5);
817
+
625818 //jList.addListSelectionListener(this);
626819 oe.jTree.addTreeSelectionListener(this);
627820 //jTree.setRootVisible(false);
....@@ -643,20 +836,157 @@
643836 radio.layout = sevenButton;
644837 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645838 }
839
+
840
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
841
+ {
842
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
843
+ colorCB.setToolTipText("Copy color when dropped");
844
+ colorCB.addItemListener(this);
845
+
846
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
847
+ materialCB.setToolTipText("Copy material when dropped");
848
+ materialCB.addItemListener(this);
849
+
850
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
851
+ textureCB.setToolTipText("Copy texture when dropped");
852
+ textureCB.addItemListener(this);
853
+
854
+ panel.Return();
855
+
856
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
857
+ boxCB.setToolTipText("Display bounding boxes");
858
+ boxCB.addItemListener(this);
859
+
860
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
861
+ zoomBoxCB.setToolTipText("Display only for wheel");
862
+ zoomBoxCB.addItemListener(this);
863
+
864
+ if (true) // Globals.ADVANCED)
865
+ {
866
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
867
+// supportCB.setToolTipText("Enable rigging");
868
+// supportCB.addItemListener(this);
869
+
870
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
871
+ freezeCB.setToolTipText("Fast moving camera");
872
+ freezeCB.addItemListener(this);
873
+
874
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
875
+ // localCB.addItemListener(this);
876
+
877
+ panel.Return();
878
+
879
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
880
+ crowdCB.setToolTipText("Used for crowds");
881
+ crowdCB.addItemListener(this);
882
+
883
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
884
+ smoothCB.setToolTipText("Snapping delay");
885
+ smoothCB.addItemListener(this);
886
+
887
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
888
+ slowCB.setToolTipText("Smooth interpolation");
889
+ slowCB.addItemListener(this);
890
+
891
+// constraints.gridy += 1;
892
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
893
+// speakerMocapCB.addItemListener(this);
894
+
895
+ panel.Return();
896
+
897
+ if (false)
898
+ {
899
+ // handled in scripts
900
+ //constraints.gridy += 1;
901
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
902
+ speakerCameraCB.addItemListener(this);
903
+
904
+ //constraints.gridy += 1;
905
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
906
+ speakerFocusCB.addItemListener(this);
907
+
908
+ //constraints.gridy += 1;
909
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
910
+ smoothfocusCB.addItemListener(this);
911
+ panel.Return();
912
+ }
913
+
914
+//constraints.gridx += 1;
915
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
916
+// debugCB.addItemListener(this);
917
+
918
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
919
+ trackCB.setToolTipText("Enable tracking target");
920
+ trackCB.addItemListener(this);
921
+
922
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
923
+ oeilCB.setToolTipText("Move camera when tracking");
924
+ oeilCB.addItemListener(this);
925
+
926
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
927
+ shadowCB.setToolTipText("When live compute shadows");
928
+ shadowCB.addItemListener(this);
929
+
930
+ panel.Return();
931
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
932
+ toggleTextureCB.setToolTipText("Load textures");
933
+ toggleTextureCB.addItemListener(this);
934
+
935
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
936
+ toggleSwitchCB.setToolTipText("Choose a single item");
937
+ toggleSwitchCB.addItemListener(this);
938
+
939
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
940
+ autosaveCB.setToolTipText("On structure change");
941
+ autosaveCB.addItemListener(this);
942
+
943
+ panel.Return();
944
+ if (Globals.ADVANCED)
945
+ {
946
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
947
+ lookAtCB.setToolTipText("Look-at target");
948
+ lookAtCB.addItemListener(this);
949
+ }
950
+
951
+ }
952
+
953
+ cGridBag fill = new cGridBag();
954
+ fill.preferredHeight = 200;
955
+ cGridBag fill2 = new cGridBag();
956
+ fill2.preferredHeight = 200;
957
+ cGridBag fill3 = new cGridBag();
958
+ fill3.preferredHeight = 200;
959
+
960
+ panel.add(fill);
961
+ panel.add(fill2);
962
+ panel.add(fill3);
963
+
964
+ }
646965
647966 void EditObject(Object3D obj)
648967 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
968
+ cRadio radioButton = new cRadio(obj.name);
969
+
970
+ // Patch to avoid bug with transparency.
971
+ radioButton.hadMaterial = obj.material != null;
972
+ if (!radioButton.hadMaterial)
973
+ {
974
+ obj.material = new cMaterial();
975
+ }
976
+
977
+ radioButton.SetObject(obj);
978
+ radioButton.layout = sevenButton;
979
+ radioButton.SetCamera(cameraView.renderCamera, false);
980
+ radioButton.addActionListener(this);
981
+ radioPanel.add(radioButton);
982
+ buttonGroup.add(radioButton);
983
+ radioButton.doClick();
657984 }
985
+
658986 void SetupViews(ObjEditor oe)
659987 {
988
+ theFrame = this;
989
+
660990 oe.SetupViews();
661991
662992 System.out.println("SetupViews");
....@@ -665,22 +995,28 @@
665995 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
666996 }
667997
668
- JCheckBox liveCB;
669
- JCheckBox supportCB;
670
- JCheckBox localCB;
671
- JCheckBox crowdCB;
672
- JCheckBox smoothCB;
673
- JCheckBox fastCB;
674
- JCheckBox slowCB;
675
- JCheckBox boxCB;
676
- JCheckBox trackCB;
677
- JCheckBox smoothfocusCB;
998
+ cToggleButton liveCB;
999
+ cCheckBox supportCB;
1000
+ cCheckBox localCB;
1001
+ cCheckBox crowdCB;
1002
+ cCheckBox smoothCB;
1003
+ cToggleButton fastCB;
1004
+ cCheckBox slowCB;
1005
+ cCheckBox boxCB;
1006
+ cCheckBox zoomBoxCB;
1007
+ cCheckBox freezeCB;
1008
+ //cToggleButton trackCB;
1009
+ cCheckBox trackCB;
1010
+ cCheckBox smoothfocusCB;
6781011 // JCheckBox speakerMocapCB;
679
- JCheckBox speakerCameraCB;
680
- JCheckBox speakerFocusCB;
681
- JCheckBox debugCB;
682
- JCheckBox oeilCB;
683
- JCheckBox lookAtCB;
1012
+ cCheckBox speakerCameraCB;
1013
+ cCheckBox speakerFocusCB;
1014
+ cCheckBox debugCB;
1015
+
1016
+ cCheckBox oeilCB;
1017
+ cCheckBox shadowCB;
1018
+ cCheckBox autosaveCB;
1019
+ cCheckBox lookAtCB;
6841020
6851021 // static int COLOR = 1;
6861022 // static int MATERIAL = 2;
....@@ -688,9 +1024,9 @@
6881024
6891025 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6901026
691
- JCheckBox colorCB;
692
- JCheckBox materialCB;
693
- JCheckBox textureCB;
1027
+ cCheckBox colorCB;
1028
+ cCheckBox materialCB;
1029
+ cCheckBox textureCB;
6941030
6951031 public void itemStateChanged(ItemEvent e)
6961032 {
....@@ -715,10 +1051,10 @@
7151051 dropAttributes |= Object3D.TEXTURE;
7161052 else
7171053 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
1054
+ } else if(e.getSource() == liveCB)
7201055 {
7211056 cameraView.ToggleLive();
1057
+ refreshContents(false);
7221058 }
7231059 else if(e.getSource() == supportCB)
7241060 {
....@@ -754,6 +1090,10 @@
7541090 cameraView.repaint();
7551091 // refreshContents();
7561092 }
1093
+ else if(e.getSource() == zoomBoxCB)
1094
+ {
1095
+ cameraView.ToggleZoomBoxMode();
1096
+ }
7571097 else if(e.getSource() == smoothfocusCB)
7581098 {
7591099 cameraView.ToggleSmoothFocus();
....@@ -779,6 +1119,18 @@
7791119 {
7801120 cameraView.ToggleOeil();
7811121 }
1122
+ else if(e.getSource() == shadowCB)
1123
+ {
1124
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1125
+ }
1126
+ else if(e.getSource() == freezeCB)
1127
+ {
1128
+ Globals.FREEZEONMOVE ^= true;
1129
+ }
1130
+ else if(e.getSource() == autosaveCB)
1131
+ {
1132
+ Globals.SAVEONMAKE ^= true;
1133
+ }
7821134 else if(e.getSource() == lookAtCB)
7831135 {
7841136 cameraView.ToggleLookAt();
....@@ -795,7 +1147,8 @@
7951147
7961148 /**/
7971149 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
798
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1150
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1151
+ TreePath path = objEditor.jTree.getSelectionPath();
7991152 if ((path == null) || (path.getPathCount() <= 1)) {
8001153 // We can't move the root node or an empty selection
8011154 return;
....@@ -867,7 +1220,9 @@
8671220 // objEditor.DropFile((java.io.File[]) object, true);
8681221 // return;
8691222 // }
870
- if (string.charAt(0) == '/')
1223
+
1224
+ // File path for Mac and Windows
1225
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711226 {
8721227 // file(s)
8731228 String[] names = string.split("\n");
....@@ -894,7 +1249,7 @@
8941249
8951250 flashIt = false;
8961251 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1252
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981253 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991254
9001255 if (group.selection.size() == 1)
....@@ -910,23 +1265,33 @@
9101265
9111266 assert target == objEditor.jTree;
9121267 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1268
+ Object3D destinationLeaf;
9131269 try {
914
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1270
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9151271 } catch (Exception e) {
9161272 System.out.println("destinationPath : " + destinationPath);
9171273 return;
9181274 }
9191275
920
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1276
+ for (int i=group.selection.size(); --i>=0;)
9211277 {
1278
+ Object3D child = (Object3D)group.selection.elementAt(i);
1279
+
1280
+ // Cannot move into itself
1281
+ if (child == destinationLeaf)
1282
+ return;
1283
+ }
1284
+
1285
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1286
+// {
9221287 loadClipboard(true);
9231288 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
925
- } else {
926
- loadClipboard(false);
927
- objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
929
- }
1289
+ pasteInto(false, false);
1290
+// } else {
1291
+// loadClipboard(false);
1292
+// objEditor.jTree.setSelectionPath(destinationPath);
1293
+// pasteInto(false, false); // true); // ???
1294
+// }
9301295 }
9311296 public void dropActionChanged(DropTargetDragEvent dtde)
9321297 // Called if the user has modified the current drop gesture
....@@ -1031,85 +1396,104 @@
10311396 {
10321397 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10331398 //heightFieldItem.addActionListener(this);
1034
- gridItem = menu.add(new MenuItem("Grid"));
1035
- gridItem.addActionListener(this);
1036
- rectoidItem = menu.add(new MenuItem("Box"));
1037
- rectoidItem.addActionListener(this);
1038
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1039
- ellipsoidItem.addActionListener(this);
1040
- coneItem = menu.add(new MenuItem("Cone"));
1041
- coneItem.addActionListener(this);
1042
- torusItem = menu.add(new MenuItem("Torus"));
1043
- torusItem.addActionListener(this);
1044
- superItem = menu.add(new MenuItem("Superellipsoid"));
1045
- superItem.addActionListener(this);
1399
+// gridItem = menu.add(new MenuItem("Grid"));
1400
+// gridItem.addActionListener(this);
1401
+// rectoidItem = menu.add(new MenuItem("Box"));
1402
+// rectoidItem.addActionListener(this);
1403
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1404
+// ellipsoidItem.addActionListener(this);
1405
+// coneItem = menu.add(new MenuItem("Cone"));
1406
+// coneItem.addActionListener(this);
1407
+// torusItem = menu.add(new MenuItem("Torus"));
1408
+// torusItem.addActionListener(this);
1409
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1410
+// superItem.addActionListener(this);
1411
+
1412
+ cameraItem = menu.add(new MenuItem("Camera"));
1413
+ cameraItem.addActionListener(this);
1414
+
1415
+ if (!Globals.ADVANCED)
1416
+ {
10461417 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10471418 kleinItem.addActionListener(this);
1048
- particleItem = menu.add(new MenuItem("Particle system"));
1049
- particleItem.addActionListener(this);
1419
+ }
1420
+
1421
+// particleItem = menu.add(new MenuItem("Particle system"));
1422
+// particleItem.addActionListener(this);
1423
+ if (Globals.ADVANCED)
1424
+ {
10501425 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511426 ragdollItem.addActionListener(this);
10521427 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531428 ragdoll2Item.addActionListener(this);
1429
+ }
10541430 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1431
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561432 meshItem.addActionListener(this);
10571433 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581434 // meshGroupItem.addActionListener(this);
1435
+ if (Globals.ADVANCED)
1436
+ {
10591437 springItem = menu.add(new MenuItem("Spring"));
10601438 springItem.addActionListener(this);
10611439 flagItem = menu.add(new MenuItem("Flag"));
10621440 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671441 blobItem = menu.add(new MenuItem("Blob"));
10681442 blobItem.addActionListener(this);
10691443 latheItem = menu.add(new MenuItem("Lathe"));
10701444 latheItem.addActionListener(this);
1071
- lightItem = menu.add(new MenuItem("Light"));
1072
- lightItem.addActionListener(this);
1445
+ }
1446
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1447
+ bezierItem.addActionListener(this);
1448
+// overlayItem = menu.add(new MenuItem("Overlay"));
1449
+// overlayItem.addActionListener(this);
1450
+// lightItem = menu.add(new MenuItem("Light"));
1451
+// lightItem.addActionListener(this);
10731452 menu.add("-");
10741453 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10751454 //superLoopItem.addActionListener(this);
1076
- loopItem = menu.add(new MenuItem("Loop"));
1077
- loopItem.addActionListener(this);
1455
+// loopItem = menu.add(new MenuItem("Loop"));
1456
+// loopItem.addActionListener(this);
10781457 doubleItem = menu.add(new MenuItem("Fork"));
10791458 doubleItem.addActionListener(this);
1459
+ if (Globals.ADVANCED)
1460
+ {
10801461 tripleItem = menu.add(new MenuItem("Trident"));
10811462 tripleItem.addActionListener(this);
1463
+ }
10821464 }
10831465
10841466 void buildToolsMenu(Menu menu)
10851467 {
10861468 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871469 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1470
+ animationItem.setState(Globals.ANIMATION);
10891471
10901472 menu.add("-");
10911473 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921474 parseverticesItem.addActionListener(this);
10931475 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941476 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1477
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961478 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991479 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001480 reduceMorphItem.addActionListener(this);
11011481 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021482 reduce34MorphItem.addActionListener(this);
1103
-
1483
+ menu.add("-");
11041484 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051485 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071486
1487
+ if (Globals.ADVANCED)
1488
+ {
1489
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1490
+ mirrorItem.addActionListener(this);
1491
+ menu.add("-");
11081492 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091493 memoryItem.addActionListener(this);
11101494 menu.add(analyzeItem = new MenuItem("Analyze"));
11111495 analyzeItem.addActionListener(this);
1112
- menu.add(dumpItem = new MenuItem("Dump"));
1496
+ menu.add(dumpItem = new MenuItem("Print"));
11131497 dumpItem.addActionListener(this);
11141498 // menu.add(pathItem = new MenuItem("From-to path"));
11151499 // pathItem.addActionListener(this);
....@@ -1118,6 +1502,8 @@
11181502 resetParentItem.addActionListener(this);
11191503 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201504 repairParentItem.addActionListener(this);
1505
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1506
+ repairShadowItem.addActionListener(this);
11211507 menu.add(invariantsItem = new MenuItem("Invariants"));
11221508 invariantsItem.addActionListener(this);
11231509 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1511,7 @@
11251511 menu.add("-");
11261512 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271513 editScriptItem.addActionListener(this);
1514
+ }
11281515 }
11291516
11301517 void ScreenFit()
....@@ -1247,9 +1634,24 @@
12471634 shadow.material = new cMaterial(obj.material);
12481635 shadow.material.diffuse = 0.0001f;
12491636 shadow.material.specular = 0.0001f;
1637
+ //shadow.projectedVertices[1].x = 300;
12501638
12511639 makeSomething(shadow);
12521640 }
1641
+
1642
+ private void ClearUnpinned()
1643
+ {
1644
+ //for (Object3D obj : listUI)
1645
+ for (int i=listUI.size(); --i>=0;)
1646
+ {
1647
+ Object3D obj = listUI.elementAt(i);
1648
+ if (!obj.pinned)
1649
+ {
1650
+ obj.CloseUI();
1651
+ listUI.remove(i);
1652
+ }
1653
+ }
1654
+ }
12531655
12541656 /**
12551657 * applyExample
....@@ -1453,9 +1855,9 @@
14531855
14541856 void Overwrite(int mask)
14551857 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1858
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571859 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1860
+ Object3D content = Grafreed.clipboard.get(0);
14591861
14601862 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611863 content = ((cGroup)content).get(0);
....@@ -1478,6 +1880,7 @@
14781880 //
14791881 public void actionPerformed(ActionEvent event) // , Object arg)
14801882 {
1883
+ Object source = event.getSource();
14811884 /*
14821885 if (event.getSource() == nameField)
14831886 {
....@@ -1489,11 +1892,11 @@
14891892 }
14901893 else
14911894 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1895
+ if (source == lookAtItem || source == lookFromItem)
14931896 {
14941897 ScreenFit();
14951898 } else
1496
- if (event.getSource() == switchItem)
1899
+ if (source == switchViewItem)
14971900 {
14981901 cVector v1 = new cVector();
14991902 cVector v2 = new cVector();
....@@ -1502,11 +1905,11 @@
15021905 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031906 objEditor.cameraView.repaint();
15041907 } else
1505
- if (event.getSource() == rectoidItem)
1908
+ if (source == rectoidItem || source == boxButton)
15061909 {
15071910 makeSomething(new Box());
15081911 } else
1509
- if (event.getSource() == particleItem)
1912
+ if (source == particleItem || source == particlesButton)
15101913 {
15111914 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121915 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1930,9 @@
15271930 applyExample(particleGeom, "SMOKE");
15281931 makeSomething(particleGeom);
15291932 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1933
+ if (source == ragdollItem || source == ragdoll2Item)
15311934 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1935
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331936
15341937 ragdoll.toParent = LA.newMatrix();
15351938 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1950,7 @@
15471950 } else
15481951 /*
15491952 */
1550
- if (event.getSource() == heightFieldItem)
1953
+ if (source == heightFieldItem)
15511954 {
15521955 Object3D obj = new Object3D();
15531956
....@@ -1585,31 +1988,31 @@
15851988
15861989 makeSomething(obj);
15871990 } else
1588
- if (event.getSource() == gridItem)
1991
+ if (source == gridItem || source == gridButton)
15891992 {
15901993 makeSomething(new Grid());
15911994 } else
1592
- if (event.getSource() == ellipsoidItem)
1995
+ if (source == ellipsoidItem || source == sphereButton)
15931996 {
15941997 makeSomething(new Sphere());
15951998 } else
1596
- if (event.getSource() == coneItem)
1999
+ if (source == coneItem || source == coneButton)
15972000 {
15982001 makeSomething(new Cone());
15992002 } else
1600
- if (event.getSource() == torusItem)
2003
+ if (source == torusItem || source == torusButton)
16012004 {
16022005 makeSomething(new Torus());
16032006 } else
1604
- if (event.getSource() == superItem)
2007
+ if (source == superItem || source == superButton)
16052008 {
16062009 makeSomething(new Superellipsoid());
16072010 } else
1608
- if (event.getSource() == kleinItem)
2011
+ if (source == kleinItem || source == kleinButton)
16092012 {
16102013 makeSomething(new Klein());
16112014 } else
1612
- if (event.getSource() == blobItem)
2015
+ if (source == blobItem)
16132016 {
16142017 Blob blob = new Blob();
16152018 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +2020,15 @@
16172020 //blob.retile();
16182021 makeSomething(blob);
16192022 } else
1620
- if (event.getSource() == latheItem)
2023
+ if (source == latheItem)
16212024 {
16222025 makeSomething(new Lathe());
16232026 } else
1624
- if (event.getSource() == bezierItem)
2027
+ if (source == bezierItem)
16252028 {
16262029 makeSomething(new BezierSurface());
16272030 } else
1628
- if (event.getSource() == checkerItem)
2031
+ if (source == overlayItem || source == overlayButton)
16292032 {
16302033 /*
16312034 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +2043,7 @@
16402043 */
16412044 makeSomething(new Checker());
16422045 } else
1643
- if (event.getSource() == meshItem)
2046
+ if (source == meshItem)
16442047 {
16452048 Object3D itemtomake = new Object3D();
16462049 Object3D child;
....@@ -1661,35 +2064,35 @@
16612064 makeSomething(child);
16622065 }
16632066 } else
1664
- if (event.getSource() == springItem)
2067
+ if (source == springItem)
16652068 {
16662069 cSpring s = new cSpring();
16672070 s.setup();
16682071 makeSomething(s);
16692072 } else
1670
- if (event.getSource() == flagItem)
2073
+ if (source == flagItem)
16712074 {
16722075 cSpring s = new cFlag();
16732076 s.setup();
16742077 makeSomething(s);
16752078 } else
1676
- if (event.getSource() == lightItem)
2079
+ if (source == lightItem || source == lightButton)
16772080 {
16782081 makeSomething(new Light());
16792082 } else
1680
- if (event.getSource() == csgItem)
2083
+ if (source == csgItem)
16812084 {
16822085 group(new CSG());
16832086 } else
1684
- if (event.getSource() == templateItem)
2087
+ if (source == templateItem)
16852088 {
16862089 group(new cTemplate());
16872090 } else
1688
- if (event.getSource() == attributeItem)
2091
+ if (source == attributeItem)
16892092 {
16902093 makeSomething(new Attribute());
16912094 } else
1692
- if (event.getSource() == pointflowItem)
2095
+ if (source == pointflowItem)
16932096 {
16942097 makeSomething(new PointFlow());
16952098 } else
....@@ -1701,7 +2104,7 @@
17012104 } else
17022105 */
17032106
1704
- if (event.getSource() == superLoopItem)
2107
+ if (source == superLoopItem)
17052108 {
17062109 Composite g = new cGroup();
17072110 for (int i=0; i<15; i++)
....@@ -1723,30 +2126,30 @@
17232126
17242127 group(g);
17252128 } else
1726
- if (event.getSource() == loopItem)
2129
+ if (source == loopItem || source == loopButton)
17272130 {
17282131 Composite csg = new GroupLeaf();
17292132 csg.count = 5;
17302133 group(csg);
1731
- Composite child = new cGroup();
2134
+ Composite child = new cGroup("Branch");
17322135 csg.addChild(child);
17332136 child.addChild(csg);
17342137 } else
1735
- if (event.getSource() == doubleItem)
2138
+ if (source == doubleItem)
17362139 {
1737
- Composite csg = new GroupLeaf();
2140
+ Composite csg = new GroupLeaf("Fork");
17382141 csg.count = 5;
17392142 group(csg);
1740
- Composite child = new cGroup();
2143
+ Composite child = new cGroup("Branch A");
17412144 csg.addChild(child);
17422145 child.addChild(csg);
1743
- child = new cGroup();
2146
+ child = new cGroup("Branch B");
17442147 csg.addChild(child);
17452148 child.addChild(csg);
17462149 } else
1747
- if (event.getSource() == tripleItem)
2150
+ if (source == tripleItem)
17482151 {
1749
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Trident");
17502153 csg.count = 4;
17512154 group(csg);
17522155 Composite child = new cGroup();
....@@ -1759,71 +2162,83 @@
17592162 csg.addChild(child);
17602163 child.addChild(csg);
17612164 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
2165
+ if (source == computeAOItem)
17642166 {
1765
- ImportGFD();
2167
+ Globals.drawMode = CameraPane.OCCLUSION;
2168
+ Globals.theRenderer.repaint();
17662169 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
2170
+ if (source == recompileItem)
17852171 {
17862172 Recompile();
17872173 refreshContents();
17882174 } else
1789
- if (event.getSource() == editScriptItem)
2175
+ if (source == editScriptItem)
17902176 {
17912177 OpenDialog();
17922178 refreshContents();
17932179 } else
1794
- if (event.getSource() == invariantsItem)
2180
+ if (source == invariantsItem)
17952181 {
17962182 System.out.println("Invariants:");
1797
- GrafreeD.grafreeD.universe.invariants();
2183
+ Grafreed.grafreeD.universe.invariants();
17982184 } else
1799
- if (event.getSource() == memoryItem)
2185
+ if (source == memoryItem)
18002186 {
18012187 //System.out.println("Invariants:");
18022188 PrintMemory();
18032189 } else
1804
- if (event.getSource() == pathItem)
2190
+ if (source == pathItem)
18052191 {
18062192 PrintPath();
18072193 } else
1808
- if (event.getSource() == analyzeItem)
2194
+ if (source == analyzeItem)
18092195 {
18102196 AnalyzeObject();
18112197 } else
1812
- if (event.getSource() == dumpItem)
2198
+ if (source == dumpItem)
18132199 {
18142200 DumpObject();
18152201 } else
1816
- if (event.getSource() == screenfitButton)
2202
+ if (source == minButton)
2203
+ {
2204
+ Minimize();
2205
+ } else
2206
+ if (source == maxButton)
2207
+ {
2208
+ Maximize();
2209
+ } else
2210
+ if (source == fullButton)
2211
+ {
2212
+ ToggleFullScreen();
2213
+ } else
2214
+ if (source == undoButton)
2215
+ {
2216
+ Undo();
2217
+ } else
2218
+ if (source == redoButton)
2219
+ {
2220
+ Redo();
2221
+ } else
2222
+ if (source == saveButton)
2223
+ {
2224
+ Save();
2225
+ } else
2226
+ if (source == oneStepButton)
2227
+ {
2228
+ Globals.ONESTEP = true;
2229
+ cameraView.repaint();
2230
+ } else
2231
+ if (source == screenfitButton)
18172232 {
18182233 //Reload(lastConverter, lastFilename, true);
18192234 ScreenFit();
18202235 } else
1821
- if (event.getSource() == screenfitpointButton)
2236
+ if (source == screenfitpointButton)
18222237 {
18232238 //Reload(lastConverter, lastFilename, true);
18242239 ScreenFitPoint();
18252240 } else
1826
- if (event.getSource() == snapobjectButton)
2241
+ if (source == snapobjectButton)
18272242 {
18282243 //Reload(lastConverter, lastFilename, true);
18292244 SnapObject();
....@@ -1834,13 +2249,13 @@
18342249 // Recompile();
18352250 // refreshContents();
18362251 // } else
1837
- if (event.getSource() == gcButton)
2252
+ if (source == gcButton)
18382253 {
18392254 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402255 System.gc();
18412256 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422257 } else
1843
- if (event.getSource() == editLeafItem)
2258
+ if (source == editLeafItem)
18442259 {
18452260 Object3D obj;
18462261 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2269,74 @@
18542269 }
18552270 refreshContents(true);
18562271 } else
1857
- if (event.getSource() == openWindowItem)
2272
+ if (source == openWindowItem)
18582273 {
18592274 EditSelection(true);
18602275 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2276
+ if (source == cutItem || source == clearButton)
18622277 {
18632278 loadClipboard(true);
18642279 } else
1865
- if (event.getSource() == duplicateItem)
2280
+ if (source == undoItem)
18662281 {
1867
- Object3D keep = GrafreeD.clipboard;
2282
+ Undo();
2283
+ } else
2284
+ if (source == redoItem)
2285
+ {
2286
+ Redo();
2287
+ } else
2288
+ if (source == duplicateItem)
2289
+ {
2290
+ Object3D keep = Grafreed.clipboard;
18682291 loadClipboard(false);
18692292 paste(false);
1870
- GrafreeD.clipboard = keep;
2293
+ Grafreed.clipboard = keep;
18712294 } else
1872
- if (event.getSource() == cloneItem)
2295
+ if (source == cloneItem)
18732296 {
18742297 CloneSelection(false);
18752298 } else
1876
- if (event.getSource() == cloneSupportItem)
2299
+ if (source == cloneSupportItem)
18772300 {
18782301 CloneSelection(true);
18792302 } else
1880
- if (event.getSource() == copyItem)
2303
+ if (source == copyItem)
18812304 {
18822305 loadClipboard(false);
18832306 } else
1884
- if (event.getSource() == pasteItem)
2307
+ if (source == pasteItem)
18852308 {
18862309 paste(false);
18872310 } else
1888
- if (event.getSource() == pasteLinkItem)
2311
+ if (source == pasteIntoItem)
18892312 {
1890
- pasteInto(false);
2313
+ pasteInto(true, false);
18912314 } else
1892
- if (event.getSource() == pasteCloneItem)
2315
+ if (source == pasteLinkItem)
18932316 {
1894
- pasteInto(true);
2317
+ pasteInto(false, false);
18952318 } else
1896
- if (event.getSource() == pasteExpandItem)
2319
+ if (source == pasteCloneItem)
2320
+ {
2321
+ pasteInto(true, true);
2322
+ } else
2323
+ if (source == pasteExpandItem)
18972324 {
18982325 paste(true);
18992326 } else
1900
- if (event.getSource() == synchronizeItem)
2327
+ if (source == synchronizeItem)
19012328 {
19022329 Overwrite(Object3D.TRANSFORM);
19032330 } else
1904
- if (event.getSource() == overwriteNameItem)
2331
+ if (source == overwriteNameItem)
19052332 {
19062333 Overwrite(Object3D.NAME);
19072334 } else
1908
- if (event.getSource() == overwriteUVItem)
2335
+ if (source == overwriteUVItem)
19092336 {
19102337 Overwrite(Object3D.UV);
19112338 } else
1912
- if (event.getSource() == overwriteMatItem)
2339
+ if (source == overwriteMatItem)
19132340 {
19142341 /* july 2015
19152342 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2356,7 @@
19292356
19302357 Overwrite(dropAttributes);
19312358 }
1932
- if (event.getSource() == overwriteGeoItem)
2359
+ if (source == overwriteGeoItem)
19332360 {
19342361 Overwrite(Object3D.GEOMETRY);
19352362 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2373,7 @@
19462373 // refreshContents();
19472374 // }
19482375 } else
1949
- if (event.getSource() == generateMeshItem)
2376
+ if (source == generateMeshItem)
19502377 {
19512378 //if (group.selection.size() == 1)
19522379 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2384,7 @@
19572384 ResetModel();
19582385 refreshContents();
19592386 } else
1960
- if (event.getSource() == extractGeometriesItem)
2387
+ if (source == extractGeometriesItem)
19612388 {
19622389 boolean one = false;
19632390
....@@ -1984,7 +2411,7 @@
19842411 ResetModel();
19852412 refreshContents();
19862413 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2414
+ if (source == cloneGeometriesItem)
19882415 {
19892416 boolean one = false;
19902417
....@@ -2010,7 +2437,7 @@
20102437 ResetModel();
20112438 refreshContents();
20122439 } else
2013
- if (event.getSource() == shareGeometriesItem)
2440
+ if (source == shareGeometriesItem)
20142441 {
20152442 boolean one = false;
20162443
....@@ -2040,7 +2467,7 @@
20402467 refreshContents();
20412468 }
20422469 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2470
+ if (source == mergeGeometriesItem)
20442471 {
20452472 boolean one = false;
20462473
....@@ -2070,7 +2497,7 @@
20702497 ResetModel();
20712498 refreshContents();
20722499 } else
2073
- if (event.getSource() == linkverticesItem)
2500
+ if (source == linkverticesItem)
20742501 {
20752502 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762503 // {
....@@ -2083,48 +2510,48 @@
20832510 // group.selection.get(0).setMasterThis(content); // should be identity
20842511 // refreshContents();
20852512 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2513
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872514 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2515
+ Object3D content = Grafreed.clipboard.get(0);
20892516
20902517 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912518 content = ((cGroup)content).get(0);
20922519
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2520
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942521 for (int i=0; i<group.selection.size(); i++)
20952522 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
20982525 group.selection.get(i).linkVerticesThis(content);
20992526 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2527
+ CameraPane.SWITCH = random;
21012528 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2529
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032530 refreshContents();
21042531 }
21052532 } else
2106
- if (event.getSource() == resetsupportItem)
2533
+ if (source == resetsupportItem)
21072534 {
21082535 for (int i=0; i<group.selection.size(); i++)
21092536 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2537
+ boolean random = CameraPane.SWITCH;
2538
+ CameraPane.SWITCH = false; // parse all random nodes
21122539 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2540
+ CameraPane.SWITCH = random;
21142541 }
21152542
21162543 refreshContents();
21172544 } else
2118
- if (event.getSource() == relinkverticesItem)
2545
+ if (source == relinkverticesItem)
21192546 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2547
+ boolean random = CameraPane.SWITCH;
2548
+ CameraPane.SWITCH = false; // parse all random nodes
21222549 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2550
+ CameraPane.SWITCH = random;
21242551
21252552 refreshContents();
21262553 } else
2127
- if (event.getSource() == resetreferencesItem)
2554
+ if (source == resetreferencesItem)
21282555 {
21292556 for (int i=0; i<group.selection.size(); i++)
21302557 {
....@@ -2133,11 +2560,11 @@
21332560
21342561 refreshContents();
21352562 } else
2136
- if (event.getSource() == setMasterItem)
2563
+ if (source == setMasterItem)
21372564 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2565
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392566 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2567
+ Object3D content = Grafreed.clipboard.get(0);
21412568
21422569 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432570 content = ((cGroup)content).get(0);
....@@ -2146,13 +2573,13 @@
21462573 refreshContents();
21472574 }
21482575 } else
2149
- if (event.getSource() == poseMeshItem)
2576
+ if (source == poseMeshItem)
21502577 {
21512578 if (group.selection.size() == 1)
21522579 {
2153
- if (GrafreeD.clipboard.size() == 1)
2580
+ if (Grafreed.clipboard.size() == 1)
21542581 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2582
+ Object3D content = Grafreed.clipboard.get(0);
21562583
21572584 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582585 content = ((cGroup)content).get(0);
....@@ -2165,19 +2592,19 @@
21652592 }
21662593
21672594 } else
2168
- if (event.getSource() == revertMeshItem)
2595
+ if (source == revertMeshItem)
21692596 {
21702597 RevertMeshes();
21712598 } else
2172
- if (event.getSource() == resetMeshItem)
2599
+ if (source == resetAllItem)
21732600 {
21742601 ResetAll();
21752602 } else
2176
- if (event.getSource() == stepAllItem)
2603
+ if (source == stepAllItem)
21772604 {
21782605 StepAll();
21792606 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2607
+ if (source == clearItem) // || event.getSource() == clearButton)
21812608 {
21822609 //int indices[] = jList.getSelectedIndices();
21832610 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2612,46 @@
21852612
21862613 ClearSelection(false);
21872614 } else
2188
- if (event.getSource() == clearAllItem)
2615
+ if (source == clearAllItem)
21892616 {
21902617 ClearSelection(true);
21912618 } else
2192
- if (event.getSource() == grabItem)
2619
+ if (source == grabItem || source == groupButton)
21932620 {
2194
- group(new cGroup(), true);
2621
+ group(new cGroup(), false); // true);
21952622 } else
2196
- if (event.getSource() == hideItem)
2623
+ if (source == hideItem)
21972624 {
21982625 group(new HiddenObject());
21992626 } else
2200
- if (event.getSource() == frontItem)
2627
+ if (source == frontItem)
22012628 {
22022629 front();
22032630 } else
2204
- if (event.getSource() == backItem)
2631
+ if (source == backItem)
22052632 {
22062633 back();
22072634 } else
2208
- if (event.getSource() == cameraItem)
2635
+ if (source == cameraItem)
22092636 {
22102637 makeSomething(new Camera());
22112638 } else
2212
- if (event.getSource() == compositeItem)
2639
+ if (source == compositeItem || source == compositeButton)
22132640 {
22142641 group(new Composite());
22152642 } else
2216
- if (event.getSource() == randomItem)
2643
+ if (source == switchItem || source == switchButton)
22172644 {
22182645 RandomNode random = new RandomNode();
22192646 group(random);
22202647 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2648
+ random.name = random.get(0).name + "Switch";
22222649 } else
2223
- if (event.getSource() == physicsItem)
2650
+ if (source == physicsItem)
22242651 {
22252652 group(new PhysicsNode());
22262653 } else
2227
- if (event.getSource() == frameselectorItem)
2654
+ if (source == frameselectorItem)
22282655 {
22292656 for (int i=0; i<group.selection.size(); i++)
22302657 {
....@@ -2236,7 +2663,7 @@
22362663 ResetModel();
22372664 refreshContents();
22382665 } else
2239
- if (event.getSource() == switchGeoItem)
2666
+ if (source == switchGeoItem)
22402667 {
22412668 for (int i=0; i<group.selection.size(); i++)
22422669 {
....@@ -2248,7 +2675,7 @@
22482675 ResetModel();
22492676 refreshContents();
22502677 } else
2251
- if (event.getSource() == switchTransfoItem)
2678
+ if (source == switchTransfoItem)
22522679 {
22532680 for (int i=0; i<group.selection.size(); i++)
22542681 {
....@@ -2260,7 +2687,7 @@
22602687 ResetModel();
22612688 refreshContents();
22622689 } else
2263
- if (event.getSource() == morphItem)
2690
+ if (source == morphItem)
22642691 {
22652692 for (int i=0; i<group.selection.size(); i++)
22662693 {
....@@ -2272,7 +2699,7 @@
22722699 ResetModel();
22732700 refreshContents();
22742701 } else
2275
- if (event.getSource() == scriptNodeItem)
2702
+ if (source == scriptNodeItem)
22762703 {
22772704 boolean atleastone = false;
22782705
....@@ -2311,215 +2738,252 @@
23112738 }
23122739 }
23132740 } else
2314
- if (event.getSource() == linkerItem)
2741
+ if (source == linkerItem)
23152742 {
23162743 group(new cLinker());
23172744 } else
2318
- if (event.getSource() == textureItem)
2745
+ if (source == textureItem || source == textureButton)
23192746 {
23202747 group(new TextureNode());
23212748 } else
2322
- if (event.getSource() == billboardItem)
2749
+ if (source == billboardItem)
23232750 {
23242751 group(new BillboardNode());
23252752 } else
2326
- if (event.getSource() == shadowXItem)
2753
+ if (source == shadowXItem)
23272754 {
23282755 CastShadow(0);
23292756 } else
2330
- if (event.getSource() == shadowYItem)
2757
+ if (source == shadowYItem)
23312758 {
23322759 CastShadow(1);
23332760 } else
2334
- if (event.getSource() == shadowZItem)
2761
+ if (source == shadowZItem)
23352762 {
23362763 CastShadow(2);
23372764 } else
2338
- if (event.getSource() == ungroupItem)
2765
+ if (source == ungroupItem || source == ungroupButton)
23392766 {
2340
- //ungroup();
2767
+ boolean hasRoot = false;
2768
+
23412769 for (int i=0; i<group.selection.size(); i++)
23422770 {
2343
- Ungroup(group.selection.get(i));
2771
+ if (group.selection.get(i) == group)
2772
+ {
2773
+ hasRoot = true;
2774
+ break;
2775
+ }
23442776 }
23452777
2346
- ClearSelection(false);
2347
-
2348
- refreshContents();
2778
+ if (!hasRoot)
2779
+ {
2780
+ for (int i=0; i<group.selection.size(); i++)
2781
+ {
2782
+ Ungroup(group.selection.get(i));
2783
+ }
2784
+
2785
+ ClearSelection(false);
2786
+
2787
+ refreshContents();
2788
+ }
23492789 } else
2350
- if (event.getSource() == genUVItem)
2790
+ if (source == genUVItem)
23512791 {
23522792 GenUV();
23532793 } else
2354
- if (event.getSource() == genNormalsCADItem)
2794
+ if (source == genNormalsCADItem)
23552795 {
23562796 GenNormals(true);
23572797 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2798
+ if (source == genNormalsMESHItem)
23592799 {
2360
- GenNormals(true); // TODO
2800
+ GenNormalsMESH();
23612801 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2802
+ if (source == genNormalsORGANItem)
23632803 {
23642804 GenNormals(false);
23652805 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2806
+ if (source == genNormalsMINEItem)
23672807 {
23682808 GenNormalsMINE();
23692809 } else
2370
- if (event.getSource() == stripifyItem)
2810
+ if (source == stripifyItem)
23712811 {
23722812 Stripify();
23732813 } else
2374
- if (event.getSource() == unstripifyItem)
2814
+ if (source == unstripifyItem)
23752815 {
23762816 Unstripify();
23772817 } else
2378
- if (event.getSource() == trimItem)
2818
+ if (source == trimItem)
23792819 {
23802820 Trim();
23812821 } else
2382
- if (event.getSource() == untrimItem)
2822
+ if (source == untrimItem)
23832823 {
23842824 Untrim();
23852825 } else
2386
- if (event.getSource() == clearColorsItem)
2826
+ if (source == clearColorsItem)
23872827 {
23882828 ClearColors();
23892829 } else
2390
- if (event.getSource() == clearMaterialsItem)
2830
+ if (source == clearMaterialsItem)
23912831 {
23922832 ClearMaterials();
23932833 } else
2394
- if (event.getSource() == liveleavesItem)
2834
+ if (source == liveleavesItem)
23952835 {
23962836 LiveLeaves(true);
23972837 } else
2398
- if (event.getSource() == unliveleavesItem)
2838
+ if (source == unliveleavesItem)
23992839 {
24002840 LiveLeaves(false);
24012841 } else
2402
- if (event.getSource() == supportleavesItem)
2842
+ if (source == supportleavesItem)
24032843 {
24042844 SupportLeaves(true);
24052845 } else
2406
- if (event.getSource() == unsupportleavesItem)
2846
+ if (source == unsupportleavesItem)
24072847 {
24082848 SupportLeaves(false);
24092849 } else
2410
- if (event.getSource() == hideleavesItem)
2850
+ if (source == hideleavesItem)
24112851 {
24122852 HideLeaves(true);
24132853 } else
2414
- if (event.getSource() == showleavesItem)
2854
+ if (source == showleavesItem)
24152855 {
24162856 HideLeaves(false);
24172857 } else
2418
- if (event.getSource() == markleavesItem)
2858
+ if (source == markleavesItem)
24192859 {
24202860 MarkLeaves(true);
24212861 } else
2422
- if (event.getSource() == unmarkleavesItem)
2862
+ if (source == unmarkleavesItem)
24232863 {
24242864 MarkLeaves(false);
24252865 } else
2426
- if (event.getSource() == flipVItem)
2866
+ if (source == rewindleavesItem)
2867
+ {
2868
+ RewindLeaves(true);
2869
+ } else
2870
+ if (source == unrewindleavesItem)
2871
+ {
2872
+ RewindLeaves(false);
2873
+ } else
2874
+ if (source == randomleavesItem)
2875
+ {
2876
+ RandomLeaves(true);
2877
+ } else
2878
+ if (source == unrandomleavesItem)
2879
+ {
2880
+ RandomLeaves(false);
2881
+ } else
2882
+ if (source == flipVItem)
24272883 {
24282884 FlipV(true);
24292885 } else
2430
- if (event.getSource() == unflipVItem)
2886
+ if (source == unflipVItem)
24312887 {
24322888 FlipV(false);
24332889 } else
2434
- if (event.getSource() == lowTexturesItem)
2890
+ if (source == lowTexturesItem)
24352891 {
24362892 SetTexRes(0);
24372893 } else
2438
- if (event.getSource() == normalTexturesItem)
2894
+ if (source == normalTexturesItem)
24392895 {
24402896 SetTexRes(1);
24412897 } else
2442
- if (event.getSource() == highTexturesItem)
2898
+ if (source == highTexturesItem)
24432899 {
24442900 SetTexRes(2);
24452901 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2902
+ if (source == veryhighTexturesItem)
24472903 {
24482904 SetTexRes(3);
24492905 } else
2450
- if (event.getSource() == maxTexturesItem)
2906
+ if (source == maxTexturesItem)
24512907 {
24522908 SetTexRes(4);
24532909 } else
2454
- if (event.getSource() == panoTexturesItem)
2910
+ if (source == panoTexturesItem)
24552911 {
24562912 SetTexRes(5);
24572913 } else
2458
- if (event.getSource() == reverseNormalsItem)
2914
+ if (source == reverseNormalsItem)
24592915 {
24602916 ReverseNormals();
24612917 } else
2462
- if (event.getSource() == parseverticesItem)
2918
+ if (source == parseverticesItem)
24632919 {
24642920 ParseVertices();
24652921 } else
2466
- if (event.getSource() == textureFieldItem)
2922
+ if (source == textureFieldItem)
24672923 {
24682924 TextureVertices();
24692925 } else
2470
- if (event.getSource() == alignItem)
2926
+ if (source == alignItem)
24712927 {
24722928 Align();
24732929 } else
2474
- if (event.getSource() == mirrorItem)
2930
+ if (source == mirrorItem)
24752931 {
24762932 MirrorPoses();
24772933 } else
2478
- if (event.getSource() == reduceMorphItem)
2934
+ if (source == reduceMorphItem)
24792935 {
24802936 MeshReduction(false);
24812937 } else
2482
- if (event.getSource() == reduce34MorphItem)
2938
+ if (source == reduce34MorphItem)
24832939 {
24842940 MeshReduction(true);
24852941 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2942
+ if (source == reverseTrianglesItem)
24872943 {
24882944 ReverseTriangles();
24892945 } else
2490
- if (event.getSource() == reduceMeshItem)
2946
+ if (source == reduceMeshItem)
24912947 {
24922948 ReduceMesh(false);
24932949 } else
2494
- if (event.getSource() == reduce34MeshItem)
2950
+ if (source == reduce34MeshItem)
24952951 {
24962952 ReduceMesh(true);
24972953 } else
2498
- if (event.getSource() == increaseMeshItem)
2954
+ if (source == increaseMeshItem)
24992955 {
25002956 IncreaseMesh();
25012957 } else
2502
- if (event.getSource() == clipMeshItem)
2958
+ if (source == clipMeshItem)
25032959 {
25042960 ClipMesh();
25052961 } else
2506
- if (event.getSource() == smoothMeshItem)
2962
+ if (source == smoothMeshItem)
25072963 {
25082964 SmoothMesh();
25092965 } else
2510
- if (event.getSource() == transformgeometryItem)
2966
+ if (source == transformGeometryItem)
25112967 {
25122968 TransformGeometry();
25132969 } else
2514
- if (event.getSource() == resetTransformItem)
2970
+ if (source == transformChildrenItem)
2971
+ {
2972
+ TransformChildren();
2973
+ } else
2974
+ if (source == resetTransformItem)
25152975 {
25162976 ResetTransform();
25172977 } else
2518
- if (event.getSource() == resetCentroidItem)
2978
+ if (source == resetCentroidItem)
25192979 {
2520
- ResetCentroid();
2980
+ ResetCentroid(true);
25212981 } else
2522
- if (event.getSource() == resetParentItem)
2982
+ if (source == resetCentroidXZItem)
2983
+ {
2984
+ ResetCentroid(false);
2985
+ } else
2986
+ if (source == resetParentItem)
25232987 {
25242988 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252989 {
....@@ -2529,7 +2993,7 @@
25292993
25302994 refreshContents();
25312995 } else
2532
- if (event.getSource() == repairParentItem)
2996
+ if (source == repairParentItem)
25332997 {
25342998 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352999 {
....@@ -2543,7 +3007,21 @@
25433007
25443008 refreshContents();
25453009 } else
2546
- if (event.getSource() == sortbysizeItem)
3010
+ if (source == repairShadowItem)
3011
+ {
3012
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3013
+ {
3014
+ Object3D obj = (Object3D)e.nextElement();
3015
+ obj.RepairShadow();
3016
+// for (int i=0; i<obj.size(); i++)
3017
+// {
3018
+// obj.get(i).parent = obj;
3019
+// }
3020
+ }
3021
+
3022
+ refreshContents();
3023
+ } else
3024
+ if (source == sortbysizeItem)
25473025 {
25483026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25493027 {
....@@ -2555,7 +3033,7 @@
25553033 ResetModel();
25563034 refreshContents();
25573035 } else
2558
- if (event.getSource() == sortbynameItem)
3036
+ if (source == sortbynameItem)
25593037 {
25603038 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25613039 {
....@@ -2567,7 +3045,7 @@
25673045 ResetModel();
25683046 refreshContents();
25693047 } else
2570
- if (event.getSource() == attachPigmentItem)
3048
+ if (source == attachPigmentItem)
25713049 {
25723050 String texture = GetFile("Attach pigment");
25733051 Object3D obj;
....@@ -2579,7 +3057,7 @@
25793057
25803058 refreshContents();
25813059 } else
2582
- if (event.getSource() == detachPigmentItem)
3060
+ if (source == detachPigmentItem)
25833061 {
25843062 Object3D obj;
25853063 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +3068,7 @@
25903068
25913069 refreshContents();
25923070 } else
2593
- if (event.getSource() == attachBumpItem)
3071
+ if (source == attachBumpItem)
25943072 {
25953073 String texture = GetFile("Attach bump");
25963074 Object3D obj;
....@@ -2602,7 +3080,7 @@
26023080
26033081 refreshContents();
26043082 } else
2605
- if (event.getSource() == detachBumpItem)
3083
+ if (source == detachBumpItem)
26063084 {
26073085 Object3D obj;
26083086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +3091,7 @@
26133091
26143092 refreshContents();
26153093 } else
2616
- if (event.getSource() == pigmentBumpItem)
3094
+ if (source == pigmentBumpItem)
26173095 {
26183096 Object3D obj;
26193097 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +3102,237 @@
26243102
26253103 refreshContents();
26263104 } else
2627
- if (event.getSource() == flashSelectionButton)
3105
+ if (source == flashSelectionButton)
26283106 {
26293107 CameraPane.flash = true;
26303108 refreshContents();
26313109 } else
2632
- if (event.getSource() == oneButton)
3110
+ if (source == oneButton)
26333111 {
26343112 } else
2635
- if (event.getSource() == twoButton)
3113
+ if (source == twoButton)
26363114 {
26373115 radio.layout = twoButton;
3116
+
3117
+ if (CameraPane.FULLSCREEN)
3118
+ fullscreenLayout = radio.layout;
3119
+
26383120 // bug
26393121 //gridPanel.setDividerLocation(1.0);
26403122 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
3123
+// bigThree.remove(scenePanel);
3124
+// bigThree.remove(centralPanel);
3125
+// bigThree.remove(XYZPanel);
3126
+// aWindowConstraints.gridx = 0;
3127
+// aWindowConstraints.gridy = 0;
3128
+// aWindowConstraints.gridwidth = 1;
3129
+// // aConstraints.gridheight = 3;
3130
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3131
+// aWindowConstraints.weightx = 0;
3132
+// aWindowConstraints.weighty = 1;
3133
+// //bigThree.add(jtp, aWindowConstraints);
3134
+// aWindowConstraints.weightx = 1;
3135
+// aWindowConstraints.gridwidth = 3;
3136
+// // aConstraints.gridheight = 3;
3137
+// aWindowConstraints.gridx = 1;
3138
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3139
+// bigThree.add(centralPanel, aWindowConstraints);
3140
+// aWindowConstraints.weightx = 0;
3141
+// aWindowConstraints.gridx = 4;
3142
+// aWindowConstraints.gridwidth = 1;
3143
+// // aConstraints.gridheight = 3;
3144
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3145
+// //bigThree.add(XYZPanel, aWindowConstraints);
3146
+// scenePanel.setVisible(false);
3147
+// centralPanel.setVisible(true);
3148
+// XYZPanel.setVisible(false);
3149
+ bigThree.ClearUI();
3150
+ bigThree.add(centralPanel);
3151
+ bigThree.FlushUI();
3152
+
3153
+ cameraView.requestFocusInWindow();
3154
+
3155
+// refreshContents(true);
3156
+//
3157
+// try
3158
+// {
3159
+// java.awt.Robot bot = new java.awt.Robot();
3160
+// int mask = InputEvent.BUTTON1_MASK;
3161
+// bot.mouseMove(100, 100);
3162
+// bot.mousePress(mask);
3163
+// bot.mouseRelease(mask);
3164
+// }
3165
+// catch (Exception e)
3166
+// {
3167
+//
3168
+// }
3169
+
26653170 } else
2666
- if (event.getSource() == threeButton)
3171
+ if (source == threeButton)
26673172 {
26683173 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
3174
+
3175
+ if (CameraPane.FULLSCREEN)
3176
+ fullscreenLayout = radio.layout;
3177
+
3178
+// bigThree.remove(scenePanel);
3179
+// bigThree.remove(centralPanel);
3180
+// bigThree.remove(XYZPanel);
3181
+// aWindowConstraints.gridx = 0;
3182
+// aWindowConstraints.gridy = 0;
3183
+// aWindowConstraints.gridwidth = 1;
3184
+// // aConstraints.gridheight = 3;
3185
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3186
+// aWindowConstraints.weightx = 0;
3187
+// aWindowConstraints.weighty = 1;
3188
+// //bigThree.add(jtp, aWindowConstraints);
3189
+// aWindowConstraints.weightx = 1;
3190
+// aWindowConstraints.gridwidth = 3;
3191
+// // aConstraints.gridheight = 3;
3192
+// aWindowConstraints.gridx = 1;
3193
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3194
+// bigThree.add(centralPanel, aWindowConstraints);
3195
+// aWindowConstraints.weightx = 0;
3196
+// aWindowConstraints.gridx = 4;
3197
+// aWindowConstraints.gridwidth = 1;
3198
+// // aConstraints.gridheight = 3;
3199
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3200
+// bigThree.add(XYZPanel, aWindowConstraints);
3201
+// bigThree.validate();
3202
+// scenePanel.setVisible(false);
3203
+// centralPanel.setVisible(true);
3204
+// XYZPanel.setVisible(true);
3205
+ bigThree.ClearUI();
3206
+ bigThree.add(centralPanel);
3207
+ bigThree.add(XYZPanel);
3208
+ bigThree.FlushUI();
3209
+
3210
+ cameraView.requestFocusInWindow();
26933211 } else
2694
- if (event.getSource() == fourButton)
3212
+ if (source == fourButton)
26953213 {
26963214 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
3215
+
3216
+ if (CameraPane.FULLSCREEN)
3217
+ fullscreenLayout = radio.layout;
3218
+
3219
+// bigThree.remove(scenePanel);
3220
+// bigThree.remove(centralPanel);
3221
+// bigThree.remove(XYZPanel);
3222
+// aWindowConstraints.gridx = 0;
3223
+// aWindowConstraints.gridy = 0;
3224
+// aWindowConstraints.gridwidth = 1;
3225
+// // aWindowConstraints.gridheight = 3;
3226
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3227
+// aWindowConstraints.weightx = 1;
3228
+// aWindowConstraints.weighty = 1;
3229
+// bigThree.add(scenePanel, aWindowConstraints);
3230
+// aWindowConstraints.weightx = 1;
3231
+// aWindowConstraints.gridwidth = 3;
3232
+// // aConstraints.gridheight = 3;
3233
+// aWindowConstraints.gridx = 1;
3234
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3235
+// //bigThree.add(cameraPanel, aWindowConstraints);
3236
+// aWindowConstraints.weightx = 0;
3237
+// aWindowConstraints.gridx = 4;
3238
+// aWindowConstraints.gridwidth = 1;
3239
+// // aWindowConstraints.gridheight = 3;
3240
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3241
+// //bigThree.add(XYZPanel, aWindowConstraints);
3242
+// bigThree.validate();
3243
+// scenePanel.setVisible(true);
3244
+// centralPanel.setVisible(false);
3245
+// XYZPanel.setVisible(false);
3246
+ bigThree.ClearUI();
3247
+ bigThree.add(scenePanel);
3248
+ bigThree.FlushUI();
3249
+
3250
+ cameraView.requestFocusInWindow();
27213251 } else
2722
- if (event.getSource() == sixButton)
3252
+ if (source == sixButton)
27233253 {
27243254 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
3255
+
3256
+ if (CameraPane.FULLSCREEN)
3257
+ fullscreenLayout = radio.layout;
3258
+
3259
+// bigThree.remove(scenePanel);
3260
+// bigThree.remove(centralPanel);
3261
+// bigThree.remove(XYZPanel);
3262
+// aWindowConstraints.gridx = 0;
3263
+// aWindowConstraints.gridy = 0;
3264
+// aWindowConstraints.gridwidth = 1;
3265
+// // aConstraints.gridheight = 3;
3266
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3267
+// aWindowConstraints.weightx = 0;
3268
+// aWindowConstraints.weighty = 1;
3269
+// bigThree.add(scenePanel, aWindowConstraints);
3270
+// aWindowConstraints.weightx = 1;
3271
+// aWindowConstraints.gridwidth = 3;
3272
+// // aWindowConstraints.gridheight = 3;
3273
+// aWindowConstraints.gridx = 1;
3274
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3275
+// bigThree.add(centralPanel, aWindowConstraints);
3276
+// aWindowConstraints.weightx = 0;
3277
+// aWindowConstraints.gridx = 4;
3278
+// aWindowConstraints.gridwidth = 1;
3279
+// // aWindowConstraints.gridheight = 3;
3280
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3281
+// //bigThree.add(XYZPanel, aConstraints);
3282
+// bigThree.validate();
3283
+// scenePanel.setVisible(true);
3284
+// centralPanel.setVisible(true);
3285
+// XYZPanel.setVisible(false);
3286
+ bigThree.ClearUI();
3287
+ bigThree.add(scenePanel);
3288
+ bigThree.add(centralPanel);
3289
+ bigThree.FlushUI();
3290
+
3291
+ cameraView.requestFocusInWindow();
27493292 } else
2750
- if (event.getSource() == sevenButton)
3293
+ if (source == sevenButton)
27513294 {
27523295 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
3296
+
3297
+ if (CameraPane.FULLSCREEN)
3298
+ fullscreenLayout = radio.layout;
3299
+
3300
+// bigThree.remove(scenePanel);
3301
+// bigThree.remove(centralPanel);
3302
+// bigThree.remove(XYZPanel);
3303
+// aWindowConstraints.gridx = 0;
3304
+// aWindowConstraints.gridy = 0;
3305
+// aWindowConstraints.gridwidth = 1;
3306
+// // aWindowConstraints.gridheight = 3;
3307
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3308
+// aWindowConstraints.weightx = 0;
3309
+// aWindowConstraints.weighty = 1;
3310
+// bigThree.add(scenePanel, aWindowConstraints);
3311
+// aWindowConstraints.weightx = 1;
3312
+// aWindowConstraints.gridwidth = 3;
3313
+// // aWindowConstraints.gridheight = 3;
3314
+// aWindowConstraints.gridx = 1;
3315
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3316
+// bigThree.add(centralPanel, aWindowConstraints);
3317
+// aWindowConstraints.weightx = 0;
3318
+// aWindowConstraints.gridx = 4;
3319
+// aWindowConstraints.gridwidth = 1;
3320
+// // aConstraints.gridheight = 3;
3321
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3322
+// bigThree.add(XYZPanel, aWindowConstraints);
3323
+// bigThree.validate();
3324
+// scenePanel.setVisible(true);
3325
+// centralPanel.setVisible(true);
3326
+// XYZPanel.setVisible(true);
3327
+ bigThree.ClearUI();
3328
+ bigThree.add(scenePanel);
3329
+ bigThree.add(centralPanel);
3330
+ bigThree.add(XYZPanel);
3331
+ bigThree.FlushUI();
3332
+
3333
+ cameraView.requestFocusInWindow();
27773334 } else
2778
- if (event.getSource() == rootButton)
3335
+ if (source == rootButton)
27793336 {
27803337 Object3D obj;
27813338 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2785,66 +3342,84 @@
27853342 EditObject(obj);
27863343 }
27873344
3345
+ cameraView.requestFocusInWindow();
27883346 refreshContents(true);
27893347 } else
2790
- if (event.getSource() == closeButton)
3348
+ if (source == closeButton)
27913349 {
27923350 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933351 cRadio ab;
27943352 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27953353 {
27963354 ab = (cRadio)e.nextElement();
2797
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3355
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27983356 {
3357
+ // Patch to avoid bug with transparency.
3358
+ if (!ab.hadMaterial)
3359
+ {
3360
+ ab.object.material = null;
3361
+ }
3362
+
27993363 buttonGroup.remove(ab);
28003364 radioPanel.remove(ab);
28013365
2802
- ab.GetObject().editWindow = null;
3366
+ //ab.GetObject().editWindow = null;
3367
+ ab.GetObject().manipWindow = null;
28033368 // ab.GetObject().objectUI = null; // ?????????
28043369
28053370 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28063371 break;
28073372 }
28083373 }
3374
+
3375
+ cameraView.requestFocusInWindow();
28093376 refreshContents(true);
28103377 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3378
+ if (source == editItem || source == editButton)
28123379 {
3380
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3381
+ {
3382
+ Object3D child = (Object3D)e.nextElement();
3383
+ child.pinned = true;
3384
+ }
3385
+
28133386 EditSelection(false);
28143387 } else
2815
- if (event.getSource() == uneditButton)
3388
+ if (source == uneditButton)
28163389 {
28173390 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183391 {
28193392 Object3D child = (Object3D)e.nextElement();
28203393 if(child.editWindow != null)
28213394 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3395
+ child.pinned = false;
28223396 child.CloseUI();
28233397 listUI.remove(child);
28243398
2825
- child.editWindow = null; // ???????????
3399
+ //child.editWindow = null; // ???????????
28263400 }
2827
- objEditor.ctrlPanel.revalidate();
3401
+ objEditor.ctrlPanel.FlushUI();
28283402 //objEditor.jTree.clearSelection();
28293403 //objEditor.ResetSliders();
28303404 refreshContents(true);
28313405 } else
2832
- if (event.getSource() == clearPanelButton)
3406
+ if (source == clearPanelButton)
28333407 {
28343408 assert(copy == group);
28353409 //copy.ClearUI();
28363410 for (Object3D obj : listUI)
28373411 {
3412
+ obj.pinned = false;
28383413 obj.CloseUI();
28393414 }
28403415 listUI.clear();
28413416 refreshContents(true);
28423417 } else
2843
- if (event.getSource() == allParamsButton)
3418
+ if (source == allParamsButton)
28443419 {
28453420 assert(copy == group);
28463421
2847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3422
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28483423
28493424 for (Object3D obj : listUI)
28503425 {
....@@ -2861,19 +3436,19 @@
28613436
28623437 refreshContents(true);
28633438 } else
2864
- if (event.getSource() == unselectButton)
3439
+ if (source == unselectButton)
28653440 {
28663441 objEditor.jTree.clearSelection();
28673442 // ?? oct 2012 GrafreeD.clipboard.clear();
28683443 objEditor.ResetSliders();
28693444 refreshContents(true);
28703445 } else
2871
- if(event.getSource() instanceof cRadio)
3446
+ if(source instanceof cRadio)
28723447 {
28733448 group.parent = keepparent;
28743449 group.attributes = 0;
28753450 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3451
+ /*cRadio*/ radio = (cRadio)source;
28773452 Object3D obj = radio.GetObject();
28783453 System.out.println("Edit " + obj);
28793454 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3468,7 @@
28933468 }
28943469
28953470 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3471
+ //Globals.theRenderer.object = group;
28973472 if(!useclient)
28983473 {
28993474 cameraView.renderCamera = radio.camera;
....@@ -2902,25 +3477,50 @@
29023477 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033478 cameraView.targetLookAt.set(radio.camera.lookAt);
29043479 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3480
+ //cameraView.lighttouched = true;
3481
+ Globals.lighttouched = true;
29063482 topView.object = group;
29073483 frontView.object = group;
29083484 sideView.object = group;
29093485 }
2910
- group.editWindow = this;
3486
+
3487
+// fix "+" issue
3488
+ //group.editWindow = this;
3489
+ group.manipWindow = this;
3490
+
29113491 /*
29123492 currentLayout = radio.layout;
29133493 if (currentLayout == null)
29143494 currentLayout = sevenButton;
29153495 */
29163496 radio.layout.doClick();
3497
+
3498
+ ClearUnpinned();
3499
+ SetPinStates(group.selection.size() > 0);
3500
+ if (group.selection.size() == 1)
3501
+ EditSelection(false);
29173502 keepparent = group.parent;
29183503 // PARENT = NULL or not???
29193504 //group.parent = null; // ROOT
29203505 //group.attributes = -1;
29213506 ResetModel();
3507
+
3508
+ cameraView.requestFocusInWindow();
29223509 refreshContents(true);
2923
- }
3510
+ } else if (event.getSource() == editCameraItem)
3511
+ {
3512
+ cameraView.ProtectCamera();
3513
+ cameraView.repaint();
3514
+ return;
3515
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3516
+ {
3517
+ cameraView.RevertCamera();
3518
+ cameraView.repaint();
3519
+ return;
3520
+ // } else if (event.getSource() == textureButton)
3521
+ // {
3522
+ // return; // true;
3523
+ }
29243524 else
29253525 {
29263526 //return super.action(event, arg);
....@@ -2929,7 +3529,6 @@
29293529 }
29303530
29313531 boolean useclient = false;
2932
- cRadio radio;
29333532
29343533 void ToggleRoot()
29353534 {
....@@ -2938,7 +3537,7 @@
29383537 if (useclient)
29393538 {
29403539 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3540
+ Globals.lighttouched = true;
29423541 //topView.object = client;
29433542 //frontView.object = client;
29443543 //sideView.object = client;
....@@ -2946,7 +3545,7 @@
29463545 else
29473546 {
29483547 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3548
+ Globals.lighttouched = true;
29503549 //topView.object = group;
29513550 //frontView.object = group;
29523551 //sideView.object = group;
....@@ -2981,6 +3580,28 @@
29813580 refreshContents();
29823581 }
29833582
3583
+ void TransformChildren()
3584
+ {
3585
+ Object3D obj;
3586
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3587
+ {
3588
+ obj = (Object3D)e.nextElement();
3589
+ obj.KeepTextureMatrices();
3590
+ obj.TransformChildren();
3591
+ obj.RestoreTextureMatrices();
3592
+
3593
+// if (obj.parent == null)
3594
+// {
3595
+// System.out.println("NULL PARENT!");
3596
+// new Exception().printStackTrace();
3597
+// }
3598
+// else
3599
+// TouchTransform(obj);
3600
+// //obj.parent.Touch();
3601
+ }
3602
+
3603
+ refreshContents();
3604
+ }
29843605
29853606 void ResetTransform()
29863607 {
....@@ -3093,7 +3714,7 @@
30933714 refreshContents();
30943715 }
30953716
3096
- void ResetCentroid()
3717
+ void ResetCentroid(boolean full)
30973718 {
30983719 Object3D obj;
30993720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3729,16 @@
31083729 LA.matIdentity(Object3D.mat);
31093730 obj.getBounds(minima, maxima, false);
31103731 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3732
+ if (full)
3733
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123734 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133735 obj.TransformMesh(Object3D.mat);
3736
+
31143737 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3738
+ if (full)
3739
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163740 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3741
+
31173742 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183743 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193744 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +3767,8 @@
31423767
31433768 int size = obj.MemorySize();
31443769
3145
- System.err.println((size/1024) + " KB is the size of " + obj);
3770
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3771
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31463772 }
31473773 }
31483774 catch (Exception e)
....@@ -3179,9 +3805,9 @@
31793805 obj = (Object3D)e.nextElement();
31803806
31813807 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3808
+ Grafreed.AnalyzeObject(obj);
31833809 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3810
+ Grafreed.AnalyzeObject(obj.bRep);
31853811
31863812 // System.err.println((size/1024) + " KB is the size of " + obj);
31873813 }
....@@ -3223,6 +3849,13 @@
32233849 void GenNormals(boolean crease)
32243850 {
32253851 group.GenNormalsS(crease);
3852
+
3853
+ refreshContents();
3854
+ }
3855
+
3856
+ void GenNormalsMESH()
3857
+ {
3858
+ group.GenNormalsMeshS();
32263859
32273860 refreshContents();
32283861 }
....@@ -3395,8 +4028,8 @@
33954028
33964029 void ParseVertices()
33974030 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
4031
+ boolean epsequal = Grafreed.epsequal;
4032
+ Grafreed.epsequal = true;
34004033
34014034 for (int i=0; i<group.selection.size(); i++)
34024035 {
....@@ -3421,7 +4054,7 @@
34214054 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34224055 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34234056
3424
- g.add(GrafreeD.clipboard);
4057
+ g.add(Grafreed.clipboard);
34254058
34264059 buffer.add(g);
34274060 }
....@@ -3436,7 +4069,7 @@
34364069 makeSomething(buffer, i==group.selection.size()-1);
34374070 }
34384071
3439
- GrafreeD.epsequal = epsequal;
4072
+ Grafreed.epsequal = epsequal;
34404073
34414074 refreshContents();
34424075 }
....@@ -3454,7 +4087,16 @@
34544087 String pigment = Object3D.GetPigment(tex);
34554088 //String bump = Object3D.GetBump(tex);
34564089
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4090
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4091
+
4092
+ try
4093
+ {
4094
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4095
+ }
4096
+ catch (Exception e)
4097
+ {
4098
+ System.err.println("FAIL: " + node);
4099
+ }
34584100
34594101 double s = v.s;
34604102
....@@ -3542,11 +4184,11 @@
35424184
35434185 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35444186
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
4187
+ boolean random = CameraPane.SWITCH;
4188
+ CameraPane.SWITCH = false; // parse all random nodes
35474189 lowres.linkVerticesThis(null);
35484190 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
4191
+ CameraPane.SWITCH = random;
35504192
35514193 System.err.flush();
35524194
....@@ -3586,7 +4228,7 @@
35864228 return;
35874229
35884230 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
4231
+ Object3D ref = Grafreed.clipboard.get(0);
35904232
35914233 Object3D newgroup = new Object3D("Po:" + poses.name);
35924234
....@@ -3755,7 +4397,7 @@
37554397 group.selection.RelinkToSupport(); // july 2014
37564398 System.out.println("DONE.");
37574399 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4400
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37594401 }
37604402
37614403 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4422,9 @@
37804422
37814423 void ClipMesh()
37824424 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4425
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844426 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4427
+ Object3D content = Grafreed.clipboard.get(0);
37864428
37874429 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884430 content = ((cGroup)content).get(0);
....@@ -3791,7 +4433,7 @@
37914433 // {
37924434 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934435 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4436
+ group.selection.ClipMesh(Grafreed.clipboard);
37954437 }
37964438 // group.selection.ClipMesh(GrafreeD.clipboard);
37974439 System.out.println("DONE.");
....@@ -3838,6 +4480,18 @@
38384480 void MarkLeaves(boolean hide)
38394481 {
38404482 group.selection.MarkLeaves(hide);
4483
+ refreshContents();
4484
+ }
4485
+
4486
+ void RewindLeaves(boolean hide)
4487
+ {
4488
+ group.selection.RewindLeaves(hide);
4489
+ refreshContents();
4490
+ }
4491
+
4492
+ void RandomLeaves(boolean hide)
4493
+ {
4494
+ group.selection.RandomLeaves(hide);
38414495 refreshContents();
38424496 }
38434497
....@@ -3912,10 +4566,6 @@
39124566 // }
39134567 // }
39144568
3915
- static boolean allparams = true;
3916
-
3917
- static Vector<Object3D> listUI = new Vector<Object3D>();
3918
-
39194569 void EditSelection(boolean newWindow)
39204570 {
39214571 // aConstraints.gridy = 0;
....@@ -3923,10 +4573,10 @@
39234573 {
39244574 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39254575 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3926
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4576
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274577
39284578 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4579
+ if(elem != group || !newWindow)
39304580 {
39314581 // if (!(elem instanceof Composite))
39324582 // newWindow = false;
....@@ -4008,7 +4658,8 @@
40084658 //new Exception().printStackTrace();
40094659
40104660 freezemodel = true;
4011
-
4661
+ ClearUnpinned();
4662
+
40124663 /**/
40134664 //switch (event.id)
40144665 {
....@@ -4016,7 +4667,6 @@
40164667 //case 702: // Event.LIST_DESELECT
40174668 group.deselectAll();
40184669 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4019
- objEditor.ClearInfo(); // .GetMaterial());
40204670 if (tps != null)
40214671 {
40224672 for (int i=0; i < tps.length; i++)
....@@ -4025,33 +4675,39 @@
40254675
40264676 //if (child.parent != null)
40274677 //child.parent.addSelectee(child);
4678
+ objEditor.SetMaterial(child);
40284679 group.addSelectee(child);
4029
- objEditor.SetMaterial(child); // .GetMaterial());
4030
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4031
- System.err.println("info : " + child.GetPath());
40324680 }
40334681 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4682
+// else
4683
+// {
4684
+// objEditor.SetMaterial(group); // .GetMaterial());
4685
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4686
+// System.err.println("info : " + group.GetPath());
4687
+// }
40404688
4041
- objEditor.SetText(); // jan 2014
4042
-
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4689
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40444690 CameraPane.flash = true;
40454691
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4692
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474693 // a camera
40484694 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4695
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4696
+ {
4697
+ CameraPane.camerachangeframe = 0; // don't refuse it
4698
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4699
+ }
4700
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4701
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534702 }
40544703
4704
+ if (tps != null && tps.length == 1)
4705
+ {
4706
+ EditSelection(false);
4707
+ }
4708
+
4709
+ SetPinStates(tps != null && tps.length > 0);
4710
+
40554711 refreshContents();
40564712 //return true;
40574713 }
....@@ -4060,6 +4716,35 @@
40604716
40614717 freezemodel = false;
40624718 }
4719
+
4720
+ void SetPinStates(boolean enabled)
4721
+ {
4722
+ editButton.setEnabled(enabled);
4723
+ uneditButton.setEnabled(enabled);
4724
+ unselectButton.setEnabled(enabled);
4725
+ flashSelectionButton.setEnabled(enabled);
4726
+ }
4727
+
4728
+ void refreshContents(boolean cp)
4729
+ {
4730
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4731
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4732
+ {
4733
+ objEditor.ClearInfo(); // .GetMaterial());
4734
+
4735
+ for (int i=0; i < group.selection.Size(); i++)
4736
+ {
4737
+ Object3D child = (Object3D) group.selection.get(i);
4738
+
4739
+ objEditor.AddInfo(child, this, true);
4740
+ System.err.println("info : " + child.GetPath());
4741
+ }
4742
+
4743
+ objEditor.SetText(); // jan 2014
4744
+ }
4745
+
4746
+ super.refreshContents(cp);
4747
+ }
40634748
40644749 void linkSomething(Object3D thing)
40654750 {
....@@ -4131,16 +4816,19 @@
41314816 {
41324817 if (group.selection.isEmpty())
41334818 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4819
+
4820
+ Grafreed.clipboardIsTempGroup = false;
41354821 Composite tGroup = null;
41364822 if (group.selection.size() > 0) // 1)
41374823 {
41384824 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4825
+ Grafreed.clipboardIsTempGroup = true;
41404826 }
41414827
41424828 if (cut)
41434829 {
4830
+ if (Globals.SAVEONMAKE)
4831
+ Save();
41444832 //int indices[] = jList.getSelectedIndices();
41454833 //for (int i = indices.length - 1; i >= 0; i--)
41464834 //jList.remove(indices[i]);
....@@ -4176,16 +4864,16 @@
41764864 //System.out.println("cut " + child);
41774865 //System.out.println("parent = " + child.parent);
41784866 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4867
+ if (Grafreed.clipboardIsTempGroup)
41804868 tGroup.add/*Child*/(tmp);
41814869 else
4182
- GrafreeD.clipboard = tmp;
4870
+ Grafreed.clipboard = tmp;
41834871 }
41844872 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4873
+ if (Grafreed.clipboardIsTempGroup)
41864874 tGroup.add/*Child*/(child);
41874875 else
4188
- GrafreeD.clipboard = child;
4876
+ Grafreed.clipboard = child;
41894877 }
41904878
41914879 //ResetModel();
....@@ -4217,21 +4905,23 @@
42174905 //System.out.println("cut " + elem);
42184906 //System.out.println("parent = " + elem.parent);
42194907 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4908
+ if (Grafreed.clipboardIsTempGroup)
42214909 tGroup.add/*Child*/(tmp);
42224910 else
4223
- GrafreeD.clipboard = tmp;
4911
+ Grafreed.clipboard = tmp;
42244912 }
42254913 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4914
+ if (Grafreed.clipboardIsTempGroup)
42274915 tGroup.add/*Child*/(child);
42284916 else
4229
- GrafreeD.clipboard = child;
4917
+ Grafreed.clipboard = child;
42304918 }
42314919
42324920 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4921
+
4922
+ if (Grafreed.clipboardIsTempGroup)
4923
+ Grafreed.clipboard = tGroup;
4924
+
42354925 if (cut)
42364926 {
42374927 ResetModel();
....@@ -4245,7 +4935,7 @@
42454935 // return;
42464936 boolean first = true;
42474937
4248
- if (GrafreeD.clipboardIsTempGroup)
4938
+ if (Grafreed.clipboardIsTempGroup)
42494939 {
42504940 Composite temp;
42514941
....@@ -4256,7 +4946,7 @@
42564946 temp = (Composite)Applet3D.clipboard.deepCopy();
42574947 */
42584948 Object3D elem;
4259
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4949
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42604950 {
42614951 Object3D child = (Object3D)e.nextElement();
42624952
....@@ -4290,21 +4980,21 @@
42904980 //Object3D cb = Applet3D.clipboard;
42914981 //temp.addChild(cb);
42924982 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4983
+ assert(Grafreed.clipboard.parent == null);
4984
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4985
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4986
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4987
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42984988 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4989
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4990
+ Grafreed.clipboard.get(0).parent = keepparent;
43014991 }
43024992
43034993 ResetModel();
43044994 refreshContents();
43054995 }
43064996
4307
- void pasteInto(boolean copyit)
4997
+ void pasteInto(boolean copyit, boolean clone)
43084998 {
43094999 // if (GrafreeD.clipboard == null)
43105000 // return;
....@@ -4333,15 +5023,22 @@
43335023 if (copyit)
43345024 {
43355025 // paste(false);
4336
- CloneClipboard(false); // sept 2014
5026
+ if (clone)
5027
+ {
5028
+ CloneClipboard(false); // sept 2014
5029
+ }
5030
+ else
5031
+ {
5032
+ paste(false);
5033
+ }
43375034 }
43385035 else
43395036 {
43405037 boolean first = true;
43415038
4342
- if (GrafreeD.clipboardIsTempGroup)
5039
+ if (Grafreed.clipboardIsTempGroup)
43435040 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
5041
+ Composite temp = (Composite)Grafreed.clipboard;
43455042 Object3D copy;
43465043 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43475044 {
....@@ -4351,7 +5048,7 @@
43515048 }
43525049 } else
43535050 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
5051
+ linkSomething(Grafreed.clipboard); //.get(0));
43555052 }
43565053 }
43575054 }
....@@ -4756,21 +5453,6 @@
47565453 }
47575454 */
47585455
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745456 /*
47755457 public void Callback(Object obj)
47765458 {
....@@ -4794,26 +5476,9 @@
47945476 }
47955477 */
47965478
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145479 String GetFile(String dialogName)
48155480 {
4816
- if (GrafreeD.standAlone)
5481
+ if (Grafreed.standAlone)
48175482 {
48185483 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195484 browser.show();
....@@ -4877,10 +5542,33 @@
48775542 cButton flashSelectionButton;
48785543 cButton editButton;
48795544 cButton uneditButton;
5545
+ JCheckBox allParamsButton;
48805546 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825547 cButton unselectButton;
48835548
5549
+ cButton restoreCameraButton;
5550
+
5551
+ cButton saveButton;
5552
+ cButton oneStepButton;
5553
+
5554
+ cButton groupButton;
5555
+ cButton ungroupButton;
5556
+ cButton compositeButton;
5557
+ cButton switchButton;
5558
+ cButton loopButton;
5559
+ cButton textureButton;
5560
+
5561
+ cButton gridButton;
5562
+ cButton boxButton;
5563
+ cButton sphereButton;
5564
+ cButton coneButton;
5565
+ cButton torusButton;
5566
+ cButton superButton;
5567
+ cButton kleinButton;
5568
+ cButton particlesButton;
5569
+ cButton overlayButton;
5570
+ cButton lightButton;
5571
+
48845572 cButton screenfitButton;
48855573 cButton screenfitpointButton;
48865574 cButton snapobjectButton;
....@@ -4892,14 +5580,6 @@
48925580
48935581 cButton setsupportButton;
48945582
4895
- cButton twoButton;
4896
- cButton sixButton;
4897
- cButton threeButton;
4898
- cButton sevenButton;
4899
- cButton fourButton; // full panel
4900
- cButton oneButton; // full XYZ
4901
- //cButton currentLayout;
4902
-
49035583 //
49045584 //Composite
49055585 Object3D // to do !!
....@@ -4909,9 +5589,11 @@
49095589 //JTree jTree;
49105590 private MenuItem lookAtItem;
49115591 private MenuItem lookFromItem;
4912
- private MenuItem switchItem;
5592
+ private MenuItem switchViewItem;
49135593 private MenuItem cutItem;
4914
- private MenuItem duplicateItem;
5594
+ private MenuItem undoItem;
5595
+ private MenuItem redoItem;
5596
+ private JMenuItem duplicateItem;
49155597 private MenuItem cloneItem;
49165598 private MenuItem cloneSupportItem;
49175599 private MenuItem overwriteGeoItem;
....@@ -4924,7 +5606,7 @@
49245606 private MenuItem linkverticesItem;
49255607 private MenuItem relinkverticesItem;
49265608 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5609
+ private MenuItem resetAllItem;
49285610 private MenuItem stepAllItem;
49295611 private MenuItem revertMeshItem;
49305612 private MenuItem poseMeshItem;
....@@ -4935,6 +5617,7 @@
49355617 private MenuItem mergeGeometriesItem;
49365618 private MenuItem copyItem;
49375619 private MenuItem pasteItem;
5620
+ private MenuItem pasteIntoItem;
49385621 private MenuItem pasteLinkItem;
49395622 private MenuItem pasteCloneItem;
49405623 private MenuItem pasteExpandItem;
....@@ -4973,6 +5656,10 @@
49735656 private MenuItem showleavesItem;
49745657 private MenuItem markleavesItem;
49755658 private MenuItem unmarkleavesItem;
5659
+ private MenuItem rewindleavesItem;
5660
+ private MenuItem unrewindleavesItem;
5661
+ private MenuItem randomleavesItem;
5662
+ private MenuItem unrandomleavesItem;
49765663
49775664 private MenuItem flipVItem;
49785665 private MenuItem unflipVItem;
....@@ -4984,15 +5671,17 @@
49845671 private MenuItem panoTexturesItem;
49855672
49865673 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5674
+ private MenuItem resetCentroidXZItem;
49885675 private MenuItem resetTransformItem;
5676
+ private MenuItem transformGeometryItem;
5677
+ private MenuItem transformChildrenItem;
49895678 private MenuItem hideItem;
49905679 private MenuItem grabItem;
49915680 private MenuItem backItem;
49925681 private MenuItem frontItem;
49935682 private MenuItem cameraItem;
49945683 private MenuItem compositeItem;
4995
- private MenuItem randomItem;
5684
+ private MenuItem switchItem;
49965685 private MenuItem physicsItem;
49975686 private MenuItem frameselectorItem;
49985687 private MenuItem scriptNodeItem;
....@@ -5007,6 +5696,7 @@
50075696
50085697 private MenuItem resetParentItem;
50095698 private MenuItem repairParentItem;
5699
+ private MenuItem repairShadowItem;
50105700 private MenuItem sortbysizeItem;
50115701 private MenuItem sortbynameItem;
50125702
....@@ -5031,7 +5721,7 @@
50315721 private MenuItem blobItem;
50325722 private MenuItem latheItem;
50335723 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5724
+ private MenuItem overlayItem;
50355725 private MenuItem meshItem;
50365726 // private MenuItem meshGroupItem;
50375727 private MenuItem springItem;
....@@ -5053,11 +5743,6 @@
50535743 private MenuItem doubleItem;
50545744 private MenuItem tripleItem;
50555745
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615746 private MenuItem computeAOItem;
50625747 private MenuItem recompileItem;
50635748 private MenuItem editScriptItem;
....@@ -5067,4 +5752,8 @@
50675752 private MenuItem analyzeItem;
50685753 private MenuItem dumpItem;
50695754 //boolean freezemodel = false;
5755
+
5756
+ Menu cameraMenu;
5757
+ MenuItem editCameraItem;
5758
+ MenuItem restoreCameraItem;
50705759 }