Normand Briere
2019-06-25 d2f456cf5280f59425084532bd2397ec625f7577
GroupEditor.java
....@@ -150,16 +150,19 @@
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"));
156158 //editItem.addActionListener(this);
157
- undoItem = menu.add(new MenuItem("Undo"));
158
- undoItem.addActionListener(this);
159
- redoItem = menu.add(new MenuItem("Redo"));
160
- redoItem.addActionListener(this);
161
- menu.add("-");
162
- 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"));
163166 duplicateItem.addActionListener(this);
164167 cloneItem = menu.add(new MenuItem("Clone"));
165168 cloneItem.addActionListener(this);
....@@ -175,7 +178,6 @@
175178 copyItem.addActionListener(this);
176179 pasteItem = menu.add(new MenuItem("Paste"));
177180 pasteItem.addActionListener(this);
178
- menu.add("-");
179181
180182 menu.add("-");
181183 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -202,21 +204,21 @@
202204 //zBufferItem.addActionListener(this);
203205 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204206 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
- revertCameraItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
207209
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
212
-
213
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
- toggleTextureItem.addItemListener(this);
215
- toggleTextureItem.setState(CameraPane.textureon);
216
-
217
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
- toggleSwitchItem.addItemListener(this);
219
- 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);
220222
221223 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222224 toggleHandleItem.addItemListener(this);
....@@ -245,7 +247,7 @@
245247
246248 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247249 toggleDebugItem.addItemListener(this);
248
- toggleDebugItem.setState(CameraPane.DEBUG);
250
+ toggleDebugItem.setState(Globals.DEBUG);
249251
250252 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251253 toggleFrustumItem.addItemListener(this);
....@@ -266,14 +268,14 @@
266268 // animationItem.addItemListener(this);
267269 // animationItem.setState(CameraPane.ANIMATION);
268270 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270272 editCameraItem.addActionListener(this);
271273
272274 if (Globals.ADVANCED)
273275 {
274276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277279 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278280 oe.cameraMenu.add("-");
279281 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +283,7 @@
281283 editLeafItem.addActionListener(this);
282284 lookAtItem.addActionListener(this);
283285 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
286
+ //switchViewItem.addActionListener(this);
285287 }
286288
287289 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +328,29 @@
326328 }
327329
328330 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
331333 backItem = menu.add(new MenuItem("Back"));
332334 backItem.addActionListener(this);
333335 frontItem = menu.add(new MenuItem("Front"));
334336 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
337342 hideItem = menu.add(new MenuItem("Hidden Group"));
338343 hideItem.addActionListener(this);
344
+ }
339345 ungroupItem = menu.add(new MenuItem("Ungroup"));
340346 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- 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
+ {
344354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345355 switchGeoItem.addActionListener(this);
346356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +358,6 @@
348358 morphItem = menu.add(new MenuItem("Morph Group"));
349359 morphItem.addActionListener(this);
350360
351
- if (Globals.ADVANCED)
352
- {
353361 menu.add("-");
354362 physicsItem = menu.add(new MenuItem("Physics"));
355363 physicsItem.addActionListener(this);
....@@ -357,22 +365,20 @@
357365 frameselectorItem.addActionListener(this);
358366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359367 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362368 }
363369
364370 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
367373 billboardItem = menu.add(new MenuItem("Billboard"));
368374 billboardItem.addActionListener(this);
369375 csgItem = menu.add(new MenuItem("CSG"));
370376 csgItem.addActionListener(this);
371
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
372378 shadowXItem.addActionListener(this);
373
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
374380 shadowYItem.addActionListener(this);
375
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376382 shadowZItem.addActionListener(this);
377383 if (Globals.ADVANCED)
378384 {
....@@ -469,6 +475,14 @@
469475 markleavesItem.addActionListener(this);
470476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
471477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
472486 menu.add("-");
473487 flipVItem = menu.add(new MenuItem("Flip V"));
474488 flipVItem.addActionListener(this);
....@@ -526,6 +540,18 @@
526540
527541 void SetupUI2(ObjEditor oe)
528542 {
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
+
529555 //new Exception().printStackTrace();
530556
531557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -554,27 +580,61 @@
554580 oe.radioPanel.add(dummyButton);
555581 oe.buttonGroup.add(dummyButton);
556582 */
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
586
+
557587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
558588
559
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, 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);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ redoButton.setToolTipText("Redo changes");
611
+ redoButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ saveButton.setToolTipText("Save changes");
615
+ saveButton.addActionListener(this);
616
+
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
560618 liveCB.setToolTipText("Enable animation");
561619 liveCB.addItemListener(this);
562620
563
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564622 oneStepButton.setToolTipText("Animate one step forward");
565623 oneStepButton.addActionListener(this);
566624
567
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
568626 fastCB.setToolTipText("Fast mode");
569627 fastCB.addItemListener(this);
570628
571
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
- trackCB.setToolTipText("Enable tracking");
573
- trackCB.addItemListener(this);
574
-
575
- 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);
576632 screenfitButton.setToolTipText("Screen fit");
577633 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);
578638
579639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
580640 // screenfitpointButton.addActionListener(this);
....@@ -586,65 +646,132 @@
586646 snapobjectButton.setToolTipText("Snap Object");
587647 }
588648
589
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
- flashSelectionButton.setToolTipText("Show selection");
591
- flashSelectionButton.addActionListener(this);
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
592650
593
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
-
595
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596652 twoButton.setToolTipText("Show center view only");
597653 twoButton.addActionListener(this);
598
- 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);
599657 fourButton.addActionListener(this);
600658 fourButton.setToolTipText("Show left panel only");
601
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
659
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602660 sixButton.setToolTipText("2-column layout left");
603661 sixButton.addActionListener(this);
604
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605663 threeButton.setToolTipText("2-column layout right");
606664 threeButton.addActionListener(this);
607
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608666 sevenButton.setToolTipText("3-column layout");
609667 sevenButton.addActionListener(this);
610668 //
611669
612
- 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);
613671 rootButton.setToolTipText("Edit selection in new tab");
614672 rootButton.addActionListener(this);
615673
616
- 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);
617675 closeButton.setToolTipText("Close tab");
618676 closeButton.addActionListener(this);
619677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
620678 //clearButton.addActionListener(this);
621
-
622
- 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
+ }
623711
624
- 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);
625748 editButton.setToolTipText("Edit selection");
626749 editButton.addActionListener(this);
627750
628
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
751
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629752 uneditButton.setToolTipText("Unedit selection");
630753 uneditButton.addActionListener(this);
631754
632
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
755
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633756 allParamsButton.setToolTipText("Edit all params");
634757 allParamsButton.addActionListener(this);
635758
636
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
759
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637760 clearPanelButton.setToolTipText("Clear edit panel");
638761 clearPanelButton.addActionListener(this);
639762
640
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
763
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641764 unselectButton.setToolTipText("Unselect");
642765 unselectButton.addActionListener(this);
643766
644
- 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);
645770
646
- oe.treePanel.add(commandsPanel);
647
- oe.treePanel.Return();
771
+ editCommandsPanel.preferredHeight = 1;
772
+
773
+// oe.treePanel.add(commandsPanel);
774
+// oe.treePanel.Return();
648775
649776 // oe.aConstraints.gridx += 1;
650777 // oe.aConstraints.weighty = 0;
....@@ -661,27 +788,12 @@
661788
662789 JScrollPane jSP;
663790 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
664
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
665792 ResetModel();
666793
667794 oe.treePanel.add(jSPPanel);
668795 oe.treePanel.Return();
669796
670
- cGridBag copyOptionsPanel = new cGridBag();
671
-
672
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
- colorCB.setToolTipText("Copy color when dropped");
674
- colorCB.addItemListener(this);
675
-
676
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
- materialCB.setToolTipText("Copy material when dropped");
678
- materialCB.addItemListener(this);
679
-
680
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
- textureCB.setToolTipText("Copy texture when dropped");
682
- textureCB.addItemListener(this);
683
-
684
- copyOptionsPanel.preferredHeight = 1;
685797 oe.treePanel.add(copyOptionsPanel);
686798 oe.treePanel.Return();
687799
....@@ -712,6 +824,20 @@
712824
713825 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
714826 {
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
+
715841 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
716842 boxCB.setToolTipText("Display bounding boxes");
717843 boxCB.addItemListener(this);
....@@ -729,6 +855,8 @@
729855 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730856 // localCB.addItemListener(this);
731857
858
+ panel.Return();
859
+
732860 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733861 crowdCB.setToolTipText("Used for crowds");
734862 crowdCB.addItemListener(this);
....@@ -745,6 +873,8 @@
745873 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
746874 // speakerMocapCB.addItemListener(this);
747875
876
+ panel.Return();
877
+
748878 if (false)
749879 {
750880 // handled in scripts
....@@ -759,32 +889,72 @@
759889 //constraints.gridy += 1;
760890 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
761891 smoothfocusCB.addItemListener(this);
892
+ panel.Return();
762893 }
763894
764895 //constraints.gridx += 1;
765896 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
766897 // debugCB.addItemListener(this);
767898
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
768903 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
769905 oeilCB.addItemListener(this);
770906
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
+ {
771927 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772928 lookAtCB.setToolTipText("Look-at target");
773929 lookAtCB.addItemListener(this);
930
+ }
774931
775932 }
776933
777934 cGridBag fill = new cGridBag();
778
-
779935 fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
780940
781941 panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
782944
783945 }
784946
785947 void EditObject(Object3D obj)
786948 {
787949 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
+
788958 radioButton.SetObject(obj);
789959 radioButton.layout = sevenButton;
790960 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -796,6 +966,8 @@
796966
797967 void SetupViews(ObjEditor oe)
798968 {
969
+ theFrame = this;
970
+
799971 oe.SetupViews();
800972
801973 System.out.println("SetupViews");
....@@ -804,23 +976,27 @@
804976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
805977 }
806978
807
- JCheckBox liveCB;
808
- JCheckBox supportCB;
809
- JCheckBox localCB;
810
- JCheckBox crowdCB;
811
- JCheckBox smoothCB;
812
- JCheckBox fastCB;
813
- JCheckBox slowCB;
814
- JCheckBox boxCB;
815
- JCheckBox zoomBoxCB;
816
- JCheckBox trackCB;
817
- 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;
818991 // JCheckBox speakerMocapCB;
819
- JCheckBox speakerCameraCB;
820
- JCheckBox speakerFocusCB;
821
- JCheckBox debugCB;
822
- JCheckBox oeilCB;
823
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
8241000
8251001 // static int COLOR = 1;
8261002 // static int MATERIAL = 2;
....@@ -828,9 +1004,9 @@
8281004
8291005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8301006
831
- JCheckBox colorCB;
832
- JCheckBox materialCB;
833
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
8341010
8351011 public void itemStateChanged(ItemEvent e)
8361012 {
....@@ -858,6 +1034,7 @@
8581034 } else if(e.getSource() == liveCB)
8591035 {
8601036 cameraView.ToggleLive();
1037
+ refreshContents(false);
8611038 }
8621039 else if(e.getSource() == supportCB)
8631040 {
....@@ -922,6 +1099,14 @@
9221099 {
9231100 cameraView.ToggleOeil();
9241101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
9251110 else if(e.getSource() == lookAtCB)
9261111 {
9271112 cameraView.ToggleLookAt();
....@@ -938,7 +1123,8 @@
9381123
9391124 /**/
9401125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
941
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
9421128 if ((path == null) || (path.getPathCount() <= 1)) {
9431129 // We can't move the root node or an empty selection
9441130 return;
....@@ -1055,23 +1241,33 @@
10551241
10561242 assert target == objEditor.jTree;
10571243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
10581245 try {
1059
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10601247 } catch (Exception e) {
10611248 System.out.println("destinationPath : " + destinationPath);
10621249 return;
10631250 }
10641251
1065
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
10661253 {
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
+// {
10671263 loadClipboard(true);
10681264 objEditor.jTree.setSelectionPath(destinationPath);
10691265 pasteInto(false, false);
1070
- } else {
1071
- loadClipboard(false);
1072
- objEditor.jTree.setSelectionPath(destinationPath);
1073
- pasteInto(false, false); // true); // ???
1074
- }
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
10751271 }
10761272 public void dropActionChanged(DropTargetDragEvent dtde)
10771273 // Called if the user has modified the current drop gesture
....@@ -1176,22 +1372,30 @@
11761372 {
11771373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11781374 //heightFieldItem.addActionListener(this);
1179
- gridItem = menu.add(new MenuItem("Grid"));
1180
- gridItem.addActionListener(this);
1181
- rectoidItem = menu.add(new MenuItem("Box"));
1182
- rectoidItem.addActionListener(this);
1183
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1184
- ellipsoidItem.addActionListener(this);
1185
- coneItem = menu.add(new MenuItem("Cone"));
1186
- coneItem.addActionListener(this);
1187
- torusItem = menu.add(new MenuItem("Torus"));
1188
- torusItem.addActionListener(this);
1189
- superItem = menu.add(new MenuItem("Superellipsoid"));
1190
- 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
+ {
11911393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11921394 kleinItem.addActionListener(this);
1193
- particleItem = menu.add(new MenuItem("Particle system"));
1194
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
11951399 if (Globals.ADVANCED)
11961400 {
11971401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1217,15 +1421,15 @@
12171421 }
12181422 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12191423 bezierItem.addActionListener(this);
1220
- overlayItem = menu.add(new MenuItem("Overlay"));
1221
- overlayItem.addActionListener(this);
1222
- lightItem = menu.add(new MenuItem("Light"));
1223
- 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);
12241428 menu.add("-");
12251429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12261430 //superLoopItem.addActionListener(this);
1227
- loopItem = menu.add(new MenuItem("Loop"));
1228
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
12291433 doubleItem = menu.add(new MenuItem("Fork"));
12301434 doubleItem.addActionListener(this);
12311435 if (Globals.ADVANCED)
....@@ -1265,7 +1469,7 @@
12651469 memoryItem.addActionListener(this);
12661470 menu.add(analyzeItem = new MenuItem("Analyze"));
12671471 analyzeItem.addActionListener(this);
1268
- menu.add(dumpItem = new MenuItem("Dump"));
1472
+ menu.add(dumpItem = new MenuItem("Print"));
12691473 dumpItem.addActionListener(this);
12701474 // menu.add(pathItem = new MenuItem("From-to path"));
12711475 // pathItem.addActionListener(this);
....@@ -1406,6 +1610,7 @@
14061610 shadow.material = new cMaterial(obj.material);
14071611 shadow.material.diffuse = 0.0001f;
14081612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
14091614
14101615 makeSomething(shadow);
14111616 }
....@@ -1653,7 +1858,7 @@
16531858 {
16541859 ScreenFit();
16551860 } else
1656
- if (source == switchItem)
1861
+ if (source == switchViewItem)
16571862 {
16581863 cVector v1 = new cVector();
16591864 cVector v2 = new cVector();
....@@ -1662,11 +1867,11 @@
16621867 objEditor.cameraView.renderCamera.setAim(v2, v1);
16631868 objEditor.cameraView.repaint();
16641869 } else
1665
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
16661871 {
16671872 makeSomething(new Box());
16681873 } else
1669
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
16701875 {
16711876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16721877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1745,27 +1950,27 @@
17451950
17461951 makeSomething(obj);
17471952 } else
1748
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
17491954 {
17501955 makeSomething(new Grid());
17511956 } else
1752
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
17531958 {
17541959 makeSomething(new Sphere());
17551960 } else
1756
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
17571962 {
17581963 makeSomething(new Cone());
17591964 } else
1760
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
17611966 {
17621967 makeSomething(new Torus());
17631968 } else
1764
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
17651970 {
17661971 makeSomething(new Superellipsoid());
17671972 } else
1768
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
17691974 {
17701975 makeSomething(new Klein());
17711976 } else
....@@ -1785,7 +1990,7 @@
17851990 {
17861991 makeSomething(new BezierSurface());
17871992 } else
1788
- if (source == overlayItem)
1993
+ if (source == overlayItem || source == overlayButton)
17891994 {
17901995 /*
17911996 Object3D obj = new BezierSurface(5,8);
....@@ -1833,7 +2038,7 @@
18332038 s.setup();
18342039 makeSomething(s);
18352040 } else
1836
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
18372042 {
18382043 makeSomething(new Light());
18392044 } else
....@@ -1883,7 +2088,7 @@
18832088
18842089 group(g);
18852090 } else
1886
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
18872092 {
18882093 Composite csg = new GroupLeaf();
18892094 csg.count = 5;
....@@ -1955,6 +2160,30 @@
19552160 if (source == dumpItem)
19562161 {
19572162 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();
2175
+ } else
2176
+ if (source == undoButton)
2177
+ {
2178
+ Undo();
2179
+ } else
2180
+ if (source == redoButton)
2181
+ {
2182
+ Redo();
2183
+ } else
2184
+ if (source == saveButton)
2185
+ {
2186
+ Save();
19582187 } else
19592188 if (source == oneStepButton)
19602189 {
....@@ -2349,9 +2578,9 @@
23492578 {
23502579 ClearSelection(true);
23512580 } else
2352
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
23532582 {
2354
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
23552584 } else
23562585 if (source == hideItem)
23572586 {
....@@ -2369,11 +2598,11 @@
23692598 {
23702599 makeSomething(new Camera());
23712600 } else
2372
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
23732602 {
23742603 group(new Composite());
23752604 } else
2376
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
23772606 {
23782607 RandomNode random = new RandomNode();
23792608 group(random);
....@@ -2475,7 +2704,7 @@
24752704 {
24762705 group(new cLinker());
24772706 } else
2478
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
24792708 {
24802709 group(new TextureNode());
24812710 } else
....@@ -2495,7 +2724,7 @@
24952724 {
24962725 CastShadow(2);
24972726 } else
2498
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
24992728 {
25002729 //ungroup();
25012730 for (int i=0; i<group.selection.size(); i++)
....@@ -2517,7 +2746,7 @@
25172746 } else
25182747 if (source == genNormalsMESHItem)
25192748 {
2520
- GenNormals(true); // TODO
2749
+ GenNormalsMESH();
25212750 } else
25222751 if (source == genNormalsORGANItem)
25232752 {
....@@ -2582,6 +2811,22 @@
25822811 if (source == unmarkleavesItem)
25832812 {
25842813 MarkLeaves(false);
2814
+ } else
2815
+ if (source == rewindleavesItem)
2816
+ {
2817
+ RewindLeaves(true);
2818
+ } else
2819
+ if (source == unrewindleavesItem)
2820
+ {
2821
+ RewindLeaves(false);
2822
+ } else
2823
+ if (source == randomleavesItem)
2824
+ {
2825
+ RandomLeaves(true);
2826
+ } else
2827
+ if (source == unrandomleavesItem)
2828
+ {
2829
+ RandomLeaves(false);
25852830 } else
25862831 if (source == flipVItem)
25872832 {
....@@ -2817,6 +3062,10 @@
28173062 if (source == twoButton)
28183063 {
28193064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
28203069 // bug
28213070 //gridPanel.setDividerLocation(1.0);
28223071 //bigPanel.setDividerLocation(0.0);
....@@ -2849,10 +3098,31 @@
28493098 bigThree.ClearUI();
28503099 bigThree.add(centralPanel);
28513100 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
+
28523119 } else
28533120 if (source == threeButton)
28543121 {
28553122 radio.layout = threeButton;
3123
+
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
28563126
28573127 // bigThree.remove(scenePanel);
28583128 // bigThree.remove(centralPanel);
....@@ -2885,10 +3155,15 @@
28853155 bigThree.add(centralPanel);
28863156 bigThree.add(XYZPanel);
28873157 bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
28883160 } else
28893161 if (source == fourButton)
28903162 {
28913163 radio.layout = fourButton;
3164
+
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
28923167
28933168 // bigThree.remove(scenePanel);
28943169 // bigThree.remove(centralPanel);
....@@ -2920,10 +3195,15 @@
29203195 bigThree.ClearUI();
29213196 bigThree.add(scenePanel);
29223197 bigThree.FlushUI();
3198
+
3199
+ cameraView.requestFocusInWindow();
29233200 } else
29243201 if (source == sixButton)
29253202 {
29263203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
29273207
29283208 // bigThree.remove(scenePanel);
29293209 // bigThree.remove(centralPanel);
....@@ -2956,10 +3236,15 @@
29563236 bigThree.add(scenePanel);
29573237 bigThree.add(centralPanel);
29583238 bigThree.FlushUI();
3239
+
3240
+ cameraView.requestFocusInWindow();
29593241 } else
29603242 if (source == sevenButton)
29613243 {
29623244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
29633248
29643249 // bigThree.remove(scenePanel);
29653250 // bigThree.remove(centralPanel);
....@@ -2993,6 +3278,8 @@
29933278 bigThree.add(centralPanel);
29943279 bigThree.add(XYZPanel);
29953280 bigThree.FlushUI();
3281
+
3282
+ cameraView.requestFocusInWindow();
29963283 } else
29973284 if (source == rootButton)
29983285 {
....@@ -3004,6 +3291,7 @@
30043291 EditObject(obj);
30053292 }
30063293
3294
+ cameraView.requestFocusInWindow();
30073295 refreshContents(true);
30083296 } else
30093297 if (source == closeButton)
....@@ -3013,18 +3301,27 @@
30133301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30143302 {
30153303 ab = (cRadio)e.nextElement();
3016
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30173305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
30183312 buttonGroup.remove(ab);
30193313 radioPanel.remove(ab);
30203314
3021
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
30223317 // ab.GetObject().objectUI = null; // ?????????
30233318
30243319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30253320 break;
30263321 }
30273322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
30283325 refreshContents(true);
30293326 } else
30303327 if (source == editItem || source == editButton)
....@@ -3041,7 +3338,7 @@
30413338 child.CloseUI();
30423339 listUI.remove(child);
30433340
3044
- child.editWindow = null; // ???????????
3341
+ //child.editWindow = null; // ???????????
30453342 }
30463343 objEditor.ctrlPanel.FlushUI();
30473344 //objEditor.jTree.clearSelection();
....@@ -3128,7 +3425,9 @@
31283425 sideView.object = group;
31293426 }
31303427
3131
-// fix "+" issue group.editWindow = this;
3428
+// fix "+" issue
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
31323431
31333432 /*
31343433 currentLayout = radio.layout;
....@@ -3141,13 +3440,15 @@
31413440 //group.parent = null; // ROOT
31423441 //group.attributes = -1;
31433442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
31443445 refreshContents(true);
31453446 } else if (event.getSource() == editCameraItem)
31463447 {
31473448 cameraView.ProtectCamera();
31483449 cameraView.repaint();
31493450 return;
3150
- } else if (event.getSource() == revertCameraItem)
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31513452 {
31523453 cameraView.RevertCamera();
31533454 cameraView.repaint();
....@@ -3164,7 +3465,6 @@
31643465 }
31653466
31663467 boolean useclient = false;
3167
- cRadio radio;
31683468
31693469 void ToggleRoot()
31703470 {
....@@ -3403,7 +3703,8 @@
34033703
34043704 int size = obj.MemorySize();
34053705
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
3706
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3707
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34073708 }
34083709 }
34093710 catch (Exception e)
....@@ -3484,6 +3785,13 @@
34843785 void GenNormals(boolean crease)
34853786 {
34863787 group.GenNormalsS(crease);
3788
+
3789
+ refreshContents();
3790
+ }
3791
+
3792
+ void GenNormalsMESH()
3793
+ {
3794
+ group.GenNormalsMeshS();
34873795
34883796 refreshContents();
34893797 }
....@@ -4111,6 +4419,18 @@
41114419 refreshContents();
41124420 }
41134421
4422
+ void RewindLeaves(boolean hide)
4423
+ {
4424
+ group.selection.RewindLeaves(hide);
4425
+ refreshContents();
4426
+ }
4427
+
4428
+ void RandomLeaves(boolean hide)
4429
+ {
4430
+ group.selection.RandomLeaves(hide);
4431
+ refreshContents();
4432
+ }
4433
+
41144434 void SetTexRes(int tr)
41154435 {
41164436 group.selection.SetTexRes(tr);
....@@ -4193,7 +4513,7 @@
41934513 {
41944514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41954515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4196
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41974517
41984518 Object3D elem = (Object3D)group.selection.elementAt(i);
41994519 if(elem != group || !newWindow)
....@@ -4286,7 +4606,6 @@
42864606 //case 702: // Event.LIST_DESELECT
42874607 group.deselectAll();
42884608 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4289
- objEditor.ClearInfo(); // .GetMaterial());
42904609 if (tps != null)
42914610 {
42924611 for (int i=0; i < tps.length; i++)
....@@ -4295,10 +4614,8 @@
42954614
42964615 //if (child.parent != null)
42974616 //child.parent.addSelectee(child);
4617
+ objEditor.SetMaterial(child);
42984618 group.addSelectee(child);
4299
- objEditor.SetMaterial(child); // .GetMaterial());
4300
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4301
- System.err.println("info : " + child.GetPath());
43024619 }
43034620 }
43044621 // else
....@@ -4308,17 +4625,13 @@
43084625 // System.err.println("info : " + group.GetPath());
43094626 // }
43104627
4311
- objEditor.SetText(); // jan 2014
4312
-
4313
- Object3D object = (Object3D) tps[0].getLastPathComponent();
4314
-
4315
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera))
4628
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43164629 CameraPane.flash = true;
43174630
4318
- if (tps != null && tps.length > 0 && object instanceof Camera)
4631
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43194632 // a camera
43204633 {
4321
- if (object != Globals.theRenderer.LightCamera())
4634
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
43224635 {
43234636 CameraPane.camerachangeframe = 0; // don't refuse it
43244637 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4335,6 +4648,27 @@
43354648
43364649 freezemodel = false;
43374650 }
4651
+
4652
+ void refreshContents(boolean cp)
4653
+ {
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4656
+ {
4657
+ objEditor.ClearInfo(); // .GetMaterial());
4658
+
4659
+ for (int i=0; i < group.selection.Size(); i++)
4660
+ {
4661
+ Object3D child = (Object3D) group.selection.get(i);
4662
+
4663
+ objEditor.AddInfo(child, this, true);
4664
+ System.err.println("info : " + child.GetPath());
4665
+ }
4666
+
4667
+ objEditor.SetText(); // jan 2014
4668
+ }
4669
+
4670
+ super.refreshContents(cp);
4671
+ }
43384672
43394673 void linkSomething(Object3D thing)
43404674 {
....@@ -4406,6 +4740,7 @@
44064740 {
44074741 if (group.selection.isEmpty())
44084742 return;
4743
+
44094744 Grafreed.clipboardIsTempGroup = false;
44104745 Composite tGroup = null;
44114746 if (group.selection.size() > 0) // 1)
....@@ -4416,6 +4751,8 @@
44164751
44174752 if (cut)
44184753 {
4754
+ if (Globals.SAVEONMAKE)
4755
+ Save();
44194756 //int indices[] = jList.getSelectedIndices();
44204757 //for (int i = indices.length - 1; i >= 0; i--)
44214758 //jList.remove(indices[i]);
....@@ -4505,8 +4842,10 @@
45054842 }
45064843
45074844 }
4845
+
45084846 if (Grafreed.clipboardIsTempGroup)
45094847 Grafreed.clipboard = tGroup;
4848
+
45104849 if (cut)
45114850 {
45124851 ResetModel();
....@@ -5131,7 +5470,33 @@
51315470 cButton clearpanelButton;
51325471 cButton unselectButton;
51335472
5473
+ cButton restoreCameraButton;
5474
+
5475
+ cButton minButton;
5476
+ cButton maxButton;
5477
+ cButton fullButton;
5478
+ cButton undoButton;
5479
+ cButton redoButton;
5480
+ cButton saveButton;
51345481 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;
51355500
51365501 cButton screenfitButton;
51375502 cButton screenfitpointButton;
....@@ -5144,14 +5509,6 @@
51445509
51455510 cButton setsupportButton;
51465511
5147
- cButton twoButton;
5148
- cButton sixButton;
5149
- cButton threeButton;
5150
- cButton sevenButton;
5151
- cButton fourButton; // full panel
5152
- cButton oneButton; // full XYZ
5153
- //cButton currentLayout;
5154
-
51555512 //
51565513 //Composite
51575514 Object3D // to do !!
....@@ -5161,11 +5518,11 @@
51615518 //JTree jTree;
51625519 private MenuItem lookAtItem;
51635520 private MenuItem lookFromItem;
5164
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
51655522 private MenuItem cutItem;
51665523 private MenuItem undoItem;
51675524 private MenuItem redoItem;
5168
- private MenuItem duplicateItem;
5525
+ private JMenuItem duplicateItem;
51695526 private MenuItem cloneItem;
51705527 private MenuItem cloneSupportItem;
51715528 private MenuItem overwriteGeoItem;
....@@ -5228,6 +5585,10 @@
52285585 private MenuItem showleavesItem;
52295586 private MenuItem markleavesItem;
52305587 private MenuItem unmarkleavesItem;
5588
+ private MenuItem rewindleavesItem;
5589
+ private MenuItem unrewindleavesItem;
5590
+ private MenuItem randomleavesItem;
5591
+ private MenuItem unrandomleavesItem;
52315592
52325593 private MenuItem flipVItem;
52335594 private MenuItem unflipVItem;
....@@ -5249,7 +5610,7 @@
52495610 private MenuItem frontItem;
52505611 private MenuItem cameraItem;
52515612 private MenuItem compositeItem;
5252
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
52535614 private MenuItem physicsItem;
52545615 private MenuItem frameselectorItem;
52555616 private MenuItem scriptNodeItem;
....@@ -5323,5 +5684,5 @@
53235684
53245685 Menu cameraMenu;
53255686 MenuItem editCameraItem;
5326
- MenuItem revertCameraItem;
5687
+ MenuItem restoreCameraItem;
53275688 }