Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,131 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ oe.jTree = new cTree();
154
+
155
+ Menu menu;
156
+ oe.menuBar.add(menu = new Menu("Edit"));
157
+ //editItem = menu.add(new MenuItem("Edit"));
158
+ //editItem.addActionListener(this);
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"));
166
+ duplicateItem.addActionListener(this);
167
+ cloneItem = menu.add(new MenuItem("Clone"));
168
+ cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
171
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
172
+ cloneSupportItem.addActionListener(this);
173
+ }
174
+ menu.add("-");
175
+ cutItem = menu.add(new MenuItem("Cut"));
176
+ cutItem.addActionListener(this);
177
+ copyItem = menu.add(new MenuItem("Copy"));
178
+ copyItem.addActionListener(this);
179
+ pasteItem = menu.add(new MenuItem("Paste"));
180
+ pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
185
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
186
+ pasteLinkItem.addActionListener(this);
187
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
188
+ pasteCloneItem.addActionListener(this);
189
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190
+// pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
192
+ clearItem = menu.add(new MenuItem("Clear"));
193
+ clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
198
+ clearAllItem = menu.add(new MenuItem("Clear All"));
199
+ 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(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
+ revertCameraItem.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());
237
+
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
+ {
152276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154278 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +284,17 @@
160284 lookAtItem.addActionListener(this);
161285 //lookFromItem.addActinoListener(this);
162286 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
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,17 +306,26 @@
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"));
226331 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,52 +336,75 @@
231336 frontItem.addActionListener(this);
232337 compositeItem = menu.add(new MenuItem("Composite"));
233338 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
+
234348 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
349
+
350
+ randomItem = menu.add(new MenuItem("Switch node"));
236351 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);
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);
249368 cameraItem = menu.add(new MenuItem("Camera"));
250369 cameraItem.addActionListener(this);
370
+ }
251371
252372 oe.menuBar.add(menu = new Menu("Object"));
253373 textureItem = menu.add(new MenuItem("Texture"));
254374 textureItem.addActionListener(this);
375
+ billboardItem = menu.add(new MenuItem("Billboard"));
376
+ billboardItem.addActionListener(this);
255377 csgItem = menu.add(new MenuItem("CSG"));
256378 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
379
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258380 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
381
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260382 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
383
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262384 shadowZItem.addActionListener(this);
385
+ if (Globals.ADVANCED)
386
+ {
387
+ menu.add("-");
263388 linkerItem = menu.add(new MenuItem("Linker"));
264389 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267390 attributeItem = menu.add(new MenuItem("Attribute"));
268391 attributeItem.addActionListener(this);
392
+ templateItem = menu.add(new MenuItem("Template"));
393
+ templateItem.addActionListener(this);
269394 pointflowItem = menu.add(new MenuItem("Point Flow"));
270395 pointflowItem.addActionListener(this);
396
+ }
271397 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274398 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275399 resetTransformItem.addActionListener(this);
276400 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277401 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
402
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
403
+ resetCentroidXZItem.addActionListener(this);
404
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
405
+ transformGeometryItem.addActionListener(this);
406
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
407
+ transformChildrenItem.addActionListener(this);
280408
281409 oe.menuBar.add(menu = new Menu("Geometry"));
282410 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +415,11 @@
287415 genNormalsCADItem.addActionListener(this);
288416 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289417 genNormalsMESHItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
420
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
421
+ genNormalsMINEItem.addActionListener(this);
422
+ }
290423 stripifyItem = menu.add(new MenuItem("Stripify"));
291424 stripifyItem.addActionListener(this);
292425 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +441,34 @@
308441 reduce34MeshItem.addActionListener(this);
309442 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310443 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313444 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314445 clipMeshItem.addActionListener(this);
446
+
447
+ if (Globals.ADVANCED)
448
+ {
449
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
450
+ smoothMeshItem.addActionListener(this);
451
+ }
315452
316453 oe.menuBar.add(menu = new Menu("Attributes"));
317454 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318455 clearMaterialsItem.addActionListener(this);
456
+ resetAllItem = menu.add(new MenuItem("Reset All"));
457
+ resetAllItem.addActionListener(this);
458
+ stepAllItem = menu.add(new MenuItem("Step All"));
459
+ stepAllItem.addActionListener(this);
319460 menu.add("-");
320461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321462 liveleavesItem.addActionListener(this);
322463 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323464 unliveleavesItem.addActionListener(this);
465
+ if (Globals.ADVANCED)
466
+ {
324467 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325468 supportleavesItem.addActionListener(this);
326469 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327470 unsupportleavesItem.addActionListener(this);
471
+ }
328472 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329473 hideleavesItem.addActionListener(this);
330474 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +477,14 @@
333477 markleavesItem.addActionListener(this);
334478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335479 unmarkleavesItem.addActionListener(this);
480
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
481
+ rewindleavesItem.addActionListener(this);
482
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
483
+ unrewindleavesItem.addActionListener(this);
484
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
485
+ randomleavesItem.addActionListener(this);
486
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
487
+ unrandomleavesItem.addActionListener(this);
336488 menu.add("-");
337489 flipVItem = menu.add(new MenuItem("Flip V"));
338490 flipVItem.addActionListener(this);
....@@ -368,35 +520,40 @@
368520 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369521 sortbynameItem.addActionListener(this);
370522 menu.add("-");
523
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
524
+ shareGeometriesItem.addActionListener(this);
525
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
526
+ mergeGeometriesItem.addActionListener(this);
527
+ if (Globals.ADVANCED)
528
+ {
529
+ // Pretty much the same as duplicate and clone.
371530 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372531 extractGeometriesItem.addActionListener(this);
373532 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374533 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);
534
+ }
379535
380536 oe.menuBar.add(menu = new Menu("Insert"));
381537 buildCreateMenu(menu);
382538
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
-
394539 oe.menuBar.add(menu = new Menu("Tools"));
395540 buildToolsMenu(menu);
396541 }
397542
398543 void SetupUI2(ObjEditor oe)
399544 {
545
+ // June 2019
546
+ if (oe == null)
547
+ {
548
+ //super.SetupUI2(this);
549
+ //return;
550
+ }
551
+
552
+ if (copy != group)
553
+ {
554
+ //super.SetupUI2(this);
555
+ }
556
+
400557 //new Exception().printStackTrace();
401558
402559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -425,150 +582,171 @@
425582 oe.radioPanel.add(dummyButton);
426583 oe.buttonGroup.add(dummyButton);
427584 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
585
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431586
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ //minButton.setToolTipText("Minimize window");
589
+ //minButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ maxButton.setToolTipText("Maximize window");
593
+ maxButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ fullButton.setToolTipText("Full-screen window");
597
+ fullButton.addActionListener(this);
598
+
599
+ oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ undoButton.setToolTipText("Undo changes");
601
+ undoButton.addActionListener(this);
602
+
603
+ oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604
+ redoButton.setToolTipText("Redo changes");
605
+ redoButton.addActionListener(this);
606
+
607
+ oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ saveButton.setToolTipText("Save changes");
609
+ saveButton.addActionListener(this);
610
+
611
+ oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612
+ liveCB.setToolTipText("Enable animation");
433613 liveCB.addItemListener(this);
434614
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);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ oneStepButton.setToolTipText("Animate one step forward");
617
+ oneStepButton.addActionListener(this);
618
+
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620
+ fastCB.setToolTipText("Fast mode");
453621 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);
622
+
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
626
+ trackCB.setToolTipText("Enable tracking");
495627 trackCB.addItemListener(this);
496628
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ screenfitButton.setToolTipText("Screen fit");
499631 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
632
+
501633 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502634 // 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;
507635
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);
636
+ if (Globals.ADVANCED)
637
+ {
638
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ snapobjectButton.addActionListener(this);
640
+ snapobjectButton.setToolTipText("Snap Object");
641
+ }
642
+
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ flashSelectionButton.setToolTipText("Highlight selection");
514645 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518646
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
648
+
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ twoButton.setToolTipText("Show center view only");
521651 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
652
+ this.fullscreenLayout = twoButton;
653
+
654
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523655 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
656
+ fourButton.setToolTipText("Show left panel only");
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ sixButton.setToolTipText("2-column layout left");
525659 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ threeButton.setToolTipText("2-column layout right");
527662 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ sevenButton.setToolTipText("3-column layout");
529665 sevenButton.addActionListener(this);
530666 //
531667
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ rootButton.setToolTipText("Edit selection in new tab");
533670 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
671
+
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ closeButton.setToolTipText("Close tab");
536674 closeButton.addActionListener(this);
537675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538676 //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;
547677
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
678
+ // INSERT
679
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
680
+ gridButton.setToolTipText("Create grid");
681
+ gridButton.addActionListener(this);
682
+
683
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ boxButton.setToolTipText("Create box");
685
+ boxButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ sphereButton.setToolTipText("Create sphere");
689
+ sphereButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.Return();
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
717
+ overlayButton.setToolTipText("Create overlay");
718
+ overlayButton.addActionListener(this);
719
+
720
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ lightButton.setToolTipText("Create light");
722
+ lightButton.addActionListener(this);
723
+
724
+ // EDIT panel
725
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
+ editButton.setToolTipText("Edit selection");
727
+ editButton.addActionListener(this);
728
+
729
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ uneditButton.setToolTipText("Unedit selection");
549731 uneditButton.addActionListener(this);
550732
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);
733
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
+ allParamsButton.setToolTipText("Edit all params");
563735 allParamsButton.addActionListener(this);
564736
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);
737
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ clearPanelButton.setToolTipText("Clear edit panel");
739
+ clearPanelButton.addActionListener(this);
740
+
741
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ unselectButton.setToolTipText("Unselect");
570743 unselectButton.addActionListener(this);
571744
745
+ editCommandsPanel.preferredHeight = 1;
746
+
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
749
+
572750 // oe.aConstraints.gridx += 1;
573751 // oe.aConstraints.weighty = 0;
574752 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +758,37 @@
580758 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581759 // gcButton.addActionListener(this);
582760
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;
761
+ cGridBag jSPPanel = new cGridBag();
762
+
763
+ JScrollPane jSP;
594764 //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);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596766 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
767
+
768
+ oe.treePanel.add(jSPPanel);
769
+ oe.treePanel.Return();
601770
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);
771
+ cGridBag copyOptionsPanel = new cGridBag();
772
+
773
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
774
+ colorCB.setToolTipText("Copy color when dropped");
606775 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
776
+
777
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
778
+ materialCB.setToolTipText("Copy material when dropped");
609779 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
780
+
781
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
782
+ textureCB.setToolTipText("Copy texture when dropped");
612783 textureCB.addItemListener(this);
613784
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
785
+ copyOptionsPanel.preferredHeight = 1;
786
+ oe.treePanel.add(copyOptionsPanel);
787
+ oe.treePanel.Return();
616788
789
+// mainPanel.setDividerLocation(0.5); //1.0);
790
+// mainPanel.setResizeWeight(0.5);
791
+
617792 //jList.addListSelectionListener(this);
618793 oe.jTree.addTreeSelectionListener(this);
619794 //jTree.setRootVisible(false);
....@@ -635,20 +810,115 @@
635810 radio.layout = sevenButton;
636811 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637812 }
813
+
814
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
815
+ {
816
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
817
+ boxCB.setToolTipText("Display bounding boxes");
818
+ boxCB.addItemListener(this);
819
+
820
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
821
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
822
+ zoomBoxCB.addItemListener(this);
823
+
824
+ if (true) // Globals.ADVANCED)
825
+ {
826
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
827
+ supportCB.setToolTipText("Enable rigging");
828
+ supportCB.addItemListener(this);
829
+
830
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
831
+ // localCB.addItemListener(this);
832
+
833
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
834
+ crowdCB.setToolTipText("Used for crowds");
835
+ crowdCB.addItemListener(this);
836
+
837
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
838
+ smoothCB.setToolTipText("Snapping delay");
839
+ smoothCB.addItemListener(this);
840
+
841
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
842
+ slowCB.setToolTipText("Smooth interpolation");
843
+ slowCB.addItemListener(this);
844
+
845
+// constraints.gridy += 1;
846
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
847
+// speakerMocapCB.addItemListener(this);
848
+
849
+ if (false)
850
+ {
851
+ // handled in scripts
852
+ //constraints.gridy += 1;
853
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
854
+ speakerCameraCB.addItemListener(this);
855
+
856
+ //constraints.gridy += 1;
857
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
858
+ speakerFocusCB.addItemListener(this);
859
+
860
+ //constraints.gridy += 1;
861
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
862
+ smoothfocusCB.addItemListener(this);
863
+ }
864
+
865
+//constraints.gridx += 1;
866
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
867
+// debugCB.addItemListener(this);
868
+
869
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
871
+ oeilCB.addItemListener(this);
872
+
873
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
+ shadowCB.setToolTipText("Compute shadows when live");
875
+ shadowCB.addItemListener(this);
876
+
877
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
+ autosaveCB.setToolTipText("Auto-save on structure change");
879
+ autosaveCB.addItemListener(this);
880
+
881
+ if (Globals.ADVANCED)
882
+ {
883
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
884
+ lookAtCB.setToolTipText("Look-at target");
885
+ lookAtCB.addItemListener(this);
886
+ }
887
+
888
+ }
889
+
890
+ cGridBag fill = new cGridBag();
891
+
892
+ fill.preferredHeight = 200;
893
+
894
+ panel.add(fill);
895
+
896
+ }
638897
639898 void EditObject(Object3D obj)
640899 {
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();
900
+ cRadio radioButton = new cRadio(obj.name);
901
+
902
+ // Patch to avoid bug with transparency.
903
+ radioButton.hadMaterial = obj.material != null;
904
+ if (!radioButton.hadMaterial)
905
+ {
906
+ obj.material = new cMaterial();
907
+ }
908
+
909
+ radioButton.SetObject(obj);
910
+ radioButton.layout = sevenButton;
911
+ radioButton.SetCamera(cameraView.renderCamera, false);
912
+ radioButton.addActionListener(this);
913
+ radioPanel.add(radioButton);
914
+ buttonGroup.add(radioButton);
915
+ radioButton.doClick();
649916 }
917
+
650918 void SetupViews(ObjEditor oe)
651919 {
920
+ theFrame = this;
921
+
652922 oe.SetupViews();
653923
654924 System.out.println("SetupViews");
....@@ -657,22 +927,26 @@
657927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
658928 }
659929
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;
930
+ cToggleButton liveCB;
931
+ cCheckBox supportCB;
932
+ cCheckBox localCB;
933
+ cCheckBox crowdCB;
934
+ cCheckBox smoothCB;
935
+ cToggleButton fastCB;
936
+ cCheckBox slowCB;
937
+ cCheckBox boxCB;
938
+ cCheckBox zoomBoxCB;
939
+ cToggleButton trackCB;
940
+ cCheckBox smoothfocusCB;
670941 // JCheckBox speakerMocapCB;
671
- JCheckBox speakerCameraCB;
672
- JCheckBox speakerFocusCB;
673
- JCheckBox debugCB;
674
- JCheckBox oeilCB;
675
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
676950
677951 // static int COLOR = 1;
678952 // static int MATERIAL = 2;
....@@ -680,9 +954,9 @@
680954
681955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
682956
683
- JCheckBox colorCB;
684
- JCheckBox materialCB;
685
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
686960
687961 public void itemStateChanged(ItemEvent e)
688962 {
....@@ -707,10 +981,10 @@
707981 dropAttributes |= Object3D.TEXTURE;
708982 else
709983 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
984
+ } else if(e.getSource() == liveCB)
712985 {
713986 cameraView.ToggleLive();
987
+ refreshContents(false);
714988 }
715989 else if(e.getSource() == supportCB)
716990 {
....@@ -746,6 +1020,10 @@
7461020 cameraView.repaint();
7471021 // refreshContents();
7481022 }
1023
+ else if(e.getSource() == zoomBoxCB)
1024
+ {
1025
+ cameraView.ToggleZoomBoxMode();
1026
+ }
7491027 else if(e.getSource() == smoothfocusCB)
7501028 {
7511029 cameraView.ToggleSmoothFocus();
....@@ -771,6 +1049,14 @@
7711049 {
7721050 cameraView.ToggleOeil();
7731051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
7741060 else if(e.getSource() == lookAtCB)
7751061 {
7761062 cameraView.ToggleLookAt();
....@@ -787,7 +1073,8 @@
7871073
7881074 /**/
7891075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
790
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
7911078 if ((path == null) || (path.getPathCount() <= 1)) {
7921079 // We can't move the root node or an empty selection
7931080 return;
....@@ -859,7 +1146,9 @@
8591146 // objEditor.DropFile((java.io.File[]) object, true);
8601147 // return;
8611148 // }
862
- if (string.charAt(0) == '/')
1149
+
1150
+ // File path for Mac and Windows
1151
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631152 {
8641153 // file(s)
8651154 String[] names = string.split("\n");
....@@ -886,7 +1175,7 @@
8861175
8871176 flashIt = false;
8881177 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1178
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901179 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911180
8921181 if (group.selection.size() == 1)
....@@ -909,16 +1198,16 @@
9091198 return;
9101199 }
9111200
912
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
913
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
9141203 loadClipboard(true);
9151204 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
917
- } else {
918
- loadClipboard(false);
919
- objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
921
- }
1205
+ pasteInto(false, false);
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
9221211 }
9231212 public void dropActionChanged(DropTargetDragEvent dtde)
9241213 // Called if the user has modified the current drop gesture
....@@ -1035,29 +1324,37 @@
10351324 torusItem.addActionListener(this);
10361325 superItem = menu.add(new MenuItem("Superellipsoid"));
10371326 superItem.addActionListener(this);
1327
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1328
+ kleinItem.addActionListener(this);
10381329 particleItem = menu.add(new MenuItem("Particle system"));
10391330 particleItem.addActionListener(this);
1331
+ if (Globals.ADVANCED)
1332
+ {
10401333 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411334 ragdollItem.addActionListener(this);
10421335 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431336 ragdoll2Item.addActionListener(this);
1337
+ }
10441338 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1339
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461340 meshItem.addActionListener(this);
10471341 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481342 // meshGroupItem.addActionListener(this);
1343
+ if (Globals.ADVANCED)
1344
+ {
10491345 springItem = menu.add(new MenuItem("Spring"));
10501346 springItem.addActionListener(this);
10511347 flagItem = menu.add(new MenuItem("Flag"));
10521348 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);
10571349 blobItem = menu.add(new MenuItem("Blob"));
10581350 blobItem.addActionListener(this);
10591351 latheItem = menu.add(new MenuItem("Lathe"));
10601352 latheItem.addActionListener(this);
1353
+ }
1354
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1355
+ bezierItem.addActionListener(this);
1356
+ overlayItem = menu.add(new MenuItem("Overlay"));
1357
+ overlayItem.addActionListener(this);
10611358 lightItem = menu.add(new MenuItem("Light"));
10621359 lightItem.addActionListener(this);
10631360 menu.add("-");
....@@ -1067,39 +1364,44 @@
10671364 loopItem.addActionListener(this);
10681365 doubleItem = menu.add(new MenuItem("Fork"));
10691366 doubleItem.addActionListener(this);
1367
+ if (Globals.ADVANCED)
1368
+ {
10701369 tripleItem = menu.add(new MenuItem("Trident"));
10711370 tripleItem.addActionListener(this);
1371
+ }
10721372 }
10731373
10741374 void buildToolsMenu(Menu menu)
10751375 {
10761376 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771377 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1378
+ animationItem.setState(Globals.ANIMATION);
10791379
10801380 menu.add("-");
10811381 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821382 parseverticesItem.addActionListener(this);
10831383 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841384 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1385
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861386 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891387 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901388 reduceMorphItem.addActionListener(this);
10911389 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921390 reduce34MorphItem.addActionListener(this);
1093
-
1391
+ menu.add("-");
10941392 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951393 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971394
1395
+ if (Globals.ADVANCED)
1396
+ {
1397
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1398
+ mirrorItem.addActionListener(this);
1399
+ menu.add("-");
10981400 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991401 memoryItem.addActionListener(this);
11001402 menu.add(analyzeItem = new MenuItem("Analyze"));
11011403 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
11031405 dumpItem.addActionListener(this);
11041406 // menu.add(pathItem = new MenuItem("From-to path"));
11051407 // pathItem.addActionListener(this);
....@@ -1108,6 +1410,8 @@
11081410 resetParentItem.addActionListener(this);
11091411 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101412 repairParentItem.addActionListener(this);
1413
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1414
+ repairShadowItem.addActionListener(this);
11111415 menu.add(invariantsItem = new MenuItem("Invariants"));
11121416 invariantsItem.addActionListener(this);
11131417 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1419,7 @@
11151419 menu.add("-");
11161420 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171421 editScriptItem.addActionListener(this);
1422
+ }
11181423 }
11191424
11201425 void ScreenFit()
....@@ -1237,6 +1542,7 @@
12371542 shadow.material = new cMaterial(obj.material);
12381543 shadow.material.diffuse = 0.0001f;
12391544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
12401546
12411547 makeSomething(shadow);
12421548 }
....@@ -1443,9 +1749,9 @@
14431749
14441750 void Overwrite(int mask)
14451751 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1752
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471753 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1754
+ Object3D content = Grafreed.clipboard.get(0);
14491755
14501756 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511757 content = ((cGroup)content).get(0);
....@@ -1468,6 +1774,7 @@
14681774 //
14691775 public void actionPerformed(ActionEvent event) // , Object arg)
14701776 {
1777
+ Object source = event.getSource();
14711778 /*
14721779 if (event.getSource() == nameField)
14731780 {
....@@ -1479,11 +1786,11 @@
14791786 }
14801787 else
14811788 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1789
+ if (source == lookAtItem || source == lookFromItem)
14831790 {
14841791 ScreenFit();
14851792 } else
1486
- if (event.getSource() == switchItem)
1793
+ if (source == switchItem)
14871794 {
14881795 cVector v1 = new cVector();
14891796 cVector v2 = new cVector();
....@@ -1492,11 +1799,11 @@
14921799 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931800 objEditor.cameraView.repaint();
14941801 } else
1495
- if (event.getSource() == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
14961803 {
14971804 makeSomething(new Box());
14981805 } else
1499
- if (event.getSource() == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
15001807 {
15011808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1824,9 @@
15171824 applyExample(particleGeom, "SMOKE");
15181825 makeSomething(particleGeom);
15191826 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1827
+ if (source == ragdollItem || source == ragdoll2Item)
15211828 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1829
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231830
15241831 ragdoll.toParent = LA.newMatrix();
15251832 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1844,7 @@
15371844 } else
15381845 /*
15391846 */
1540
- if (event.getSource() == heightFieldItem)
1847
+ if (source == heightFieldItem)
15411848 {
15421849 Object3D obj = new Object3D();
15431850
....@@ -1575,27 +1882,31 @@
15751882
15761883 makeSomething(obj);
15771884 } else
1578
- if (event.getSource() == gridItem)
1885
+ if (source == gridItem || source == gridButton)
15791886 {
15801887 makeSomething(new Grid());
15811888 } else
1582
- if (event.getSource() == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
15831890 {
15841891 makeSomething(new Sphere());
15851892 } else
1586
- if (event.getSource() == coneItem)
1893
+ if (source == coneItem || source == coneButton)
15871894 {
15881895 makeSomething(new Cone());
15891896 } else
1590
- if (event.getSource() == torusItem)
1897
+ if (source == torusItem || source == torusButton)
15911898 {
15921899 makeSomething(new Torus());
15931900 } else
1594
- if (event.getSource() == superItem)
1901
+ if (source == superItem || source == superButton)
15951902 {
15961903 makeSomething(new Superellipsoid());
15971904 } else
1598
- if (event.getSource() == blobItem)
1905
+ if (source == kleinItem || source == kleinButton)
1906
+ {
1907
+ makeSomething(new Klein());
1908
+ } else
1909
+ if (source == blobItem)
15991910 {
16001911 Blob blob = new Blob();
16011912 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1914,15 @@
16031914 //blob.retile();
16041915 makeSomething(blob);
16051916 } else
1606
- if (event.getSource() == latheItem)
1917
+ if (source == latheItem)
16071918 {
16081919 makeSomething(new Lathe());
16091920 } else
1610
- if (event.getSource() == bezierItem)
1921
+ if (source == bezierItem)
16111922 {
16121923 makeSomething(new BezierSurface());
16131924 } else
1614
- if (event.getSource() == checkerItem)
1925
+ if (source == overlayItem || source == overlayButton)
16151926 {
16161927 /*
16171928 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1937,7 @@
16261937 */
16271938 makeSomething(new Checker());
16281939 } else
1629
- if (event.getSource() == meshItem)
1940
+ if (source == meshItem)
16301941 {
16311942 Object3D itemtomake = new Object3D();
16321943 Object3D child;
....@@ -1647,35 +1958,35 @@
16471958 makeSomething(child);
16481959 }
16491960 } else
1650
- if (event.getSource() == springItem)
1961
+ if (source == springItem)
16511962 {
16521963 cSpring s = new cSpring();
16531964 s.setup();
16541965 makeSomething(s);
16551966 } else
1656
- if (event.getSource() == flagItem)
1967
+ if (source == flagItem)
16571968 {
16581969 cSpring s = new cFlag();
16591970 s.setup();
16601971 makeSomething(s);
16611972 } else
1662
- if (event.getSource() == lightItem)
1973
+ if (source == lightItem || source == lightButton)
16631974 {
16641975 makeSomething(new Light());
16651976 } else
1666
- if (event.getSource() == csgItem)
1977
+ if (source == csgItem)
16671978 {
16681979 group(new CSG());
16691980 } else
1670
- if (event.getSource() == templateItem)
1981
+ if (source == templateItem)
16711982 {
16721983 group(new cTemplate());
16731984 } else
1674
- if (event.getSource() == attributeItem)
1985
+ if (source == attributeItem)
16751986 {
16761987 makeSomething(new Attribute());
16771988 } else
1678
- if (event.getSource() == pointflowItem)
1989
+ if (source == pointflowItem)
16791990 {
16801991 makeSomething(new PointFlow());
16811992 } else
....@@ -1687,7 +1998,7 @@
16871998 } else
16881999 */
16892000
1690
- if (event.getSource() == superLoopItem)
2001
+ if (source == superLoopItem)
16912002 {
16922003 Composite g = new cGroup();
16932004 for (int i=0; i<15; i++)
....@@ -1709,7 +2020,7 @@
17092020
17102021 group(g);
17112022 } else
1712
- if (event.getSource() == loopItem)
2023
+ if (source == loopItem)
17132024 {
17142025 Composite csg = new GroupLeaf();
17152026 csg.count = 5;
....@@ -1718,7 +2029,7 @@
17182029 csg.addChild(child);
17192030 child.addChild(csg);
17202031 } else
1721
- if (event.getSource() == doubleItem)
2032
+ if (source == doubleItem)
17222033 {
17232034 Composite csg = new GroupLeaf();
17242035 csg.count = 5;
....@@ -1730,7 +2041,7 @@
17302041 csg.addChild(child);
17312042 child.addChild(csg);
17322043 } else
1733
- if (event.getSource() == tripleItem)
2044
+ if (source == tripleItem)
17342045 {
17352046 Composite csg = new GroupLeaf();
17362047 csg.count = 4;
....@@ -1745,71 +2056,83 @@
17452056 csg.addChild(child);
17462057 child.addChild(csg);
17472058 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
2059
+ if (source == computeAOItem)
17502060 {
1751
- ImportGFD();
2061
+ Globals.drawMode = CameraPane.OCCLUSION;
2062
+ Globals.theRenderer.repaint();
17522063 } 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)
2064
+ if (source == recompileItem)
17712065 {
17722066 Recompile();
17732067 refreshContents();
17742068 } else
1775
- if (event.getSource() == editScriptItem)
2069
+ if (source == editScriptItem)
17762070 {
17772071 OpenDialog();
17782072 refreshContents();
17792073 } else
1780
- if (event.getSource() == invariantsItem)
2074
+ if (source == invariantsItem)
17812075 {
17822076 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
2077
+ Grafreed.grafreeD.universe.invariants();
17842078 } else
1785
- if (event.getSource() == memoryItem)
2079
+ if (source == memoryItem)
17862080 {
17872081 //System.out.println("Invariants:");
17882082 PrintMemory();
17892083 } else
1790
- if (event.getSource() == pathItem)
2084
+ if (source == pathItem)
17912085 {
17922086 PrintPath();
17932087 } else
1794
- if (event.getSource() == analyzeItem)
2088
+ if (source == analyzeItem)
17952089 {
17962090 AnalyzeObject();
17972091 } else
1798
- if (event.getSource() == dumpItem)
2092
+ if (source == dumpItem)
17992093 {
18002094 DumpObject();
18012095 } else
1802
- if (event.getSource() == screenfitButton)
2096
+ if (source == minButton)
2097
+ {
2098
+ Minimize();
2099
+ } else
2100
+ if (source == maxButton)
2101
+ {
2102
+ Maximize();
2103
+ } else
2104
+ if (source == fullButton)
2105
+ {
2106
+ ToggleFullScreen();
2107
+ } else
2108
+ if (source == undoButton)
2109
+ {
2110
+ Undo();
2111
+ } else
2112
+ if (source == redoButton)
2113
+ {
2114
+ Redo();
2115
+ } else
2116
+ if (source == saveButton)
2117
+ {
2118
+ Save();
2119
+ } else
2120
+ if (source == oneStepButton)
2121
+ {
2122
+ Globals.ONESTEP = true;
2123
+ cameraView.repaint();
2124
+ } else
2125
+ if (source == screenfitButton)
18032126 {
18042127 //Reload(lastConverter, lastFilename, true);
18052128 ScreenFit();
18062129 } else
1807
- if (event.getSource() == screenfitpointButton)
2130
+ if (source == screenfitpointButton)
18082131 {
18092132 //Reload(lastConverter, lastFilename, true);
18102133 ScreenFitPoint();
18112134 } else
1812
- if (event.getSource() == snapobjectButton)
2135
+ if (source == snapobjectButton)
18132136 {
18142137 //Reload(lastConverter, lastFilename, true);
18152138 SnapObject();
....@@ -1820,13 +2143,13 @@
18202143 // Recompile();
18212144 // refreshContents();
18222145 // } else
1823
- if (event.getSource() == gcButton)
2146
+ if (source == gcButton)
18242147 {
18252148 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262149 System.gc();
18272150 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282151 } else
1829
- if (event.getSource() == editLeafItem)
2152
+ if (source == editLeafItem)
18302153 {
18312154 Object3D obj;
18322155 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2163,74 @@
18402163 }
18412164 refreshContents(true);
18422165 } else
1843
- if (event.getSource() == openWindowItem)
2166
+ if (source == openWindowItem)
18442167 {
18452168 EditSelection(true);
18462169 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2170
+ if (source == cutItem || source == clearButton)
18482171 {
18492172 loadClipboard(true);
18502173 } else
1851
- if (event.getSource() == duplicateItem)
2174
+ if (source == undoItem)
18522175 {
1853
- Object3D keep = GrafreeD.clipboard;
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
2181
+ } else
2182
+ if (source == duplicateItem)
2183
+ {
2184
+ Object3D keep = Grafreed.clipboard;
18542185 loadClipboard(false);
18552186 paste(false);
1856
- GrafreeD.clipboard = keep;
2187
+ Grafreed.clipboard = keep;
18572188 } else
1858
- if (event.getSource() == cloneItem)
2189
+ if (source == cloneItem)
18592190 {
18602191 CloneSelection(false);
18612192 } else
1862
- if (event.getSource() == cloneSupportItem)
2193
+ if (source == cloneSupportItem)
18632194 {
18642195 CloneSelection(true);
18652196 } else
1866
- if (event.getSource() == copyItem)
2197
+ if (source == copyItem)
18672198 {
18682199 loadClipboard(false);
18692200 } else
1870
- if (event.getSource() == pasteItem)
2201
+ if (source == pasteItem)
18712202 {
18722203 paste(false);
18732204 } else
1874
- if (event.getSource() == pasteLinkItem)
2205
+ if (source == pasteIntoItem)
18752206 {
1876
- pasteInto(false);
2207
+ pasteInto(true, false);
18772208 } else
1878
- if (event.getSource() == pasteCloneItem)
2209
+ if (source == pasteLinkItem)
18792210 {
1880
- pasteInto(true);
2211
+ pasteInto(false, false);
18812212 } else
1882
- if (event.getSource() == pasteExpandItem)
2213
+ if (source == pasteCloneItem)
2214
+ {
2215
+ pasteInto(true, true);
2216
+ } else
2217
+ if (source == pasteExpandItem)
18832218 {
18842219 paste(true);
18852220 } else
1886
- if (event.getSource() == synchronizeItem)
2221
+ if (source == synchronizeItem)
18872222 {
18882223 Overwrite(Object3D.TRANSFORM);
18892224 } else
1890
- if (event.getSource() == overwriteNameItem)
2225
+ if (source == overwriteNameItem)
18912226 {
18922227 Overwrite(Object3D.NAME);
18932228 } else
1894
- if (event.getSource() == overwriteUVItem)
2229
+ if (source == overwriteUVItem)
18952230 {
18962231 Overwrite(Object3D.UV);
18972232 } else
1898
- if (event.getSource() == overwriteMatItem)
2233
+ if (source == overwriteMatItem)
18992234 {
19002235 /* july 2015
19012236 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2250,7 @@
19152250
19162251 Overwrite(dropAttributes);
19172252 }
1918
- if (event.getSource() == overwriteGeoItem)
2253
+ if (source == overwriteGeoItem)
19192254 {
19202255 Overwrite(Object3D.GEOMETRY);
19212256 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2267,7 @@
19322267 // refreshContents();
19332268 // }
19342269 } else
1935
- if (event.getSource() == generateMeshItem)
2270
+ if (source == generateMeshItem)
19362271 {
19372272 //if (group.selection.size() == 1)
19382273 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2278,7 @@
19432278 ResetModel();
19442279 refreshContents();
19452280 } else
1946
- if (event.getSource() == extractGeometriesItem)
2281
+ if (source == extractGeometriesItem)
19472282 {
19482283 boolean one = false;
19492284
....@@ -1970,7 +2305,7 @@
19702305 ResetModel();
19712306 refreshContents();
19722307 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2308
+ if (source == cloneGeometriesItem)
19742309 {
19752310 boolean one = false;
19762311
....@@ -1996,32 +2331,37 @@
19962331 ResetModel();
19972332 refreshContents();
19982333 } else
1999
- if (event.getSource() == shareGeometriesItem)
2334
+ if (source == shareGeometriesItem)
20002335 {
20012336 boolean one = false;
20022337
20032338 if (group.selection.size() == 1)
20042339 one = true;
20052340
2341
+ Object3D merge = null;
2342
+
20062343 Object3D content = new cGroup();
20072344
20082345 for (int i=0; i<group.selection.size(); i++)
20092346 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2347
+ merge = new Merge(group.selection.get(i));
20112348
20122349 if (one)
2013
- makeSomething(sel, false);
2350
+ makeSomething(merge, false);
20142351 else
2015
- content.addChild(sel);
2352
+ content.addChild(merge);
20162353 }
20172354
20182355 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2356
+ makeSomething(content, true);
2357
+ else
2358
+ {
2359
+ ResetModel();
2360
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2361
+ refreshContents();
2362
+ }
20232363 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2364
+ if (source == mergeGeometriesItem)
20252365 {
20262366 boolean one = false;
20272367
....@@ -2051,7 +2391,7 @@
20512391 ResetModel();
20522392 refreshContents();
20532393 } else
2054
- if (event.getSource() == linkverticesItem)
2394
+ if (source == linkverticesItem)
20552395 {
20562396 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572397 // {
....@@ -2064,39 +2404,48 @@
20642404 // group.selection.get(0).setMasterThis(content); // should be identity
20652405 // refreshContents();
20662406 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2407
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682408 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2409
+ Object3D content = Grafreed.clipboard.get(0);
20702410
20712411 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722412 content = ((cGroup)content).get(0);
20732413
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2414
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752415 for (int i=0; i<group.selection.size(); i++)
20762416 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2417
+ boolean random = CameraPane.SWITCH;
2418
+ CameraPane.SWITCH = false; // parse all random nodes
20792419 group.selection.get(i).linkVerticesThis(content);
20802420 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2421
+ CameraPane.SWITCH = random;
20822422 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2423
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842424 refreshContents();
20852425 }
20862426 } else
2087
- if (event.getSource() == resetsupportItem)
2427
+ if (source == resetsupportItem)
20882428 {
20892429 for (int i=0; i<group.selection.size(); i++)
20902430 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2431
+ boolean random = CameraPane.SWITCH;
2432
+ CameraPane.SWITCH = false; // parse all random nodes
20932433 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2434
+ CameraPane.SWITCH = random;
20952435 }
20962436
20972437 refreshContents();
20982438 } else
2099
- if (event.getSource() == resetreferencesItem)
2439
+ if (source == relinkverticesItem)
2440
+ {
2441
+ boolean random = CameraPane.SWITCH;
2442
+ CameraPane.SWITCH = false; // parse all random nodes
2443
+ group.selection.RelinkToSupport();
2444
+ CameraPane.SWITCH = random;
2445
+
2446
+ refreshContents();
2447
+ } else
2448
+ if (source == resetreferencesItem)
21002449 {
21012450 for (int i=0; i<group.selection.size(); i++)
21022451 {
....@@ -2105,11 +2454,11 @@
21052454
21062455 refreshContents();
21072456 } else
2108
- if (event.getSource() == setMasterItem)
2457
+ if (source == setMasterItem)
21092458 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2459
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112460 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2461
+ Object3D content = Grafreed.clipboard.get(0);
21132462
21142463 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152464 content = ((cGroup)content).get(0);
....@@ -2118,13 +2467,13 @@
21182467 refreshContents();
21192468 }
21202469 } else
2121
- if (event.getSource() == poseMeshItem)
2470
+ if (source == poseMeshItem)
21222471 {
21232472 if (group.selection.size() == 1)
21242473 {
2125
- if (GrafreeD.clipboard.size() == 1)
2474
+ if (Grafreed.clipboard.size() == 1)
21262475 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2476
+ Object3D content = Grafreed.clipboard.get(0);
21282477
21292478 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302479 content = ((cGroup)content).get(0);
....@@ -2137,19 +2486,19 @@
21372486 }
21382487
21392488 } else
2140
- if (event.getSource() == revertMeshItem)
2489
+ if (source == revertMeshItem)
21412490 {
21422491 RevertMeshes();
21432492 } else
2144
- if (event.getSource() == resetMeshItem)
2493
+ if (source == resetAllItem)
21452494 {
21462495 ResetAll();
21472496 } else
2148
- if (event.getSource() == stepAllItem)
2497
+ if (source == stepAllItem)
21492498 {
21502499 StepAll();
21512500 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2501
+ if (source == clearItem) // || event.getSource() == clearButton)
21532502 {
21542503 //int indices[] = jList.getSelectedIndices();
21552504 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2506,46 @@
21572506
21582507 ClearSelection(false);
21592508 } else
2160
- if (event.getSource() == clearAllItem)
2509
+ if (source == clearAllItem)
21612510 {
21622511 ClearSelection(true);
21632512 } else
2164
- if (event.getSource() == grabItem)
2513
+ if (source == grabItem)
21652514 {
21662515 group(new cGroup(), true);
21672516 } else
2168
- if (event.getSource() == frontItem)
2517
+ if (source == hideItem)
2518
+ {
2519
+ group(new HiddenObject());
2520
+ } else
2521
+ if (source == frontItem)
21692522 {
21702523 front();
21712524 } else
2172
- if (event.getSource() == backItem)
2525
+ if (source == backItem)
21732526 {
21742527 back();
21752528 } else
2176
- if (event.getSource() == cameraItem)
2529
+ if (source == cameraItem)
21772530 {
21782531 makeSomething(new Camera());
21792532 } else
2180
- if (event.getSource() == compositeItem)
2533
+ if (source == compositeItem)
21812534 {
21822535 group(new Composite());
21832536 } else
2184
- if (event.getSource() == randomItem)
2537
+ if (source == randomItem)
21852538 {
21862539 RandomNode random = new RandomNode();
21872540 group(random);
21882541 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2542
+ random.name = random.get(0).name + "Switch";
21902543 } else
2191
- if (event.getSource() == physicsItem)
2544
+ if (source == physicsItem)
21922545 {
21932546 group(new PhysicsNode());
21942547 } else
2195
- if (event.getSource() == frameselectorItem)
2548
+ if (source == frameselectorItem)
21962549 {
21972550 for (int i=0; i<group.selection.size(); i++)
21982551 {
....@@ -2204,7 +2557,7 @@
22042557 ResetModel();
22052558 refreshContents();
22062559 } else
2207
- if (event.getSource() == switchGeoItem)
2560
+ if (source == switchGeoItem)
22082561 {
22092562 for (int i=0; i<group.selection.size(); i++)
22102563 {
....@@ -2216,7 +2569,7 @@
22162569 ResetModel();
22172570 refreshContents();
22182571 } else
2219
- if (event.getSource() == switchTransfoItem)
2572
+ if (source == switchTransfoItem)
22202573 {
22212574 for (int i=0; i<group.selection.size(); i++)
22222575 {
....@@ -2228,7 +2581,7 @@
22282581 ResetModel();
22292582 refreshContents();
22302583 } else
2231
- if (event.getSource() == morphItem)
2584
+ if (source == morphItem)
22322585 {
22332586 for (int i=0; i<group.selection.size(); i++)
22342587 {
....@@ -2240,7 +2593,7 @@
22402593 ResetModel();
22412594 refreshContents();
22422595 } else
2243
- if (event.getSource() == scriptNodeItem)
2596
+ if (source == scriptNodeItem)
22442597 {
22452598 boolean atleastone = false;
22462599
....@@ -2279,199 +2632,239 @@
22792632 }
22802633 }
22812634 } else
2282
- if (event.getSource() == linkerItem)
2635
+ if (source == linkerItem)
22832636 {
22842637 group(new cLinker());
22852638 } else
2286
- if (event.getSource() == textureItem)
2639
+ if (source == textureItem)
22872640 {
22882641 group(new TextureNode());
22892642 } else
2290
- if (event.getSource() == shadowXItem)
2643
+ if (source == billboardItem)
2644
+ {
2645
+ group(new BillboardNode());
2646
+ } else
2647
+ if (source == shadowXItem)
22912648 {
22922649 CastShadow(0);
22932650 } else
2294
- if (event.getSource() == shadowYItem)
2651
+ if (source == shadowYItem)
22952652 {
22962653 CastShadow(1);
22972654 } else
2298
- if (event.getSource() == shadowZItem)
2655
+ if (source == shadowZItem)
22992656 {
23002657 CastShadow(2);
23012658 } else
2302
- if (event.getSource() == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
23032660 {
2304
- ungroup();
2661
+ //ungroup();
2662
+ for (int i=0; i<group.selection.size(); i++)
2663
+ {
2664
+ Ungroup(group.selection.get(i));
2665
+ }
2666
+
2667
+ ClearSelection(false);
2668
+
2669
+ refreshContents();
23052670 } else
2306
- if (event.getSource() == genUVItem)
2671
+ if (source == genUVItem)
23072672 {
23082673 GenUV();
23092674 } else
2310
- if (event.getSource() == genNormalsCADItem)
2675
+ if (source == genNormalsCADItem)
23112676 {
23122677 GenNormals(true);
23132678 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2679
+ if (source == genNormalsMESHItem)
23152680 {
2316
- GenNormals(true); // TODO
2681
+ GenNormalsMESH();
23172682 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2683
+ if (source == genNormalsORGANItem)
23192684 {
23202685 GenNormals(false);
23212686 } else
2322
- if (event.getSource() == stripifyItem)
2687
+ if (source == genNormalsMINEItem)
2688
+ {
2689
+ GenNormalsMINE();
2690
+ } else
2691
+ if (source == stripifyItem)
23232692 {
23242693 Stripify();
23252694 } else
2326
- if (event.getSource() == unstripifyItem)
2695
+ if (source == unstripifyItem)
23272696 {
23282697 Unstripify();
23292698 } else
2330
- if (event.getSource() == trimItem)
2699
+ if (source == trimItem)
23312700 {
23322701 Trim();
23332702 } else
2334
- if (event.getSource() == untrimItem)
2703
+ if (source == untrimItem)
23352704 {
23362705 Untrim();
23372706 } else
2338
- if (event.getSource() == clearColorsItem)
2707
+ if (source == clearColorsItem)
23392708 {
23402709 ClearColors();
23412710 } else
2342
- if (event.getSource() == clearMaterialsItem)
2711
+ if (source == clearMaterialsItem)
23432712 {
23442713 ClearMaterials();
23452714 } else
2346
- if (event.getSource() == liveleavesItem)
2715
+ if (source == liveleavesItem)
23472716 {
23482717 LiveLeaves(true);
23492718 } else
2350
- if (event.getSource() == unliveleavesItem)
2719
+ if (source == unliveleavesItem)
23512720 {
23522721 LiveLeaves(false);
23532722 } else
2354
- if (event.getSource() == supportleavesItem)
2723
+ if (source == supportleavesItem)
23552724 {
23562725 SupportLeaves(true);
23572726 } else
2358
- if (event.getSource() == unsupportleavesItem)
2727
+ if (source == unsupportleavesItem)
23592728 {
23602729 SupportLeaves(false);
23612730 } else
2362
- if (event.getSource() == hideleavesItem)
2731
+ if (source == hideleavesItem)
23632732 {
23642733 HideLeaves(true);
23652734 } else
2366
- if (event.getSource() == showleavesItem)
2735
+ if (source == showleavesItem)
23672736 {
23682737 HideLeaves(false);
23692738 } else
2370
- if (event.getSource() == markleavesItem)
2739
+ if (source == markleavesItem)
23712740 {
23722741 MarkLeaves(true);
23732742 } else
2374
- if (event.getSource() == unmarkleavesItem)
2743
+ if (source == unmarkleavesItem)
23752744 {
23762745 MarkLeaves(false);
23772746 } else
2378
- if (event.getSource() == flipVItem)
2747
+ if (source == rewindleavesItem)
2748
+ {
2749
+ RewindLeaves(true);
2750
+ } else
2751
+ if (source == unrewindleavesItem)
2752
+ {
2753
+ RewindLeaves(false);
2754
+ } else
2755
+ if (source == randomleavesItem)
2756
+ {
2757
+ RandomLeaves(true);
2758
+ } else
2759
+ if (source == unrandomleavesItem)
2760
+ {
2761
+ RandomLeaves(false);
2762
+ } else
2763
+ if (source == flipVItem)
23792764 {
23802765 FlipV(true);
23812766 } else
2382
- if (event.getSource() == unflipVItem)
2767
+ if (source == unflipVItem)
23832768 {
23842769 FlipV(false);
23852770 } else
2386
- if (event.getSource() == lowTexturesItem)
2771
+ if (source == lowTexturesItem)
23872772 {
23882773 SetTexRes(0);
23892774 } else
2390
- if (event.getSource() == normalTexturesItem)
2775
+ if (source == normalTexturesItem)
23912776 {
23922777 SetTexRes(1);
23932778 } else
2394
- if (event.getSource() == highTexturesItem)
2779
+ if (source == highTexturesItem)
23952780 {
23962781 SetTexRes(2);
23972782 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2783
+ if (source == veryhighTexturesItem)
23992784 {
24002785 SetTexRes(3);
24012786 } else
2402
- if (event.getSource() == maxTexturesItem)
2787
+ if (source == maxTexturesItem)
24032788 {
24042789 SetTexRes(4);
24052790 } else
2406
- if (event.getSource() == panoTexturesItem)
2791
+ if (source == panoTexturesItem)
24072792 {
24082793 SetTexRes(5);
24092794 } else
2410
- if (event.getSource() == reverseNormalsItem)
2795
+ if (source == reverseNormalsItem)
24112796 {
24122797 ReverseNormals();
24132798 } else
2414
- if (event.getSource() == parseverticesItem)
2799
+ if (source == parseverticesItem)
24152800 {
24162801 ParseVertices();
24172802 } else
2418
- if (event.getSource() == textureFieldItem)
2803
+ if (source == textureFieldItem)
24192804 {
24202805 TextureVertices();
24212806 } else
2422
- if (event.getSource() == alignItem)
2807
+ if (source == alignItem)
24232808 {
24242809 Align();
24252810 } else
2426
- if (event.getSource() == mirrorItem)
2811
+ if (source == mirrorItem)
24272812 {
24282813 MirrorPoses();
24292814 } else
2430
- if (event.getSource() == reduceMorphItem)
2815
+ if (source == reduceMorphItem)
24312816 {
24322817 MeshReduction(false);
24332818 } else
2434
- if (event.getSource() == reduce34MorphItem)
2819
+ if (source == reduce34MorphItem)
24352820 {
24362821 MeshReduction(true);
24372822 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2823
+ if (source == reverseTrianglesItem)
24392824 {
24402825 ReverseTriangles();
24412826 } else
2442
- if (event.getSource() == reduceMeshItem)
2827
+ if (source == reduceMeshItem)
24432828 {
24442829 ReduceMesh(false);
24452830 } else
2446
- if (event.getSource() == reduce34MeshItem)
2831
+ if (source == reduce34MeshItem)
24472832 {
24482833 ReduceMesh(true);
24492834 } else
2450
- if (event.getSource() == increaseMeshItem)
2835
+ if (source == increaseMeshItem)
24512836 {
24522837 IncreaseMesh();
24532838 } else
2454
- if (event.getSource() == clipMeshItem)
2839
+ if (source == clipMeshItem)
24552840 {
24562841 ClipMesh();
24572842 } else
2458
- if (event.getSource() == smoothMeshItem)
2843
+ if (source == smoothMeshItem)
24592844 {
24602845 SmoothMesh();
24612846 } else
2462
- if (event.getSource() == transformgeometryItem)
2847
+ if (source == transformGeometryItem)
24632848 {
24642849 TransformGeometry();
24652850 } else
2466
- if (event.getSource() == resetTransformItem)
2851
+ if (source == transformChildrenItem)
2852
+ {
2853
+ TransformChildren();
2854
+ } else
2855
+ if (source == resetTransformItem)
24672856 {
24682857 ResetTransform();
24692858 } else
2470
- if (event.getSource() == resetCentroidItem)
2859
+ if (source == resetCentroidItem)
24712860 {
2472
- ResetCentroid();
2861
+ ResetCentroid(true);
24732862 } else
2474
- if (event.getSource() == resetParentItem)
2863
+ if (source == resetCentroidXZItem)
2864
+ {
2865
+ ResetCentroid(false);
2866
+ } else
2867
+ if (source == resetParentItem)
24752868 {
24762869 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772870 {
....@@ -2481,7 +2874,7 @@
24812874
24822875 refreshContents();
24832876 } else
2484
- if (event.getSource() == repairParentItem)
2877
+ if (source == repairParentItem)
24852878 {
24862879 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872880 {
....@@ -2495,7 +2888,21 @@
24952888
24962889 refreshContents();
24972890 } else
2498
- if (event.getSource() == sortbysizeItem)
2891
+ if (source == repairShadowItem)
2892
+ {
2893
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2894
+ {
2895
+ Object3D obj = (Object3D)e.nextElement();
2896
+ obj.RepairShadow();
2897
+// for (int i=0; i<obj.size(); i++)
2898
+// {
2899
+// obj.get(i).parent = obj;
2900
+// }
2901
+ }
2902
+
2903
+ refreshContents();
2904
+ } else
2905
+ if (source == sortbysizeItem)
24992906 {
25002907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012908 {
....@@ -2507,7 +2914,7 @@
25072914 ResetModel();
25082915 refreshContents();
25092916 } else
2510
- if (event.getSource() == sortbynameItem)
2917
+ if (source == sortbynameItem)
25112918 {
25122919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132920 {
....@@ -2519,7 +2926,7 @@
25192926 ResetModel();
25202927 refreshContents();
25212928 } else
2522
- if (event.getSource() == attachPigmentItem)
2929
+ if (source == attachPigmentItem)
25232930 {
25242931 String texture = GetFile("Attach pigment");
25252932 Object3D obj;
....@@ -2531,7 +2938,7 @@
25312938
25322939 refreshContents();
25332940 } else
2534
- if (event.getSource() == detachPigmentItem)
2941
+ if (source == detachPigmentItem)
25352942 {
25362943 Object3D obj;
25372944 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2949,7 @@
25422949
25432950 refreshContents();
25442951 } else
2545
- if (event.getSource() == attachBumpItem)
2952
+ if (source == attachBumpItem)
25462953 {
25472954 String texture = GetFile("Attach bump");
25482955 Object3D obj;
....@@ -2554,7 +2961,7 @@
25542961
25552962 refreshContents();
25562963 } else
2557
- if (event.getSource() == detachBumpItem)
2964
+ if (source == detachBumpItem)
25582965 {
25592966 Object3D obj;
25602967 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2972,7 @@
25652972
25662973 refreshContents();
25672974 } else
2568
- if (event.getSource() == pigmentBumpItem)
2975
+ if (source == pigmentBumpItem)
25692976 {
25702977 Object3D obj;
25712978 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2983,237 @@
25762983
25772984 refreshContents();
25782985 } else
2579
- if (event.getSource() == flashSelectionButton)
2986
+ if (source == flashSelectionButton)
25802987 {
25812988 CameraPane.flash = true;
25822989 refreshContents();
25832990 } else
2584
- if (event.getSource() == oneButton)
2991
+ if (source == oneButton)
25852992 {
25862993 } else
2587
- if (event.getSource() == twoButton)
2994
+ if (source == twoButton)
25882995 {
25892996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
25903001 // bug
25913002 //gridPanel.setDividerLocation(1.0);
25923003 //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();
3004
+// bigThree.remove(scenePanel);
3005
+// bigThree.remove(centralPanel);
3006
+// bigThree.remove(XYZPanel);
3007
+// aWindowConstraints.gridx = 0;
3008
+// aWindowConstraints.gridy = 0;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// aWindowConstraints.weightx = 0;
3013
+// aWindowConstraints.weighty = 1;
3014
+// //bigThree.add(jtp, aWindowConstraints);
3015
+// aWindowConstraints.weightx = 1;
3016
+// aWindowConstraints.gridwidth = 3;
3017
+// // aConstraints.gridheight = 3;
3018
+// aWindowConstraints.gridx = 1;
3019
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3020
+// bigThree.add(centralPanel, aWindowConstraints);
3021
+// aWindowConstraints.weightx = 0;
3022
+// aWindowConstraints.gridx = 4;
3023
+// aWindowConstraints.gridwidth = 1;
3024
+// // aConstraints.gridheight = 3;
3025
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3026
+// //bigThree.add(XYZPanel, aWindowConstraints);
3027
+// scenePanel.setVisible(false);
3028
+// centralPanel.setVisible(true);
3029
+// XYZPanel.setVisible(false);
3030
+ bigThree.ClearUI();
3031
+ bigThree.add(centralPanel);
3032
+ bigThree.FlushUI();
3033
+
3034
+ cameraView.requestFocusInWindow();
3035
+
3036
+// refreshContents(true);
3037
+//
3038
+// try
3039
+// {
3040
+// java.awt.Robot bot = new java.awt.Robot();
3041
+// int mask = InputEvent.BUTTON1_MASK;
3042
+// bot.mouseMove(100, 100);
3043
+// bot.mousePress(mask);
3044
+// bot.mouseRelease(mask);
3045
+// }
3046
+// catch (Exception e)
3047
+// {
3048
+//
3049
+// }
3050
+
26173051 } else
2618
- if (event.getSource() == threeButton)
3052
+ if (source == threeButton)
26193053 {
26203054 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();
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
3058
+
3059
+// bigThree.remove(scenePanel);
3060
+// bigThree.remove(centralPanel);
3061
+// bigThree.remove(XYZPanel);
3062
+// aWindowConstraints.gridx = 0;
3063
+// aWindowConstraints.gridy = 0;
3064
+// aWindowConstraints.gridwidth = 1;
3065
+// // aConstraints.gridheight = 3;
3066
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3067
+// aWindowConstraints.weightx = 0;
3068
+// aWindowConstraints.weighty = 1;
3069
+// //bigThree.add(jtp, aWindowConstraints);
3070
+// aWindowConstraints.weightx = 1;
3071
+// aWindowConstraints.gridwidth = 3;
3072
+// // aConstraints.gridheight = 3;
3073
+// aWindowConstraints.gridx = 1;
3074
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3075
+// bigThree.add(centralPanel, aWindowConstraints);
3076
+// aWindowConstraints.weightx = 0;
3077
+// aWindowConstraints.gridx = 4;
3078
+// aWindowConstraints.gridwidth = 1;
3079
+// // aConstraints.gridheight = 3;
3080
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3081
+// bigThree.add(XYZPanel, aWindowConstraints);
3082
+// bigThree.validate();
3083
+// scenePanel.setVisible(false);
3084
+// centralPanel.setVisible(true);
3085
+// XYZPanel.setVisible(true);
3086
+ bigThree.ClearUI();
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.add(XYZPanel);
3089
+ bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
26453092 } else
2646
- if (event.getSource() == fourButton)
3093
+ if (source == fourButton)
26473094 {
26483095 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();
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
3099
+
3100
+// bigThree.remove(scenePanel);
3101
+// bigThree.remove(centralPanel);
3102
+// bigThree.remove(XYZPanel);
3103
+// aWindowConstraints.gridx = 0;
3104
+// aWindowConstraints.gridy = 0;
3105
+// aWindowConstraints.gridwidth = 1;
3106
+// // aWindowConstraints.gridheight = 3;
3107
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3108
+// aWindowConstraints.weightx = 1;
3109
+// aWindowConstraints.weighty = 1;
3110
+// bigThree.add(scenePanel, aWindowConstraints);
3111
+// aWindowConstraints.weightx = 1;
3112
+// aWindowConstraints.gridwidth = 3;
3113
+// // aConstraints.gridheight = 3;
3114
+// aWindowConstraints.gridx = 1;
3115
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3116
+// //bigThree.add(cameraPanel, aWindowConstraints);
3117
+// aWindowConstraints.weightx = 0;
3118
+// aWindowConstraints.gridx = 4;
3119
+// aWindowConstraints.gridwidth = 1;
3120
+// // aWindowConstraints.gridheight = 3;
3121
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3122
+// //bigThree.add(XYZPanel, aWindowConstraints);
3123
+// bigThree.validate();
3124
+// scenePanel.setVisible(true);
3125
+// centralPanel.setVisible(false);
3126
+// XYZPanel.setVisible(false);
3127
+ bigThree.ClearUI();
3128
+ bigThree.add(scenePanel);
3129
+ bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
26733132 } else
2674
- if (event.getSource() == sixButton)
3133
+ if (source == sixButton)
26753134 {
26763135 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();
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
3139
+
3140
+// bigThree.remove(scenePanel);
3141
+// bigThree.remove(centralPanel);
3142
+// bigThree.remove(XYZPanel);
3143
+// aWindowConstraints.gridx = 0;
3144
+// aWindowConstraints.gridy = 0;
3145
+// aWindowConstraints.gridwidth = 1;
3146
+// // aConstraints.gridheight = 3;
3147
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3148
+// aWindowConstraints.weightx = 0;
3149
+// aWindowConstraints.weighty = 1;
3150
+// bigThree.add(scenePanel, aWindowConstraints);
3151
+// aWindowConstraints.weightx = 1;
3152
+// aWindowConstraints.gridwidth = 3;
3153
+// // aWindowConstraints.gridheight = 3;
3154
+// aWindowConstraints.gridx = 1;
3155
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3156
+// bigThree.add(centralPanel, aWindowConstraints);
3157
+// aWindowConstraints.weightx = 0;
3158
+// aWindowConstraints.gridx = 4;
3159
+// aWindowConstraints.gridwidth = 1;
3160
+// // aWindowConstraints.gridheight = 3;
3161
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3162
+// //bigThree.add(XYZPanel, aConstraints);
3163
+// bigThree.validate();
3164
+// scenePanel.setVisible(true);
3165
+// centralPanel.setVisible(true);
3166
+// XYZPanel.setVisible(false);
3167
+ bigThree.ClearUI();
3168
+ bigThree.add(scenePanel);
3169
+ bigThree.add(centralPanel);
3170
+ bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
27013173 } else
2702
- if (event.getSource() == sevenButton)
3174
+ if (source == sevenButton)
27033175 {
27043176 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();
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
3180
+
3181
+// bigThree.remove(scenePanel);
3182
+// bigThree.remove(centralPanel);
3183
+// bigThree.remove(XYZPanel);
3184
+// aWindowConstraints.gridx = 0;
3185
+// aWindowConstraints.gridy = 0;
3186
+// aWindowConstraints.gridwidth = 1;
3187
+// // aWindowConstraints.gridheight = 3;
3188
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3189
+// aWindowConstraints.weightx = 0;
3190
+// aWindowConstraints.weighty = 1;
3191
+// bigThree.add(scenePanel, aWindowConstraints);
3192
+// aWindowConstraints.weightx = 1;
3193
+// aWindowConstraints.gridwidth = 3;
3194
+// // aWindowConstraints.gridheight = 3;
3195
+// aWindowConstraints.gridx = 1;
3196
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3197
+// bigThree.add(centralPanel, aWindowConstraints);
3198
+// aWindowConstraints.weightx = 0;
3199
+// aWindowConstraints.gridx = 4;
3200
+// aWindowConstraints.gridwidth = 1;
3201
+// // aConstraints.gridheight = 3;
3202
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3203
+// bigThree.add(XYZPanel, aWindowConstraints);
3204
+// bigThree.validate();
3205
+// scenePanel.setVisible(true);
3206
+// centralPanel.setVisible(true);
3207
+// XYZPanel.setVisible(true);
3208
+ bigThree.ClearUI();
3209
+ bigThree.add(scenePanel);
3210
+ bigThree.add(centralPanel);
3211
+ bigThree.add(XYZPanel);
3212
+ bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
27293215 } else
2730
- if (event.getSource() == rootButton)
3216
+ if (source == rootButton)
27313217 {
27323218 Object3D obj;
27333219 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2737,34 +3223,44 @@
27373223 EditObject(obj);
27383224 }
27393225
3226
+ cameraView.requestFocusInWindow();
27403227 refreshContents(true);
27413228 } else
2742
- if (event.getSource() == closeButton)
3229
+ if (source == closeButton)
27433230 {
27443231 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453232 cRadio ab;
27463233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27473234 {
27483235 ab = (cRadio)e.nextElement();
2749
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27503237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
27513244 buttonGroup.remove(ab);
27523245 radioPanel.remove(ab);
27533246
2754
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
27553249 // ab.GetObject().objectUI = null; // ?????????
27563250
27573251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27583252 break;
27593253 }
27603254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
27613257 refreshContents(true);
27623258 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3259
+ if (source == editItem || source == editButton)
27643260 {
27653261 EditSelection(false);
27663262 } else
2767
- if (event.getSource() == uneditButton)
3263
+ if (source == uneditButton)
27683264 {
27693265 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703266 {
....@@ -2774,14 +3270,14 @@
27743270 child.CloseUI();
27753271 listUI.remove(child);
27763272
2777
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
27783274 }
2779
- objEditor.ctrlPanel.revalidate();
3275
+ objEditor.ctrlPanel.FlushUI();
27803276 //objEditor.jTree.clearSelection();
27813277 //objEditor.ResetSliders();
27823278 refreshContents(true);
27833279 } else
2784
- if (event.getSource() == clearPanelButton)
3280
+ if (source == clearPanelButton)
27853281 {
27863282 assert(copy == group);
27873283 //copy.ClearUI();
....@@ -2792,7 +3288,7 @@
27923288 listUI.clear();
27933289 refreshContents(true);
27943290 } else
2795
- if (event.getSource() == allParamsButton)
3291
+ if (source == allParamsButton)
27963292 {
27973293 assert(copy == group);
27983294
....@@ -2813,19 +3309,19 @@
28133309
28143310 refreshContents(true);
28153311 } else
2816
- if (event.getSource() == unselectButton)
3312
+ if (source == unselectButton)
28173313 {
28183314 objEditor.jTree.clearSelection();
28193315 // ?? oct 2012 GrafreeD.clipboard.clear();
28203316 objEditor.ResetSliders();
28213317 refreshContents(true);
28223318 } else
2823
- if(event.getSource() instanceof cRadio)
3319
+ if(source instanceof cRadio)
28243320 {
28253321 group.parent = keepparent;
28263322 group.attributes = 0;
28273323 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3324
+ /*cRadio*/ radio = (cRadio)source;
28293325 Object3D obj = radio.GetObject();
28303326 System.out.println("Edit " + obj);
28313327 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3341,7 @@
28453341 }
28463342
28473343 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3344
+ //Globals.theRenderer.object = group;
28493345 if(!useclient)
28503346 {
28513347 cameraView.renderCamera = radio.camera;
....@@ -2854,12 +3350,17 @@
28543350 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553351 cameraView.targetLookAt.set(radio.camera.lookAt);
28563352 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3353
+ //cameraView.lighttouched = true;
3354
+ Globals.lighttouched = true;
28583355 topView.object = group;
28593356 frontView.object = group;
28603357 sideView.object = group;
28613358 }
2862
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
28633364 /*
28643365 currentLayout = radio.layout;
28653366 if (currentLayout == null)
....@@ -2871,8 +3372,23 @@
28713372 //group.parent = null; // ROOT
28723373 //group.attributes = -1;
28733374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
28743377 refreshContents(true);
2875
- }
3378
+ } else if (event.getSource() == editCameraItem)
3379
+ {
3380
+ cameraView.ProtectCamera();
3381
+ cameraView.repaint();
3382
+ return;
3383
+ } else if (event.getSource() == revertCameraItem)
3384
+ {
3385
+ cameraView.RevertCamera();
3386
+ cameraView.repaint();
3387
+ return;
3388
+ // } else if (event.getSource() == textureButton)
3389
+ // {
3390
+ // return; // true;
3391
+ }
28763392 else
28773393 {
28783394 //return super.action(event, arg);
....@@ -2881,7 +3397,6 @@
28813397 }
28823398
28833399 boolean useclient = false;
2884
- cRadio radio;
28853400
28863401 void ToggleRoot()
28873402 {
....@@ -2890,7 +3405,7 @@
28903405 if (useclient)
28913406 {
28923407 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3408
+ Globals.lighttouched = true;
28943409 //topView.object = client;
28953410 //frontView.object = client;
28963411 //sideView.object = client;
....@@ -2898,7 +3413,7 @@
28983413 else
28993414 {
29003415 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3416
+ Globals.lighttouched = true;
29023417 //topView.object = group;
29033418 //frontView.object = group;
29043419 //sideView.object = group;
....@@ -2933,6 +3448,28 @@
29333448 refreshContents();
29343449 }
29353450
3451
+ void TransformChildren()
3452
+ {
3453
+ Object3D obj;
3454
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3455
+ {
3456
+ obj = (Object3D)e.nextElement();
3457
+ obj.KeepTextureMatrices();
3458
+ obj.TransformChildren();
3459
+ obj.RestoreTextureMatrices();
3460
+
3461
+// if (obj.parent == null)
3462
+// {
3463
+// System.out.println("NULL PARENT!");
3464
+// new Exception().printStackTrace();
3465
+// }
3466
+// else
3467
+// TouchTransform(obj);
3468
+// //obj.parent.Touch();
3469
+ }
3470
+
3471
+ refreshContents();
3472
+ }
29363473
29373474 void ResetTransform()
29383475 {
....@@ -3045,7 +3582,7 @@
30453582 refreshContents();
30463583 }
30473584
3048
- void ResetCentroid()
3585
+ void ResetCentroid(boolean full)
30493586 {
30503587 Object3D obj;
30513588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3597,16 @@
30603597 LA.matIdentity(Object3D.mat);
30613598 obj.getBounds(minima, maxima, false);
30623599 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3600
+ if (full)
3601
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643602 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653603 obj.TransformMesh(Object3D.mat);
3604
+
30663605 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3606
+ if (full)
3607
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683608 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3609
+
30693610 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703611 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713612 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3635,8 @@
30943635
30953636 int size = obj.MemorySize();
30963637
3097
- System.err.println((size/1024) + " KB is the size of " + obj);
3638
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3639
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30983640 }
30993641 }
31003642 catch (Exception e)
....@@ -3131,9 +3673,9 @@
31313673 obj = (Object3D)e.nextElement();
31323674
31333675 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3676
+ Grafreed.AnalyzeObject(obj);
31353677 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3678
+ Grafreed.AnalyzeObject(obj.bRep);
31373679
31383680 // System.err.println((size/1024) + " KB is the size of " + obj);
31393681 }
....@@ -3175,6 +3717,20 @@
31753717 void GenNormals(boolean crease)
31763718 {
31773719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
3727
+
3728
+ refreshContents();
3729
+ }
3730
+
3731
+ void GenNormalsMINE()
3732
+ {
3733
+ group.selection.GenNormalsMINE();
31783734
31793735 refreshContents();
31803736 }
....@@ -3340,8 +3896,8 @@
33403896
33413897 void ParseVertices()
33423898 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
3899
+ boolean epsequal = Grafreed.epsequal;
3900
+ Grafreed.epsequal = true;
33453901
33463902 for (int i=0; i<group.selection.size(); i++)
33473903 {
....@@ -3366,7 +3922,7 @@
33663922 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33673923 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33683924
3369
- g.add(GrafreeD.clipboard);
3925
+ g.add(Grafreed.clipboard);
33703926
33713927 buffer.add(g);
33723928 }
....@@ -3381,7 +3937,7 @@
33813937 makeSomething(buffer, i==group.selection.size()-1);
33823938 }
33833939
3384
- GrafreeD.epsequal = epsequal;
3940
+ Grafreed.epsequal = epsequal;
33853941
33863942 refreshContents();
33873943 }
....@@ -3399,7 +3955,16 @@
33993955 String pigment = Object3D.GetPigment(tex);
34003956 //String bump = Object3D.GetBump(tex);
34013957
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3958
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3959
+
3960
+ try
3961
+ {
3962
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3963
+ }
3964
+ catch (Exception e)
3965
+ {
3966
+ System.err.println("FAIL: " + node);
3967
+ }
34033968
34043969 double s = v.s;
34053970
....@@ -3447,12 +4012,26 @@
34474012
34484013 void Align()
34494014 {
4015
+ if (group.selection.size() == 0)
4016
+ return;
4017
+
4018
+ cVector bbmin = new cVector();
4019
+ cVector bbmax = new cVector();
4020
+
4021
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4022
+
4023
+ double dx = bbmax.x - bbmin.x;
4024
+ double dy = bbmax.y - bbmin.y;
4025
+ double dz = bbmax.z - bbmin.z;
4026
+
4027
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4028
+
34504029 for (int i=0; i<group.selection.size(); i++)
34514030 {
34524031 Object3D obj = group.selection.get(i);
34534032
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4033
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4034
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34564035 }
34574036
34584037 refreshContents();
....@@ -3473,11 +4052,11 @@
34734052
34744053 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34754054
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
4055
+ boolean random = CameraPane.SWITCH;
4056
+ CameraPane.SWITCH = false; // parse all random nodes
34784057 lowres.linkVerticesThis(null);
34794058 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
4059
+ CameraPane.SWITCH = random;
34814060
34824061 System.err.flush();
34834062
....@@ -3517,7 +4096,7 @@
35174096 return;
35184097
35194098 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
4099
+ Object3D ref = Grafreed.clipboard.get(0);
35214100
35224101 Object3D newgroup = new Object3D("Po:" + poses.name);
35234102
....@@ -3686,7 +4265,7 @@
36864265 group.selection.RelinkToSupport(); // july 2014
36874266 System.out.println("DONE.");
36884267 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4268
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904269 }
36914270
36924271 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4290,9 @@
37114290
37124291 void ClipMesh()
37134292 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4293
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154294 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4295
+ Object3D content = Grafreed.clipboard.get(0);
37174296
37184297 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194298 content = ((cGroup)content).get(0);
....@@ -3722,7 +4301,7 @@
37224301 // {
37234302 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244303 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4304
+ group.selection.ClipMesh(Grafreed.clipboard);
37264305 }
37274306 // group.selection.ClipMesh(GrafreeD.clipboard);
37284307 System.out.println("DONE.");
....@@ -3769,6 +4348,18 @@
37694348 void MarkLeaves(boolean hide)
37704349 {
37714350 group.selection.MarkLeaves(hide);
4351
+ refreshContents();
4352
+ }
4353
+
4354
+ void RewindLeaves(boolean hide)
4355
+ {
4356
+ group.selection.RewindLeaves(hide);
4357
+ refreshContents();
4358
+ }
4359
+
4360
+ void RandomLeaves(boolean hide)
4361
+ {
4362
+ group.selection.RandomLeaves(hide);
37724363 refreshContents();
37734364 }
37744365
....@@ -3854,10 +4445,10 @@
38544445 {
38554446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38564447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3857
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584449
38594450 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4451
+ if(elem != group || !newWindow)
38614452 {
38624453 // if (!(elem instanceof Composite))
38634454 // newWindow = false;
....@@ -3947,7 +4538,6 @@
39474538 //case 702: // Event.LIST_DESELECT
39484539 group.deselectAll();
39494540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514541 if (tps != null)
39524542 {
39534543 for (int i=0; i < tps.length; i++)
....@@ -3956,31 +4546,30 @@
39564546
39574547 //if (child.parent != null)
39584548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
39594550 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634551 }
39644552 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4553
+// else
4554
+// {
4555
+// objEditor.SetMaterial(group); // .GetMaterial());
4556
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4557
+// System.err.println("info : " + group.GetPath());
4558
+// }
39714559
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4560
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39754561 CameraPane.flash = true;
39764562
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784564 // a camera
39794565 {
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;
4566
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4567
+ {
4568
+ CameraPane.camerachangeframe = 0; // don't refuse it
4569
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4570
+ }
4571
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4572
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844573 }
39854574
39864575 refreshContents();
....@@ -3991,6 +4580,26 @@
39914580
39924581 freezemodel = false;
39934582 }
4583
+
4584
+ void refreshContents(boolean cp)
4585
+ {
4586
+ if (!Globals.MOUSEDRAGGED)
4587
+ {
4588
+ objEditor.ClearInfo(); // .GetMaterial());
4589
+
4590
+ for (int i=0; i < group.selection.Size(); i++)
4591
+ {
4592
+ Object3D child = (Object3D) group.selection.get(i);
4593
+
4594
+ objEditor.AddInfo(child, this, true);
4595
+ System.err.println("info : " + child.GetPath());
4596
+ }
4597
+
4598
+ objEditor.SetText(); // jan 2014
4599
+ }
4600
+
4601
+ super.refreshContents(cp);
4602
+ }
39944603
39954604 void linkSomething(Object3D thing)
39964605 {
....@@ -4062,16 +4671,19 @@
40624671 {
40634672 if (group.selection.isEmpty())
40644673 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4674
+
4675
+ Grafreed.clipboardIsTempGroup = false;
40664676 Composite tGroup = null;
40674677 if (group.selection.size() > 0) // 1)
40684678 {
40694679 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4680
+ Grafreed.clipboardIsTempGroup = true;
40714681 }
40724682
40734683 if (cut)
40744684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
40754687 //int indices[] = jList.getSelectedIndices();
40764688 //for (int i = indices.length - 1; i >= 0; i--)
40774689 //jList.remove(indices[i]);
....@@ -4107,16 +4719,16 @@
41074719 //System.out.println("cut " + child);
41084720 //System.out.println("parent = " + child.parent);
41094721 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4722
+ if (Grafreed.clipboardIsTempGroup)
41114723 tGroup.add/*Child*/(tmp);
41124724 else
4113
- GrafreeD.clipboard = tmp;
4725
+ Grafreed.clipboard = tmp;
41144726 }
41154727 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4728
+ if (Grafreed.clipboardIsTempGroup)
41174729 tGroup.add/*Child*/(child);
41184730 else
4119
- GrafreeD.clipboard = child;
4731
+ Grafreed.clipboard = child;
41204732 }
41214733
41224734 //ResetModel();
....@@ -4148,21 +4760,23 @@
41484760 //System.out.println("cut " + elem);
41494761 //System.out.println("parent = " + elem.parent);
41504762 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4763
+ if (Grafreed.clipboardIsTempGroup)
41524764 tGroup.add/*Child*/(tmp);
41534765 else
4154
- GrafreeD.clipboard = tmp;
4766
+ Grafreed.clipboard = tmp;
41554767 }
41564768 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4769
+ if (Grafreed.clipboardIsTempGroup)
41584770 tGroup.add/*Child*/(child);
41594771 else
4160
- GrafreeD.clipboard = child;
4772
+ Grafreed.clipboard = child;
41614773 }
41624774
41634775 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4776
+
4777
+ if (Grafreed.clipboardIsTempGroup)
4778
+ Grafreed.clipboard = tGroup;
4779
+
41664780 if (cut)
41674781 {
41684782 ResetModel();
....@@ -4176,7 +4790,7 @@
41764790 // return;
41774791 boolean first = true;
41784792
4179
- if (GrafreeD.clipboardIsTempGroup)
4793
+ if (Grafreed.clipboardIsTempGroup)
41804794 {
41814795 Composite temp;
41824796
....@@ -4187,7 +4801,7 @@
41874801 temp = (Composite)Applet3D.clipboard.deepCopy();
41884802 */
41894803 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4804
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41914805 {
41924806 Object3D child = (Object3D)e.nextElement();
41934807
....@@ -4221,21 +4835,21 @@
42214835 //Object3D cb = Applet3D.clipboard;
42224836 //temp.addChild(cb);
42234837 //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());
4838
+ assert(Grafreed.clipboard.parent == null);
4839
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4840
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4841
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4842
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42294843 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4844
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4845
+ Grafreed.clipboard.get(0).parent = keepparent;
42324846 }
42334847
42344848 ResetModel();
42354849 refreshContents();
42364850 }
42374851
4238
- void pasteInto(boolean copyit)
4852
+ void pasteInto(boolean copyit, boolean clone)
42394853 {
42404854 // if (GrafreeD.clipboard == null)
42414855 // return;
....@@ -4264,15 +4878,22 @@
42644878 if (copyit)
42654879 {
42664880 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4881
+ if (clone)
4882
+ {
4883
+ CloneClipboard(false); // sept 2014
4884
+ }
4885
+ else
4886
+ {
4887
+ paste(false);
4888
+ }
42684889 }
42694890 else
42704891 {
42714892 boolean first = true;
42724893
4273
- if (GrafreeD.clipboardIsTempGroup)
4894
+ if (Grafreed.clipboardIsTempGroup)
42744895 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
4896
+ Composite temp = (Composite)Grafreed.clipboard;
42764897 Object3D copy;
42774898 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42784899 {
....@@ -4282,7 +4903,7 @@
42824903 }
42834904 } else
42844905 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
4906
+ linkSomething(Grafreed.clipboard); //.get(0));
42864907 }
42874908 }
42884909 }
....@@ -4474,6 +5095,26 @@
44745095 makeSomething(csg);
44755096 }
44765097
5098
+ void Ungroup(Object3D g)
5099
+ {
5100
+ if (g instanceof HiddenObject)
5101
+ {
5102
+ HiddenObject h = (HiddenObject) g;
5103
+
5104
+ for (int i=0; i<h.ActualSize(); i++)
5105
+ {
5106
+ objEditor.makeSomething(h.get(i), false);
5107
+ }
5108
+ }
5109
+ else
5110
+ {
5111
+ for (int i=0; i<g.Size(); i++)
5112
+ {
5113
+ objEditor.makeSomething(g.get(i), false);
5114
+ }
5115
+ }
5116
+ }
5117
+
44775118 void ungroup()
44785119 {
44795120 /*
....@@ -4667,21 +5308,6 @@
46675308 }
46685309 */
46695310
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
-
46855311 /*
46865312 public void Callback(Object obj)
46875313 {
....@@ -4705,26 +5331,9 @@
47055331 }
47065332 */
47075333
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
-
47255334 String GetFile(String dialogName)
47265335 {
4727
- if (GrafreeD.standAlone)
5336
+ if (Grafreed.standAlone)
47285337 {
47295338 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305339 browser.show();
....@@ -4788,10 +5397,33 @@
47885397 cButton flashSelectionButton;
47895398 cButton editButton;
47905399 cButton uneditButton;
5400
+ JCheckBox allParamsButton;
47915401 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935402 cButton unselectButton;
47945403
5404
+ cButton minButton;
5405
+ cButton maxButton;
5406
+ cButton fullButton;
5407
+ cButton undoButton;
5408
+ cButton redoButton;
5409
+ cButton saveButton;
5410
+ cButton oneStepButton;
5411
+
5412
+ cButton groupButton;
5413
+ cButton ungroupButton;
5414
+ cButton compositeButton;
5415
+
5416
+ cButton gridButton;
5417
+ cButton boxButton;
5418
+ cButton sphereButton;
5419
+ cButton coneButton;
5420
+ cButton torusButton;
5421
+ cButton superButton;
5422
+ cButton kleinButton;
5423
+ cButton particlesButton;
5424
+ cButton overlayButton;
5425
+ cButton lightButton;
5426
+
47955427 cButton screenfitButton;
47965428 cButton screenfitpointButton;
47975429 cButton snapobjectButton;
....@@ -4802,14 +5434,6 @@
48025434 cButton closeButton;
48035435
48045436 cButton setsupportButton;
4805
-
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;
48135437
48145438 //
48155439 //Composite
....@@ -4822,7 +5446,9 @@
48225446 private MenuItem lookFromItem;
48235447 private MenuItem switchItem;
48245448 private MenuItem cutItem;
4825
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
48265452 private MenuItem cloneItem;
48275453 private MenuItem cloneSupportItem;
48285454 private MenuItem overwriteGeoItem;
....@@ -4833,8 +5459,9 @@
48335459 private MenuItem resetsupportItem;
48345460 private MenuItem resetreferencesItem;
48355461 private MenuItem linkverticesItem;
5462
+ private MenuItem relinkverticesItem;
48365463 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
48385465 private MenuItem stepAllItem;
48395466 private MenuItem revertMeshItem;
48405467 private MenuItem poseMeshItem;
....@@ -4845,6 +5472,7 @@
48455472 private MenuItem mergeGeometriesItem;
48465473 private MenuItem copyItem;
48475474 private MenuItem pasteItem;
5475
+ private MenuItem pasteIntoItem;
48485476 private MenuItem pasteLinkItem;
48495477 private MenuItem pasteCloneItem;
48505478 private MenuItem pasteExpandItem;
....@@ -4854,6 +5482,7 @@
48545482 private MenuItem genNormalsMESHItem;
48555483 private MenuItem genNormalsCADItem;
48565484 private MenuItem genNormalsORGANItem;
5485
+ private MenuItem genNormalsMINEItem;
48575486 private MenuItem stripifyItem;
48585487 private MenuItem unstripifyItem;
48595488 private MenuItem trimItem;
....@@ -4882,6 +5511,10 @@
48825511 private MenuItem showleavesItem;
48835512 private MenuItem markleavesItem;
48845513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
48855518
48865519 private MenuItem flipVItem;
48875520 private MenuItem unflipVItem;
....@@ -4893,8 +5526,11 @@
48935526 private MenuItem panoTexturesItem;
48945527
48955528 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5529
+ private MenuItem resetCentroidXZItem;
48975530 private MenuItem resetTransformItem;
5531
+ private MenuItem transformGeometryItem;
5532
+ private MenuItem transformChildrenItem;
5533
+ private MenuItem hideItem;
48985534 private MenuItem grabItem;
48995535 private MenuItem backItem;
49005536 private MenuItem frontItem;
....@@ -4915,6 +5551,7 @@
49155551
49165552 private MenuItem resetParentItem;
49175553 private MenuItem repairParentItem;
5554
+ private MenuItem repairShadowItem;
49185555 private MenuItem sortbysizeItem;
49195556 private MenuItem sortbynameItem;
49205557
....@@ -4935,10 +5572,11 @@
49355572 private MenuItem coneItem;
49365573 private MenuItem torusItem;
49375574 private MenuItem superItem;
5575
+ private MenuItem kleinItem;
49385576 private MenuItem blobItem;
49395577 private MenuItem latheItem;
49405578 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5579
+ private MenuItem overlayItem;
49425580 private MenuItem meshItem;
49435581 // private MenuItem meshGroupItem;
49445582 private MenuItem springItem;
....@@ -4947,6 +5585,7 @@
49475585 private MenuItem csgItem;
49485586 private MenuItem templateItem;
49495587 private MenuItem textureItem;
5588
+ private MenuItem billboardItem;
49505589 private MenuItem shadowXItem;
49515590 private MenuItem shadowYItem;
49525591 private MenuItem shadowZItem;
....@@ -4959,11 +5598,6 @@
49595598 private MenuItem doubleItem;
49605599 private MenuItem tripleItem;
49615600
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675601 private MenuItem computeAOItem;
49685602 private MenuItem recompileItem;
49695603 private MenuItem editScriptItem;
....@@ -4973,4 +5607,8 @@
49735607 private MenuItem analyzeItem;
49745608 private MenuItem dumpItem;
49755609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
49765614 }