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,19 +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);
222321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
224326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225327 setMasterItem.addActionListener(this);
328
+ }
226329
227330 oe.menuBar.add(menu = new Menu("Group"));
228331 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +336,38 @@
233336 frontItem.addActionListener(this);
234337 compositeItem = menu.add(new MenuItem("Composite"));
235338 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237343 hideItem.addActionListener(this);
344
+ }
238345 ungroupItem = menu.add(new MenuItem("Ungroup"));
239346 ungroupItem.addActionListener(this);
347
+
240348 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
349
+
350
+ randomItem = menu.add(new MenuItem("Switch node"));
242351 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
247354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248355 switchGeoItem.addActionListener(this);
249356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250357 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
252359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
253366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254367 scriptNodeItem.addActionListener(this);
255368 cameraItem = menu.add(new MenuItem("Camera"));
256369 cameraItem.addActionListener(this);
370
+ }
257371
258372 oe.menuBar.add(menu = new Menu("Object"));
259373 textureItem = menu.add(new MenuItem("Texture"));
....@@ -262,27 +376,35 @@
262376 billboardItem.addActionListener(this);
263377 csgItem = menu.add(new MenuItem("CSG"));
264378 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
379
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266380 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
381
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268382 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
383
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270384 shadowZItem.addActionListener(this);
385
+ if (Globals.ADVANCED)
386
+ {
387
+ menu.add("-");
271388 linkerItem = menu.add(new MenuItem("Linker"));
272389 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275390 attributeItem = menu.add(new MenuItem("Attribute"));
276391 attributeItem.addActionListener(this);
392
+ templateItem = menu.add(new MenuItem("Template"));
393
+ templateItem.addActionListener(this);
277394 pointflowItem = menu.add(new MenuItem("Point Flow"));
278395 pointflowItem.addActionListener(this);
396
+ }
279397 menu.add("-");
280398 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281399 resetTransformItem.addActionListener(this);
282400 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283401 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.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);
286408
287409 oe.menuBar.add(menu = new Menu("Geometry"));
288410 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +415,11 @@
293415 genNormalsCADItem.addActionListener(this);
294416 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295417 genNormalsMESHItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
296420 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297421 genNormalsMINEItem.addActionListener(this);
422
+ }
298423 stripifyItem = menu.add(new MenuItem("Stripify"));
299424 stripifyItem.addActionListener(this);
300425 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +441,34 @@
316441 reduce34MeshItem.addActionListener(this);
317442 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318443 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321444 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322445 clipMeshItem.addActionListener(this);
446
+
447
+ if (Globals.ADVANCED)
448
+ {
449
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
450
+ smoothMeshItem.addActionListener(this);
451
+ }
323452
324453 oe.menuBar.add(menu = new Menu("Attributes"));
325454 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326455 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);
327460 menu.add("-");
328461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329462 liveleavesItem.addActionListener(this);
330463 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331464 unliveleavesItem.addActionListener(this);
465
+ if (Globals.ADVANCED)
466
+ {
332467 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333468 supportleavesItem.addActionListener(this);
334469 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335470 unsupportleavesItem.addActionListener(this);
471
+ }
336472 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337473 hideleavesItem.addActionListener(this);
338474 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +477,14 @@
341477 markleavesItem.addActionListener(this);
342478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343479 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);
344488 menu.add("-");
345489 flipVItem = menu.add(new MenuItem("Flip V"));
346490 flipVItem.addActionListener(this);
....@@ -376,35 +520,40 @@
376520 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377521 sortbynameItem.addActionListener(this);
378522 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.
379530 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380531 extractGeometriesItem.addActionListener(this);
381532 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382533 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
534
+ }
387535
388536 oe.menuBar.add(menu = new Menu("Insert"));
389537 buildCreateMenu(menu);
390538
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402539 oe.menuBar.add(menu = new Menu("Tools"));
403540 buildToolsMenu(menu);
404541 }
405542
406543 void SetupUI2(ObjEditor oe)
407544 {
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
+
408557 //new Exception().printStackTrace();
409558
410559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +582,171 @@
433582 oe.radioPanel.add(dummyButton);
434583 oe.buttonGroup.add(dummyButton);
435584 */
436
- aConstraints.gridy += 1;
437
-
438585 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439586
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
587
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ //minButton.setToolTipText("Minimize window");
589
+ //minButton.addActionListener(this);
442590
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
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");
445613 liveCB.addItemListener(this);
446614
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), 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");
621
+ fastCB.addItemListener(this);
622
+
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
449626 trackCB.setToolTipText("Enable tracking");
450627 trackCB.addItemListener(this);
451628
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454630 screenfitButton.setToolTipText("Screen fit");
455631 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
632
+
457633 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458634 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464635
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
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");
472645 flashSelectionButton.addActionListener(this);
473646
474
- oe.toolbarPanel.add(new cButton(" ", false));
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475648
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482650 twoButton.setToolTipText("Show center view only");
483651 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
652
+ this.fullscreenLayout = twoButton;
653
+
654
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485655 fourButton.addActionListener(this);
486656 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488658 sixButton.setToolTipText("2-column layout left");
489659 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491661 threeButton.setToolTipText("2-column layout right");
492662 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494664 sevenButton.setToolTipText("3-column layout");
495665 sevenButton.addActionListener(this);
496666 //
497667
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ rootButton.setToolTipText("Edit selection in new tab");
500670 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
671
+
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503673 closeButton.setToolTipText("Close tab");
504674 closeButton.addActionListener(this);
505675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506676 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515677
516
- 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");
517731 uneditButton.addActionListener(this);
518732
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- 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");
531735 allParamsButton.addActionListener(this);
532736
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- 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");
538743 unselectButton.addActionListener(this);
539744
745
+ editCommandsPanel.preferredHeight = 1;
746
+
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
749
+
540750 // oe.aConstraints.gridx += 1;
541751 // oe.aConstraints.weighty = 0;
542752 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +758,37 @@
548758 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549759 // gcButton.addActionListener(this);
550760
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
761
+ cGridBag jSPPanel = new cGridBag();
762
+
763
+ JScrollPane jSP;
562764 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564766 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
767
+
768
+ oe.treePanel.add(jSPPanel);
769
+ oe.treePanel.Return();
569770
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- 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");
574775 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- 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");
577779 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- 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");
580783 textureCB.addItemListener(this);
581784
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
785
+ copyOptionsPanel.preferredHeight = 1;
786
+ oe.treePanel.add(copyOptionsPanel);
787
+ oe.treePanel.Return();
584788
789
+// mainPanel.setDividerLocation(0.5); //1.0);
790
+// mainPanel.setResizeWeight(0.5);
791
+
585792 //jList.addListSelectionListener(this);
586793 oe.jTree.addTreeSelectionListener(this);
587794 //jTree.setRootVisible(false);
....@@ -604,45 +811,37 @@
604811 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605812 }
606813
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
814
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608815 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
816
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639817 boxCB.setToolTipText("Display bounding boxes");
640818 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
819
+
820
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643821 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644822 zoomBoxCB.addItemListener(this);
645823
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
+
646845 // constraints.gridy += 1;
647846 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648847 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +849,16 @@
650849 if (false)
651850 {
652851 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
852
+ //constraints.gridy += 1;
853
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655854 speakerCameraCB.addItemListener(this);
656855
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
856
+ //constraints.gridy += 1;
857
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659858 speakerFocusCB.addItemListener(this);
660859
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
860
+ //constraints.gridy += 1;
861
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663862 smoothfocusCB.addItemListener(this);
664863 }
665864
....@@ -667,20 +866,46 @@
667866 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668867 // debugCB.addItemListener(this);
669868
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
869
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
672871 oeilCB.addItemListener(this);
673872
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
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);
676884 lookAtCB.setToolTipText("Look-at target");
677885 lookAtCB.addItemListener(this);
886
+ }
887
+
888
+ }
889
+
890
+ cGridBag fill = new cGridBag();
891
+
892
+ fill.preferredHeight = 200;
893
+
894
+ panel.add(fill);
678895
679896 }
680897
681898 void EditObject(Object3D obj)
682899 {
683900 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
+
684909 radioButton.SetObject(obj);
685910 radioButton.layout = sevenButton;
686911 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +914,11 @@
689914 buttonGroup.add(radioButton);
690915 radioButton.doClick();
691916 }
917
+
692918 void SetupViews(ObjEditor oe)
693919 {
920
+ theFrame = this;
921
+
694922 oe.SetupViews();
695923
696924 System.out.println("SetupViews");
....@@ -699,23 +927,26 @@
699927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
700928 }
701929
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- 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;
713941 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
719950
720951 // static int COLOR = 1;
721952 // static int MATERIAL = 2;
....@@ -723,9 +954,9 @@
723954
724955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
725956
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
729960
730961 public void itemStateChanged(ItemEvent e)
731962 {
....@@ -753,6 +984,7 @@
753984 } else if(e.getSource() == liveCB)
754985 {
755986 cameraView.ToggleLive();
987
+ refreshContents(false);
756988 }
757989 else if(e.getSource() == supportCB)
758990 {
....@@ -817,6 +1049,14 @@
8171049 {
8181050 cameraView.ToggleOeil();
8191051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
8201060 else if(e.getSource() == lookAtCB)
8211061 {
8221062 cameraView.ToggleLookAt();
....@@ -833,7 +1073,8 @@
8331073
8341074 /**/
8351075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
8371078 if ((path == null) || (path.getPathCount() <= 1)) {
8381079 // We can't move the root node or an empty selection
8391080 return;
....@@ -905,7 +1146,9 @@
9051146 // objEditor.DropFile((java.io.File[]) object, true);
9061147 // return;
9071148 // }
908
- if (string.charAt(0) == '/')
1149
+
1150
+ // File path for Mac and Windows
1151
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091152 {
9101153 // file(s)
9111154 String[] names = string.split("\n");
....@@ -932,7 +1175,7 @@
9321175
9331176 flashIt = false;
9341177 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1178
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361179 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371180
9381181 if (group.selection.size() == 1)
....@@ -955,16 +1198,16 @@
9551198 return;
9561199 }
9571200
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
959
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
9601203 loadClipboard(true);
9611204 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1205
+ pasteInto(false, false);
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
9681211 }
9691212 public void dropActionChanged(DropTargetDragEvent dtde)
9701213 // Called if the user has modified the current drop gesture
....@@ -1085,27 +1328,33 @@
10851328 kleinItem.addActionListener(this);
10861329 particleItem = menu.add(new MenuItem("Particle system"));
10871330 particleItem.addActionListener(this);
1331
+ if (Globals.ADVANCED)
1332
+ {
10881333 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891334 ragdollItem.addActionListener(this);
10901335 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911336 ragdoll2Item.addActionListener(this);
1337
+ }
10921338 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1339
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941340 meshItem.addActionListener(this);
10951341 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961342 // meshGroupItem.addActionListener(this);
1343
+ if (Globals.ADVANCED)
1344
+ {
10971345 springItem = menu.add(new MenuItem("Spring"));
10981346 springItem.addActionListener(this);
10991347 flagItem = menu.add(new MenuItem("Flag"));
11001348 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051349 blobItem = menu.add(new MenuItem("Blob"));
11061350 blobItem.addActionListener(this);
11071351 latheItem = menu.add(new MenuItem("Lathe"));
11081352 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);
11091358 lightItem = menu.add(new MenuItem("Light"));
11101359 lightItem.addActionListener(this);
11111360 menu.add("-");
....@@ -1115,39 +1364,44 @@
11151364 loopItem.addActionListener(this);
11161365 doubleItem = menu.add(new MenuItem("Fork"));
11171366 doubleItem.addActionListener(this);
1367
+ if (Globals.ADVANCED)
1368
+ {
11181369 tripleItem = menu.add(new MenuItem("Trident"));
11191370 tripleItem.addActionListener(this);
1371
+ }
11201372 }
11211373
11221374 void buildToolsMenu(Menu menu)
11231375 {
11241376 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251377 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1378
+ animationItem.setState(Globals.ANIMATION);
11271379
11281380 menu.add("-");
11291381 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301382 parseverticesItem.addActionListener(this);
11311383 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321384 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1385
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341386 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371387 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381388 reduceMorphItem.addActionListener(this);
11391389 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401390 reduce34MorphItem.addActionListener(this);
1141
-
1391
+ menu.add("-");
11421392 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431393 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451394
1395
+ if (Globals.ADVANCED)
1396
+ {
1397
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1398
+ mirrorItem.addActionListener(this);
1399
+ menu.add("-");
11461400 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471401 memoryItem.addActionListener(this);
11481402 menu.add(analyzeItem = new MenuItem("Analyze"));
11491403 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
11511405 dumpItem.addActionListener(this);
11521406 // menu.add(pathItem = new MenuItem("From-to path"));
11531407 // pathItem.addActionListener(this);
....@@ -1165,6 +1419,7 @@
11651419 menu.add("-");
11661420 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671421 editScriptItem.addActionListener(this);
1422
+ }
11681423 }
11691424
11701425 void ScreenFit()
....@@ -1287,6 +1542,7 @@
12871542 shadow.material = new cMaterial(obj.material);
12881543 shadow.material.diffuse = 0.0001f;
12891544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
12901546
12911547 makeSomething(shadow);
12921548 }
....@@ -1493,9 +1749,9 @@
14931749
14941750 void Overwrite(int mask)
14951751 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1752
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971753 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1754
+ Object3D content = Grafreed.clipboard.get(0);
14991755
15001756 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011757 content = ((cGroup)content).get(0);
....@@ -1543,11 +1799,11 @@
15431799 objEditor.cameraView.renderCamera.setAim(v2, v1);
15441800 objEditor.cameraView.repaint();
15451801 } else
1546
- if (source == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
15471803 {
15481804 makeSomething(new Box());
15491805 } else
1550
- if (source == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
15511807 {
15521808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15531809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1626,27 +1882,27 @@
16261882
16271883 makeSomething(obj);
16281884 } else
1629
- if (source == gridItem)
1885
+ if (source == gridItem || source == gridButton)
16301886 {
16311887 makeSomething(new Grid());
16321888 } else
1633
- if (source == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
16341890 {
16351891 makeSomething(new Sphere());
16361892 } else
1637
- if (source == coneItem)
1893
+ if (source == coneItem || source == coneButton)
16381894 {
16391895 makeSomething(new Cone());
16401896 } else
1641
- if (source == torusItem)
1897
+ if (source == torusItem || source == torusButton)
16421898 {
16431899 makeSomething(new Torus());
16441900 } else
1645
- if (source == superItem)
1901
+ if (source == superItem || source == superButton)
16461902 {
16471903 makeSomething(new Superellipsoid());
16481904 } else
1649
- if (source == kleinItem)
1905
+ if (source == kleinItem || source == kleinButton)
16501906 {
16511907 makeSomething(new Klein());
16521908 } else
....@@ -1666,7 +1922,7 @@
16661922 {
16671923 makeSomething(new BezierSurface());
16681924 } else
1669
- if (source == checkerItem)
1925
+ if (source == overlayItem || source == overlayButton)
16701926 {
16711927 /*
16721928 Object3D obj = new BezierSurface(5,8);
....@@ -1714,7 +1970,7 @@
17141970 s.setup();
17151971 makeSomething(s);
17161972 } else
1717
- if (source == lightItem)
1973
+ if (source == lightItem || source == lightButton)
17181974 {
17191975 makeSomething(new Light());
17201976 } else
....@@ -1800,23 +2056,6 @@
18002056 csg.addChild(child);
18012057 child.addChild(csg);
18022058 } else
1803
-
1804
- if (source == importGFDItem)
1805
- {
1806
- ImportGFD();
1807
- } else
1808
- if (source == importVRMLX3DItem)
1809
- {
1810
- ImportVRMLX3D();
1811
- } else
1812
- if (source == import3DSItem)
1813
- {
1814
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1815
- } else
1816
- if (source == importOBJItem)
1817
- {
1818
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1819
- } else
18202059 if (source == computeAOItem)
18212060 {
18222061 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1835,7 +2074,7 @@
18352074 if (source == invariantsItem)
18362075 {
18372076 System.out.println("Invariants:");
1838
- GrafreeD.grafreeD.universe.invariants();
2077
+ Grafreed.grafreeD.universe.invariants();
18392078 } else
18402079 if (source == memoryItem)
18412080 {
....@@ -1853,6 +2092,35 @@
18532092 if (source == dumpItem)
18542093 {
18552094 DumpObject();
2095
+ } else
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();
18562124 } else
18572125 if (source == screenfitButton)
18582126 {
....@@ -1903,12 +2171,20 @@
19032171 {
19042172 loadClipboard(true);
19052173 } else
2174
+ if (source == undoItem)
2175
+ {
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
2181
+ } else
19062182 if (source == duplicateItem)
19072183 {
1908
- Object3D keep = GrafreeD.clipboard;
2184
+ Object3D keep = Grafreed.clipboard;
19092185 loadClipboard(false);
19102186 paste(false);
1911
- GrafreeD.clipboard = keep;
2187
+ Grafreed.clipboard = keep;
19122188 } else
19132189 if (source == cloneItem)
19142190 {
....@@ -1926,13 +2202,17 @@
19262202 {
19272203 paste(false);
19282204 } else
2205
+ if (source == pasteIntoItem)
2206
+ {
2207
+ pasteInto(true, false);
2208
+ } else
19292209 if (source == pasteLinkItem)
19302210 {
1931
- pasteInto(false);
2211
+ pasteInto(false, false);
19322212 } else
19332213 if (source == pasteCloneItem)
19342214 {
1935
- pasteInto(true);
2215
+ pasteInto(true, true);
19362216 } else
19372217 if (source == pasteExpandItem)
19382218 {
....@@ -2124,9 +2404,9 @@
21242404 // group.selection.get(0).setMasterThis(content); // should be identity
21252405 // refreshContents();
21262406 // }
2127
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2407
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21282408 {
2129
- Object3D content = GrafreeD.clipboard.get(0);
2409
+ Object3D content = Grafreed.clipboard.get(0);
21302410
21312411 if (content instanceof cGroup && ((cGroup)content).transientlink )
21322412 content = ((cGroup)content).get(0);
....@@ -2134,11 +2414,11 @@
21342414 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352415 for (int i=0; i<group.selection.size(); i++)
21362416 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2417
+ boolean random = CameraPane.SWITCH;
2418
+ CameraPane.SWITCH = false; // parse all random nodes
21392419 group.selection.get(i).linkVerticesThis(content);
21402420 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2421
+ CameraPane.SWITCH = random;
21422422 }
21432423 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442424 refreshContents();
....@@ -2148,20 +2428,20 @@
21482428 {
21492429 for (int i=0; i<group.selection.size(); i++)
21502430 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2431
+ boolean random = CameraPane.SWITCH;
2432
+ CameraPane.SWITCH = false; // parse all random nodes
21532433 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2434
+ CameraPane.SWITCH = random;
21552435 }
21562436
21572437 refreshContents();
21582438 } else
21592439 if (source == relinkverticesItem)
21602440 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2441
+ boolean random = CameraPane.SWITCH;
2442
+ CameraPane.SWITCH = false; // parse all random nodes
21632443 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2444
+ CameraPane.SWITCH = random;
21652445
21662446 refreshContents();
21672447 } else
....@@ -2176,9 +2456,9 @@
21762456 } else
21772457 if (source == setMasterItem)
21782458 {
2179
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2459
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21802460 {
2181
- Object3D content = GrafreeD.clipboard.get(0);
2461
+ Object3D content = Grafreed.clipboard.get(0);
21822462
21832463 if (content instanceof cGroup && ((cGroup)content).transientlink )
21842464 content = ((cGroup)content).get(0);
....@@ -2191,9 +2471,9 @@
21912471 {
21922472 if (group.selection.size() == 1)
21932473 {
2194
- if (GrafreeD.clipboard.size() == 1)
2474
+ if (Grafreed.clipboard.size() == 1)
21952475 {
2196
- Object3D content = GrafreeD.clipboard.get(0);
2476
+ Object3D content = Grafreed.clipboard.get(0);
21972477
21982478 if (content instanceof cGroup && ((cGroup)content).transientlink )
21992479 content = ((cGroup)content).get(0);
....@@ -2210,7 +2490,7 @@
22102490 {
22112491 RevertMeshes();
22122492 } else
2213
- if (source == resetMeshItem)
2493
+ if (source == resetAllItem)
22142494 {
22152495 ResetAll();
22162496 } else
....@@ -2259,7 +2539,7 @@
22592539 RandomNode random = new RandomNode();
22602540 group(random);
22612541 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2542
+ random.name = random.get(0).name + "Switch";
22632543 } else
22642544 if (source == physicsItem)
22652545 {
....@@ -2376,7 +2656,7 @@
23762656 {
23772657 CastShadow(2);
23782658 } else
2379
- if (source == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
23802660 {
23812661 //ungroup();
23822662 for (int i=0; i<group.selection.size(); i++)
....@@ -2398,7 +2678,7 @@
23982678 } else
23992679 if (source == genNormalsMESHItem)
24002680 {
2401
- GenNormals(true); // TODO
2681
+ GenNormalsMESH();
24022682 } else
24032683 if (source == genNormalsORGANItem)
24042684 {
....@@ -2463,6 +2743,22 @@
24632743 if (source == unmarkleavesItem)
24642744 {
24652745 MarkLeaves(false);
2746
+ } else
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);
24662762 } else
24672763 if (source == flipVItem)
24682764 {
....@@ -2548,9 +2844,13 @@
25482844 {
25492845 SmoothMesh();
25502846 } else
2551
- if (source == transformgeometryItem)
2847
+ if (source == transformGeometryItem)
25522848 {
25532849 TransformGeometry();
2850
+ } else
2851
+ if (source == transformChildrenItem)
2852
+ {
2853
+ TransformChildren();
25542854 } else
25552855 if (source == resetTransformItem)
25562856 {
....@@ -2558,7 +2858,11 @@
25582858 } else
25592859 if (source == resetCentroidItem)
25602860 {
2561
- ResetCentroid();
2861
+ ResetCentroid(true);
2862
+ } else
2863
+ if (source == resetCentroidXZItem)
2864
+ {
2865
+ ResetCentroid(false);
25622866 } else
25632867 if (source == resetParentItem)
25642868 {
....@@ -2690,6 +2994,10 @@
26902994 if (source == twoButton)
26912995 {
26922996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
26933001 // bug
26943002 //gridPanel.setDividerLocation(1.0);
26953003 //bigPanel.setDividerLocation(0.0);
....@@ -2722,10 +3030,31 @@
27223030 bigThree.ClearUI();
27233031 bigThree.add(centralPanel);
27243032 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
+
27253051 } else
27263052 if (source == threeButton)
27273053 {
27283054 radio.layout = threeButton;
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
27293058
27303059 // bigThree.remove(scenePanel);
27313060 // bigThree.remove(centralPanel);
....@@ -2758,10 +3087,15 @@
27583087 bigThree.add(centralPanel);
27593088 bigThree.add(XYZPanel);
27603089 bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
27613092 } else
27623093 if (source == fourButton)
27633094 {
27643095 radio.layout = fourButton;
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
27653099
27663100 // bigThree.remove(scenePanel);
27673101 // bigThree.remove(centralPanel);
....@@ -2793,10 +3127,15 @@
27933127 bigThree.ClearUI();
27943128 bigThree.add(scenePanel);
27953129 bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
27963132 } else
27973133 if (source == sixButton)
27983134 {
27993135 radio.layout = sixButton;
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
28003139
28013140 // bigThree.remove(scenePanel);
28023141 // bigThree.remove(centralPanel);
....@@ -2829,10 +3168,15 @@
28293168 bigThree.add(scenePanel);
28303169 bigThree.add(centralPanel);
28313170 bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
28323173 } else
28333174 if (source == sevenButton)
28343175 {
28353176 radio.layout = sevenButton;
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
28363180
28373181 // bigThree.remove(scenePanel);
28383182 // bigThree.remove(centralPanel);
....@@ -2866,6 +3210,8 @@
28663210 bigThree.add(centralPanel);
28673211 bigThree.add(XYZPanel);
28683212 bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
28693215 } else
28703216 if (source == rootButton)
28713217 {
....@@ -2877,6 +3223,7 @@
28773223 EditObject(obj);
28783224 }
28793225
3226
+ cameraView.requestFocusInWindow();
28803227 refreshContents(true);
28813228 } else
28823229 if (source == closeButton)
....@@ -2886,18 +3233,27 @@
28863233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28873234 {
28883235 ab = (cRadio)e.nextElement();
2889
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28903237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
28913244 buttonGroup.remove(ab);
28923245 radioPanel.remove(ab);
28933246
2894
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
28953249 // ab.GetObject().objectUI = null; // ?????????
28963250
28973251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28983252 break;
28993253 }
29003254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
29013257 refreshContents(true);
29023258 } else
29033259 if (source == editItem || source == editButton)
....@@ -2914,9 +3270,9 @@
29143270 child.CloseUI();
29153271 listUI.remove(child);
29163272
2917
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
29183274 }
2919
- objEditor.ctrlPanel.revalidate();
3275
+ objEditor.ctrlPanel.FlushUI();
29203276 //objEditor.jTree.clearSelection();
29213277 //objEditor.ResetSliders();
29223278 refreshContents(true);
....@@ -3000,7 +3356,11 @@
30003356 frontView.object = group;
30013357 sideView.object = group;
30023358 }
3003
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
30043364 /*
30053365 currentLayout = radio.layout;
30063366 if (currentLayout == null)
....@@ -3012,8 +3372,23 @@
30123372 //group.parent = null; // ROOT
30133373 //group.attributes = -1;
30143374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
30153377 refreshContents(true);
3016
- }
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
+ }
30173392 else
30183393 {
30193394 //return super.action(event, arg);
....@@ -3022,7 +3397,6 @@
30223397 }
30233398
30243399 boolean useclient = false;
3025
- cRadio radio;
30263400
30273401 void ToggleRoot()
30283402 {
....@@ -3074,6 +3448,28 @@
30743448 refreshContents();
30753449 }
30763450
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
+ }
30773473
30783474 void ResetTransform()
30793475 {
....@@ -3186,7 +3582,7 @@
31863582 refreshContents();
31873583 }
31883584
3189
- void ResetCentroid()
3585
+ void ResetCentroid(boolean full)
31903586 {
31913587 Object3D obj;
31923588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3201,12 +3597,16 @@
32013597 LA.matIdentity(Object3D.mat);
32023598 obj.getBounds(minima, maxima, false);
32033599 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3204
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3600
+ if (full)
3601
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32053602 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32063603 obj.TransformMesh(Object3D.mat);
3604
+
32073605 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3208
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3606
+ if (full)
3607
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32093608 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3609
+
32103610 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32113611 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32123612 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3235,7 +3635,8 @@
32353635
32363636 int size = obj.MemorySize();
32373637
3238
- 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)");
32393640 }
32403641 }
32413642 catch (Exception e)
....@@ -3272,9 +3673,9 @@
32723673 obj = (Object3D)e.nextElement();
32733674
32743675 System.out.println("Object is: " + obj);
3275
- GrafreeD.AnalyzeObject(obj);
3676
+ Grafreed.AnalyzeObject(obj);
32763677 System.out.println("Boundary rep: " + obj.bRep);
3277
- GrafreeD.AnalyzeObject(obj.bRep);
3678
+ Grafreed.AnalyzeObject(obj.bRep);
32783679
32793680 // System.err.println((size/1024) + " KB is the size of " + obj);
32803681 }
....@@ -3316,6 +3717,13 @@
33163717 void GenNormals(boolean crease)
33173718 {
33183719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
33193727
33203728 refreshContents();
33213729 }
....@@ -3488,8 +3896,8 @@
34883896
34893897 void ParseVertices()
34903898 {
3491
- boolean epsequal = GrafreeD.epsequal;
3492
- GrafreeD.epsequal = true;
3899
+ boolean epsequal = Grafreed.epsequal;
3900
+ Grafreed.epsequal = true;
34933901
34943902 for (int i=0; i<group.selection.size(); i++)
34953903 {
....@@ -3514,7 +3922,7 @@
35143922 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35153923 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35163924
3517
- g.add(GrafreeD.clipboard);
3925
+ g.add(Grafreed.clipboard);
35183926
35193927 buffer.add(g);
35203928 }
....@@ -3529,7 +3937,7 @@
35293937 makeSomething(buffer, i==group.selection.size()-1);
35303938 }
35313939
3532
- GrafreeD.epsequal = epsequal;
3940
+ Grafreed.epsequal = epsequal;
35333941
35343942 refreshContents();
35353943 }
....@@ -3547,7 +3955,16 @@
35473955 String pigment = Object3D.GetPigment(tex);
35483956 //String bump = Object3D.GetBump(tex);
35493957
3550
- com.sun.opengl.util.texture.TextureData texturedata = Globals.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
+ }
35513968
35523969 double s = v.s;
35533970
....@@ -3635,11 +4052,11 @@
36354052
36364053 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36374054
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
4055
+ boolean random = CameraPane.SWITCH;
4056
+ CameraPane.SWITCH = false; // parse all random nodes
36404057 lowres.linkVerticesThis(null);
36414058 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
4059
+ CameraPane.SWITCH = random;
36434060
36444061 System.err.flush();
36454062
....@@ -3679,7 +4096,7 @@
36794096 return;
36804097
36814098 Object3D poses = group.selection.get(0);
3682
- Object3D ref = GrafreeD.clipboard.get(0);
4099
+ Object3D ref = Grafreed.clipboard.get(0);
36834100
36844101 Object3D newgroup = new Object3D("Po:" + poses.name);
36854102
....@@ -3873,9 +4290,9 @@
38734290
38744291 void ClipMesh()
38754292 {
3876
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4293
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38774294 {
3878
- Object3D content = GrafreeD.clipboard.get(0);
4295
+ Object3D content = Grafreed.clipboard.get(0);
38794296
38804297 if (content instanceof cGroup && ((cGroup)content).transientlink )
38814298 content = ((cGroup)content).get(0);
....@@ -3884,7 +4301,7 @@
38844301 // {
38854302 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38864303 // }
3887
- group.selection.ClipMesh(GrafreeD.clipboard);
4304
+ group.selection.ClipMesh(Grafreed.clipboard);
38884305 }
38894306 // group.selection.ClipMesh(GrafreeD.clipboard);
38904307 System.out.println("DONE.");
....@@ -3931,6 +4348,18 @@
39314348 void MarkLeaves(boolean hide)
39324349 {
39334350 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);
39344363 refreshContents();
39354364 }
39364365
....@@ -4016,10 +4445,10 @@
40164445 {
40174446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40184447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4019
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40204449
40214450 Object3D elem = (Object3D)group.selection.elementAt(i);
4022
- if(elem != group)
4451
+ if(elem != group || !newWindow)
40234452 {
40244453 // if (!(elem instanceof Composite))
40254454 // newWindow = false;
....@@ -4109,7 +4538,6 @@
41094538 //case 702: // Event.LIST_DESELECT
41104539 group.deselectAll();
41114540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4112
- objEditor.ClearInfo(); // .GetMaterial());
41134541 if (tps != null)
41144542 {
41154543 for (int i=0; i < tps.length; i++)
....@@ -4118,29 +4546,28 @@
41184546
41194547 //if (child.parent != null)
41204548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
41214550 group.addSelectee(child);
4122
- objEditor.SetMaterial(child); // .GetMaterial());
4123
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4124
- System.err.println("info : " + child.GetPath());
41254551 }
41264552 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4553
+// else
4554
+// {
4555
+// objEditor.SetMaterial(group); // .GetMaterial());
4556
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4557
+// System.err.println("info : " + group.GetPath());
4558
+// }
41334559
4134
- objEditor.SetText(); // jan 2014
4135
-
4136
- if (flashIt && !Globals.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))
41374561 CameraPane.flash = true;
41384562
4139
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41404564 // a camera
41414565 {
4142
- CameraPane.camerachangeframe = 0; // don't refuse it
4143
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
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
+ }
41444571 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41454572 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41464573 }
....@@ -4153,6 +4580,26 @@
41534580
41544581 freezemodel = false;
41554582 }
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
+ }
41564603
41574604 void linkSomething(Object3D thing)
41584605 {
....@@ -4224,16 +4671,19 @@
42244671 {
42254672 if (group.selection.isEmpty())
42264673 return;
4227
- GrafreeD.clipboardIsTempGroup = false;
4674
+
4675
+ Grafreed.clipboardIsTempGroup = false;
42284676 Composite tGroup = null;
42294677 if (group.selection.size() > 0) // 1)
42304678 {
42314679 tGroup = new cGroup();
4232
- GrafreeD.clipboardIsTempGroup = true;
4680
+ Grafreed.clipboardIsTempGroup = true;
42334681 }
42344682
42354683 if (cut)
42364684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
42374687 //int indices[] = jList.getSelectedIndices();
42384688 //for (int i = indices.length - 1; i >= 0; i--)
42394689 //jList.remove(indices[i]);
....@@ -4269,16 +4719,16 @@
42694719 //System.out.println("cut " + child);
42704720 //System.out.println("parent = " + child.parent);
42714721 // tmp.addChild(child);
4272
- if (GrafreeD.clipboardIsTempGroup)
4722
+ if (Grafreed.clipboardIsTempGroup)
42734723 tGroup.add/*Child*/(tmp);
42744724 else
4275
- GrafreeD.clipboard = tmp;
4725
+ Grafreed.clipboard = tmp;
42764726 }
42774727 else
4278
- if (GrafreeD.clipboardIsTempGroup)
4728
+ if (Grafreed.clipboardIsTempGroup)
42794729 tGroup.add/*Child*/(child);
42804730 else
4281
- GrafreeD.clipboard = child;
4731
+ Grafreed.clipboard = child;
42824732 }
42834733
42844734 //ResetModel();
....@@ -4310,21 +4760,23 @@
43104760 //System.out.println("cut " + elem);
43114761 //System.out.println("parent = " + elem.parent);
43124762 // tmp.addChild(elem);
4313
- if (GrafreeD.clipboardIsTempGroup)
4763
+ if (Grafreed.clipboardIsTempGroup)
43144764 tGroup.add/*Child*/(tmp);
43154765 else
4316
- GrafreeD.clipboard = tmp;
4766
+ Grafreed.clipboard = tmp;
43174767 }
43184768 else
4319
- if (GrafreeD.clipboardIsTempGroup)
4769
+ if (Grafreed.clipboardIsTempGroup)
43204770 tGroup.add/*Child*/(child);
43214771 else
4322
- GrafreeD.clipboard = child;
4772
+ Grafreed.clipboard = child;
43234773 }
43244774
43254775 }
4326
- if (GrafreeD.clipboardIsTempGroup)
4327
- GrafreeD.clipboard = tGroup;
4776
+
4777
+ if (Grafreed.clipboardIsTempGroup)
4778
+ Grafreed.clipboard = tGroup;
4779
+
43284780 if (cut)
43294781 {
43304782 ResetModel();
....@@ -4338,7 +4790,7 @@
43384790 // return;
43394791 boolean first = true;
43404792
4341
- if (GrafreeD.clipboardIsTempGroup)
4793
+ if (Grafreed.clipboardIsTempGroup)
43424794 {
43434795 Composite temp;
43444796
....@@ -4349,7 +4801,7 @@
43494801 temp = (Composite)Applet3D.clipboard.deepCopy();
43504802 */
43514803 Object3D elem;
4352
- 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))
43534805 {
43544806 Object3D child = (Object3D)e.nextElement();
43554807
....@@ -4383,21 +4835,21 @@
43834835 //Object3D cb = Applet3D.clipboard;
43844836 //temp.addChild(cb);
43854837 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4386
- assert(GrafreeD.clipboard.parent == null);
4387
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4388
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4389
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4390
- 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());
43914843 else
4392
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4393
- GrafreeD.clipboard.get(0).parent = keepparent;
4844
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4845
+ Grafreed.clipboard.get(0).parent = keepparent;
43944846 }
43954847
43964848 ResetModel();
43974849 refreshContents();
43984850 }
43994851
4400
- void pasteInto(boolean copyit)
4852
+ void pasteInto(boolean copyit, boolean clone)
44014853 {
44024854 // if (GrafreeD.clipboard == null)
44034855 // return;
....@@ -4426,15 +4878,22 @@
44264878 if (copyit)
44274879 {
44284880 // paste(false);
4429
- CloneClipboard(false); // sept 2014
4881
+ if (clone)
4882
+ {
4883
+ CloneClipboard(false); // sept 2014
4884
+ }
4885
+ else
4886
+ {
4887
+ paste(false);
4888
+ }
44304889 }
44314890 else
44324891 {
44334892 boolean first = true;
44344893
4435
- if (GrafreeD.clipboardIsTempGroup)
4894
+ if (Grafreed.clipboardIsTempGroup)
44364895 {
4437
- Composite temp = (Composite)GrafreeD.clipboard;
4896
+ Composite temp = (Composite)Grafreed.clipboard;
44384897 Object3D copy;
44394898 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44404899 {
....@@ -4444,7 +4903,7 @@
44444903 }
44454904 } else
44464905 {
4447
- linkSomething(GrafreeD.clipboard); //.get(0));
4906
+ linkSomething(Grafreed.clipboard); //.get(0));
44484907 }
44494908 }
44504909 }
....@@ -4849,21 +5308,6 @@
48495308 }
48505309 */
48515310
4852
- void ImportGFD()
4853
- {
4854
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4855
- browser.show();
4856
- String filename = browser.getFile();
4857
- if (filename != null && filename.length() > 0)
4858
- {
4859
- String fullname = browser.getDirectory() + filename;
4860
-
4861
- //Object3D readobj =
4862
- objEditor.ReadGFD(fullname, objEditor);
4863
- //makeSomething(readobj);
4864
- }
4865
- }
4866
-
48675311 /*
48685312 public void Callback(Object obj)
48695313 {
....@@ -4887,26 +5331,9 @@
48875331 }
48885332 */
48895333
4890
- void ImportVRMLX3D()
4891
- {
4892
- if (GrafreeD.standAlone)
4893
- {
4894
- /**/
4895
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4896
- browser.show();
4897
- String filename = browser.getFile();
4898
- if (filename != null && filename.length() > 0)
4899
- {
4900
- String fullname = browser.getDirectory() + filename;
4901
- LoadVRMLX3D(fullname);
4902
- }
4903
- /**/
4904
- }
4905
- }
4906
-
49075334 String GetFile(String dialogName)
49085335 {
4909
- if (GrafreeD.standAlone)
5336
+ if (Grafreed.standAlone)
49105337 {
49115338 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49125339 browser.show();
....@@ -4970,10 +5397,33 @@
49705397 cButton flashSelectionButton;
49715398 cButton editButton;
49725399 cButton uneditButton;
5400
+ JCheckBox allParamsButton;
49735401 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755402 cButton unselectButton;
49765403
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
+
49775427 cButton screenfitButton;
49785428 cButton screenfitpointButton;
49795429 cButton snapobjectButton;
....@@ -4984,14 +5434,6 @@
49845434 cButton closeButton;
49855435
49865436 cButton setsupportButton;
4987
-
4988
- cButton twoButton;
4989
- cButton sixButton;
4990
- cButton threeButton;
4991
- cButton sevenButton;
4992
- cButton fourButton; // full panel
4993
- cButton oneButton; // full XYZ
4994
- //cButton currentLayout;
49955437
49965438 //
49975439 //Composite
....@@ -5004,7 +5446,9 @@
50045446 private MenuItem lookFromItem;
50055447 private MenuItem switchItem;
50065448 private MenuItem cutItem;
5007
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
50085452 private MenuItem cloneItem;
50095453 private MenuItem cloneSupportItem;
50105454 private MenuItem overwriteGeoItem;
....@@ -5017,7 +5461,7 @@
50175461 private MenuItem linkverticesItem;
50185462 private MenuItem relinkverticesItem;
50195463 private MenuItem setMasterItem;
5020
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
50215465 private MenuItem stepAllItem;
50225466 private MenuItem revertMeshItem;
50235467 private MenuItem poseMeshItem;
....@@ -5028,6 +5472,7 @@
50285472 private MenuItem mergeGeometriesItem;
50295473 private MenuItem copyItem;
50305474 private MenuItem pasteItem;
5475
+ private MenuItem pasteIntoItem;
50315476 private MenuItem pasteLinkItem;
50325477 private MenuItem pasteCloneItem;
50335478 private MenuItem pasteExpandItem;
....@@ -5066,6 +5511,10 @@
50665511 private MenuItem showleavesItem;
50675512 private MenuItem markleavesItem;
50685513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
50695518
50705519 private MenuItem flipVItem;
50715520 private MenuItem unflipVItem;
....@@ -5077,8 +5526,10 @@
50775526 private MenuItem panoTexturesItem;
50785527
50795528 private MenuItem resetCentroidItem;
5080
- private MenuItem transformgeometryItem;
5529
+ private MenuItem resetCentroidXZItem;
50815530 private MenuItem resetTransformItem;
5531
+ private MenuItem transformGeometryItem;
5532
+ private MenuItem transformChildrenItem;
50825533 private MenuItem hideItem;
50835534 private MenuItem grabItem;
50845535 private MenuItem backItem;
....@@ -5125,7 +5576,7 @@
51255576 private MenuItem blobItem;
51265577 private MenuItem latheItem;
51275578 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5579
+ private MenuItem overlayItem;
51295580 private MenuItem meshItem;
51305581 // private MenuItem meshGroupItem;
51315582 private MenuItem springItem;
....@@ -5147,11 +5598,6 @@
51475598 private MenuItem doubleItem;
51485599 private MenuItem tripleItem;
51495600
5150
- private MenuItem importGFDItem;
5151
- private MenuItem importVRMLX3DItem;
5152
- private MenuItem import3DSItem;
5153
- private MenuItem importOBJItem;
5154
-
51555601 private MenuItem computeAOItem;
51565602 private MenuItem recompileItem;
51575603 private MenuItem editScriptItem;
....@@ -5161,4 +5607,8 @@
51615607 private MenuItem analyzeItem;
51625608 private MenuItem dumpItem;
51635609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
51645614 }