Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
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));
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));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -148,28 +148,21 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
- if (Globals.ADVANCED)
154
- {
155
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
156
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
157
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
158
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
159
- oe.cameraMenu.add("-");
160
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
161
- openWindowItem.addActionListener(this);
162
- editLeafItem.addActionListener(this);
163
- lookAtItem.addActionListener(this);
164
- //lookFromItem.addActinoListener(this);
165
- //switchItem.addActionListener(this);
166
- }
167
-
153
+ oe.jTree = new cTree();
154
+
168155 Menu menu;
169156 oe.menuBar.add(menu = new Menu("Edit"));
170157 //editItem = menu.add(new MenuItem("Edit"));
171158 //editItem.addActionListener(this);
172
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
173166 duplicateItem.addActionListener(this);
174167 cloneItem = menu.add(new MenuItem("Clone"));
175168 cloneItem.addActionListener(this);
....@@ -185,7 +178,6 @@
185178 copyItem.addActionListener(this);
186179 pasteItem = menu.add(new MenuItem("Paste"));
187180 pasteItem.addActionListener(this);
188
- menu.add("-");
189181
190182 menu.add("-");
191183 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -206,14 +198,97 @@
206198 clearAllItem = menu.add(new MenuItem("Clear All"));
207199 clearAllItem.addActionListener(this);
208200 }
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());
209237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchItem.addActionListener(this);
287
+ }
288
+
210289 oe.menuBar.add(menu = new Menu("Setting"));
211290 if (Globals.ADVANCED)
212291 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218293 revertMeshItem.addActionListener(this);
219294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -261,13 +336,21 @@
261336 frontItem.addActionListener(this);
262337 compositeItem = menu.add(new MenuItem("Composite"));
263338 compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
264342 hideItem = menu.add(new MenuItem("Hidden Group"));
265343 hideItem.addActionListener(this);
344
+ }
266345 ungroupItem = menu.add(new MenuItem("Ungroup"));
267346 ungroupItem.addActionListener(this);
347
+
268348 menu.add("-");
349
+
269350 randomItem = menu.add(new MenuItem("Switch node"));
270351 randomItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
271354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
272355 switchGeoItem.addActionListener(this);
273356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -275,8 +358,6 @@
275358 morphItem = menu.add(new MenuItem("Morph Group"));
276359 morphItem.addActionListener(this);
277360
278
- if (Globals.ADVANCED)
279
- {
280361 menu.add("-");
281362 physicsItem = menu.add(new MenuItem("Physics"));
282363 physicsItem.addActionListener(this);
....@@ -295,11 +376,11 @@
295376 billboardItem.addActionListener(this);
296377 csgItem = menu.add(new MenuItem("CSG"));
297378 csgItem.addActionListener(this);
298
- shadowXItem = menu.add(new MenuItem("Shadow X"));
379
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
299380 shadowXItem.addActionListener(this);
300
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
381
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
301382 shadowYItem.addActionListener(this);
302
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
383
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
303384 shadowZItem.addActionListener(this);
304385 if (Globals.ADVANCED)
305386 {
....@@ -318,8 +399,12 @@
318399 resetTransformItem.addActionListener(this);
319400 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320401 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- 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);
323408
324409 oe.menuBar.add(menu = new Menu("Geometry"));
325410 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -368,6 +453,10 @@
368453 oe.menuBar.add(menu = new Menu("Attributes"));
369454 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370455 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);
371460 menu.add("-");
372461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
373462 liveleavesItem.addActionListener(this);
....@@ -388,6 +477,14 @@
388477 markleavesItem.addActionListener(this);
389478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
390479 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);
391488 menu.add("-");
392489 flipVItem = menu.add(new MenuItem("Flip V"));
393490 flipVItem.addActionListener(this);
....@@ -422,41 +519,41 @@
422519 sortbysizeItem.addActionListener(this);
423520 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424521 sortbynameItem.addActionListener(this);
522
+ 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);
425527 if (Globals.ADVANCED)
426528 {
427
- menu.add("-");
529
+ // Pretty much the same as duplicate and clone.
428530 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429531 extractGeometriesItem.addActionListener(this);
430532 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431533 cloneGeometriesItem.addActionListener(this);
432
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
- shareGeometriesItem.addActionListener(this);
434
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
- mergeGeometriesItem.addActionListener(this);
436534 }
437535
438536 oe.menuBar.add(menu = new Menu("Insert"));
439537 buildCreateMenu(menu);
440538
441
- oe.menuBar.add(menu = new Menu("Include"));
442
- importOBJItem = menu.add(new MenuItem("OBJ file..."));
443
- importOBJItem.addActionListener(this);
444
- menu.add("-");
445
- import3DSItem = menu.add(new MenuItem("3DS file..."));
446
- import3DSItem.addActionListener(this);
447
- menu.add("-");
448
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
- importVRMLX3DItem.addActionListener(this);
450
- menu.add("-");
451
- importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
- importGFDItem.addActionListener(this);
453
-
454539 oe.menuBar.add(menu = new Menu("Tools"));
455540 buildToolsMenu(menu);
456541 }
457542
458543 void SetupUI2(ObjEditor oe)
459544 {
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
+
460557 //new Exception().printStackTrace();
461558
462559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -487,23 +584,49 @@
487584 */
488585 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
489586
490
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
- liveCB.setToolTipText("Enabled animation");
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");
492613 liveCB.addItemListener(this);
493614
494
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495616 oneStepButton.setToolTipText("Animate one step forward");
496617 oneStepButton.addActionListener(this);
497618
498
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
499620 fastCB.setToolTipText("Fast mode");
500621 fastCB.addItemListener(this);
501622
502
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
503626 trackCB.setToolTipText("Enable tracking");
504627 trackCB.addItemListener(this);
505628
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
507630 screenfitButton.setToolTipText("Screen fit");
508631 screenfitButton.addActionListener(this);
509632
....@@ -512,70 +635,117 @@
512635
513636 if (Globals.ADVANCED)
514637 {
515
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
638
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516639 snapobjectButton.addActionListener(this);
517640 snapobjectButton.setToolTipText("Snap Object");
518641 }
519642
520
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
- flashSelectionButton.setToolTipText("Show selection");
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ flashSelectionButton.setToolTipText("Highlight selection");
522645 flashSelectionButton.addActionListener(this);
523646
524
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525648
526
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527650 twoButton.setToolTipText("Show center view only");
528651 twoButton.addActionListener(this);
529
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
652
+ this.fullscreenLayout = twoButton;
653
+
654
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530655 fourButton.addActionListener(this);
531656 fourButton.setToolTipText("Show left panel only");
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533658 sixButton.setToolTipText("2-column layout left");
534659 sixButton.addActionListener(this);
535
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536661 threeButton.setToolTipText("2-column layout right");
537662 threeButton.addActionListener(this);
538
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
539664 sevenButton.setToolTipText("3-column layout");
540665 sevenButton.addActionListener(this);
541666 //
542667
543
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544669 rootButton.setToolTipText("Edit selection in new tab");
545670 rootButton.addActionListener(this);
546671
547
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548673 closeButton.setToolTipText("Close tab");
549674 closeButton.addActionListener(this);
550675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
551676 //clearButton.addActionListener(this);
552
-
553
- cGridBag commandsPanel = new cGridBag();
677
+
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();
554692
555
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
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);
556726 editButton.setToolTipText("Edit selection");
557727 editButton.addActionListener(this);
558728
559
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
729
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560730 uneditButton.setToolTipText("Unedit selection");
561731 uneditButton.addActionListener(this);
562732
563
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
733
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564734 allParamsButton.setToolTipText("Edit all params");
565735 allParamsButton.addActionListener(this);
566736
567
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
737
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
568738 clearPanelButton.setToolTipText("Clear edit panel");
569739 clearPanelButton.addActionListener(this);
570740
571
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
741
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
572742 unselectButton.setToolTipText("Unselect");
573743 unselectButton.addActionListener(this);
574744
575
- commandsPanel.preferredHeight = 1;
745
+ editCommandsPanel.preferredHeight = 1;
576746
577
- oe.treePanel.add(commandsPanel);
578
- oe.treePanel.Return();
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
579749
580750 // oe.aConstraints.gridx += 1;
581751 // oe.aConstraints.weighty = 0;
....@@ -592,7 +762,7 @@
592762
593763 JScrollPane jSP;
594764 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596766 ResetModel();
597767
598768 oe.treePanel.add(jSPPanel);
....@@ -651,7 +821,7 @@
651821 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
652822 zoomBoxCB.addItemListener(this);
653823
654
- if (Globals.ADVANCED)
824
+ if (true) // Globals.ADVANCED)
655825 {
656826 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657827 supportCB.setToolTipText("Enable rigging");
....@@ -697,11 +867,23 @@
697867 // debugCB.addItemListener(this);
698868
699869 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
700871 oeilCB.addItemListener(this);
701872
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
+ {
702883 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
703884 lookAtCB.setToolTipText("Look-at target");
704885 lookAtCB.addItemListener(this);
886
+ }
705887
706888 }
707889
....@@ -716,6 +898,14 @@
716898 void EditObject(Object3D obj)
717899 {
718900 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
+
719909 radioButton.SetObject(obj);
720910 radioButton.layout = sevenButton;
721911 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -724,8 +914,11 @@
724914 buttonGroup.add(radioButton);
725915 radioButton.doClick();
726916 }
917
+
727918 void SetupViews(ObjEditor oe)
728919 {
920
+ theFrame = this;
921
+
729922 oe.SetupViews();
730923
731924 System.out.println("SetupViews");
....@@ -734,23 +927,26 @@
734927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
735928 }
736929
737
- JCheckBox liveCB;
738
- JCheckBox supportCB;
739
- JCheckBox localCB;
740
- JCheckBox crowdCB;
741
- JCheckBox smoothCB;
742
- JCheckBox fastCB;
743
- JCheckBox slowCB;
744
- JCheckBox boxCB;
745
- JCheckBox zoomBoxCB;
746
- JCheckBox trackCB;
747
- 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;
748941 // JCheckBox speakerMocapCB;
749
- JCheckBox speakerCameraCB;
750
- JCheckBox speakerFocusCB;
751
- JCheckBox debugCB;
752
- JCheckBox oeilCB;
753
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
754950
755951 // static int COLOR = 1;
756952 // static int MATERIAL = 2;
....@@ -758,9 +954,9 @@
758954
759955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
760956
761
- JCheckBox colorCB;
762
- JCheckBox materialCB;
763
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
764960
765961 public void itemStateChanged(ItemEvent e)
766962 {
....@@ -788,6 +984,7 @@
788984 } else if(e.getSource() == liveCB)
789985 {
790986 cameraView.ToggleLive();
987
+ refreshContents(false);
791988 }
792989 else if(e.getSource() == supportCB)
793990 {
....@@ -852,6 +1049,14 @@
8521049 {
8531050 cameraView.ToggleOeil();
8541051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
8551060 else if(e.getSource() == lookAtCB)
8561061 {
8571062 cameraView.ToggleLookAt();
....@@ -868,7 +1073,8 @@
8681073
8691074 /**/
8701075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
871
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
8721078 if ((path == null) || (path.getPathCount() <= 1)) {
8731079 // We can't move the root node or an empty selection
8741080 return;
....@@ -940,7 +1146,9 @@
9401146 // objEditor.DropFile((java.io.File[]) object, true);
9411147 // return;
9421148 // }
943
- if (string.charAt(0) == '/')
1149
+
1150
+ // File path for Mac and Windows
1151
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9441152 {
9451153 // file(s)
9461154 String[] names = string.split("\n");
....@@ -967,7 +1175,7 @@
9671175
9681176 flashIt = false;
9691177 CameraPane pane = (CameraPane) target;
970
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1178
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9711179 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9721180
9731181 if (group.selection.size() == 1)
....@@ -990,16 +1198,16 @@
9901198 return;
9911199 }
9921200
993
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
994
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
9951203 loadClipboard(true);
9961204 objEditor.jTree.setSelectionPath(destinationPath);
9971205 pasteInto(false, false);
998
- } else {
999
- loadClipboard(false);
1000
- objEditor.jTree.setSelectionPath(destinationPath);
1001
- pasteInto(false, false); // true); // ???
1002
- }
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
10031211 }
10041212 public void dropActionChanged(DropTargetDragEvent dtde)
10051213 // Called if the user has modified the current drop gesture
....@@ -1193,7 +1401,7 @@
11931401 memoryItem.addActionListener(this);
11941402 menu.add(analyzeItem = new MenuItem("Analyze"));
11951403 analyzeItem.addActionListener(this);
1196
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
11971405 dumpItem.addActionListener(this);
11981406 // menu.add(pathItem = new MenuItem("From-to path"));
11991407 // pathItem.addActionListener(this);
....@@ -1334,6 +1542,7 @@
13341542 shadow.material = new cMaterial(obj.material);
13351543 shadow.material.diffuse = 0.0001f;
13361544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
13371546
13381547 makeSomething(shadow);
13391548 }
....@@ -1540,9 +1749,9 @@
15401749
15411750 void Overwrite(int mask)
15421751 {
1543
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1752
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15441753 {
1545
- Object3D content = GrafreeD.clipboard.get(0);
1754
+ Object3D content = Grafreed.clipboard.get(0);
15461755
15471756 if (content instanceof cGroup && ((cGroup)content).transientlink )
15481757 content = ((cGroup)content).get(0);
....@@ -1590,11 +1799,11 @@
15901799 objEditor.cameraView.renderCamera.setAim(v2, v1);
15911800 objEditor.cameraView.repaint();
15921801 } else
1593
- if (source == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
15941803 {
15951804 makeSomething(new Box());
15961805 } else
1597
- if (source == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
15981807 {
15991808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16001809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1673,27 +1882,27 @@
16731882
16741883 makeSomething(obj);
16751884 } else
1676
- if (source == gridItem)
1885
+ if (source == gridItem || source == gridButton)
16771886 {
16781887 makeSomething(new Grid());
16791888 } else
1680
- if (source == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
16811890 {
16821891 makeSomething(new Sphere());
16831892 } else
1684
- if (source == coneItem)
1893
+ if (source == coneItem || source == coneButton)
16851894 {
16861895 makeSomething(new Cone());
16871896 } else
1688
- if (source == torusItem)
1897
+ if (source == torusItem || source == torusButton)
16891898 {
16901899 makeSomething(new Torus());
16911900 } else
1692
- if (source == superItem)
1901
+ if (source == superItem || source == superButton)
16931902 {
16941903 makeSomething(new Superellipsoid());
16951904 } else
1696
- if (source == kleinItem)
1905
+ if (source == kleinItem || source == kleinButton)
16971906 {
16981907 makeSomething(new Klein());
16991908 } else
....@@ -1713,7 +1922,7 @@
17131922 {
17141923 makeSomething(new BezierSurface());
17151924 } else
1716
- if (source == overlayItem)
1925
+ if (source == overlayItem || source == overlayButton)
17171926 {
17181927 /*
17191928 Object3D obj = new BezierSurface(5,8);
....@@ -1761,7 +1970,7 @@
17611970 s.setup();
17621971 makeSomething(s);
17631972 } else
1764
- if (source == lightItem)
1973
+ if (source == lightItem || source == lightButton)
17651974 {
17661975 makeSomething(new Light());
17671976 } else
....@@ -1847,31 +2056,6 @@
18472056 csg.addChild(child);
18482057 child.addChild(csg);
18492058 } else
1850
-
1851
- if (source == importGFDItem)
1852
- {
1853
- ImportGFD();
1854
- } else
1855
- if (source == importVRMLX3DItem)
1856
- {
1857
- ImportVRMLX3D();
1858
- } else
1859
- if (source == import3DSItem)
1860
- {
1861
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1862
- } else
1863
- if (source == importOBJItem)
1864
- {
1865
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
- browser.setVisible(true);
1868
- String filename = browser.getFile();
1869
- if (filename != null && filename.length() > 0)
1870
- {
1871
- String fullname = browser.getDirectory() + filename;
1872
- makeSomething(ReadOBJ(fullname), true);
1873
- }
1874
- } else
18752059 if (source == computeAOItem)
18762060 {
18772061 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1890,7 +2074,7 @@
18902074 if (source == invariantsItem)
18912075 {
18922076 System.out.println("Invariants:");
1893
- GrafreeD.grafreeD.universe.invariants();
2077
+ Grafreed.grafreeD.universe.invariants();
18942078 } else
18952079 if (source == memoryItem)
18962080 {
....@@ -1908,6 +2092,30 @@
19082092 if (source == dumpItem)
19092093 {
19102094 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();
19112119 } else
19122120 if (source == oneStepButton)
19132121 {
....@@ -1963,12 +2171,20 @@
19632171 {
19642172 loadClipboard(true);
19652173 } else
2174
+ if (source == undoItem)
2175
+ {
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
2181
+ } else
19662182 if (source == duplicateItem)
19672183 {
1968
- Object3D keep = GrafreeD.clipboard;
2184
+ Object3D keep = Grafreed.clipboard;
19692185 loadClipboard(false);
19702186 paste(false);
1971
- GrafreeD.clipboard = keep;
2187
+ Grafreed.clipboard = keep;
19722188 } else
19732189 if (source == cloneItem)
19742190 {
....@@ -2188,9 +2404,9 @@
21882404 // group.selection.get(0).setMasterThis(content); // should be identity
21892405 // refreshContents();
21902406 // }
2191
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2407
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21922408 {
2193
- Object3D content = GrafreeD.clipboard.get(0);
2409
+ Object3D content = Grafreed.clipboard.get(0);
21942410
21952411 if (content instanceof cGroup && ((cGroup)content).transientlink )
21962412 content = ((cGroup)content).get(0);
....@@ -2240,9 +2456,9 @@
22402456 } else
22412457 if (source == setMasterItem)
22422458 {
2243
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2459
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22442460 {
2245
- Object3D content = GrafreeD.clipboard.get(0);
2461
+ Object3D content = Grafreed.clipboard.get(0);
22462462
22472463 if (content instanceof cGroup && ((cGroup)content).transientlink )
22482464 content = ((cGroup)content).get(0);
....@@ -2255,9 +2471,9 @@
22552471 {
22562472 if (group.selection.size() == 1)
22572473 {
2258
- if (GrafreeD.clipboard.size() == 1)
2474
+ if (Grafreed.clipboard.size() == 1)
22592475 {
2260
- Object3D content = GrafreeD.clipboard.get(0);
2476
+ Object3D content = Grafreed.clipboard.get(0);
22612477
22622478 if (content instanceof cGroup && ((cGroup)content).transientlink )
22632479 content = ((cGroup)content).get(0);
....@@ -2274,7 +2490,7 @@
22742490 {
22752491 RevertMeshes();
22762492 } else
2277
- if (source == resetMeshItem)
2493
+ if (source == resetAllItem)
22782494 {
22792495 ResetAll();
22802496 } else
....@@ -2440,7 +2656,7 @@
24402656 {
24412657 CastShadow(2);
24422658 } else
2443
- if (source == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
24442660 {
24452661 //ungroup();
24462662 for (int i=0; i<group.selection.size(); i++)
....@@ -2462,7 +2678,7 @@
24622678 } else
24632679 if (source == genNormalsMESHItem)
24642680 {
2465
- GenNormals(true); // TODO
2681
+ GenNormalsMESH();
24662682 } else
24672683 if (source == genNormalsORGANItem)
24682684 {
....@@ -2527,6 +2743,22 @@
25272743 if (source == unmarkleavesItem)
25282744 {
25292745 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);
25302762 } else
25312763 if (source == flipVItem)
25322764 {
....@@ -2612,9 +2844,13 @@
26122844 {
26132845 SmoothMesh();
26142846 } else
2615
- if (source == transformgeometryItem)
2847
+ if (source == transformGeometryItem)
26162848 {
26172849 TransformGeometry();
2850
+ } else
2851
+ if (source == transformChildrenItem)
2852
+ {
2853
+ TransformChildren();
26182854 } else
26192855 if (source == resetTransformItem)
26202856 {
....@@ -2622,7 +2858,11 @@
26222858 } else
26232859 if (source == resetCentroidItem)
26242860 {
2625
- ResetCentroid();
2861
+ ResetCentroid(true);
2862
+ } else
2863
+ if (source == resetCentroidXZItem)
2864
+ {
2865
+ ResetCentroid(false);
26262866 } else
26272867 if (source == resetParentItem)
26282868 {
....@@ -2754,6 +2994,10 @@
27542994 if (source == twoButton)
27552995 {
27562996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
27573001 // bug
27583002 //gridPanel.setDividerLocation(1.0);
27593003 //bigPanel.setDividerLocation(0.0);
....@@ -2786,10 +3030,31 @@
27863030 bigThree.ClearUI();
27873031 bigThree.add(centralPanel);
27883032 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
+
27893051 } else
27903052 if (source == threeButton)
27913053 {
27923054 radio.layout = threeButton;
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
27933058
27943059 // bigThree.remove(scenePanel);
27953060 // bigThree.remove(centralPanel);
....@@ -2822,10 +3087,15 @@
28223087 bigThree.add(centralPanel);
28233088 bigThree.add(XYZPanel);
28243089 bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
28253092 } else
28263093 if (source == fourButton)
28273094 {
28283095 radio.layout = fourButton;
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
28293099
28303100 // bigThree.remove(scenePanel);
28313101 // bigThree.remove(centralPanel);
....@@ -2857,10 +3127,15 @@
28573127 bigThree.ClearUI();
28583128 bigThree.add(scenePanel);
28593129 bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
28603132 } else
28613133 if (source == sixButton)
28623134 {
28633135 radio.layout = sixButton;
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
28643139
28653140 // bigThree.remove(scenePanel);
28663141 // bigThree.remove(centralPanel);
....@@ -2893,10 +3168,15 @@
28933168 bigThree.add(scenePanel);
28943169 bigThree.add(centralPanel);
28953170 bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
28963173 } else
28973174 if (source == sevenButton)
28983175 {
28993176 radio.layout = sevenButton;
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
29003180
29013181 // bigThree.remove(scenePanel);
29023182 // bigThree.remove(centralPanel);
....@@ -2930,6 +3210,8 @@
29303210 bigThree.add(centralPanel);
29313211 bigThree.add(XYZPanel);
29323212 bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
29333215 } else
29343216 if (source == rootButton)
29353217 {
....@@ -2941,6 +3223,7 @@
29413223 EditObject(obj);
29423224 }
29433225
3226
+ cameraView.requestFocusInWindow();
29443227 refreshContents(true);
29453228 } else
29463229 if (source == closeButton)
....@@ -2950,18 +3233,27 @@
29503233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29513234 {
29523235 ab = (cRadio)e.nextElement();
2953
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29543237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
29553244 buttonGroup.remove(ab);
29563245 radioPanel.remove(ab);
29573246
2958
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
29593249 // ab.GetObject().objectUI = null; // ?????????
29603250
29613251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29623252 break;
29633253 }
29643254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
29653257 refreshContents(true);
29663258 } else
29673259 if (source == editItem || source == editButton)
....@@ -2978,7 +3270,7 @@
29783270 child.CloseUI();
29793271 listUI.remove(child);
29803272
2981
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
29823274 }
29833275 objEditor.ctrlPanel.FlushUI();
29843276 //objEditor.jTree.clearSelection();
....@@ -3064,7 +3356,11 @@
30643356 frontView.object = group;
30653357 sideView.object = group;
30663358 }
3067
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
30683364 /*
30693365 currentLayout = radio.layout;
30703366 if (currentLayout == null)
....@@ -3076,8 +3372,23 @@
30763372 //group.parent = null; // ROOT
30773373 //group.attributes = -1;
30783374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
30793377 refreshContents(true);
3080
- }
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
+ }
30813392 else
30823393 {
30833394 //return super.action(event, arg);
....@@ -3086,7 +3397,6 @@
30863397 }
30873398
30883399 boolean useclient = false;
3089
- cRadio radio;
30903400
30913401 void ToggleRoot()
30923402 {
....@@ -3138,6 +3448,28 @@
31383448 refreshContents();
31393449 }
31403450
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
+ }
31413473
31423474 void ResetTransform()
31433475 {
....@@ -3250,7 +3582,7 @@
32503582 refreshContents();
32513583 }
32523584
3253
- void ResetCentroid()
3585
+ void ResetCentroid(boolean full)
32543586 {
32553587 Object3D obj;
32563588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3265,12 +3597,16 @@
32653597 LA.matIdentity(Object3D.mat);
32663598 obj.getBounds(minima, maxima, false);
32673599 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3268
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3600
+ if (full)
3601
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32693602 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32703603 obj.TransformMesh(Object3D.mat);
3604
+
32713605 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3272
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3606
+ if (full)
3607
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32733608 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3609
+
32743610 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32753611 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32763612 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3299,7 +3635,8 @@
32993635
33003636 int size = obj.MemorySize();
33013637
3302
- 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)");
33033640 }
33043641 }
33053642 catch (Exception e)
....@@ -3336,9 +3673,9 @@
33363673 obj = (Object3D)e.nextElement();
33373674
33383675 System.out.println("Object is: " + obj);
3339
- GrafreeD.AnalyzeObject(obj);
3676
+ Grafreed.AnalyzeObject(obj);
33403677 System.out.println("Boundary rep: " + obj.bRep);
3341
- GrafreeD.AnalyzeObject(obj.bRep);
3678
+ Grafreed.AnalyzeObject(obj.bRep);
33423679
33433680 // System.err.println((size/1024) + " KB is the size of " + obj);
33443681 }
....@@ -3380,6 +3717,13 @@
33803717 void GenNormals(boolean crease)
33813718 {
33823719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
33833727
33843728 refreshContents();
33853729 }
....@@ -3552,8 +3896,8 @@
35523896
35533897 void ParseVertices()
35543898 {
3555
- boolean epsequal = GrafreeD.epsequal;
3556
- GrafreeD.epsequal = true;
3899
+ boolean epsequal = Grafreed.epsequal;
3900
+ Grafreed.epsequal = true;
35573901
35583902 for (int i=0; i<group.selection.size(); i++)
35593903 {
....@@ -3578,7 +3922,7 @@
35783922 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35793923 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35803924
3581
- g.add(GrafreeD.clipboard);
3925
+ g.add(Grafreed.clipboard);
35823926
35833927 buffer.add(g);
35843928 }
....@@ -3593,7 +3937,7 @@
35933937 makeSomething(buffer, i==group.selection.size()-1);
35943938 }
35953939
3596
- GrafreeD.epsequal = epsequal;
3940
+ Grafreed.epsequal = epsequal;
35973941
35983942 refreshContents();
35993943 }
....@@ -3611,7 +3955,16 @@
36113955 String pigment = Object3D.GetPigment(tex);
36123956 //String bump = Object3D.GetBump(tex);
36133957
3614
- 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
+ }
36153968
36163969 double s = v.s;
36173970
....@@ -3743,7 +4096,7 @@
37434096 return;
37444097
37454098 Object3D poses = group.selection.get(0);
3746
- Object3D ref = GrafreeD.clipboard.get(0);
4099
+ Object3D ref = Grafreed.clipboard.get(0);
37474100
37484101 Object3D newgroup = new Object3D("Po:" + poses.name);
37494102
....@@ -3937,9 +4290,9 @@
39374290
39384291 void ClipMesh()
39394292 {
3940
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4293
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39414294 {
3942
- Object3D content = GrafreeD.clipboard.get(0);
4295
+ Object3D content = Grafreed.clipboard.get(0);
39434296
39444297 if (content instanceof cGroup && ((cGroup)content).transientlink )
39454298 content = ((cGroup)content).get(0);
....@@ -3948,7 +4301,7 @@
39484301 // {
39494302 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39504303 // }
3951
- group.selection.ClipMesh(GrafreeD.clipboard);
4304
+ group.selection.ClipMesh(Grafreed.clipboard);
39524305 }
39534306 // group.selection.ClipMesh(GrafreeD.clipboard);
39544307 System.out.println("DONE.");
....@@ -3995,6 +4348,18 @@
39954348 void MarkLeaves(boolean hide)
39964349 {
39974350 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);
39984363 refreshContents();
39994364 }
40004365
....@@ -4080,10 +4445,10 @@
40804445 {
40814446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40824447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4083
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40844449
40854450 Object3D elem = (Object3D)group.selection.elementAt(i);
4086
- if(elem != group)
4451
+ if(elem != group || !newWindow)
40874452 {
40884453 // if (!(elem instanceof Composite))
40894454 // newWindow = false;
....@@ -4173,7 +4538,6 @@
41734538 //case 702: // Event.LIST_DESELECT
41744539 group.deselectAll();
41754540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4176
- objEditor.ClearInfo(); // .GetMaterial());
41774541 if (tps != null)
41784542 {
41794543 for (int i=0; i < tps.length; i++)
....@@ -4182,10 +4546,8 @@
41824546
41834547 //if (child.parent != null)
41844548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
41854550 group.addSelectee(child);
4186
- objEditor.SetMaterial(child); // .GetMaterial());
4187
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4188
- System.err.println("info : " + child.GetPath());
41894551 }
41904552 }
41914553 // else
....@@ -4195,16 +4557,17 @@
41954557 // System.err.println("info : " + group.GetPath());
41964558 // }
41974559
4198
- objEditor.SetText(); // jan 2014
4199
-
4200
- 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))
42014561 CameraPane.flash = true;
42024562
4203
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42044564 // a camera
42054565 {
4206
- CameraPane.camerachangeframe = 0; // don't refuse it
4207
- 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
+ }
42084571 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42094572 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42104573 }
....@@ -4217,6 +4580,26 @@
42174580
42184581 freezemodel = false;
42194582 }
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
+ }
42204603
42214604 void linkSomething(Object3D thing)
42224605 {
....@@ -4288,16 +4671,19 @@
42884671 {
42894672 if (group.selection.isEmpty())
42904673 return;
4291
- GrafreeD.clipboardIsTempGroup = false;
4674
+
4675
+ Grafreed.clipboardIsTempGroup = false;
42924676 Composite tGroup = null;
42934677 if (group.selection.size() > 0) // 1)
42944678 {
42954679 tGroup = new cGroup();
4296
- GrafreeD.clipboardIsTempGroup = true;
4680
+ Grafreed.clipboardIsTempGroup = true;
42974681 }
42984682
42994683 if (cut)
43004684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
43014687 //int indices[] = jList.getSelectedIndices();
43024688 //for (int i = indices.length - 1; i >= 0; i--)
43034689 //jList.remove(indices[i]);
....@@ -4333,16 +4719,16 @@
43334719 //System.out.println("cut " + child);
43344720 //System.out.println("parent = " + child.parent);
43354721 // tmp.addChild(child);
4336
- if (GrafreeD.clipboardIsTempGroup)
4722
+ if (Grafreed.clipboardIsTempGroup)
43374723 tGroup.add/*Child*/(tmp);
43384724 else
4339
- GrafreeD.clipboard = tmp;
4725
+ Grafreed.clipboard = tmp;
43404726 }
43414727 else
4342
- if (GrafreeD.clipboardIsTempGroup)
4728
+ if (Grafreed.clipboardIsTempGroup)
43434729 tGroup.add/*Child*/(child);
43444730 else
4345
- GrafreeD.clipboard = child;
4731
+ Grafreed.clipboard = child;
43464732 }
43474733
43484734 //ResetModel();
....@@ -4374,21 +4760,23 @@
43744760 //System.out.println("cut " + elem);
43754761 //System.out.println("parent = " + elem.parent);
43764762 // tmp.addChild(elem);
4377
- if (GrafreeD.clipboardIsTempGroup)
4763
+ if (Grafreed.clipboardIsTempGroup)
43784764 tGroup.add/*Child*/(tmp);
43794765 else
4380
- GrafreeD.clipboard = tmp;
4766
+ Grafreed.clipboard = tmp;
43814767 }
43824768 else
4383
- if (GrafreeD.clipboardIsTempGroup)
4769
+ if (Grafreed.clipboardIsTempGroup)
43844770 tGroup.add/*Child*/(child);
43854771 else
4386
- GrafreeD.clipboard = child;
4772
+ Grafreed.clipboard = child;
43874773 }
43884774
43894775 }
4390
- if (GrafreeD.clipboardIsTempGroup)
4391
- GrafreeD.clipboard = tGroup;
4776
+
4777
+ if (Grafreed.clipboardIsTempGroup)
4778
+ Grafreed.clipboard = tGroup;
4779
+
43924780 if (cut)
43934781 {
43944782 ResetModel();
....@@ -4402,7 +4790,7 @@
44024790 // return;
44034791 boolean first = true;
44044792
4405
- if (GrafreeD.clipboardIsTempGroup)
4793
+ if (Grafreed.clipboardIsTempGroup)
44064794 {
44074795 Composite temp;
44084796
....@@ -4413,7 +4801,7 @@
44134801 temp = (Composite)Applet3D.clipboard.deepCopy();
44144802 */
44154803 Object3D elem;
4416
- 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))
44174805 {
44184806 Object3D child = (Object3D)e.nextElement();
44194807
....@@ -4447,14 +4835,14 @@
44474835 //Object3D cb = Applet3D.clipboard;
44484836 //temp.addChild(cb);
44494837 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4450
- assert(GrafreeD.clipboard.parent == null);
4451
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4452
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4453
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4454
- 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());
44554843 else
4456
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4457
- GrafreeD.clipboard.get(0).parent = keepparent;
4844
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4845
+ Grafreed.clipboard.get(0).parent = keepparent;
44584846 }
44594847
44604848 ResetModel();
....@@ -4503,9 +4891,9 @@
45034891 {
45044892 boolean first = true;
45054893
4506
- if (GrafreeD.clipboardIsTempGroup)
4894
+ if (Grafreed.clipboardIsTempGroup)
45074895 {
4508
- Composite temp = (Composite)GrafreeD.clipboard;
4896
+ Composite temp = (Composite)Grafreed.clipboard;
45094897 Object3D copy;
45104898 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45114899 {
....@@ -4515,7 +4903,7 @@
45154903 }
45164904 } else
45174905 {
4518
- linkSomething(GrafreeD.clipboard); //.get(0));
4906
+ linkSomething(Grafreed.clipboard); //.get(0));
45194907 }
45204908 }
45214909 }
....@@ -4920,21 +5308,6 @@
49205308 }
49215309 */
49225310
4923
- void ImportGFD()
4924
- {
4925
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4926
- browser.show();
4927
- String filename = browser.getFile();
4928
- if (filename != null && filename.length() > 0)
4929
- {
4930
- String fullname = browser.getDirectory() + filename;
4931
-
4932
- //Object3D readobj =
4933
- objEditor.ReadGFD(fullname, objEditor);
4934
- //makeSomething(readobj);
4935
- }
4936
- }
4937
-
49385311 /*
49395312 public void Callback(Object obj)
49405313 {
....@@ -4958,26 +5331,9 @@
49585331 }
49595332 */
49605333
4961
- void ImportVRMLX3D()
4962
- {
4963
- if (GrafreeD.standAlone)
4964
- {
4965
- /**/
4966
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4967
- browser.show();
4968
- String filename = browser.getFile();
4969
- if (filename != null && filename.length() > 0)
4970
- {
4971
- String fullname = browser.getDirectory() + filename;
4972
- LoadVRMLX3D(fullname);
4973
- }
4974
- /**/
4975
- }
4976
- }
4977
-
49785334 String GetFile(String dialogName)
49795335 {
4980
- if (GrafreeD.standAlone)
5336
+ if (Grafreed.standAlone)
49815337 {
49825338 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49835339 browser.show();
....@@ -5045,7 +5401,28 @@
50455401 cButton clearpanelButton;
50465402 cButton unselectButton;
50475403
5404
+ cButton minButton;
5405
+ cButton maxButton;
5406
+ cButton fullButton;
5407
+ cButton undoButton;
5408
+ cButton redoButton;
5409
+ cButton saveButton;
50485410 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;
50495426
50505427 cButton screenfitButton;
50515428 cButton screenfitpointButton;
....@@ -5058,14 +5435,6 @@
50585435
50595436 cButton setsupportButton;
50605437
5061
- cButton twoButton;
5062
- cButton sixButton;
5063
- cButton threeButton;
5064
- cButton sevenButton;
5065
- cButton fourButton; // full panel
5066
- cButton oneButton; // full XYZ
5067
- //cButton currentLayout;
5068
-
50695438 //
50705439 //Composite
50715440 Object3D // to do !!
....@@ -5077,7 +5446,9 @@
50775446 private MenuItem lookFromItem;
50785447 private MenuItem switchItem;
50795448 private MenuItem cutItem;
5080
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
50815452 private MenuItem cloneItem;
50825453 private MenuItem cloneSupportItem;
50835454 private MenuItem overwriteGeoItem;
....@@ -5090,7 +5461,7 @@
50905461 private MenuItem linkverticesItem;
50915462 private MenuItem relinkverticesItem;
50925463 private MenuItem setMasterItem;
5093
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
50945465 private MenuItem stepAllItem;
50955466 private MenuItem revertMeshItem;
50965467 private MenuItem poseMeshItem;
....@@ -5140,6 +5511,10 @@
51405511 private MenuItem showleavesItem;
51415512 private MenuItem markleavesItem;
51425513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
51435518
51445519 private MenuItem flipVItem;
51455520 private MenuItem unflipVItem;
....@@ -5151,8 +5526,10 @@
51515526 private MenuItem panoTexturesItem;
51525527
51535528 private MenuItem resetCentroidItem;
5154
- private MenuItem transformgeometryItem;
5529
+ private MenuItem resetCentroidXZItem;
51555530 private MenuItem resetTransformItem;
5531
+ private MenuItem transformGeometryItem;
5532
+ private MenuItem transformChildrenItem;
51565533 private MenuItem hideItem;
51575534 private MenuItem grabItem;
51585535 private MenuItem backItem;
....@@ -5221,11 +5598,6 @@
52215598 private MenuItem doubleItem;
52225599 private MenuItem tripleItem;
52235600
5224
- private MenuItem importGFDItem;
5225
- private MenuItem importVRMLX3DItem;
5226
- private MenuItem import3DSItem;
5227
- private MenuItem importOBJItem;
5228
-
52295601 private MenuItem computeAOItem;
52305602 private MenuItem recompileItem;
52315603 private MenuItem editScriptItem;
....@@ -5235,4 +5607,8 @@
52355607 private MenuItem analyzeItem;
52365608 private MenuItem dumpItem;
52375609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
52385614 }