Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,30 +148,29 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
163155 Menu menu;
164156 oe.menuBar.add(menu = new Menu("Edit"));
165157 //editItem = menu.add(new MenuItem("Edit"));
166158 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168166 duplicateItem.addActionListener(this);
169
- menu.add("-");
170167 cloneItem = menu.add(new MenuItem("Clone"));
171168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
172171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173172 cloneSupportItem.addActionListener(this);
173
+ }
174174 menu.add("-");
175175 cutItem = menu.add(new MenuItem("Cut"));
176176 cutItem.addActionListener(this);
....@@ -178,27 +178,123 @@
178178 copyItem.addActionListener(this);
179179 pasteItem = menu.add(new MenuItem("Paste"));
180180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
181185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182186 pasteLinkItem.addActionListener(this);
183187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184188 pasteCloneItem.addActionListener(this);
185189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
187192 clearItem = menu.add(new MenuItem("Clear"));
188193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
189198 clearAllItem = menu.add(new MenuItem("Clear All"));
190199 clearAllItem.addActionListener(this);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209
+
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
191237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
192289 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
290
+ if (Globals.ADVANCED)
291
+ {
197292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198293 revertMeshItem.addActionListener(this);
199294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200295 resetreferencesItem.addActionListener(this);
201296 menu.add("-");
297
+ }
202298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203299 overwriteGeoItem.addActionListener(this);
204300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +306,103 @@
210306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211307 overwriteUVItem.addActionListener(this);
212308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
213311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214312 generateMeshItem.addActionListener(this);
215313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216314 poseMeshItem.addActionListener(this);
217315 menu.add("-");
316
+ }
218317 resetsupportItem = menu.add(new MenuItem("Reset support"));
219318 resetsupportItem.addActionListener(this);
220319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221320 linkverticesItem.addActionListener(this);
321
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
322
+ relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
222326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223327 setMasterItem.addActionListener(this);
328
+ }
224329
225330 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
228333 backItem = menu.add(new MenuItem("Back"));
229334 backItem.addActionListener(this);
230335 frontItem = menu.add(new MenuItem("Front"));
231336 frontItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
343
+ hideItem.addActionListener(this);
344
+ }
345
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
346
+ ungroupItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
241354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242355 switchGeoItem.addActionListener(this);
243356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244357 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
246359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
247366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248367 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
368
+ }
251369
252370 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
373
+ billboardItem = menu.add(new MenuItem("Billboard"));
374
+ billboardItem.addActionListener(this);
255375 csgItem = menu.add(new MenuItem("CSG"));
256376 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258378 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260380 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
263386 linkerItem = menu.add(new MenuItem("Linker"));
264387 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267388 attributeItem = menu.add(new MenuItem("Attribute"));
268389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
269392 pointflowItem = menu.add(new MenuItem("Point Flow"));
270393 pointflowItem.addActionListener(this);
394
+ }
271395 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275397 resetTransformItem.addActionListener(this);
276398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277399 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
280406
281407 oe.menuBar.add(menu = new Menu("Geometry"));
282408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +413,11 @@
287413 genNormalsCADItem.addActionListener(this);
288414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
418
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
419
+ genNormalsMINEItem.addActionListener(this);
420
+ }
290421 stripifyItem = menu.add(new MenuItem("Stripify"));
291422 stripifyItem.addActionListener(this);
292423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +439,34 @@
308439 reduce34MeshItem.addActionListener(this);
309440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310441 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
315450
316451 oe.menuBar.add(menu = new Menu("Attributes"));
317452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318453 clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
319458 menu.add("-");
320459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321460 liveleavesItem.addActionListener(this);
322461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
324465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325466 supportleavesItem.addActionListener(this);
326467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327468 unsupportleavesItem.addActionListener(this);
469
+ }
328470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329471 hideleavesItem.addActionListener(this);
330472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +475,14 @@
333475 markleavesItem.addActionListener(this);
334476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
336486 menu.add("-");
337487 flipVItem = menu.add(new MenuItem("Flip V"));
338488 flipVItem.addActionListener(this);
....@@ -368,35 +518,40 @@
368518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369519 sortbynameItem.addActionListener(this);
370520 menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
371528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372529 extractGeometriesItem.addActionListener(this);
373530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374531 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
532
+ }
379533
380534 oe.menuBar.add(menu = new Menu("Insert"));
381535 buildCreateMenu(menu);
382536
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394537 oe.menuBar.add(menu = new Menu("Tools"));
395538 buildToolsMenu(menu);
396539 }
397540
398541 void SetupUI2(ObjEditor oe)
399542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
400555 //new Exception().printStackTrace();
401556
402557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -425,150 +580,213 @@
425580 oe.radioPanel.add(dummyButton);
426581 oe.buttonGroup.add(dummyButton);
427582 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
431586
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588
+
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+ 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");
433621 liveCB.addItemListener(this);
434622
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
453629 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
495
- trackCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
630
+
631
+ //oe.toolboxPanel.Return();
632
+
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ screenfitButton.setToolTipText("Screen fit");
499635 screenfitButton.addActionListener(this);
500
- 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
+
501641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502642 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507643
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
514
- flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
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));
518652
519
- //
520
- 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");
521655 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
656
+ this.fullscreenLayout = twoButton;
657
+
658
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523659 fourButton.addActionListener(this);
524
- 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");
525663 sixButton.addActionListener(this);
526
- 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");
527666 threeButton.addActionListener(this);
528
- 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");
529669 sevenButton.addActionListener(this);
530670 //
531671
532
- 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");
533674 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- 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");
536678 closeButton.addActionListener(this);
537679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538680 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540
-
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
- editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547681
548
- 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 switch");
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 = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Edit selection");
763
+ editButton.addActionListener(this);
764
+
765
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Unedit selection");
549767 uneditButton.addActionListener(this);
550768
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
769
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
+ allParamsButton.setToolTipText("Edit all params");
563771 allParamsButton.addActionListener(this);
564772
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
570779 unselectButton.addActionListener(this);
571780
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
+// oe.treePanel.add(commandsPanel);
788
+// oe.treePanel.Return();
789
+
572790 // oe.aConstraints.gridx += 1;
573791 // oe.aConstraints.weighty = 0;
574792 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +798,22 @@
580798 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581799 // gcButton.addActionListener(this);
582800
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
801
+ cGridBag jSPPanel = new cGridBag();
802
+
803
+ JScrollPane jSP;
594804 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596806 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
601
-
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
- colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
609
- materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
612
- textureCB.addItemListener(this);
613
-
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
616807
808
+ oe.treePanel.add(jSPPanel);
809
+ oe.treePanel.Return();
810
+
811
+ oe.treePanel.add(copyOptionsPanel);
812
+ oe.treePanel.Return();
813
+
814
+// mainPanel.setDividerLocation(0.5); //1.0);
815
+// mainPanel.setResizeWeight(0.5);
816
+
617817 //jList.addListSelectionListener(this);
618818 oe.jTree.addTreeSelectionListener(this);
619819 //jTree.setRootVisible(false);
....@@ -635,20 +835,153 @@
635835 radio.layout = sevenButton;
636836 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637837 }
838
+
839
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
840
+ {
841
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
842
+ colorCB.setToolTipText("Copy color when dropped");
843
+ colorCB.addItemListener(this);
844
+
845
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
846
+ materialCB.setToolTipText("Copy material when dropped");
847
+ materialCB.addItemListener(this);
848
+
849
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
850
+ textureCB.setToolTipText("Copy texture when dropped");
851
+ textureCB.addItemListener(this);
852
+
853
+ panel.Return();
854
+
855
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
856
+ boxCB.setToolTipText("Display bounding boxes");
857
+ boxCB.addItemListener(this);
858
+
859
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
861
+ zoomBoxCB.addItemListener(this);
862
+
863
+ if (true) // Globals.ADVANCED)
864
+ {
865
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
+ supportCB.setToolTipText("Enable rigging");
867
+ supportCB.addItemListener(this);
868
+
869
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870
+ // localCB.addItemListener(this);
871
+
872
+ panel.Return();
873
+
874
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
875
+ crowdCB.setToolTipText("Used for crowds");
876
+ crowdCB.addItemListener(this);
877
+
878
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
879
+ smoothCB.setToolTipText("Snapping delay");
880
+ smoothCB.addItemListener(this);
881
+
882
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
883
+ slowCB.setToolTipText("Smooth interpolation");
884
+ slowCB.addItemListener(this);
885
+
886
+// constraints.gridy += 1;
887
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
888
+// speakerMocapCB.addItemListener(this);
889
+
890
+ panel.Return();
891
+
892
+ if (false)
893
+ {
894
+ // handled in scripts
895
+ //constraints.gridy += 1;
896
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
897
+ speakerCameraCB.addItemListener(this);
898
+
899
+ //constraints.gridy += 1;
900
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
901
+ speakerFocusCB.addItemListener(this);
902
+
903
+ //constraints.gridy += 1;
904
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
905
+ smoothfocusCB.addItemListener(this);
906
+ panel.Return();
907
+ }
908
+
909
+//constraints.gridx += 1;
910
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
911
+// debugCB.addItemListener(this);
912
+
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
917
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
919
+ oeilCB.addItemListener(this);
920
+
921
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
+ shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.addItemListener(this);
924
+
925
+ panel.Return();
926
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
927
+ toggleTextureCB.setToolTipText("Load textures");
928
+ toggleTextureCB.addItemListener(this);
929
+
930
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
+ toggleSwitchCB.setToolTipText("Use switch");
932
+ toggleSwitchCB.addItemListener(this);
933
+
934
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
+ autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.addItemListener(this);
937
+
938
+ panel.Return();
939
+ if (Globals.ADVANCED)
940
+ {
941
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
942
+ lookAtCB.setToolTipText("Look-at target");
943
+ lookAtCB.addItemListener(this);
944
+ }
945
+
946
+ }
947
+
948
+ cGridBag fill = new cGridBag();
949
+ fill.preferredHeight = 200;
950
+ cGridBag fill2 = new cGridBag();
951
+ fill2.preferredHeight = 200;
952
+ cGridBag fill3 = new cGridBag();
953
+ fill3.preferredHeight = 200;
954
+
955
+ panel.add(fill);
956
+ panel.add(fill2);
957
+ panel.add(fill3);
958
+
959
+ }
638960
639961 void EditObject(Object3D obj)
640962 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
963
+ cRadio radioButton = new cRadio(obj.name);
964
+
965
+ // Patch to avoid bug with transparency.
966
+ radioButton.hadMaterial = obj.material != null;
967
+ if (!radioButton.hadMaterial)
968
+ {
969
+ obj.material = new cMaterial();
970
+ }
971
+
972
+ radioButton.SetObject(obj);
973
+ radioButton.layout = sevenButton;
974
+ radioButton.SetCamera(cameraView.renderCamera, false);
975
+ radioButton.addActionListener(this);
976
+ radioPanel.add(radioButton);
977
+ buttonGroup.add(radioButton);
978
+ radioButton.doClick();
649979 }
980
+
650981 void SetupViews(ObjEditor oe)
651982 {
983
+ theFrame = this;
984
+
652985 oe.SetupViews();
653986
654987 System.out.println("SetupViews");
....@@ -657,22 +990,27 @@
657990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
658991 }
659992
660
- JCheckBox liveCB;
661
- JCheckBox supportCB;
662
- JCheckBox localCB;
663
- JCheckBox crowdCB;
664
- JCheckBox smoothCB;
665
- JCheckBox fastCB;
666
- JCheckBox slowCB;
667
- JCheckBox boxCB;
668
- JCheckBox trackCB;
669
- JCheckBox smoothfocusCB;
993
+ cToggleButton liveCB;
994
+ cCheckBox supportCB;
995
+ cCheckBox localCB;
996
+ cCheckBox crowdCB;
997
+ cCheckBox smoothCB;
998
+ cToggleButton fastCB;
999
+ cCheckBox slowCB;
1000
+ cCheckBox boxCB;
1001
+ cCheckBox zoomBoxCB;
1002
+ //cToggleButton trackCB;
1003
+ cCheckBox trackCB;
1004
+ cCheckBox smoothfocusCB;
6701005 // JCheckBox speakerMocapCB;
671
- JCheckBox speakerCameraCB;
672
- JCheckBox speakerFocusCB;
673
- JCheckBox debugCB;
674
- JCheckBox oeilCB;
675
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
6761014
6771015 // static int COLOR = 1;
6781016 // static int MATERIAL = 2;
....@@ -680,9 +1018,9 @@
6801018
6811019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6821020
683
- JCheckBox colorCB;
684
- JCheckBox materialCB;
685
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
6861024
6871025 public void itemStateChanged(ItemEvent e)
6881026 {
....@@ -707,10 +1045,10 @@
7071045 dropAttributes |= Object3D.TEXTURE;
7081046 else
7091047 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
1048
+ } else if(e.getSource() == liveCB)
7121049 {
7131050 cameraView.ToggleLive();
1051
+ refreshContents(false);
7141052 }
7151053 else if(e.getSource() == supportCB)
7161054 {
....@@ -746,6 +1084,10 @@
7461084 cameraView.repaint();
7471085 // refreshContents();
7481086 }
1087
+ else if(e.getSource() == zoomBoxCB)
1088
+ {
1089
+ cameraView.ToggleZoomBoxMode();
1090
+ }
7491091 else if(e.getSource() == smoothfocusCB)
7501092 {
7511093 cameraView.ToggleSmoothFocus();
....@@ -771,6 +1113,14 @@
7711113 {
7721114 cameraView.ToggleOeil();
7731115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
7741124 else if(e.getSource() == lookAtCB)
7751125 {
7761126 cameraView.ToggleLookAt();
....@@ -787,7 +1137,8 @@
7871137
7881138 /**/
7891139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
790
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
7911142 if ((path == null) || (path.getPathCount() <= 1)) {
7921143 // We can't move the root node or an empty selection
7931144 return;
....@@ -859,7 +1210,9 @@
8591210 // objEditor.DropFile((java.io.File[]) object, true);
8601211 // return;
8611212 // }
862
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631216 {
8641217 // file(s)
8651218 String[] names = string.split("\n");
....@@ -886,7 +1239,7 @@
8861239
8871240 flashIt = false;
8881241 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911244
8921245 if (group.selection.size() == 1)
....@@ -902,23 +1255,33 @@
9021255
9031256 assert target == objEditor.jTree;
9041257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
9051259 try {
906
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9071261 } catch (Exception e) {
9081262 System.out.println("destinationPath : " + destinationPath);
9091263 return;
9101264 }
9111265
912
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
9131267 {
1268
+ Object3D child = (Object3D)group.selection.elementAt(i);
1269
+
1270
+ // Cannot move into itself
1271
+ if (child == destinationLeaf)
1272
+ return;
1273
+ }
1274
+
1275
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1276
+// {
9141277 loadClipboard(true);
9151278 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
917
- } else {
918
- loadClipboard(false);
919
- objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
921
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9221285 }
9231286 public void dropActionChanged(DropTargetDragEvent dtde)
9241287 // Called if the user has modified the current drop gesture
....@@ -1023,83 +1386,104 @@
10231386 {
10241387 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10251388 //heightFieldItem.addActionListener(this);
1026
- gridItem = menu.add(new MenuItem("Grid"));
1027
- gridItem.addActionListener(this);
1028
- rectoidItem = menu.add(new MenuItem("Box"));
1029
- rectoidItem.addActionListener(this);
1030
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1031
- ellipsoidItem.addActionListener(this);
1032
- coneItem = menu.add(new MenuItem("Cone"));
1033
- coneItem.addActionListener(this);
1034
- torusItem = menu.add(new MenuItem("Torus"));
1035
- torusItem.addActionListener(this);
1036
- superItem = menu.add(new MenuItem("Superellipsoid"));
1037
- superItem.addActionListener(this);
1038
- particleItem = menu.add(new MenuItem("Particle system"));
1039
- particleItem.addActionListener(this);
1389
+// gridItem = menu.add(new MenuItem("Grid"));
1390
+// gridItem.addActionListener(this);
1391
+// rectoidItem = menu.add(new MenuItem("Box"));
1392
+// rectoidItem.addActionListener(this);
1393
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1394
+// ellipsoidItem.addActionListener(this);
1395
+// coneItem = menu.add(new MenuItem("Cone"));
1396
+// coneItem.addActionListener(this);
1397
+// torusItem = menu.add(new MenuItem("Torus"));
1398
+// torusItem.addActionListener(this);
1399
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1400
+// superItem.addActionListener(this);
1401
+
1402
+ cameraItem = menu.add(new MenuItem("Camera"));
1403
+ cameraItem.addActionListener(this);
1404
+
1405
+ if (!Globals.ADVANCED)
1406
+ {
1407
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1408
+ kleinItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10401415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411416 ragdollItem.addActionListener(this);
10421417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431418 ragdoll2Item.addActionListener(this);
1419
+ }
10441420 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461422 meshItem.addActionListener(this);
10471423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10491427 springItem = menu.add(new MenuItem("Spring"));
10501428 springItem.addActionListener(this);
10511429 flagItem = menu.add(new MenuItem("Flag"));
10521430 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571431 blobItem = menu.add(new MenuItem("Blob"));
10581432 blobItem.addActionListener(this);
10591433 latheItem = menu.add(new MenuItem("Lathe"));
10601434 latheItem.addActionListener(this);
1061
- lightItem = menu.add(new MenuItem("Light"));
1062
- lightItem.addActionListener(this);
1435
+ }
1436
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1437
+ bezierItem.addActionListener(this);
1438
+// overlayItem = menu.add(new MenuItem("Overlay"));
1439
+// overlayItem.addActionListener(this);
1440
+// lightItem = menu.add(new MenuItem("Light"));
1441
+// lightItem.addActionListener(this);
10631442 menu.add("-");
10641443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10651444 //superLoopItem.addActionListener(this);
1066
- loopItem = menu.add(new MenuItem("Loop"));
1067
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
10681447 doubleItem = menu.add(new MenuItem("Fork"));
10691448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
10701451 tripleItem = menu.add(new MenuItem("Trident"));
10711452 tripleItem.addActionListener(this);
1453
+ }
10721454 }
10731455
10741456 void buildToolsMenu(Menu menu)
10751457 {
10761458 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771459 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1460
+ animationItem.setState(Globals.ANIMATION);
10791461
10801462 menu.add("-");
10811463 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821464 parseverticesItem.addActionListener(this);
10831465 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841466 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861468 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901470 reduceMorphItem.addActionListener(this);
10911471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921472 reduce34MorphItem.addActionListener(this);
1093
-
1473
+ menu.add("-");
10941474 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951475 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
10981482 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991483 memoryItem.addActionListener(this);
11001484 menu.add(analyzeItem = new MenuItem("Analyze"));
11011485 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
11031487 dumpItem.addActionListener(this);
11041488 // menu.add(pathItem = new MenuItem("From-to path"));
11051489 // pathItem.addActionListener(this);
....@@ -1108,6 +1492,8 @@
11081492 resetParentItem.addActionListener(this);
11091493 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101494 repairParentItem.addActionListener(this);
1495
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1496
+ repairShadowItem.addActionListener(this);
11111497 menu.add(invariantsItem = new MenuItem("Invariants"));
11121498 invariantsItem.addActionListener(this);
11131499 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1501,7 @@
11151501 menu.add("-");
11161502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171503 editScriptItem.addActionListener(this);
1504
+ }
11181505 }
11191506
11201507 void ScreenFit()
....@@ -1237,6 +1624,7 @@
12371624 shadow.material = new cMaterial(obj.material);
12381625 shadow.material.diffuse = 0.0001f;
12391626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12401628
12411629 makeSomething(shadow);
12421630 }
....@@ -1443,9 +1831,9 @@
14431831
14441832 void Overwrite(int mask)
14451833 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471835 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
14491837
14501838 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511839 content = ((cGroup)content).get(0);
....@@ -1468,6 +1856,7 @@
14681856 //
14691857 public void actionPerformed(ActionEvent event) // , Object arg)
14701858 {
1859
+ Object source = event.getSource();
14711860 /*
14721861 if (event.getSource() == nameField)
14731862 {
....@@ -1479,11 +1868,11 @@
14791868 }
14801869 else
14811870 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1871
+ if (source == lookAtItem || source == lookFromItem)
14831872 {
14841873 ScreenFit();
14851874 } else
1486
- if (event.getSource() == switchItem)
1875
+ if (source == switchViewItem)
14871876 {
14881877 cVector v1 = new cVector();
14891878 cVector v2 = new cVector();
....@@ -1492,11 +1881,11 @@
14921881 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931882 objEditor.cameraView.repaint();
14941883 } else
1495
- if (event.getSource() == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
14961885 {
14971886 makeSomething(new Box());
14981887 } else
1499
- if (event.getSource() == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
15001889 {
15011890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1906,9 @@
15171906 applyExample(particleGeom, "SMOKE");
15181907 makeSomething(particleGeom);
15191908 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1909
+ if (source == ragdollItem || source == ragdoll2Item)
15211910 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1911
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231912
15241913 ragdoll.toParent = LA.newMatrix();
15251914 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1926,7 @@
15371926 } else
15381927 /*
15391928 */
1540
- if (event.getSource() == heightFieldItem)
1929
+ if (source == heightFieldItem)
15411930 {
15421931 Object3D obj = new Object3D();
15431932
....@@ -1575,27 +1964,31 @@
15751964
15761965 makeSomething(obj);
15771966 } else
1578
- if (event.getSource() == gridItem)
1967
+ if (source == gridItem || source == gridButton)
15791968 {
15801969 makeSomething(new Grid());
15811970 } else
1582
- if (event.getSource() == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
15831972 {
15841973 makeSomething(new Sphere());
15851974 } else
1586
- if (event.getSource() == coneItem)
1975
+ if (source == coneItem || source == coneButton)
15871976 {
15881977 makeSomething(new Cone());
15891978 } else
1590
- if (event.getSource() == torusItem)
1979
+ if (source == torusItem || source == torusButton)
15911980 {
15921981 makeSomething(new Torus());
15931982 } else
1594
- if (event.getSource() == superItem)
1983
+ if (source == superItem || source == superButton)
15951984 {
15961985 makeSomething(new Superellipsoid());
15971986 } else
1598
- if (event.getSource() == blobItem)
1987
+ if (source == kleinItem || source == kleinButton)
1988
+ {
1989
+ makeSomething(new Klein());
1990
+ } else
1991
+ if (source == blobItem)
15991992 {
16001993 Blob blob = new Blob();
16011994 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1996,15 @@
16031996 //blob.retile();
16041997 makeSomething(blob);
16051998 } else
1606
- if (event.getSource() == latheItem)
1999
+ if (source == latheItem)
16072000 {
16082001 makeSomething(new Lathe());
16092002 } else
1610
- if (event.getSource() == bezierItem)
2003
+ if (source == bezierItem)
16112004 {
16122005 makeSomething(new BezierSurface());
16132006 } else
1614
- if (event.getSource() == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
16152008 {
16162009 /*
16172010 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +2019,7 @@
16262019 */
16272020 makeSomething(new Checker());
16282021 } else
1629
- if (event.getSource() == meshItem)
2022
+ if (source == meshItem)
16302023 {
16312024 Object3D itemtomake = new Object3D();
16322025 Object3D child;
....@@ -1647,35 +2040,35 @@
16472040 makeSomething(child);
16482041 }
16492042 } else
1650
- if (event.getSource() == springItem)
2043
+ if (source == springItem)
16512044 {
16522045 cSpring s = new cSpring();
16532046 s.setup();
16542047 makeSomething(s);
16552048 } else
1656
- if (event.getSource() == flagItem)
2049
+ if (source == flagItem)
16572050 {
16582051 cSpring s = new cFlag();
16592052 s.setup();
16602053 makeSomething(s);
16612054 } else
1662
- if (event.getSource() == lightItem)
2055
+ if (source == lightItem || source == lightButton)
16632056 {
16642057 makeSomething(new Light());
16652058 } else
1666
- if (event.getSource() == csgItem)
2059
+ if (source == csgItem)
16672060 {
16682061 group(new CSG());
16692062 } else
1670
- if (event.getSource() == templateItem)
2063
+ if (source == templateItem)
16712064 {
16722065 group(new cTemplate());
16732066 } else
1674
- if (event.getSource() == attributeItem)
2067
+ if (source == attributeItem)
16752068 {
16762069 makeSomething(new Attribute());
16772070 } else
1678
- if (event.getSource() == pointflowItem)
2071
+ if (source == pointflowItem)
16792072 {
16802073 makeSomething(new PointFlow());
16812074 } else
....@@ -1687,7 +2080,7 @@
16872080 } else
16882081 */
16892082
1690
- if (event.getSource() == superLoopItem)
2083
+ if (source == superLoopItem)
16912084 {
16922085 Composite g = new cGroup();
16932086 for (int i=0; i<15; i++)
....@@ -1709,7 +2102,7 @@
17092102
17102103 group(g);
17112104 } else
1712
- if (event.getSource() == loopItem)
2105
+ if (source == loopItem || source == loopButton)
17132106 {
17142107 Composite csg = new GroupLeaf();
17152108 csg.count = 5;
....@@ -1718,7 +2111,7 @@
17182111 csg.addChild(child);
17192112 child.addChild(csg);
17202113 } else
1721
- if (event.getSource() == doubleItem)
2114
+ if (source == doubleItem)
17222115 {
17232116 Composite csg = new GroupLeaf();
17242117 csg.count = 5;
....@@ -1730,7 +2123,7 @@
17302123 csg.addChild(child);
17312124 child.addChild(csg);
17322125 } else
1733
- if (event.getSource() == tripleItem)
2126
+ if (source == tripleItem)
17342127 {
17352128 Composite csg = new GroupLeaf();
17362129 csg.count = 4;
....@@ -1745,71 +2138,83 @@
17452138 csg.addChild(child);
17462139 child.addChild(csg);
17472140 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
2141
+ if (source == computeAOItem)
17502142 {
1751
- ImportGFD();
2143
+ Globals.drawMode = CameraPane.OCCLUSION;
2144
+ Globals.theRenderer.repaint();
17522145 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
2146
+ if (source == recompileItem)
17712147 {
17722148 Recompile();
17732149 refreshContents();
17742150 } else
1775
- if (event.getSource() == editScriptItem)
2151
+ if (source == editScriptItem)
17762152 {
17772153 OpenDialog();
17782154 refreshContents();
17792155 } else
1780
- if (event.getSource() == invariantsItem)
2156
+ if (source == invariantsItem)
17812157 {
17822158 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
17842160 } else
1785
- if (event.getSource() == memoryItem)
2161
+ if (source == memoryItem)
17862162 {
17872163 //System.out.println("Invariants:");
17882164 PrintMemory();
17892165 } else
1790
- if (event.getSource() == pathItem)
2166
+ if (source == pathItem)
17912167 {
17922168 PrintPath();
17932169 } else
1794
- if (event.getSource() == analyzeItem)
2170
+ if (source == analyzeItem)
17952171 {
17962172 AnalyzeObject();
17972173 } else
1798
- if (event.getSource() == dumpItem)
2174
+ if (source == dumpItem)
17992175 {
18002176 DumpObject();
18012177 } else
1802
- if (event.getSource() == screenfitButton)
2178
+ if (source == minButton)
2179
+ {
2180
+ Minimize();
2181
+ } else
2182
+ if (source == maxButton)
2183
+ {
2184
+ Maximize();
2185
+ } else
2186
+ if (source == fullButton)
2187
+ {
2188
+ ToggleFullScreen();
2189
+ } else
2190
+ if (source == undoButton)
2191
+ {
2192
+ Undo();
2193
+ } else
2194
+ if (source == redoButton)
2195
+ {
2196
+ Redo();
2197
+ } else
2198
+ if (source == saveButton)
2199
+ {
2200
+ Save();
2201
+ } else
2202
+ if (source == oneStepButton)
2203
+ {
2204
+ Globals.ONESTEP = true;
2205
+ cameraView.repaint();
2206
+ } else
2207
+ if (source == screenfitButton)
18032208 {
18042209 //Reload(lastConverter, lastFilename, true);
18052210 ScreenFit();
18062211 } else
1807
- if (event.getSource() == screenfitpointButton)
2212
+ if (source == screenfitpointButton)
18082213 {
18092214 //Reload(lastConverter, lastFilename, true);
18102215 ScreenFitPoint();
18112216 } else
1812
- if (event.getSource() == snapobjectButton)
2217
+ if (source == snapobjectButton)
18132218 {
18142219 //Reload(lastConverter, lastFilename, true);
18152220 SnapObject();
....@@ -1820,13 +2225,13 @@
18202225 // Recompile();
18212226 // refreshContents();
18222227 // } else
1823
- if (event.getSource() == gcButton)
2228
+ if (source == gcButton)
18242229 {
18252230 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262231 System.gc();
18272232 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282233 } else
1829
- if (event.getSource() == editLeafItem)
2234
+ if (source == editLeafItem)
18302235 {
18312236 Object3D obj;
18322237 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2245,74 @@
18402245 }
18412246 refreshContents(true);
18422247 } else
1843
- if (event.getSource() == openWindowItem)
2248
+ if (source == openWindowItem)
18442249 {
18452250 EditSelection(true);
18462251 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2252
+ if (source == cutItem || source == clearButton)
18482253 {
18492254 loadClipboard(true);
18502255 } else
1851
- if (event.getSource() == duplicateItem)
2256
+ if (source == undoItem)
18522257 {
1853
- Object3D keep = GrafreeD.clipboard;
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
2264
+ if (source == duplicateItem)
2265
+ {
2266
+ Object3D keep = Grafreed.clipboard;
18542267 loadClipboard(false);
18552268 paste(false);
1856
- GrafreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
18572270 } else
1858
- if (event.getSource() == cloneItem)
2271
+ if (source == cloneItem)
18592272 {
18602273 CloneSelection(false);
18612274 } else
1862
- if (event.getSource() == cloneSupportItem)
2275
+ if (source == cloneSupportItem)
18632276 {
18642277 CloneSelection(true);
18652278 } else
1866
- if (event.getSource() == copyItem)
2279
+ if (source == copyItem)
18672280 {
18682281 loadClipboard(false);
18692282 } else
1870
- if (event.getSource() == pasteItem)
2283
+ if (source == pasteItem)
18712284 {
18722285 paste(false);
18732286 } else
1874
- if (event.getSource() == pasteLinkItem)
2287
+ if (source == pasteIntoItem)
18752288 {
1876
- pasteInto(false);
2289
+ pasteInto(true, false);
18772290 } else
1878
- if (event.getSource() == pasteCloneItem)
2291
+ if (source == pasteLinkItem)
18792292 {
1880
- pasteInto(true);
2293
+ pasteInto(false, false);
18812294 } else
1882
- if (event.getSource() == pasteExpandItem)
2295
+ if (source == pasteCloneItem)
2296
+ {
2297
+ pasteInto(true, true);
2298
+ } else
2299
+ if (source == pasteExpandItem)
18832300 {
18842301 paste(true);
18852302 } else
1886
- if (event.getSource() == synchronizeItem)
2303
+ if (source == synchronizeItem)
18872304 {
18882305 Overwrite(Object3D.TRANSFORM);
18892306 } else
1890
- if (event.getSource() == overwriteNameItem)
2307
+ if (source == overwriteNameItem)
18912308 {
18922309 Overwrite(Object3D.NAME);
18932310 } else
1894
- if (event.getSource() == overwriteUVItem)
2311
+ if (source == overwriteUVItem)
18952312 {
18962313 Overwrite(Object3D.UV);
18972314 } else
1898
- if (event.getSource() == overwriteMatItem)
2315
+ if (source == overwriteMatItem)
18992316 {
19002317 /* july 2015
19012318 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2332,7 @@
19152332
19162333 Overwrite(dropAttributes);
19172334 }
1918
- if (event.getSource() == overwriteGeoItem)
2335
+ if (source == overwriteGeoItem)
19192336 {
19202337 Overwrite(Object3D.GEOMETRY);
19212338 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2349,7 @@
19322349 // refreshContents();
19332350 // }
19342351 } else
1935
- if (event.getSource() == generateMeshItem)
2352
+ if (source == generateMeshItem)
19362353 {
19372354 //if (group.selection.size() == 1)
19382355 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2360,7 @@
19432360 ResetModel();
19442361 refreshContents();
19452362 } else
1946
- if (event.getSource() == extractGeometriesItem)
2363
+ if (source == extractGeometriesItem)
19472364 {
19482365 boolean one = false;
19492366
....@@ -1970,7 +2387,7 @@
19702387 ResetModel();
19712388 refreshContents();
19722389 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2390
+ if (source == cloneGeometriesItem)
19742391 {
19752392 boolean one = false;
19762393
....@@ -1996,32 +2413,37 @@
19962413 ResetModel();
19972414 refreshContents();
19982415 } else
1999
- if (event.getSource() == shareGeometriesItem)
2416
+ if (source == shareGeometriesItem)
20002417 {
20012418 boolean one = false;
20022419
20032420 if (group.selection.size() == 1)
20042421 one = true;
20052422
2423
+ Object3D merge = null;
2424
+
20062425 Object3D content = new cGroup();
20072426
20082427 for (int i=0; i<group.selection.size(); i++)
20092428 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2429
+ merge = new Merge(group.selection.get(i));
20112430
20122431 if (one)
2013
- makeSomething(sel, false);
2432
+ makeSomething(merge, false);
20142433 else
2015
- content.addChild(sel);
2434
+ content.addChild(merge);
20162435 }
20172436
20182437 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2438
+ makeSomething(content, true);
2439
+ else
2440
+ {
2441
+ ResetModel();
2442
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2443
+ refreshContents();
2444
+ }
20232445 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2446
+ if (source == mergeGeometriesItem)
20252447 {
20262448 boolean one = false;
20272449
....@@ -2051,7 +2473,7 @@
20512473 ResetModel();
20522474 refreshContents();
20532475 } else
2054
- if (event.getSource() == linkverticesItem)
2476
+ if (source == linkverticesItem)
20552477 {
20562478 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572479 // {
....@@ -2064,39 +2486,48 @@
20642486 // group.selection.get(0).setMasterThis(content); // should be identity
20652487 // refreshContents();
20662488 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682490 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
20702492
20712493 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722494 content = ((cGroup)content).get(0);
20732495
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2496
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752497 for (int i=0; i<group.selection.size(); i++)
20762498 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
20792501 group.selection.get(i).linkVerticesThis(content);
20802502 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
20822504 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2505
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842506 refreshContents();
20852507 }
20862508 } else
2087
- if (event.getSource() == resetsupportItem)
2509
+ if (source == resetsupportItem)
20882510 {
20892511 for (int i=0; i<group.selection.size(); i++)
20902512 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
20932515 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
20952517 }
20962518
20972519 refreshContents();
20982520 } else
2099
- if (event.getSource() == resetreferencesItem)
2521
+ if (source == relinkverticesItem)
2522
+ {
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
2525
+ group.selection.RelinkToSupport();
2526
+ CameraPane.SWITCH = random;
2527
+
2528
+ refreshContents();
2529
+ } else
2530
+ if (source == resetreferencesItem)
21002531 {
21012532 for (int i=0; i<group.selection.size(); i++)
21022533 {
....@@ -2105,11 +2536,11 @@
21052536
21062537 refreshContents();
21072538 } else
2108
- if (event.getSource() == setMasterItem)
2539
+ if (source == setMasterItem)
21092540 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112542 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
21132544
21142545 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152546 content = ((cGroup)content).get(0);
....@@ -2118,13 +2549,13 @@
21182549 refreshContents();
21192550 }
21202551 } else
2121
- if (event.getSource() == poseMeshItem)
2552
+ if (source == poseMeshItem)
21222553 {
21232554 if (group.selection.size() == 1)
21242555 {
2125
- if (GrafreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
21262557 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
21282559
21292560 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302561 content = ((cGroup)content).get(0);
....@@ -2137,19 +2568,19 @@
21372568 }
21382569
21392570 } else
2140
- if (event.getSource() == revertMeshItem)
2571
+ if (source == revertMeshItem)
21412572 {
21422573 RevertMeshes();
21432574 } else
2144
- if (event.getSource() == resetMeshItem)
2575
+ if (source == resetAllItem)
21452576 {
21462577 ResetAll();
21472578 } else
2148
- if (event.getSource() == stepAllItem)
2579
+ if (source == stepAllItem)
21492580 {
21502581 StepAll();
21512582 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2583
+ if (source == clearItem) // || event.getSource() == clearButton)
21532584 {
21542585 //int indices[] = jList.getSelectedIndices();
21552586 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2588,46 @@
21572588
21582589 ClearSelection(false);
21592590 } else
2160
- if (event.getSource() == clearAllItem)
2591
+ if (source == clearAllItem)
21612592 {
21622593 ClearSelection(true);
21632594 } else
2164
- if (event.getSource() == grabItem)
2595
+ if (source == grabItem || source == groupButton)
21652596 {
2166
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
21672598 } else
2168
- if (event.getSource() == frontItem)
2599
+ if (source == hideItem)
2600
+ {
2601
+ group(new HiddenObject());
2602
+ } else
2603
+ if (source == frontItem)
21692604 {
21702605 front();
21712606 } else
2172
- if (event.getSource() == backItem)
2607
+ if (source == backItem)
21732608 {
21742609 back();
21752610 } else
2176
- if (event.getSource() == cameraItem)
2611
+ if (source == cameraItem)
21772612 {
21782613 makeSomething(new Camera());
21792614 } else
2180
- if (event.getSource() == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
21812616 {
21822617 group(new Composite());
21832618 } else
2184
- if (event.getSource() == randomItem)
2619
+ if (source == switchItem || source == switchButton)
21852620 {
21862621 RandomNode random = new RandomNode();
21872622 group(random);
21882623 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2624
+ random.name = random.get(0).name + "Switch";
21902625 } else
2191
- if (event.getSource() == physicsItem)
2626
+ if (source == physicsItem)
21922627 {
21932628 group(new PhysicsNode());
21942629 } else
2195
- if (event.getSource() == frameselectorItem)
2630
+ if (source == frameselectorItem)
21962631 {
21972632 for (int i=0; i<group.selection.size(); i++)
21982633 {
....@@ -2204,7 +2639,7 @@
22042639 ResetModel();
22052640 refreshContents();
22062641 } else
2207
- if (event.getSource() == switchGeoItem)
2642
+ if (source == switchGeoItem)
22082643 {
22092644 for (int i=0; i<group.selection.size(); i++)
22102645 {
....@@ -2216,7 +2651,7 @@
22162651 ResetModel();
22172652 refreshContents();
22182653 } else
2219
- if (event.getSource() == switchTransfoItem)
2654
+ if (source == switchTransfoItem)
22202655 {
22212656 for (int i=0; i<group.selection.size(); i++)
22222657 {
....@@ -2228,7 +2663,7 @@
22282663 ResetModel();
22292664 refreshContents();
22302665 } else
2231
- if (event.getSource() == morphItem)
2666
+ if (source == morphItem)
22322667 {
22332668 for (int i=0; i<group.selection.size(); i++)
22342669 {
....@@ -2240,7 +2675,7 @@
22402675 ResetModel();
22412676 refreshContents();
22422677 } else
2243
- if (event.getSource() == scriptNodeItem)
2678
+ if (source == scriptNodeItem)
22442679 {
22452680 boolean atleastone = false;
22462681
....@@ -2279,199 +2714,239 @@
22792714 }
22802715 }
22812716 } else
2282
- if (event.getSource() == linkerItem)
2717
+ if (source == linkerItem)
22832718 {
22842719 group(new cLinker());
22852720 } else
2286
- if (event.getSource() == textureItem)
2721
+ if (source == textureItem || source == textureButton)
22872722 {
22882723 group(new TextureNode());
22892724 } else
2290
- if (event.getSource() == shadowXItem)
2725
+ if (source == billboardItem)
2726
+ {
2727
+ group(new BillboardNode());
2728
+ } else
2729
+ if (source == shadowXItem)
22912730 {
22922731 CastShadow(0);
22932732 } else
2294
- if (event.getSource() == shadowYItem)
2733
+ if (source == shadowYItem)
22952734 {
22962735 CastShadow(1);
22972736 } else
2298
- if (event.getSource() == shadowZItem)
2737
+ if (source == shadowZItem)
22992738 {
23002739 CastShadow(2);
23012740 } else
2302
- if (event.getSource() == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
23032742 {
2304
- ungroup();
2743
+ //ungroup();
2744
+ for (int i=0; i<group.selection.size(); i++)
2745
+ {
2746
+ Ungroup(group.selection.get(i));
2747
+ }
2748
+
2749
+ ClearSelection(false);
2750
+
2751
+ refreshContents();
23052752 } else
2306
- if (event.getSource() == genUVItem)
2753
+ if (source == genUVItem)
23072754 {
23082755 GenUV();
23092756 } else
2310
- if (event.getSource() == genNormalsCADItem)
2757
+ if (source == genNormalsCADItem)
23112758 {
23122759 GenNormals(true);
23132760 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2761
+ if (source == genNormalsMESHItem)
23152762 {
2316
- GenNormals(true); // TODO
2763
+ GenNormalsMESH();
23172764 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2765
+ if (source == genNormalsORGANItem)
23192766 {
23202767 GenNormals(false);
23212768 } else
2322
- if (event.getSource() == stripifyItem)
2769
+ if (source == genNormalsMINEItem)
2770
+ {
2771
+ GenNormalsMINE();
2772
+ } else
2773
+ if (source == stripifyItem)
23232774 {
23242775 Stripify();
23252776 } else
2326
- if (event.getSource() == unstripifyItem)
2777
+ if (source == unstripifyItem)
23272778 {
23282779 Unstripify();
23292780 } else
2330
- if (event.getSource() == trimItem)
2781
+ if (source == trimItem)
23312782 {
23322783 Trim();
23332784 } else
2334
- if (event.getSource() == untrimItem)
2785
+ if (source == untrimItem)
23352786 {
23362787 Untrim();
23372788 } else
2338
- if (event.getSource() == clearColorsItem)
2789
+ if (source == clearColorsItem)
23392790 {
23402791 ClearColors();
23412792 } else
2342
- if (event.getSource() == clearMaterialsItem)
2793
+ if (source == clearMaterialsItem)
23432794 {
23442795 ClearMaterials();
23452796 } else
2346
- if (event.getSource() == liveleavesItem)
2797
+ if (source == liveleavesItem)
23472798 {
23482799 LiveLeaves(true);
23492800 } else
2350
- if (event.getSource() == unliveleavesItem)
2801
+ if (source == unliveleavesItem)
23512802 {
23522803 LiveLeaves(false);
23532804 } else
2354
- if (event.getSource() == supportleavesItem)
2805
+ if (source == supportleavesItem)
23552806 {
23562807 SupportLeaves(true);
23572808 } else
2358
- if (event.getSource() == unsupportleavesItem)
2809
+ if (source == unsupportleavesItem)
23592810 {
23602811 SupportLeaves(false);
23612812 } else
2362
- if (event.getSource() == hideleavesItem)
2813
+ if (source == hideleavesItem)
23632814 {
23642815 HideLeaves(true);
23652816 } else
2366
- if (event.getSource() == showleavesItem)
2817
+ if (source == showleavesItem)
23672818 {
23682819 HideLeaves(false);
23692820 } else
2370
- if (event.getSource() == markleavesItem)
2821
+ if (source == markleavesItem)
23712822 {
23722823 MarkLeaves(true);
23732824 } else
2374
- if (event.getSource() == unmarkleavesItem)
2825
+ if (source == unmarkleavesItem)
23752826 {
23762827 MarkLeaves(false);
23772828 } else
2378
- if (event.getSource() == flipVItem)
2829
+ if (source == rewindleavesItem)
2830
+ {
2831
+ RewindLeaves(true);
2832
+ } else
2833
+ if (source == unrewindleavesItem)
2834
+ {
2835
+ RewindLeaves(false);
2836
+ } else
2837
+ if (source == randomleavesItem)
2838
+ {
2839
+ RandomLeaves(true);
2840
+ } else
2841
+ if (source == unrandomleavesItem)
2842
+ {
2843
+ RandomLeaves(false);
2844
+ } else
2845
+ if (source == flipVItem)
23792846 {
23802847 FlipV(true);
23812848 } else
2382
- if (event.getSource() == unflipVItem)
2849
+ if (source == unflipVItem)
23832850 {
23842851 FlipV(false);
23852852 } else
2386
- if (event.getSource() == lowTexturesItem)
2853
+ if (source == lowTexturesItem)
23872854 {
23882855 SetTexRes(0);
23892856 } else
2390
- if (event.getSource() == normalTexturesItem)
2857
+ if (source == normalTexturesItem)
23912858 {
23922859 SetTexRes(1);
23932860 } else
2394
- if (event.getSource() == highTexturesItem)
2861
+ if (source == highTexturesItem)
23952862 {
23962863 SetTexRes(2);
23972864 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2865
+ if (source == veryhighTexturesItem)
23992866 {
24002867 SetTexRes(3);
24012868 } else
2402
- if (event.getSource() == maxTexturesItem)
2869
+ if (source == maxTexturesItem)
24032870 {
24042871 SetTexRes(4);
24052872 } else
2406
- if (event.getSource() == panoTexturesItem)
2873
+ if (source == panoTexturesItem)
24072874 {
24082875 SetTexRes(5);
24092876 } else
2410
- if (event.getSource() == reverseNormalsItem)
2877
+ if (source == reverseNormalsItem)
24112878 {
24122879 ReverseNormals();
24132880 } else
2414
- if (event.getSource() == parseverticesItem)
2881
+ if (source == parseverticesItem)
24152882 {
24162883 ParseVertices();
24172884 } else
2418
- if (event.getSource() == textureFieldItem)
2885
+ if (source == textureFieldItem)
24192886 {
24202887 TextureVertices();
24212888 } else
2422
- if (event.getSource() == alignItem)
2889
+ if (source == alignItem)
24232890 {
24242891 Align();
24252892 } else
2426
- if (event.getSource() == mirrorItem)
2893
+ if (source == mirrorItem)
24272894 {
24282895 MirrorPoses();
24292896 } else
2430
- if (event.getSource() == reduceMorphItem)
2897
+ if (source == reduceMorphItem)
24312898 {
24322899 MeshReduction(false);
24332900 } else
2434
- if (event.getSource() == reduce34MorphItem)
2901
+ if (source == reduce34MorphItem)
24352902 {
24362903 MeshReduction(true);
24372904 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2905
+ if (source == reverseTrianglesItem)
24392906 {
24402907 ReverseTriangles();
24412908 } else
2442
- if (event.getSource() == reduceMeshItem)
2909
+ if (source == reduceMeshItem)
24432910 {
24442911 ReduceMesh(false);
24452912 } else
2446
- if (event.getSource() == reduce34MeshItem)
2913
+ if (source == reduce34MeshItem)
24472914 {
24482915 ReduceMesh(true);
24492916 } else
2450
- if (event.getSource() == increaseMeshItem)
2917
+ if (source == increaseMeshItem)
24512918 {
24522919 IncreaseMesh();
24532920 } else
2454
- if (event.getSource() == clipMeshItem)
2921
+ if (source == clipMeshItem)
24552922 {
24562923 ClipMesh();
24572924 } else
2458
- if (event.getSource() == smoothMeshItem)
2925
+ if (source == smoothMeshItem)
24592926 {
24602927 SmoothMesh();
24612928 } else
2462
- if (event.getSource() == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
24632930 {
24642931 TransformGeometry();
24652932 } else
2466
- if (event.getSource() == resetTransformItem)
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
2936
+ } else
2937
+ if (source == resetTransformItem)
24672938 {
24682939 ResetTransform();
24692940 } else
2470
- if (event.getSource() == resetCentroidItem)
2941
+ if (source == resetCentroidItem)
24712942 {
2472
- ResetCentroid();
2943
+ ResetCentroid(true);
24732944 } else
2474
- if (event.getSource() == resetParentItem)
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
2948
+ } else
2949
+ if (source == resetParentItem)
24752950 {
24762951 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772952 {
....@@ -2481,7 +2956,7 @@
24812956
24822957 refreshContents();
24832958 } else
2484
- if (event.getSource() == repairParentItem)
2959
+ if (source == repairParentItem)
24852960 {
24862961 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872962 {
....@@ -2495,7 +2970,21 @@
24952970
24962971 refreshContents();
24972972 } else
2498
- if (event.getSource() == sortbysizeItem)
2973
+ if (source == repairShadowItem)
2974
+ {
2975
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2976
+ {
2977
+ Object3D obj = (Object3D)e.nextElement();
2978
+ obj.RepairShadow();
2979
+// for (int i=0; i<obj.size(); i++)
2980
+// {
2981
+// obj.get(i).parent = obj;
2982
+// }
2983
+ }
2984
+
2985
+ refreshContents();
2986
+ } else
2987
+ if (source == sortbysizeItem)
24992988 {
25002989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012990 {
....@@ -2507,7 +2996,7 @@
25072996 ResetModel();
25082997 refreshContents();
25092998 } else
2510
- if (event.getSource() == sortbynameItem)
2999
+ if (source == sortbynameItem)
25113000 {
25123001 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25133002 {
....@@ -2519,7 +3008,7 @@
25193008 ResetModel();
25203009 refreshContents();
25213010 } else
2522
- if (event.getSource() == attachPigmentItem)
3011
+ if (source == attachPigmentItem)
25233012 {
25243013 String texture = GetFile("Attach pigment");
25253014 Object3D obj;
....@@ -2531,7 +3020,7 @@
25313020
25323021 refreshContents();
25333022 } else
2534
- if (event.getSource() == detachPigmentItem)
3023
+ if (source == detachPigmentItem)
25353024 {
25363025 Object3D obj;
25373026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +3031,7 @@
25423031
25433032 refreshContents();
25443033 } else
2545
- if (event.getSource() == attachBumpItem)
3034
+ if (source == attachBumpItem)
25463035 {
25473036 String texture = GetFile("Attach bump");
25483037 Object3D obj;
....@@ -2554,7 +3043,7 @@
25543043
25553044 refreshContents();
25563045 } else
2557
- if (event.getSource() == detachBumpItem)
3046
+ if (source == detachBumpItem)
25583047 {
25593048 Object3D obj;
25603049 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +3054,7 @@
25653054
25663055 refreshContents();
25673056 } else
2568
- if (event.getSource() == pigmentBumpItem)
3057
+ if (source == pigmentBumpItem)
25693058 {
25703059 Object3D obj;
25713060 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +3065,237 @@
25763065
25773066 refreshContents();
25783067 } else
2579
- if (event.getSource() == flashSelectionButton)
3068
+ if (source == flashSelectionButton)
25803069 {
25813070 CameraPane.flash = true;
25823071 refreshContents();
25833072 } else
2584
- if (event.getSource() == oneButton)
3073
+ if (source == oneButton)
25853074 {
25863075 } else
2587
- if (event.getSource() == twoButton)
3076
+ if (source == twoButton)
25883077 {
25893078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
25903083 // bug
25913084 //gridPanel.setDividerLocation(1.0);
25923085 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
3086
+// bigThree.remove(scenePanel);
3087
+// bigThree.remove(centralPanel);
3088
+// bigThree.remove(XYZPanel);
3089
+// aWindowConstraints.gridx = 0;
3090
+// aWindowConstraints.gridy = 0;
3091
+// aWindowConstraints.gridwidth = 1;
3092
+// // aConstraints.gridheight = 3;
3093
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3094
+// aWindowConstraints.weightx = 0;
3095
+// aWindowConstraints.weighty = 1;
3096
+// //bigThree.add(jtp, aWindowConstraints);
3097
+// aWindowConstraints.weightx = 1;
3098
+// aWindowConstraints.gridwidth = 3;
3099
+// // aConstraints.gridheight = 3;
3100
+// aWindowConstraints.gridx = 1;
3101
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3102
+// bigThree.add(centralPanel, aWindowConstraints);
3103
+// aWindowConstraints.weightx = 0;
3104
+// aWindowConstraints.gridx = 4;
3105
+// aWindowConstraints.gridwidth = 1;
3106
+// // aConstraints.gridheight = 3;
3107
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3108
+// //bigThree.add(XYZPanel, aWindowConstraints);
3109
+// scenePanel.setVisible(false);
3110
+// centralPanel.setVisible(true);
3111
+// XYZPanel.setVisible(false);
3112
+ bigThree.ClearUI();
3113
+ bigThree.add(centralPanel);
3114
+ bigThree.FlushUI();
3115
+
3116
+ cameraView.requestFocusInWindow();
3117
+
3118
+// refreshContents(true);
3119
+//
3120
+// try
3121
+// {
3122
+// java.awt.Robot bot = new java.awt.Robot();
3123
+// int mask = InputEvent.BUTTON1_MASK;
3124
+// bot.mouseMove(100, 100);
3125
+// bot.mousePress(mask);
3126
+// bot.mouseRelease(mask);
3127
+// }
3128
+// catch (Exception e)
3129
+// {
3130
+//
3131
+// }
3132
+
26173133 } else
2618
- if (event.getSource() == threeButton)
3134
+ if (source == threeButton)
26193135 {
26203136 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
3140
+
3141
+// bigThree.remove(scenePanel);
3142
+// bigThree.remove(centralPanel);
3143
+// bigThree.remove(XYZPanel);
3144
+// aWindowConstraints.gridx = 0;
3145
+// aWindowConstraints.gridy = 0;
3146
+// aWindowConstraints.gridwidth = 1;
3147
+// // aConstraints.gridheight = 3;
3148
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3149
+// aWindowConstraints.weightx = 0;
3150
+// aWindowConstraints.weighty = 1;
3151
+// //bigThree.add(jtp, aWindowConstraints);
3152
+// aWindowConstraints.weightx = 1;
3153
+// aWindowConstraints.gridwidth = 3;
3154
+// // aConstraints.gridheight = 3;
3155
+// aWindowConstraints.gridx = 1;
3156
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3157
+// bigThree.add(centralPanel, aWindowConstraints);
3158
+// aWindowConstraints.weightx = 0;
3159
+// aWindowConstraints.gridx = 4;
3160
+// aWindowConstraints.gridwidth = 1;
3161
+// // aConstraints.gridheight = 3;
3162
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3163
+// bigThree.add(XYZPanel, aWindowConstraints);
3164
+// bigThree.validate();
3165
+// scenePanel.setVisible(false);
3166
+// centralPanel.setVisible(true);
3167
+// XYZPanel.setVisible(true);
3168
+ bigThree.ClearUI();
3169
+ bigThree.add(centralPanel);
3170
+ bigThree.add(XYZPanel);
3171
+ bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
26453174 } else
2646
- if (event.getSource() == fourButton)
3175
+ if (source == fourButton)
26473176 {
26483177 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
3181
+
3182
+// bigThree.remove(scenePanel);
3183
+// bigThree.remove(centralPanel);
3184
+// bigThree.remove(XYZPanel);
3185
+// aWindowConstraints.gridx = 0;
3186
+// aWindowConstraints.gridy = 0;
3187
+// aWindowConstraints.gridwidth = 1;
3188
+// // aWindowConstraints.gridheight = 3;
3189
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3190
+// aWindowConstraints.weightx = 1;
3191
+// aWindowConstraints.weighty = 1;
3192
+// bigThree.add(scenePanel, aWindowConstraints);
3193
+// aWindowConstraints.weightx = 1;
3194
+// aWindowConstraints.gridwidth = 3;
3195
+// // aConstraints.gridheight = 3;
3196
+// aWindowConstraints.gridx = 1;
3197
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3198
+// //bigThree.add(cameraPanel, aWindowConstraints);
3199
+// aWindowConstraints.weightx = 0;
3200
+// aWindowConstraints.gridx = 4;
3201
+// aWindowConstraints.gridwidth = 1;
3202
+// // aWindowConstraints.gridheight = 3;
3203
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3204
+// //bigThree.add(XYZPanel, aWindowConstraints);
3205
+// bigThree.validate();
3206
+// scenePanel.setVisible(true);
3207
+// centralPanel.setVisible(false);
3208
+// XYZPanel.setVisible(false);
3209
+ bigThree.ClearUI();
3210
+ bigThree.add(scenePanel);
3211
+ bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
26733214 } else
2674
- if (event.getSource() == sixButton)
3215
+ if (source == sixButton)
26753216 {
26763217 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
3221
+
3222
+// bigThree.remove(scenePanel);
3223
+// bigThree.remove(centralPanel);
3224
+// bigThree.remove(XYZPanel);
3225
+// aWindowConstraints.gridx = 0;
3226
+// aWindowConstraints.gridy = 0;
3227
+// aWindowConstraints.gridwidth = 1;
3228
+// // aConstraints.gridheight = 3;
3229
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3230
+// aWindowConstraints.weightx = 0;
3231
+// aWindowConstraints.weighty = 1;
3232
+// bigThree.add(scenePanel, aWindowConstraints);
3233
+// aWindowConstraints.weightx = 1;
3234
+// aWindowConstraints.gridwidth = 3;
3235
+// // aWindowConstraints.gridheight = 3;
3236
+// aWindowConstraints.gridx = 1;
3237
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3238
+// bigThree.add(centralPanel, aWindowConstraints);
3239
+// aWindowConstraints.weightx = 0;
3240
+// aWindowConstraints.gridx = 4;
3241
+// aWindowConstraints.gridwidth = 1;
3242
+// // aWindowConstraints.gridheight = 3;
3243
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3244
+// //bigThree.add(XYZPanel, aConstraints);
3245
+// bigThree.validate();
3246
+// scenePanel.setVisible(true);
3247
+// centralPanel.setVisible(true);
3248
+// XYZPanel.setVisible(false);
3249
+ bigThree.ClearUI();
3250
+ bigThree.add(scenePanel);
3251
+ bigThree.add(centralPanel);
3252
+ bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
27013255 } else
2702
- if (event.getSource() == sevenButton)
3256
+ if (source == sevenButton)
27033257 {
27043258 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
3262
+
3263
+// bigThree.remove(scenePanel);
3264
+// bigThree.remove(centralPanel);
3265
+// bigThree.remove(XYZPanel);
3266
+// aWindowConstraints.gridx = 0;
3267
+// aWindowConstraints.gridy = 0;
3268
+// aWindowConstraints.gridwidth = 1;
3269
+// // aWindowConstraints.gridheight = 3;
3270
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3271
+// aWindowConstraints.weightx = 0;
3272
+// aWindowConstraints.weighty = 1;
3273
+// bigThree.add(scenePanel, aWindowConstraints);
3274
+// aWindowConstraints.weightx = 1;
3275
+// aWindowConstraints.gridwidth = 3;
3276
+// // aWindowConstraints.gridheight = 3;
3277
+// aWindowConstraints.gridx = 1;
3278
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3279
+// bigThree.add(centralPanel, aWindowConstraints);
3280
+// aWindowConstraints.weightx = 0;
3281
+// aWindowConstraints.gridx = 4;
3282
+// aWindowConstraints.gridwidth = 1;
3283
+// // aConstraints.gridheight = 3;
3284
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3285
+// bigThree.add(XYZPanel, aWindowConstraints);
3286
+// bigThree.validate();
3287
+// scenePanel.setVisible(true);
3288
+// centralPanel.setVisible(true);
3289
+// XYZPanel.setVisible(true);
3290
+ bigThree.ClearUI();
3291
+ bigThree.add(scenePanel);
3292
+ bigThree.add(centralPanel);
3293
+ bigThree.add(XYZPanel);
3294
+ bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
27293297 } else
2730
- if (event.getSource() == rootButton)
3298
+ if (source == rootButton)
27313299 {
27323300 Object3D obj;
27333301 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2737,66 +3305,84 @@
27373305 EditObject(obj);
27383306 }
27393307
3308
+ cameraView.requestFocusInWindow();
27403309 refreshContents(true);
27413310 } else
2742
- if (event.getSource() == closeButton)
3311
+ if (source == closeButton)
27433312 {
27443313 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453314 cRadio ab;
27463315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27473316 {
27483317 ab = (cRadio)e.nextElement();
2749
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27503319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
27513326 buttonGroup.remove(ab);
27523327 radioPanel.remove(ab);
27533328
2754
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
27553331 // ab.GetObject().objectUI = null; // ?????????
27563332
27573333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27583334 break;
27593335 }
27603336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
27613339 refreshContents(true);
27623340 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3341
+ if (source == editItem || source == editButton)
27643342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
27653349 EditSelection(false);
27663350 } else
2767
- if (event.getSource() == uneditButton)
3351
+ if (source == uneditButton)
27683352 {
27693353 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703354 {
27713355 Object3D child = (Object3D)e.nextElement();
27723356 if(child.editWindow != null)
27733357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
27743359 child.CloseUI();
27753360 listUI.remove(child);
27763361
2777
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
27783363 }
2779
- objEditor.ctrlPanel.revalidate();
3364
+ objEditor.ctrlPanel.FlushUI();
27803365 //objEditor.jTree.clearSelection();
27813366 //objEditor.ResetSliders();
27823367 refreshContents(true);
27833368 } else
2784
- if (event.getSource() == clearPanelButton)
3369
+ if (source == clearPanelButton)
27853370 {
27863371 assert(copy == group);
27873372 //copy.ClearUI();
27883373 for (Object3D obj : listUI)
27893374 {
3375
+ obj.pinned = true;
27903376 obj.CloseUI();
27913377 }
27923378 listUI.clear();
27933379 refreshContents(true);
27943380 } else
2795
- if (event.getSource() == allParamsButton)
3381
+ if (source == allParamsButton)
27963382 {
27973383 assert(copy == group);
27983384
2799
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28003386
28013387 for (Object3D obj : listUI)
28023388 {
....@@ -2813,19 +3399,19 @@
28133399
28143400 refreshContents(true);
28153401 } else
2816
- if (event.getSource() == unselectButton)
3402
+ if (source == unselectButton)
28173403 {
28183404 objEditor.jTree.clearSelection();
28193405 // ?? oct 2012 GrafreeD.clipboard.clear();
28203406 objEditor.ResetSliders();
28213407 refreshContents(true);
28223408 } else
2823
- if(event.getSource() instanceof cRadio)
3409
+ if(source instanceof cRadio)
28243410 {
28253411 group.parent = keepparent;
28263412 group.attributes = 0;
28273413 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3414
+ /*cRadio*/ radio = (cRadio)source;
28293415 Object3D obj = radio.GetObject();
28303416 System.out.println("Edit " + obj);
28313417 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3431,7 @@
28453431 }
28463432
28473433 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3434
+ //Globals.theRenderer.object = group;
28493435 if(!useclient)
28503436 {
28513437 cameraView.renderCamera = radio.camera;
....@@ -2854,12 +3440,17 @@
28543440 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553441 cameraView.targetLookAt.set(radio.camera.lookAt);
28563442 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3443
+ //cameraView.lighttouched = true;
3444
+ Globals.lighttouched = true;
28583445 topView.object = group;
28593446 frontView.object = group;
28603447 sideView.object = group;
28613448 }
2862
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
28633454 /*
28643455 currentLayout = radio.layout;
28653456 if (currentLayout == null)
....@@ -2871,8 +3462,23 @@
28713462 //group.parent = null; // ROOT
28723463 //group.attributes = -1;
28733464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
28743467 refreshContents(true);
2875
- }
3468
+ } else if (event.getSource() == editCameraItem)
3469
+ {
3470
+ cameraView.ProtectCamera();
3471
+ cameraView.repaint();
3472
+ return;
3473
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3474
+ {
3475
+ cameraView.RevertCamera();
3476
+ cameraView.repaint();
3477
+ return;
3478
+ // } else if (event.getSource() == textureButton)
3479
+ // {
3480
+ // return; // true;
3481
+ }
28763482 else
28773483 {
28783484 //return super.action(event, arg);
....@@ -2881,7 +3487,6 @@
28813487 }
28823488
28833489 boolean useclient = false;
2884
- cRadio radio;
28853490
28863491 void ToggleRoot()
28873492 {
....@@ -2890,7 +3495,7 @@
28903495 if (useclient)
28913496 {
28923497 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3498
+ Globals.lighttouched = true;
28943499 //topView.object = client;
28953500 //frontView.object = client;
28963501 //sideView.object = client;
....@@ -2898,7 +3503,7 @@
28983503 else
28993504 {
29003505 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3506
+ Globals.lighttouched = true;
29023507 //topView.object = group;
29033508 //frontView.object = group;
29043509 //sideView.object = group;
....@@ -2933,6 +3538,28 @@
29333538 refreshContents();
29343539 }
29353540
3541
+ void TransformChildren()
3542
+ {
3543
+ Object3D obj;
3544
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3545
+ {
3546
+ obj = (Object3D)e.nextElement();
3547
+ obj.KeepTextureMatrices();
3548
+ obj.TransformChildren();
3549
+ obj.RestoreTextureMatrices();
3550
+
3551
+// if (obj.parent == null)
3552
+// {
3553
+// System.out.println("NULL PARENT!");
3554
+// new Exception().printStackTrace();
3555
+// }
3556
+// else
3557
+// TouchTransform(obj);
3558
+// //obj.parent.Touch();
3559
+ }
3560
+
3561
+ refreshContents();
3562
+ }
29363563
29373564 void ResetTransform()
29383565 {
....@@ -3045,7 +3672,7 @@
30453672 refreshContents();
30463673 }
30473674
3048
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
30493676 {
30503677 Object3D obj;
30513678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3687,16 @@
30603687 LA.matIdentity(Object3D.mat);
30613688 obj.getBounds(minima, maxima, false);
30623689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653693 obj.TransformMesh(Object3D.mat);
3694
+
30663695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
30693700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3725,8 @@
30943725
30953726 int size = obj.MemorySize();
30963727
3097
- System.err.println((size/1024) + " KB is the size of " + obj);
3728
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3729
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30983730 }
30993731 }
31003732 catch (Exception e)
....@@ -3131,9 +3763,9 @@
31313763 obj = (Object3D)e.nextElement();
31323764
31333765 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
31353767 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
31373769
31383770 // System.err.println((size/1024) + " KB is the size of " + obj);
31393771 }
....@@ -3175,6 +3807,20 @@
31753807 void GenNormals(boolean crease)
31763808 {
31773809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
3817
+
3818
+ refreshContents();
3819
+ }
3820
+
3821
+ void GenNormalsMINE()
3822
+ {
3823
+ group.selection.GenNormalsMINE();
31783824
31793825 refreshContents();
31803826 }
....@@ -3340,8 +3986,8 @@
33403986
33413987 void ParseVertices()
33423988 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
33453991
33463992 for (int i=0; i<group.selection.size(); i++)
33473993 {
....@@ -3366,7 +4012,7 @@
33664012 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33674013 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33684014
3369
- g.add(GrafreeD.clipboard);
4015
+ g.add(Grafreed.clipboard);
33704016
33714017 buffer.add(g);
33724018 }
....@@ -3381,7 +4027,7 @@
33814027 makeSomething(buffer, i==group.selection.size()-1);
33824028 }
33834029
3384
- GrafreeD.epsequal = epsequal;
4030
+ Grafreed.epsequal = epsequal;
33854031
33864032 refreshContents();
33874033 }
....@@ -3399,7 +4045,16 @@
33994045 String pigment = Object3D.GetPigment(tex);
34004046 //String bump = Object3D.GetBump(tex);
34014047
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4048
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4049
+
4050
+ try
4051
+ {
4052
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4053
+ }
4054
+ catch (Exception e)
4055
+ {
4056
+ System.err.println("FAIL: " + node);
4057
+ }
34034058
34044059 double s = v.s;
34054060
....@@ -3447,12 +4102,26 @@
34474102
34484103 void Align()
34494104 {
4105
+ if (group.selection.size() == 0)
4106
+ return;
4107
+
4108
+ cVector bbmin = new cVector();
4109
+ cVector bbmax = new cVector();
4110
+
4111
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4112
+
4113
+ double dx = bbmax.x - bbmin.x;
4114
+ double dy = bbmax.y - bbmin.y;
4115
+ double dz = bbmax.z - bbmin.z;
4116
+
4117
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4118
+
34504119 for (int i=0; i<group.selection.size(); i++)
34514120 {
34524121 Object3D obj = group.selection.get(i);
34534122
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4123
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4124
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34564125 }
34574126
34584127 refreshContents();
....@@ -3473,11 +4142,11 @@
34734142
34744143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34754144
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
34784147 lowres.linkVerticesThis(null);
34794148 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
34814150
34824151 System.err.flush();
34834152
....@@ -3517,7 +4186,7 @@
35174186 return;
35184187
35194188 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
35214190
35224191 Object3D newgroup = new Object3D("Po:" + poses.name);
35234192
....@@ -3686,7 +4355,7 @@
36864355 group.selection.RelinkToSupport(); // july 2014
36874356 System.out.println("DONE.");
36884357 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4358
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904359 }
36914360
36924361 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4380,9 @@
37114380
37124381 void ClipMesh()
37134382 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154384 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
37174386
37184387 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194388 content = ((cGroup)content).get(0);
....@@ -3722,7 +4391,7 @@
37224391 // {
37234392 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244393 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
37264395 }
37274396 // group.selection.ClipMesh(GrafreeD.clipboard);
37284397 System.out.println("DONE.");
....@@ -3769,6 +4438,18 @@
37694438 void MarkLeaves(boolean hide)
37704439 {
37714440 group.selection.MarkLeaves(hide);
4441
+ refreshContents();
4442
+ }
4443
+
4444
+ void RewindLeaves(boolean hide)
4445
+ {
4446
+ group.selection.RewindLeaves(hide);
4447
+ refreshContents();
4448
+ }
4449
+
4450
+ void RandomLeaves(boolean hide)
4451
+ {
4452
+ group.selection.RandomLeaves(hide);
37724453 refreshContents();
37734454 }
37744455
....@@ -3843,10 +4524,6 @@
38434524 // }
38444525 // }
38454526
3846
- static boolean allparams = true;
3847
-
3848
- static Vector<Object3D> listUI = new Vector<Object3D>();
3849
-
38504527 void EditSelection(boolean newWindow)
38514528 {
38524529 // aConstraints.gridy = 0;
....@@ -3854,10 +4531,10 @@
38544531 {
38554532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38564533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3857
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584535
38594536 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4537
+ if(elem != group || !newWindow)
38614538 {
38624539 // if (!(elem instanceof Composite))
38634540 // newWindow = false;
....@@ -3940,6 +4617,17 @@
39404617
39414618 freezemodel = true;
39424619
4620
+ //for (Object3D obj : listUI)
4621
+ for (int i=listUI.size(); --i>=0;)
4622
+ {
4623
+ Object3D obj = listUI.elementAt(i);
4624
+ if (!obj.pinned)
4625
+ {
4626
+ obj.CloseUI();
4627
+ listUI.remove(i);
4628
+ }
4629
+ }
4630
+
39434631 /**/
39444632 //switch (event.id)
39454633 {
....@@ -3947,7 +4635,6 @@
39474635 //case 702: // Event.LIST_DESELECT
39484636 group.deselectAll();
39494637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514638 if (tps != null)
39524639 {
39534640 for (int i=0; i < tps.length; i++)
....@@ -3956,33 +4643,39 @@
39564643
39574644 //if (child.parent != null)
39584645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
39594647 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634648 }
39644649 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4650
+// else
4651
+// {
4652
+// objEditor.SetMaterial(group); // .GetMaterial());
4653
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4654
+// System.err.println("info : " + group.GetPath());
4655
+// }
39714656
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4657
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39754658 CameraPane.flash = true;
39764659
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784661 // a camera
39794662 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4663
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4664
+ {
4665
+ CameraPane.camerachangeframe = 0; // don't refuse it
4666
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4667
+ }
4668
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4669
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844670 }
39854671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
39864679 refreshContents();
39874680 //return true;
39884681 }
....@@ -3991,6 +4684,33 @@
39914684
39924685 freezemodel = false;
39934686 }
4687
+
4688
+ void SetPinStates(boolean enabled)
4689
+ {
4690
+ editButton.setEnabled(enabled);
4691
+ uneditButton.setEnabled(enabled);
4692
+ }
4693
+
4694
+ void refreshContents(boolean cp)
4695
+ {
4696
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4698
+ {
4699
+ objEditor.ClearInfo(); // .GetMaterial());
4700
+
4701
+ for (int i=0; i < group.selection.Size(); i++)
4702
+ {
4703
+ Object3D child = (Object3D) group.selection.get(i);
4704
+
4705
+ objEditor.AddInfo(child, this, true);
4706
+ System.err.println("info : " + child.GetPath());
4707
+ }
4708
+
4709
+ objEditor.SetText(); // jan 2014
4710
+ }
4711
+
4712
+ super.refreshContents(cp);
4713
+ }
39944714
39954715 void linkSomething(Object3D thing)
39964716 {
....@@ -4062,16 +4782,19 @@
40624782 {
40634783 if (group.selection.isEmpty())
40644784 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
40664787 Composite tGroup = null;
40674788 if (group.selection.size() > 0) // 1)
40684789 {
40694790 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
40714792 }
40724793
40734794 if (cut)
40744795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
40754798 //int indices[] = jList.getSelectedIndices();
40764799 //for (int i = indices.length - 1; i >= 0; i--)
40774800 //jList.remove(indices[i]);
....@@ -4107,16 +4830,16 @@
41074830 //System.out.println("cut " + child);
41084831 //System.out.println("parent = " + child.parent);
41094832 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
41114834 tGroup.add/*Child*/(tmp);
41124835 else
4113
- GrafreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
41144837 }
41154838 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
41174840 tGroup.add/*Child*/(child);
41184841 else
4119
- GrafreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
41204843 }
41214844
41224845 //ResetModel();
....@@ -4148,21 +4871,23 @@
41484871 //System.out.println("cut " + elem);
41494872 //System.out.println("parent = " + elem.parent);
41504873 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
41524875 tGroup.add/*Child*/(tmp);
41534876 else
4154
- GrafreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
41554878 }
41564879 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
41584881 tGroup.add/*Child*/(child);
41594882 else
4160
- GrafreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
41614884 }
41624885
41634886 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
41664891 if (cut)
41674892 {
41684893 ResetModel();
....@@ -4176,7 +4901,7 @@
41764901 // return;
41774902 boolean first = true;
41784903
4179
- if (GrafreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
41804905 {
41814906 Composite temp;
41824907
....@@ -4187,7 +4912,7 @@
41874912 temp = (Composite)Applet3D.clipboard.deepCopy();
41884913 */
41894914 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4915
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41914916 {
41924917 Object3D child = (Object3D)e.nextElement();
41934918
....@@ -4221,21 +4946,21 @@
42214946 //Object3D cb = Applet3D.clipboard;
42224947 //temp.addChild(cb);
42234948 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4949
+ assert(Grafreed.clipboard.parent == null);
4950
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4951
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4952
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4953
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42294954 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
42324957 }
42334958
42344959 ResetModel();
42354960 refreshContents();
42364961 }
42374962
4238
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
42394964 {
42404965 // if (GrafreeD.clipboard == null)
42414966 // return;
....@@ -4264,15 +4989,22 @@
42644989 if (copyit)
42654990 {
42664991 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
42685000 }
42695001 else
42705002 {
42715003 boolean first = true;
42725004
4273
- if (GrafreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
42745006 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
42765008 Object3D copy;
42775009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42785010 {
....@@ -4282,7 +5014,7 @@
42825014 }
42835015 } else
42845016 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
42865018 }
42875019 }
42885020 }
....@@ -4474,6 +5206,26 @@
44745206 makeSomething(csg);
44755207 }
44765208
5209
+ void Ungroup(Object3D g)
5210
+ {
5211
+ if (g instanceof HiddenObject)
5212
+ {
5213
+ HiddenObject h = (HiddenObject) g;
5214
+
5215
+ for (int i=0; i<h.ActualSize(); i++)
5216
+ {
5217
+ objEditor.makeSomething(h.get(i), false);
5218
+ }
5219
+ }
5220
+ else
5221
+ {
5222
+ for (int i=0; i<g.Size(); i++)
5223
+ {
5224
+ objEditor.makeSomething(g.get(i), false);
5225
+ }
5226
+ }
5227
+ }
5228
+
44775229 void ungroup()
44785230 {
44795231 /*
....@@ -4667,21 +5419,6 @@
46675419 }
46685420 */
46695421
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855422 /*
46865423 public void Callback(Object obj)
46875424 {
....@@ -4705,26 +5442,9 @@
47055442 }
47065443 */
47075444
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255445 String GetFile(String dialogName)
47265446 {
4727
- if (GrafreeD.standAlone)
5447
+ if (Grafreed.standAlone)
47285448 {
47295449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305450 browser.show();
....@@ -4788,10 +5508,36 @@
47885508 cButton flashSelectionButton;
47895509 cButton editButton;
47905510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
47915512 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935513 cButton unselectButton;
47945514
5515
+ cButton restoreCameraButton;
5516
+
5517
+ cButton minButton;
5518
+ cButton maxButton;
5519
+ cButton fullButton;
5520
+ cButton saveButton;
5521
+ cButton oneStepButton;
5522
+
5523
+ cButton groupButton;
5524
+ cButton ungroupButton;
5525
+ cButton compositeButton;
5526
+ cButton switchButton;
5527
+ cButton loopButton;
5528
+ cButton textureButton;
5529
+
5530
+ cButton gridButton;
5531
+ cButton boxButton;
5532
+ cButton sphereButton;
5533
+ cButton coneButton;
5534
+ cButton torusButton;
5535
+ cButton superButton;
5536
+ cButton kleinButton;
5537
+ cButton particlesButton;
5538
+ cButton overlayButton;
5539
+ cButton lightButton;
5540
+
47955541 cButton screenfitButton;
47965542 cButton screenfitpointButton;
47975543 cButton snapobjectButton;
....@@ -4803,14 +5549,6 @@
48035549
48045550 cButton setsupportButton;
48055551
4806
- cButton twoButton;
4807
- cButton sixButton;
4808
- cButton threeButton;
4809
- cButton sevenButton;
4810
- cButton fourButton; // full panel
4811
- cButton oneButton; // full XYZ
4812
- //cButton currentLayout;
4813
-
48145552 //
48155553 //Composite
48165554 Object3D // to do !!
....@@ -4820,9 +5558,11 @@
48205558 //JTree jTree;
48215559 private MenuItem lookAtItem;
48225560 private MenuItem lookFromItem;
4823
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
48245562 private MenuItem cutItem;
4825
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
48265566 private MenuItem cloneItem;
48275567 private MenuItem cloneSupportItem;
48285568 private MenuItem overwriteGeoItem;
....@@ -4833,8 +5573,9 @@
48335573 private MenuItem resetsupportItem;
48345574 private MenuItem resetreferencesItem;
48355575 private MenuItem linkverticesItem;
5576
+ private MenuItem relinkverticesItem;
48365577 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
48385579 private MenuItem stepAllItem;
48395580 private MenuItem revertMeshItem;
48405581 private MenuItem poseMeshItem;
....@@ -4845,6 +5586,7 @@
48455586 private MenuItem mergeGeometriesItem;
48465587 private MenuItem copyItem;
48475588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
48485590 private MenuItem pasteLinkItem;
48495591 private MenuItem pasteCloneItem;
48505592 private MenuItem pasteExpandItem;
....@@ -4854,6 +5596,7 @@
48545596 private MenuItem genNormalsMESHItem;
48555597 private MenuItem genNormalsCADItem;
48565598 private MenuItem genNormalsORGANItem;
5599
+ private MenuItem genNormalsMINEItem;
48575600 private MenuItem stripifyItem;
48585601 private MenuItem unstripifyItem;
48595602 private MenuItem trimItem;
....@@ -4882,6 +5625,10 @@
48825625 private MenuItem showleavesItem;
48835626 private MenuItem markleavesItem;
48845627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
48855632
48865633 private MenuItem flipVItem;
48875634 private MenuItem unflipVItem;
....@@ -4893,14 +5640,17 @@
48935640 private MenuItem panoTexturesItem;
48945641
48955642 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
48975644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
5647
+ private MenuItem hideItem;
48985648 private MenuItem grabItem;
48995649 private MenuItem backItem;
49005650 private MenuItem frontItem;
49015651 private MenuItem cameraItem;
49025652 private MenuItem compositeItem;
4903
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
49045654 private MenuItem physicsItem;
49055655 private MenuItem frameselectorItem;
49065656 private MenuItem scriptNodeItem;
....@@ -4915,6 +5665,7 @@
49155665
49165666 private MenuItem resetParentItem;
49175667 private MenuItem repairParentItem;
5668
+ private MenuItem repairShadowItem;
49185669 private MenuItem sortbysizeItem;
49195670 private MenuItem sortbynameItem;
49205671
....@@ -4935,10 +5686,11 @@
49355686 private MenuItem coneItem;
49365687 private MenuItem torusItem;
49375688 private MenuItem superItem;
5689
+ private MenuItem kleinItem;
49385690 private MenuItem blobItem;
49395691 private MenuItem latheItem;
49405692 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
49425694 private MenuItem meshItem;
49435695 // private MenuItem meshGroupItem;
49445696 private MenuItem springItem;
....@@ -4947,6 +5699,7 @@
49475699 private MenuItem csgItem;
49485700 private MenuItem templateItem;
49495701 private MenuItem textureItem;
5702
+ private MenuItem billboardItem;
49505703 private MenuItem shadowXItem;
49515704 private MenuItem shadowYItem;
49525705 private MenuItem shadowZItem;
....@@ -4959,11 +5712,6 @@
49595712 private MenuItem doubleItem;
49605713 private MenuItem tripleItem;
49615714
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675715 private MenuItem computeAOItem;
49685716 private MenuItem recompileItem;
49695717 private MenuItem editScriptItem;
....@@ -4973,4 +5721,8 @@
49735721 private MenuItem analyzeItem;
49745722 private MenuItem dumpItem;
49755723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
49765728 }