Normand Briere
2019-06-25 26b24f5b623e709a88e91e9bce0864f9d5e8f084
GroupEditor.java
....@@ -150,6 +150,8 @@
150150
151151 void SetupMenu2(GroupEditor oe)
152152 {
153
+ oe.jTree = new cTree();
154
+
153155 Menu menu;
154156 oe.menuBar.add(menu = new Menu("Edit"));
155157 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +162,7 @@
160162 // redoItem = menu.add(new MenuItem("Redo"));
161163 // redoItem.addActionListener(this);
162164 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164166 duplicateItem.addActionListener(this);
165167 cloneItem = menu.add(new MenuItem("Clone"));
166168 cloneItem.addActionListener(this);
....@@ -176,7 +178,6 @@
176178 copyItem.addActionListener(this);
177179 pasteItem = menu.add(new MenuItem("Paste"));
178180 pasteItem.addActionListener(this);
179
- menu.add("-");
180181
181182 menu.add("-");
182183 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -203,21 +204,21 @@
203204 //zBufferItem.addActionListener(this);
204205 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205206 //normalLensItem.addActionListener(this);
206
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
- revertCameraItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
208209
209
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
- toggleFullScreenItem.addItemListener(this);
211
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
- cameraMenu.add("-");
213
-
214
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
- toggleTextureItem.addItemListener(this);
216
- toggleTextureItem.setState(CameraPane.textureon);
217
-
218
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
- toggleSwitchItem.addItemListener(this);
220
- toggleSwitchItem.setState(CameraPane.SWITCH);
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);
221222
222223 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223224 toggleHandleItem.addItemListener(this);
....@@ -246,7 +247,7 @@
246247
247248 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248249 toggleDebugItem.addItemListener(this);
249
- toggleDebugItem.setState(CameraPane.DEBUG);
250
+ toggleDebugItem.setState(Globals.DEBUG);
250251
251252 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252253 toggleFrustumItem.addItemListener(this);
....@@ -274,7 +275,7 @@
274275 {
275276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
276277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
277
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
278279 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
279280 oe.cameraMenu.add("-");
280281 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -282,7 +283,7 @@
282283 editLeafItem.addActionListener(this);
283284 lookAtItem.addActionListener(this);
284285 //lookFromItem.addActinoListener(this);
285
- //switchItem.addActionListener(this);
286
+ //switchViewItem.addActionListener(this);
286287 }
287288
288289 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -327,21 +328,29 @@
327328 }
328329
329330 oe.menuBar.add(menu = new Menu("Group"));
330
- grabItem = menu.add(new MenuItem("Grab"));
331
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
332333 backItem = menu.add(new MenuItem("Back"));
333334 backItem.addActionListener(this);
334335 frontItem = menu.add(new MenuItem("Front"));
335336 frontItem.addActionListener(this);
336
- compositeItem = menu.add(new MenuItem("Composite"));
337
- compositeItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
338342 hideItem = menu.add(new MenuItem("Hidden Group"));
339343 hideItem.addActionListener(this);
344
+ }
340345 ungroupItem = menu.add(new MenuItem("Ungroup"));
341346 ungroupItem.addActionListener(this);
342
- menu.add("-");
343
- randomItem = menu.add(new MenuItem("Switch node"));
344
- randomItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
345354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
346355 switchGeoItem.addActionListener(this);
347356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -349,8 +358,6 @@
349358 morphItem = menu.add(new MenuItem("Morph Group"));
350359 morphItem.addActionListener(this);
351360
352
- if (Globals.ADVANCED)
353
- {
354361 menu.add("-");
355362 physicsItem = menu.add(new MenuItem("Physics"));
356363 physicsItem.addActionListener(this);
....@@ -358,22 +365,20 @@
358365 frameselectorItem.addActionListener(this);
359366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
360367 scriptNodeItem.addActionListener(this);
361
- cameraItem = menu.add(new MenuItem("Camera"));
362
- cameraItem.addActionListener(this);
363368 }
364369
365370 oe.menuBar.add(menu = new Menu("Object"));
366
- textureItem = menu.add(new MenuItem("Texture"));
367
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
368373 billboardItem = menu.add(new MenuItem("Billboard"));
369374 billboardItem.addActionListener(this);
370375 csgItem = menu.add(new MenuItem("CSG"));
371376 csgItem.addActionListener(this);
372
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
373378 shadowXItem.addActionListener(this);
374
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
375380 shadowYItem.addActionListener(this);
376
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
377382 shadowZItem.addActionListener(this);
378383 if (Globals.ADVANCED)
379384 {
....@@ -535,6 +540,18 @@
535540
536541 void SetupUI2(ObjEditor oe)
537542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
538555 //new Exception().printStackTrace();
539556
540557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -563,39 +580,61 @@
563580 oe.radioPanel.add(dummyButton);
564581 oe.buttonGroup.add(dummyButton);
565582 */
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
586
+
566587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
567588
568
- oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569606 undoButton.setToolTipText("Undo changes");
570607 undoButton.addActionListener(this);
571608
572
- oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573610 redoButton.setToolTipText("Redo changes");
574611 redoButton.addActionListener(this);
575612
576
- oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577614 saveButton.setToolTipText("Save changes");
578615 saveButton.addActionListener(this);
579616
580
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
581618 liveCB.setToolTipText("Enable animation");
582619 liveCB.addItemListener(this);
583620
584
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585622 oneStepButton.setToolTipText("Animate one step forward");
586623 oneStepButton.addActionListener(this);
587624
588
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
589626 fastCB.setToolTipText("Fast mode");
590627 fastCB.addItemListener(this);
591628
592
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
593
- trackCB.setToolTipText("Enable tracking");
594
- trackCB.addItemListener(this);
595
-
596
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ //oe.toolboxPanel.Return();
630
+
631
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597632 screenfitButton.setToolTipText("Screen fit");
598633 screenfitButton.addActionListener(this);
634
+
635
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636
+// trackCB.setToolTipText("Enable tracking");
637
+// trackCB.addItemListener(this);
599638
600639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
601640 // screenfitpointButton.addActionListener(this);
....@@ -607,65 +646,132 @@
607646 snapobjectButton.setToolTipText("Snap Object");
608647 }
609648
610
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
- flashSelectionButton.setToolTipText("Show selection");
612
- flashSelectionButton.addActionListener(this);
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
613650
614
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
615
-
616
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617652 twoButton.setToolTipText("Show center view only");
618653 twoButton.addActionListener(this);
619
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ this.fullscreenLayout = twoButton;
655
+
656
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620657 fourButton.addActionListener(this);
621658 fourButton.setToolTipText("Show left panel only");
622
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
659
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623660 sixButton.setToolTipText("2-column layout left");
624661 sixButton.addActionListener(this);
625
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626663 threeButton.setToolTipText("2-column layout right");
627664 threeButton.addActionListener(this);
628
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629666 sevenButton.setToolTipText("3-column layout");
630667 sevenButton.addActionListener(this);
631668 //
632669
633
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634671 rootButton.setToolTipText("Edit selection in new tab");
635672 rootButton.addActionListener(this);
636673
637
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638675 closeButton.setToolTipText("Close tab");
639676 closeButton.addActionListener(this);
640677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
641678 //clearButton.addActionListener(this);
642
-
643
- cGridBag commandsPanel = new cGridBag();
679
+
680
+ // INSERT
681
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ gridButton.setToolTipText("Create grid");
683
+ gridButton.addActionListener(this);
684
+
685
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ boxButton.setToolTipText("Create box");
687
+ boxButton.addActionListener(this);
688
+
689
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ sphereButton.setToolTipText("Create sphere");
691
+ sphereButton.addActionListener(this);
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
644711
645
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
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.Return();
717
+
718
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ groupButton.setToolTipText("Create group");
720
+ groupButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ compositeButton.setToolTipText("Create composite");
724
+ compositeButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ switchButton.setToolTipText("Create switch");
728
+ switchButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ loopButton.setToolTipText("Create loop");
732
+ loopButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ textureButton.setToolTipText("Create texture");
736
+ textureButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ overlayButton.setToolTipText("Create overlay");
740
+ overlayButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ lightButton.setToolTipText("Create light");
744
+ lightButton.addActionListener(this);
745
+
746
+ // EDIT panel
747
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646748 editButton.setToolTipText("Edit selection");
647749 editButton.addActionListener(this);
648750
649
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
751
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650752 uneditButton.setToolTipText("Unedit selection");
651753 uneditButton.addActionListener(this);
652754
653
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
755
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654756 allParamsButton.setToolTipText("Edit all params");
655757 allParamsButton.addActionListener(this);
656758
657
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
759
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658760 clearPanelButton.setToolTipText("Clear edit panel");
659761 clearPanelButton.addActionListener(this);
660762
661
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
763
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662764 unselectButton.setToolTipText("Unselect");
663765 unselectButton.addActionListener(this);
664766
665
- commandsPanel.preferredHeight = 1;
767
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ flashSelectionButton.setToolTipText("Highlight selection");
769
+ flashSelectionButton.addActionListener(this);
666770
667
- oe.treePanel.add(commandsPanel);
668
- oe.treePanel.Return();
771
+ editCommandsPanel.preferredHeight = 1;
772
+
773
+// oe.treePanel.add(commandsPanel);
774
+// oe.treePanel.Return();
669775
670776 // oe.aConstraints.gridx += 1;
671777 // oe.aConstraints.weighty = 0;
....@@ -682,27 +788,12 @@
682788
683789 JScrollPane jSP;
684790 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
685
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
686792 ResetModel();
687793
688794 oe.treePanel.add(jSPPanel);
689795 oe.treePanel.Return();
690796
691
- cGridBag copyOptionsPanel = new cGridBag();
692
-
693
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
694
- colorCB.setToolTipText("Copy color when dropped");
695
- colorCB.addItemListener(this);
696
-
697
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
698
- materialCB.setToolTipText("Copy material when dropped");
699
- materialCB.addItemListener(this);
700
-
701
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
702
- textureCB.setToolTipText("Copy texture when dropped");
703
- textureCB.addItemListener(this);
704
-
705
- copyOptionsPanel.preferredHeight = 1;
706797 oe.treePanel.add(copyOptionsPanel);
707798 oe.treePanel.Return();
708799
....@@ -733,6 +824,20 @@
733824
734825 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
735826 {
827
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
828
+ colorCB.setToolTipText("Copy color when dropped");
829
+ colorCB.addItemListener(this);
830
+
831
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
832
+ materialCB.setToolTipText("Copy material when dropped");
833
+ materialCB.addItemListener(this);
834
+
835
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
836
+ textureCB.setToolTipText("Copy texture when dropped");
837
+ textureCB.addItemListener(this);
838
+
839
+ panel.Return();
840
+
736841 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
737842 boxCB.setToolTipText("Display bounding boxes");
738843 boxCB.addItemListener(this);
....@@ -750,6 +855,8 @@
750855 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
751856 // localCB.addItemListener(this);
752857
858
+ panel.Return();
859
+
753860 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
754861 crowdCB.setToolTipText("Used for crowds");
755862 crowdCB.addItemListener(this);
....@@ -766,6 +873,8 @@
766873 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
767874 // speakerMocapCB.addItemListener(this);
768875
876
+ panel.Return();
877
+
769878 if (false)
770879 {
771880 // handled in scripts
....@@ -780,32 +889,72 @@
780889 //constraints.gridy += 1;
781890 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
782891 smoothfocusCB.addItemListener(this);
892
+ panel.Return();
783893 }
784894
785895 //constraints.gridx += 1;
786896 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
787897 // debugCB.addItemListener(this);
788898
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
789903 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
790905 oeilCB.addItemListener(this);
791906
907
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
+ shadowCB.setToolTipText("Compute shadows when live");
909
+ shadowCB.addItemListener(this);
910
+
911
+ panel.Return();
912
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
913
+ toggleTextureCB.setToolTipText("Load textures");
914
+ toggleTextureCB.addItemListener(this);
915
+
916
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
+ toggleSwitchCB.setToolTipText("Use switch");
918
+ toggleSwitchCB.addItemListener(this);
919
+
920
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
+ autosaveCB.setToolTipText("Auto-save on structure change");
922
+ autosaveCB.addItemListener(this);
923
+
924
+ panel.Return();
925
+ if (Globals.ADVANCED)
926
+ {
792927 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
793928 lookAtCB.setToolTipText("Look-at target");
794929 lookAtCB.addItemListener(this);
930
+ }
795931
796932 }
797933
798934 cGridBag fill = new cGridBag();
799
-
800935 fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
801940
802941 panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
803944
804945 }
805946
806947 void EditObject(Object3D obj)
807948 {
808949 cRadio radioButton = new cRadio(obj.name);
950
+
951
+ // Patch to avoid bug with transparency.
952
+ radioButton.hadMaterial = obj.material != null;
953
+ if (!radioButton.hadMaterial)
954
+ {
955
+ obj.material = new cMaterial();
956
+ }
957
+
809958 radioButton.SetObject(obj);
810959 radioButton.layout = sevenButton;
811960 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -817,6 +966,8 @@
817966
818967 void SetupViews(ObjEditor oe)
819968 {
969
+ theFrame = this;
970
+
820971 oe.SetupViews();
821972
822973 System.out.println("SetupViews");
....@@ -825,23 +976,27 @@
825976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
826977 }
827978
828
- JCheckBox liveCB;
829
- JCheckBox supportCB;
830
- JCheckBox localCB;
831
- JCheckBox crowdCB;
832
- JCheckBox smoothCB;
833
- JCheckBox fastCB;
834
- JCheckBox slowCB;
835
- JCheckBox boxCB;
836
- JCheckBox zoomBoxCB;
837
- JCheckBox trackCB;
838
- JCheckBox smoothfocusCB;
979
+ cToggleButton liveCB;
980
+ cCheckBox supportCB;
981
+ cCheckBox localCB;
982
+ cCheckBox crowdCB;
983
+ cCheckBox smoothCB;
984
+ cToggleButton fastCB;
985
+ cCheckBox slowCB;
986
+ cCheckBox boxCB;
987
+ cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
989
+ cCheckBox trackCB;
990
+ cCheckBox smoothfocusCB;
839991 // JCheckBox speakerMocapCB;
840
- JCheckBox speakerCameraCB;
841
- JCheckBox speakerFocusCB;
842
- JCheckBox debugCB;
843
- JCheckBox oeilCB;
844
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
8451000
8461001 // static int COLOR = 1;
8471002 // static int MATERIAL = 2;
....@@ -849,9 +1004,9 @@
8491004
8501005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8511006
852
- JCheckBox colorCB;
853
- JCheckBox materialCB;
854
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
8551010
8561011 public void itemStateChanged(ItemEvent e)
8571012 {
....@@ -944,6 +1099,14 @@
9441099 {
9451100 cameraView.ToggleOeil();
9461101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
9471110 else if(e.getSource() == lookAtCB)
9481111 {
9491112 cameraView.ToggleLookAt();
....@@ -960,7 +1123,8 @@
9601123
9611124 /**/
9621125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
963
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
9641128 if ((path == null) || (path.getPathCount() <= 1)) {
9651129 // We can't move the root node or an empty selection
9661130 return;
....@@ -1077,23 +1241,33 @@
10771241
10781242 assert target == objEditor.jTree;
10791243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
10801245 try {
1081
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10821247 } catch (Exception e) {
10831248 System.out.println("destinationPath : " + destinationPath);
10841249 return;
10851250 }
10861251
1087
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
10881253 {
1254
+ Object3D child = (Object3D)group.selection.elementAt(i);
1255
+
1256
+ // Cannot move into itself
1257
+ if (child == destinationLeaf)
1258
+ return;
1259
+ }
1260
+
1261
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1262
+// {
10891263 loadClipboard(true);
10901264 objEditor.jTree.setSelectionPath(destinationPath);
10911265 pasteInto(false, false);
1092
- } else {
1093
- loadClipboard(false);
1094
- objEditor.jTree.setSelectionPath(destinationPath);
1095
- pasteInto(false, false); // true); // ???
1096
- }
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
10971271 }
10981272 public void dropActionChanged(DropTargetDragEvent dtde)
10991273 // Called if the user has modified the current drop gesture
....@@ -1198,22 +1372,30 @@
11981372 {
11991373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12001374 //heightFieldItem.addActionListener(this);
1201
- gridItem = menu.add(new MenuItem("Grid"));
1202
- gridItem.addActionListener(this);
1203
- rectoidItem = menu.add(new MenuItem("Box"));
1204
- rectoidItem.addActionListener(this);
1205
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1206
- ellipsoidItem.addActionListener(this);
1207
- coneItem = menu.add(new MenuItem("Cone"));
1208
- coneItem.addActionListener(this);
1209
- torusItem = menu.add(new MenuItem("Torus"));
1210
- torusItem.addActionListener(this);
1211
- superItem = menu.add(new MenuItem("Superellipsoid"));
1212
- superItem.addActionListener(this);
1375
+// gridItem = menu.add(new MenuItem("Grid"));
1376
+// gridItem.addActionListener(this);
1377
+// rectoidItem = menu.add(new MenuItem("Box"));
1378
+// rectoidItem.addActionListener(this);
1379
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1380
+// ellipsoidItem.addActionListener(this);
1381
+// coneItem = menu.add(new MenuItem("Cone"));
1382
+// coneItem.addActionListener(this);
1383
+// torusItem = menu.add(new MenuItem("Torus"));
1384
+// torusItem.addActionListener(this);
1385
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1386
+// superItem.addActionListener(this);
1387
+
1388
+ cameraItem = menu.add(new MenuItem("Camera"));
1389
+ cameraItem.addActionListener(this);
1390
+
1391
+ if (!Globals.ADVANCED)
1392
+ {
12131393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12141394 kleinItem.addActionListener(this);
1215
- particleItem = menu.add(new MenuItem("Particle system"));
1216
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
12171399 if (Globals.ADVANCED)
12181400 {
12191401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1239,15 +1421,15 @@
12391421 }
12401422 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12411423 bezierItem.addActionListener(this);
1242
- overlayItem = menu.add(new MenuItem("Overlay"));
1243
- overlayItem.addActionListener(this);
1244
- lightItem = menu.add(new MenuItem("Light"));
1245
- lightItem.addActionListener(this);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
12461428 menu.add("-");
12471429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12481430 //superLoopItem.addActionListener(this);
1249
- loopItem = menu.add(new MenuItem("Loop"));
1250
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
12511433 doubleItem = menu.add(new MenuItem("Fork"));
12521434 doubleItem.addActionListener(this);
12531435 if (Globals.ADVANCED)
....@@ -1428,6 +1610,7 @@
14281610 shadow.material = new cMaterial(obj.material);
14291611 shadow.material.diffuse = 0.0001f;
14301612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
14311614
14321615 makeSomething(shadow);
14331616 }
....@@ -1675,7 +1858,7 @@
16751858 {
16761859 ScreenFit();
16771860 } else
1678
- if (source == switchItem)
1861
+ if (source == switchViewItem)
16791862 {
16801863 cVector v1 = new cVector();
16811864 cVector v2 = new cVector();
....@@ -1684,11 +1867,11 @@
16841867 objEditor.cameraView.renderCamera.setAim(v2, v1);
16851868 objEditor.cameraView.repaint();
16861869 } else
1687
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
16881871 {
16891872 makeSomething(new Box());
16901873 } else
1691
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
16921875 {
16931876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16941877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1767,27 +1950,27 @@
17671950
17681951 makeSomething(obj);
17691952 } else
1770
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
17711954 {
17721955 makeSomething(new Grid());
17731956 } else
1774
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
17751958 {
17761959 makeSomething(new Sphere());
17771960 } else
1778
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
17791962 {
17801963 makeSomething(new Cone());
17811964 } else
1782
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
17831966 {
17841967 makeSomething(new Torus());
17851968 } else
1786
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
17871970 {
17881971 makeSomething(new Superellipsoid());
17891972 } else
1790
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
17911974 {
17921975 makeSomething(new Klein());
17931976 } else
....@@ -1807,7 +1990,7 @@
18071990 {
18081991 makeSomething(new BezierSurface());
18091992 } else
1810
- if (source == overlayItem)
1993
+ if (source == overlayItem || source == overlayButton)
18111994 {
18121995 /*
18131996 Object3D obj = new BezierSurface(5,8);
....@@ -1855,7 +2038,7 @@
18552038 s.setup();
18562039 makeSomething(s);
18572040 } else
1858
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
18592042 {
18602043 makeSomething(new Light());
18612044 } else
....@@ -1905,7 +2088,7 @@
19052088
19062089 group(g);
19072090 } else
1908
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
19092092 {
19102093 Composite csg = new GroupLeaf();
19112094 csg.count = 5;
....@@ -1977,6 +2160,18 @@
19772160 if (source == dumpItem)
19782161 {
19792162 DumpObject();
2163
+ } else
2164
+ if (source == minButton)
2165
+ {
2166
+ Minimize();
2167
+ } else
2168
+ if (source == maxButton)
2169
+ {
2170
+ Maximize();
2171
+ } else
2172
+ if (source == fullButton)
2173
+ {
2174
+ ToggleFullScreen();
19802175 } else
19812176 if (source == undoButton)
19822177 {
....@@ -2383,9 +2578,9 @@
23832578 {
23842579 ClearSelection(true);
23852580 } else
2386
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
23872582 {
2388
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
23892584 } else
23902585 if (source == hideItem)
23912586 {
....@@ -2403,11 +2598,11 @@
24032598 {
24042599 makeSomething(new Camera());
24052600 } else
2406
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
24072602 {
24082603 group(new Composite());
24092604 } else
2410
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
24112606 {
24122607 RandomNode random = new RandomNode();
24132608 group(random);
....@@ -2509,7 +2704,7 @@
25092704 {
25102705 group(new cLinker());
25112706 } else
2512
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
25132708 {
25142709 group(new TextureNode());
25152710 } else
....@@ -2529,7 +2724,7 @@
25292724 {
25302725 CastShadow(2);
25312726 } else
2532
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
25332728 {
25342729 //ungroup();
25352730 for (int i=0; i<group.selection.size(); i++)
....@@ -2867,6 +3062,10 @@
28673062 if (source == twoButton)
28683063 {
28693064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
28703069 // bug
28713070 //gridPanel.setDividerLocation(1.0);
28723071 //bigPanel.setDividerLocation(0.0);
....@@ -2899,10 +3098,31 @@
28993098 bigThree.ClearUI();
29003099 bigThree.add(centralPanel);
29013100 bigThree.FlushUI();
3101
+
3102
+ cameraView.requestFocusInWindow();
3103
+
3104
+// refreshContents(true);
3105
+//
3106
+// try
3107
+// {
3108
+// java.awt.Robot bot = new java.awt.Robot();
3109
+// int mask = InputEvent.BUTTON1_MASK;
3110
+// bot.mouseMove(100, 100);
3111
+// bot.mousePress(mask);
3112
+// bot.mouseRelease(mask);
3113
+// }
3114
+// catch (Exception e)
3115
+// {
3116
+//
3117
+// }
3118
+
29023119 } else
29033120 if (source == threeButton)
29043121 {
29053122 radio.layout = threeButton;
3123
+
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
29063126
29073127 // bigThree.remove(scenePanel);
29083128 // bigThree.remove(centralPanel);
....@@ -2935,10 +3155,15 @@
29353155 bigThree.add(centralPanel);
29363156 bigThree.add(XYZPanel);
29373157 bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
29383160 } else
29393161 if (source == fourButton)
29403162 {
29413163 radio.layout = fourButton;
3164
+
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
29423167
29433168 // bigThree.remove(scenePanel);
29443169 // bigThree.remove(centralPanel);
....@@ -2970,10 +3195,15 @@
29703195 bigThree.ClearUI();
29713196 bigThree.add(scenePanel);
29723197 bigThree.FlushUI();
3198
+
3199
+ cameraView.requestFocusInWindow();
29733200 } else
29743201 if (source == sixButton)
29753202 {
29763203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
29773207
29783208 // bigThree.remove(scenePanel);
29793209 // bigThree.remove(centralPanel);
....@@ -3006,10 +3236,15 @@
30063236 bigThree.add(scenePanel);
30073237 bigThree.add(centralPanel);
30083238 bigThree.FlushUI();
3239
+
3240
+ cameraView.requestFocusInWindow();
30093241 } else
30103242 if (source == sevenButton)
30113243 {
30123244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
30133248
30143249 // bigThree.remove(scenePanel);
30153250 // bigThree.remove(centralPanel);
....@@ -3043,6 +3278,8 @@
30433278 bigThree.add(centralPanel);
30443279 bigThree.add(XYZPanel);
30453280 bigThree.FlushUI();
3281
+
3282
+ cameraView.requestFocusInWindow();
30463283 } else
30473284 if (source == rootButton)
30483285 {
....@@ -3054,6 +3291,7 @@
30543291 EditObject(obj);
30553292 }
30563293
3294
+ cameraView.requestFocusInWindow();
30573295 refreshContents(true);
30583296 } else
30593297 if (source == closeButton)
....@@ -3063,18 +3301,27 @@
30633301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30643302 {
30653303 ab = (cRadio)e.nextElement();
3066
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30673305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
30683312 buttonGroup.remove(ab);
30693313 radioPanel.remove(ab);
30703314
3071
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
30723317 // ab.GetObject().objectUI = null; // ?????????
30733318
30743319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30753320 break;
30763321 }
30773322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
30783325 refreshContents(true);
30793326 } else
30803327 if (source == editItem || source == editButton)
....@@ -3179,7 +3426,8 @@
31793426 }
31803427
31813428 // fix "+" issue
3182
- group.editWindow = this;
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
31833431
31843432 /*
31853433 currentLayout = radio.layout;
....@@ -3192,13 +3440,15 @@
31923440 //group.parent = null; // ROOT
31933441 //group.attributes = -1;
31943442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
31953445 refreshContents(true);
31963446 } else if (event.getSource() == editCameraItem)
31973447 {
31983448 cameraView.ProtectCamera();
31993449 cameraView.repaint();
32003450 return;
3201
- } else if (event.getSource() == revertCameraItem)
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
32023452 {
32033453 cameraView.RevertCamera();
32043454 cameraView.repaint();
....@@ -3215,7 +3465,6 @@
32153465 }
32163466
32173467 boolean useclient = false;
3218
- cRadio radio;
32193468
32203469 void ToggleRoot()
32213470 {
....@@ -4264,7 +4513,7 @@
42644513 {
42654514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
42664515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4267
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
42684517
42694518 Object3D elem = (Object3D)group.selection.elementAt(i);
42704519 if(elem != group || !newWindow)
....@@ -4402,7 +4651,8 @@
44024651
44034652 void refreshContents(boolean cp)
44044653 {
4405
- if (!Globals.MOUSEDRAGGED)
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
44064656 {
44074657 objEditor.ClearInfo(); // .GetMaterial());
44084658
....@@ -4501,6 +4751,7 @@
45014751
45024752 if (cut)
45034753 {
4754
+ if (Globals.SAVEONMAKE)
45044755 Save();
45054756 //int indices[] = jList.getSelectedIndices();
45064757 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -5219,10 +5470,33 @@
52195470 cButton clearpanelButton;
52205471 cButton unselectButton;
52215472
5222
- cButton saveButton;
5473
+ cButton restoreCameraButton;
5474
+
5475
+ cButton minButton;
5476
+ cButton maxButton;
5477
+ cButton fullButton;
52235478 cButton undoButton;
52245479 cButton redoButton;
5480
+ cButton saveButton;
52255481 cButton oneStepButton;
5482
+
5483
+ cButton groupButton;
5484
+ cButton ungroupButton;
5485
+ cButton compositeButton;
5486
+ cButton switchButton;
5487
+ cButton loopButton;
5488
+ cButton textureButton;
5489
+
5490
+ cButton gridButton;
5491
+ cButton boxButton;
5492
+ cButton sphereButton;
5493
+ cButton coneButton;
5494
+ cButton torusButton;
5495
+ cButton superButton;
5496
+ cButton kleinButton;
5497
+ cButton particlesButton;
5498
+ cButton overlayButton;
5499
+ cButton lightButton;
52265500
52275501 cButton screenfitButton;
52285502 cButton screenfitpointButton;
....@@ -5235,14 +5509,6 @@
52355509
52365510 cButton setsupportButton;
52375511
5238
- cButton twoButton;
5239
- cButton sixButton;
5240
- cButton threeButton;
5241
- cButton sevenButton;
5242
- cButton fourButton; // full panel
5243
- cButton oneButton; // full XYZ
5244
- //cButton currentLayout;
5245
-
52465512 //
52475513 //Composite
52485514 Object3D // to do !!
....@@ -5252,11 +5518,11 @@
52525518 //JTree jTree;
52535519 private MenuItem lookAtItem;
52545520 private MenuItem lookFromItem;
5255
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
52565522 private MenuItem cutItem;
52575523 private MenuItem undoItem;
52585524 private MenuItem redoItem;
5259
- private MenuItem duplicateItem;
5525
+ private JMenuItem duplicateItem;
52605526 private MenuItem cloneItem;
52615527 private MenuItem cloneSupportItem;
52625528 private MenuItem overwriteGeoItem;
....@@ -5344,7 +5610,7 @@
53445610 private MenuItem frontItem;
53455611 private MenuItem cameraItem;
53465612 private MenuItem compositeItem;
5347
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
53485614 private MenuItem physicsItem;
53495615 private MenuItem frameselectorItem;
53505616 private MenuItem scriptNodeItem;
....@@ -5418,5 +5684,5 @@
54185684
54195685 Menu cameraMenu;
54205686 MenuItem editCameraItem;
5421
- MenuItem revertCameraItem;
5687
+ MenuItem restoreCameraItem;
54225688 }