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);
....@@ -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 {
....@@ -372,6 +453,10 @@
372453 oe.menuBar.add(menu = new Menu("Attributes"));
373454 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
374455 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);
375460 menu.add("-");
376461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
377462 liveleavesItem.addActionListener(this);
....@@ -392,6 +477,14 @@
392477 markleavesItem.addActionListener(this);
393478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
394479 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);
395488 menu.add("-");
396489 flipVItem = menu.add(new MenuItem("Flip V"));
397490 flipVItem.addActionListener(this);
....@@ -443,25 +536,24 @@
443536 oe.menuBar.add(menu = new Menu("Insert"));
444537 buildCreateMenu(menu);
445538
446
- oe.menuBar.add(menu = new Menu("Include"));
447
- importOBJItem = menu.add(new MenuItem("OBJ file..."));
448
- importOBJItem.addActionListener(this);
449
- menu.add("-");
450
- import3DSItem = menu.add(new MenuItem("3DS file..."));
451
- import3DSItem.addActionListener(this);
452
- menu.add("-");
453
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
- importVRMLX3DItem.addActionListener(this);
455
- menu.add("-");
456
- importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
- importGFDItem.addActionListener(this);
458
-
459539 oe.menuBar.add(menu = new Menu("Tools"));
460540 buildToolsMenu(menu);
461541 }
462542
463543 void SetupUI2(ObjEditor oe)
464544 {
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
+
465557 //new Exception().printStackTrace();
466558
467559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -492,23 +584,49 @@
492584 */
493585 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
494586
495
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
- 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");
497613 liveCB.addItemListener(this);
498614
499
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500616 oneStepButton.setToolTipText("Animate one step forward");
501617 oneStepButton.addActionListener(this);
502618
503
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
504620 fastCB.setToolTipText("Fast mode");
505621 fastCB.addItemListener(this);
506622
507
- 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);
508626 trackCB.setToolTipText("Enable tracking");
509627 trackCB.addItemListener(this);
510628
511
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512630 screenfitButton.setToolTipText("Screen fit");
513631 screenfitButton.addActionListener(this);
514632
....@@ -522,65 +640,112 @@
522640 snapobjectButton.setToolTipText("Snap Object");
523641 }
524642
525
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526
- flashSelectionButton.setToolTipText("Show selection");
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ flashSelectionButton.setToolTipText("Highlight selection");
527645 flashSelectionButton.addActionListener(this);
528646
529
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
530648
531
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532650 twoButton.setToolTipText("Show center view only");
533651 twoButton.addActionListener(this);
534
- 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);
535655 fourButton.addActionListener(this);
536656 fourButton.setToolTipText("Show left panel only");
537
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538658 sixButton.setToolTipText("2-column layout left");
539659 sixButton.addActionListener(this);
540
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541661 threeButton.setToolTipText("2-column layout right");
542662 threeButton.addActionListener(this);
543
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544664 sevenButton.setToolTipText("3-column layout");
545665 sevenButton.addActionListener(this);
546666 //
547667
548
- 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);
549669 rootButton.setToolTipText("Edit selection in new tab");
550670 rootButton.addActionListener(this);
551671
552
- 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);
553673 closeButton.setToolTipText("Close tab");
554674 closeButton.addActionListener(this);
555675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
556676 //clearButton.addActionListener(this);
557
-
558
- 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();
559692
560
- 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);
561726 editButton.setToolTipText("Edit selection");
562727 editButton.addActionListener(this);
563728
564
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565730 uneditButton.setToolTipText("Unedit selection");
566731 uneditButton.addActionListener(this);
567732
568
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
733
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569734 allParamsButton.setToolTipText("Edit all params");
570735 allParamsButton.addActionListener(this);
571736
572
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573738 clearPanelButton.setToolTipText("Clear edit panel");
574739 clearPanelButton.addActionListener(this);
575740
576
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577742 unselectButton.setToolTipText("Unselect");
578743 unselectButton.addActionListener(this);
579744
580
- commandsPanel.preferredHeight = 1;
745
+ editCommandsPanel.preferredHeight = 1;
581746
582
- oe.treePanel.add(commandsPanel);
583
- oe.treePanel.Return();
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
584749
585750 // oe.aConstraints.gridx += 1;
586751 // oe.aConstraints.weighty = 0;
....@@ -597,7 +762,7 @@
597762
598763 JScrollPane jSP;
599764 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
600
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
601766 ResetModel();
602767
603768 oe.treePanel.add(jSPPanel);
....@@ -702,11 +867,23 @@
702867 // debugCB.addItemListener(this);
703868
704869 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
705871 oeilCB.addItemListener(this);
706872
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
+ {
707883 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
708884 lookAtCB.setToolTipText("Look-at target");
709885 lookAtCB.addItemListener(this);
886
+ }
710887
711888 }
712889
....@@ -721,6 +898,14 @@
721898 void EditObject(Object3D obj)
722899 {
723900 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
+
724909 radioButton.SetObject(obj);
725910 radioButton.layout = sevenButton;
726911 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -729,8 +914,11 @@
729914 buttonGroup.add(radioButton);
730915 radioButton.doClick();
731916 }
917
+
732918 void SetupViews(ObjEditor oe)
733919 {
920
+ theFrame = this;
921
+
734922 oe.SetupViews();
735923
736924 System.out.println("SetupViews");
....@@ -739,23 +927,26 @@
739927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
740928 }
741929
742
- JCheckBox liveCB;
743
- JCheckBox supportCB;
744
- JCheckBox localCB;
745
- JCheckBox crowdCB;
746
- JCheckBox smoothCB;
747
- JCheckBox fastCB;
748
- JCheckBox slowCB;
749
- JCheckBox boxCB;
750
- JCheckBox zoomBoxCB;
751
- JCheckBox trackCB;
752
- 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;
753941 // JCheckBox speakerMocapCB;
754
- JCheckBox speakerCameraCB;
755
- JCheckBox speakerFocusCB;
756
- JCheckBox debugCB;
757
- JCheckBox oeilCB;
758
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
759950
760951 // static int COLOR = 1;
761952 // static int MATERIAL = 2;
....@@ -763,9 +954,9 @@
763954
764955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
765956
766
- JCheckBox colorCB;
767
- JCheckBox materialCB;
768
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
769960
770961 public void itemStateChanged(ItemEvent e)
771962 {
....@@ -793,6 +984,7 @@
793984 } else if(e.getSource() == liveCB)
794985 {
795986 cameraView.ToggleLive();
987
+ refreshContents(false);
796988 }
797989 else if(e.getSource() == supportCB)
798990 {
....@@ -857,6 +1049,14 @@
8571049 {
8581050 cameraView.ToggleOeil();
8591051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
8601060 else if(e.getSource() == lookAtCB)
8611061 {
8621062 cameraView.ToggleLookAt();
....@@ -873,7 +1073,8 @@
8731073
8741074 /**/
8751075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
876
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
8771078 if ((path == null) || (path.getPathCount() <= 1)) {
8781079 // We can't move the root node or an empty selection
8791080 return;
....@@ -997,16 +1198,16 @@
9971198 return;
9981199 }
9991200
1000
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1001
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
10021203 loadClipboard(true);
10031204 objEditor.jTree.setSelectionPath(destinationPath);
10041205 pasteInto(false, false);
1005
- } else {
1006
- loadClipboard(false);
1007
- objEditor.jTree.setSelectionPath(destinationPath);
1008
- pasteInto(false, false); // true); // ???
1009
- }
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
10101211 }
10111212 public void dropActionChanged(DropTargetDragEvent dtde)
10121213 // Called if the user has modified the current drop gesture
....@@ -1200,7 +1401,7 @@
12001401 memoryItem.addActionListener(this);
12011402 menu.add(analyzeItem = new MenuItem("Analyze"));
12021403 analyzeItem.addActionListener(this);
1203
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
12041405 dumpItem.addActionListener(this);
12051406 // menu.add(pathItem = new MenuItem("From-to path"));
12061407 // pathItem.addActionListener(this);
....@@ -1341,6 +1542,7 @@
13411542 shadow.material = new cMaterial(obj.material);
13421543 shadow.material.diffuse = 0.0001f;
13431544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
13441546
13451547 makeSomething(shadow);
13461548 }
....@@ -1597,11 +1799,11 @@
15971799 objEditor.cameraView.renderCamera.setAim(v2, v1);
15981800 objEditor.cameraView.repaint();
15991801 } else
1600
- if (source == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
16011803 {
16021804 makeSomething(new Box());
16031805 } else
1604
- if (source == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
16051807 {
16061808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16071809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1680,27 +1882,27 @@
16801882
16811883 makeSomething(obj);
16821884 } else
1683
- if (source == gridItem)
1885
+ if (source == gridItem || source == gridButton)
16841886 {
16851887 makeSomething(new Grid());
16861888 } else
1687
- if (source == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
16881890 {
16891891 makeSomething(new Sphere());
16901892 } else
1691
- if (source == coneItem)
1893
+ if (source == coneItem || source == coneButton)
16921894 {
16931895 makeSomething(new Cone());
16941896 } else
1695
- if (source == torusItem)
1897
+ if (source == torusItem || source == torusButton)
16961898 {
16971899 makeSomething(new Torus());
16981900 } else
1699
- if (source == superItem)
1901
+ if (source == superItem || source == superButton)
17001902 {
17011903 makeSomething(new Superellipsoid());
17021904 } else
1703
- if (source == kleinItem)
1905
+ if (source == kleinItem || source == kleinButton)
17041906 {
17051907 makeSomething(new Klein());
17061908 } else
....@@ -1720,7 +1922,7 @@
17201922 {
17211923 makeSomething(new BezierSurface());
17221924 } else
1723
- if (source == overlayItem)
1925
+ if (source == overlayItem || source == overlayButton)
17241926 {
17251927 /*
17261928 Object3D obj = new BezierSurface(5,8);
....@@ -1768,7 +1970,7 @@
17681970 s.setup();
17691971 makeSomething(s);
17701972 } else
1771
- if (source == lightItem)
1973
+ if (source == lightItem || source == lightButton)
17721974 {
17731975 makeSomething(new Light());
17741976 } else
....@@ -1854,31 +2056,6 @@
18542056 csg.addChild(child);
18552057 child.addChild(csg);
18562058 } else
1857
-
1858
- if (source == importGFDItem)
1859
- {
1860
- ImportGFD();
1861
- } else
1862
- if (source == importVRMLX3DItem)
1863
- {
1864
- ImportVRMLX3D();
1865
- } else
1866
- if (source == import3DSItem)
1867
- {
1868
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1869
- } else
1870
- if (source == importOBJItem)
1871
- {
1872
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
- browser.setVisible(true);
1875
- String filename = browser.getFile();
1876
- if (filename != null && filename.length() > 0)
1877
- {
1878
- String fullname = browser.getDirectory() + filename;
1879
- makeSomething(ReadOBJ(fullname), true);
1880
- }
1881
- } else
18822059 if (source == computeAOItem)
18832060 {
18842061 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1915,6 +2092,30 @@
19152092 if (source == dumpItem)
19162093 {
19172094 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();
19182119 } else
19192120 if (source == oneStepButton)
19202121 {
....@@ -1969,6 +2170,14 @@
19692170 if (source == cutItem || source == clearButton)
19702171 {
19712172 loadClipboard(true);
2173
+ } else
2174
+ if (source == undoItem)
2175
+ {
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
19722181 } else
19732182 if (source == duplicateItem)
19742183 {
....@@ -2281,7 +2490,7 @@
22812490 {
22822491 RevertMeshes();
22832492 } else
2284
- if (source == resetMeshItem)
2493
+ if (source == resetAllItem)
22852494 {
22862495 ResetAll();
22872496 } else
....@@ -2447,7 +2656,7 @@
24472656 {
24482657 CastShadow(2);
24492658 } else
2450
- if (source == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
24512660 {
24522661 //ungroup();
24532662 for (int i=0; i<group.selection.size(); i++)
....@@ -2469,7 +2678,7 @@
24692678 } else
24702679 if (source == genNormalsMESHItem)
24712680 {
2472
- GenNormals(true); // TODO
2681
+ GenNormalsMESH();
24732682 } else
24742683 if (source == genNormalsORGANItem)
24752684 {
....@@ -2534,6 +2743,22 @@
25342743 if (source == unmarkleavesItem)
25352744 {
25362745 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);
25372762 } else
25382763 if (source == flipVItem)
25392764 {
....@@ -2769,6 +2994,10 @@
27692994 if (source == twoButton)
27702995 {
27712996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
27723001 // bug
27733002 //gridPanel.setDividerLocation(1.0);
27743003 //bigPanel.setDividerLocation(0.0);
....@@ -2801,10 +3030,31 @@
28013030 bigThree.ClearUI();
28023031 bigThree.add(centralPanel);
28033032 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
+
28043051 } else
28053052 if (source == threeButton)
28063053 {
28073054 radio.layout = threeButton;
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
28083058
28093059 // bigThree.remove(scenePanel);
28103060 // bigThree.remove(centralPanel);
....@@ -2837,10 +3087,15 @@
28373087 bigThree.add(centralPanel);
28383088 bigThree.add(XYZPanel);
28393089 bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
28403092 } else
28413093 if (source == fourButton)
28423094 {
28433095 radio.layout = fourButton;
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
28443099
28453100 // bigThree.remove(scenePanel);
28463101 // bigThree.remove(centralPanel);
....@@ -2872,10 +3127,15 @@
28723127 bigThree.ClearUI();
28733128 bigThree.add(scenePanel);
28743129 bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
28753132 } else
28763133 if (source == sixButton)
28773134 {
28783135 radio.layout = sixButton;
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
28793139
28803140 // bigThree.remove(scenePanel);
28813141 // bigThree.remove(centralPanel);
....@@ -2908,10 +3168,15 @@
29083168 bigThree.add(scenePanel);
29093169 bigThree.add(centralPanel);
29103170 bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
29113173 } else
29123174 if (source == sevenButton)
29133175 {
29143176 radio.layout = sevenButton;
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
29153180
29163181 // bigThree.remove(scenePanel);
29173182 // bigThree.remove(centralPanel);
....@@ -2945,6 +3210,8 @@
29453210 bigThree.add(centralPanel);
29463211 bigThree.add(XYZPanel);
29473212 bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
29483215 } else
29493216 if (source == rootButton)
29503217 {
....@@ -2956,6 +3223,7 @@
29563223 EditObject(obj);
29573224 }
29583225
3226
+ cameraView.requestFocusInWindow();
29593227 refreshContents(true);
29603228 } else
29613229 if (source == closeButton)
....@@ -2965,18 +3233,27 @@
29653233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29663234 {
29673235 ab = (cRadio)e.nextElement();
2968
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29693237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
29703244 buttonGroup.remove(ab);
29713245 radioPanel.remove(ab);
29723246
2973
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
29743249 // ab.GetObject().objectUI = null; // ?????????
29753250
29763251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29773252 break;
29783253 }
29793254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
29803257 refreshContents(true);
29813258 } else
29823259 if (source == editItem || source == editButton)
....@@ -2993,7 +3270,7 @@
29933270 child.CloseUI();
29943271 listUI.remove(child);
29953272
2996
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
29973274 }
29983275 objEditor.ctrlPanel.FlushUI();
29993276 //objEditor.jTree.clearSelection();
....@@ -3079,7 +3356,11 @@
30793356 frontView.object = group;
30803357 sideView.object = group;
30813358 }
3082
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
30833364 /*
30843365 currentLayout = radio.layout;
30853366 if (currentLayout == null)
....@@ -3091,8 +3372,23 @@
30913372 //group.parent = null; // ROOT
30923373 //group.attributes = -1;
30933374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
30943377 refreshContents(true);
3095
- }
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
+ }
30963392 else
30973393 {
30983394 //return super.action(event, arg);
....@@ -3101,7 +3397,6 @@
31013397 }
31023398
31033399 boolean useclient = false;
3104
- cRadio radio;
31053400
31063401 void ToggleRoot()
31073402 {
....@@ -3340,7 +3635,8 @@
33403635
33413636 int size = obj.MemorySize();
33423637
3343
- 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)");
33443640 }
33453641 }
33463642 catch (Exception e)
....@@ -3421,6 +3717,13 @@
34213717 void GenNormals(boolean crease)
34223718 {
34233719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
34243727
34253728 refreshContents();
34263729 }
....@@ -3652,7 +3955,16 @@
36523955 String pigment = Object3D.GetPigment(tex);
36533956 //String bump = Object3D.GetBump(tex);
36543957
3655
- 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
+ }
36563968
36573969 double s = v.s;
36583970
....@@ -4039,6 +4351,18 @@
40394351 refreshContents();
40404352 }
40414353
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);
4363
+ refreshContents();
4364
+ }
4365
+
40424366 void SetTexRes(int tr)
40434367 {
40444368 group.selection.SetTexRes(tr);
....@@ -4121,10 +4445,10 @@
41214445 {
41224446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41234447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4124
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41254449
41264450 Object3D elem = (Object3D)group.selection.elementAt(i);
4127
- if(elem != group)
4451
+ if(elem != group || !newWindow)
41284452 {
41294453 // if (!(elem instanceof Composite))
41304454 // newWindow = false;
....@@ -4214,7 +4538,6 @@
42144538 //case 702: // Event.LIST_DESELECT
42154539 group.deselectAll();
42164540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4217
- objEditor.ClearInfo(); // .GetMaterial());
42184541 if (tps != null)
42194542 {
42204543 for (int i=0; i < tps.length; i++)
....@@ -4223,10 +4546,8 @@
42234546
42244547 //if (child.parent != null)
42254548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
42264550 group.addSelectee(child);
4227
- objEditor.SetMaterial(child); // .GetMaterial());
4228
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4229
- System.err.println("info : " + child.GetPath());
42304551 }
42314552 }
42324553 // else
....@@ -4236,16 +4557,17 @@
42364557 // System.err.println("info : " + group.GetPath());
42374558 // }
42384559
4239
- objEditor.SetText(); // jan 2014
4240
-
4241
- 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))
42424561 CameraPane.flash = true;
42434562
4244
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42454564 // a camera
42464565 {
4247
- CameraPane.camerachangeframe = 0; // don't refuse it
4248
- 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
+ }
42494571 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42504572 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42514573 }
....@@ -4258,6 +4580,26 @@
42584580
42594581 freezemodel = false;
42604582 }
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
+ }
42614603
42624604 void linkSomething(Object3D thing)
42634605 {
....@@ -4329,6 +4671,7 @@
43294671 {
43304672 if (group.selection.isEmpty())
43314673 return;
4674
+
43324675 Grafreed.clipboardIsTempGroup = false;
43334676 Composite tGroup = null;
43344677 if (group.selection.size() > 0) // 1)
....@@ -4339,6 +4682,8 @@
43394682
43404683 if (cut)
43414684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
43424687 //int indices[] = jList.getSelectedIndices();
43434688 //for (int i = indices.length - 1; i >= 0; i--)
43444689 //jList.remove(indices[i]);
....@@ -4428,8 +4773,10 @@
44284773 }
44294774
44304775 }
4776
+
44314777 if (Grafreed.clipboardIsTempGroup)
44324778 Grafreed.clipboard = tGroup;
4779
+
44334780 if (cut)
44344781 {
44354782 ResetModel();
....@@ -4961,21 +5308,6 @@
49615308 }
49625309 */
49635310
4964
- void ImportGFD()
4965
- {
4966
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", 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
-
4973
- //Object3D readobj =
4974
- objEditor.ReadGFD(fullname, objEditor);
4975
- //makeSomething(readobj);
4976
- }
4977
- }
4978
-
49795311 /*
49805312 public void Callback(Object obj)
49815313 {
....@@ -4999,23 +5331,6 @@
49995331 }
50005332 */
50015333
5002
- void ImportVRMLX3D()
5003
- {
5004
- if (Grafreed.standAlone)
5005
- {
5006
- /**/
5007
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
5008
- browser.show();
5009
- String filename = browser.getFile();
5010
- if (filename != null && filename.length() > 0)
5011
- {
5012
- String fullname = browser.getDirectory() + filename;
5013
- LoadVRMLX3D(fullname);
5014
- }
5015
- /**/
5016
- }
5017
- }
5018
-
50195334 String GetFile(String dialogName)
50205335 {
50215336 if (Grafreed.standAlone)
....@@ -5086,7 +5401,28 @@
50865401 cButton clearpanelButton;
50875402 cButton unselectButton;
50885403
5404
+ cButton minButton;
5405
+ cButton maxButton;
5406
+ cButton fullButton;
5407
+ cButton undoButton;
5408
+ cButton redoButton;
5409
+ cButton saveButton;
50895410 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;
50905426
50915427 cButton screenfitButton;
50925428 cButton screenfitpointButton;
....@@ -5099,14 +5435,6 @@
50995435
51005436 cButton setsupportButton;
51015437
5102
- cButton twoButton;
5103
- cButton sixButton;
5104
- cButton threeButton;
5105
- cButton sevenButton;
5106
- cButton fourButton; // full panel
5107
- cButton oneButton; // full XYZ
5108
- //cButton currentLayout;
5109
-
51105438 //
51115439 //Composite
51125440 Object3D // to do !!
....@@ -5118,7 +5446,9 @@
51185446 private MenuItem lookFromItem;
51195447 private MenuItem switchItem;
51205448 private MenuItem cutItem;
5121
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
51225452 private MenuItem cloneItem;
51235453 private MenuItem cloneSupportItem;
51245454 private MenuItem overwriteGeoItem;
....@@ -5131,7 +5461,7 @@
51315461 private MenuItem linkverticesItem;
51325462 private MenuItem relinkverticesItem;
51335463 private MenuItem setMasterItem;
5134
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
51355465 private MenuItem stepAllItem;
51365466 private MenuItem revertMeshItem;
51375467 private MenuItem poseMeshItem;
....@@ -5181,6 +5511,10 @@
51815511 private MenuItem showleavesItem;
51825512 private MenuItem markleavesItem;
51835513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
51845518
51855519 private MenuItem flipVItem;
51865520 private MenuItem unflipVItem;
....@@ -5264,11 +5598,6 @@
52645598 private MenuItem doubleItem;
52655599 private MenuItem tripleItem;
52665600
5267
- private MenuItem importGFDItem;
5268
- private MenuItem importVRMLX3DItem;
5269
- private MenuItem import3DSItem;
5270
- private MenuItem importOBJItem;
5271
-
52725601 private MenuItem computeAOItem;
52735602 private MenuItem recompileItem;
52745603 private MenuItem editScriptItem;
....@@ -5278,4 +5607,8 @@
52785607 private MenuItem analyzeItem;
52795608 private MenuItem dumpItem;
52805609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
52815614 }