Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
GroupEditor.java
....@@ -154,11 +154,12 @@
154154 oe.menuBar.add(menu = new Menu("Edit"));
155155 //editItem = menu.add(new MenuItem("Edit"));
156156 //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("-");
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
162163 duplicateItem = menu.add(new MenuItem("Duplicate"));
163164 duplicateItem.addActionListener(this);
164165 cloneItem = menu.add(new MenuItem("Clone"));
....@@ -175,7 +176,6 @@
175176 copyItem.addActionListener(this);
176177 pasteItem = menu.add(new MenuItem("Paste"));
177178 pasteItem.addActionListener(this);
178
- menu.add("-");
179179
180180 menu.add("-");
181181 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -202,7 +202,7 @@
202202 //zBufferItem.addActionListener(this);
203203 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204204 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206206 revertCameraItem.addActionListener(this);
207207
208208 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
....@@ -245,7 +245,7 @@
245245
246246 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247247 toggleDebugItem.addItemListener(this);
248
- toggleDebugItem.setState(CameraPane.DEBUG);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249249
250250 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251251 toggleFrustumItem.addItemListener(this);
....@@ -266,7 +266,7 @@
266266 // animationItem.addItemListener(this);
267267 // animationItem.setState(CameraPane.ANIMATION);
268268 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270270 editCameraItem.addActionListener(this);
271271
272272 if (Globals.ADVANCED)
....@@ -368,11 +368,11 @@
368368 billboardItem.addActionListener(this);
369369 csgItem = menu.add(new MenuItem("CSG"));
370370 csgItem.addActionListener(this);
371
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
372372 shadowXItem.addActionListener(this);
373
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
374374 shadowYItem.addActionListener(this);
375
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376376 shadowZItem.addActionListener(this);
377377 if (Globals.ADVANCED)
378378 {
....@@ -469,6 +469,14 @@
469469 markleavesItem.addActionListener(this);
470470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
471471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
472480 menu.add("-");
473481 flipVItem = menu.add(new MenuItem("Flip V"));
474482 flipVItem.addActionListener(this);
....@@ -526,6 +534,18 @@
526534
527535 void SetupUI2(ObjEditor oe)
528536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
529549 //new Exception().printStackTrace();
530550
531551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -556,23 +576,47 @@
556576 */
557577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
558578
559
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
560604 liveCB.setToolTipText("Enable animation");
561605 liveCB.addItemListener(this);
562606
563
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564
- oneStepButton.setToolTipText("Animate one step forward");
565
- oneStepButton.addActionListener(this);
566
-
567
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
607
+ oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
568608 fastCB.setToolTipText("Fast mode");
569609 fastCB.addItemListener(this);
570610
571
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ oneStepButton.setToolTipText("Animate one step forward");
613
+ oneStepButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
572616 trackCB.setToolTipText("Enable tracking");
573617 trackCB.addItemListener(this);
574618
575
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576620 screenfitButton.setToolTipText("Screen fit");
577621 screenfitButton.addActionListener(this);
578622
....@@ -586,25 +630,25 @@
586630 snapobjectButton.setToolTipText("Snap Object");
587631 }
588632
589
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
- flashSelectionButton.setToolTipText("Show selection");
633
+ oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Highlight selection");
591635 flashSelectionButton.addActionListener(this);
592636
593637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594638
595
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596640 twoButton.setToolTipText("Show center view only");
597641 twoButton.addActionListener(this);
598
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599643 fourButton.addActionListener(this);
600644 fourButton.setToolTipText("Show left panel only");
601
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602646 sixButton.setToolTipText("2-column layout left");
603647 sixButton.addActionListener(this);
604
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605649 threeButton.setToolTipText("2-column layout right");
606650 threeButton.addActionListener(this);
607
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608652 sevenButton.setToolTipText("3-column layout");
609653 sevenButton.addActionListener(this);
610654 //
....@@ -619,32 +663,30 @@
619663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
620664 //clearButton.addActionListener(this);
621665
622
- cGridBag commandsPanel = new cGridBag();
623
-
624
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625667 editButton.setToolTipText("Edit selection");
626668 editButton.addActionListener(this);
627669
628
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629671 uneditButton.setToolTipText("Unedit selection");
630672 uneditButton.addActionListener(this);
631673
632
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633675 allParamsButton.setToolTipText("Edit all params");
634676 allParamsButton.addActionListener(this);
635677
636
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637679 clearPanelButton.setToolTipText("Clear edit panel");
638680 clearPanelButton.addActionListener(this);
639681
640
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641683 unselectButton.setToolTipText("Unselect");
642684 unselectButton.addActionListener(this);
643685
644
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
645687
646
- oe.treePanel.add(commandsPanel);
647
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
648690
649691 // oe.aConstraints.gridx += 1;
650692 // oe.aConstraints.weighty = 0;
....@@ -766,11 +808,23 @@
766808 // debugCB.addItemListener(this);
767809
768810 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
769812 oeilCB.addItemListener(this);
770813
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
+ autosaveCB.setToolTipText("Auto-save on structure change");
820
+ autosaveCB.addItemListener(this);
821
+
822
+ if (Globals.ADVANCED)
823
+ {
771824 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772825 lookAtCB.setToolTipText("Look-at target");
773826 lookAtCB.addItemListener(this);
827
+ }
774828
775829 }
776830
....@@ -785,6 +839,14 @@
785839 void EditObject(Object3D obj)
786840 {
787841 cRadio radioButton = new cRadio(obj.name);
842
+
843
+ // Patch to avoid bug with transparency.
844
+ radioButton.hadMaterial = obj.material != null;
845
+ if (!radioButton.hadMaterial)
846
+ {
847
+ obj.material = new cMaterial();
848
+ }
849
+
788850 radioButton.SetObject(obj);
789851 radioButton.layout = sevenButton;
790852 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -796,6 +858,8 @@
796858
797859 void SetupViews(ObjEditor oe)
798860 {
861
+ theFrame = this;
862
+
799863 oe.SetupViews();
800864
801865 System.out.println("SetupViews");
....@@ -804,23 +868,26 @@
804868 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
805869 }
806870
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;
871
+ cCheckBox liveCB;
872
+ cCheckBox supportCB;
873
+ cCheckBox localCB;
874
+ cCheckBox crowdCB;
875
+ cCheckBox smoothCB;
876
+ cCheckBox fastCB;
877
+ cCheckBox slowCB;
878
+ cCheckBox boxCB;
879
+ cCheckBox zoomBoxCB;
880
+ cCheckBox trackCB;
881
+ cCheckBox smoothfocusCB;
818882 // JCheckBox speakerMocapCB;
819
- JCheckBox speakerCameraCB;
820
- JCheckBox speakerFocusCB;
821
- JCheckBox debugCB;
822
- JCheckBox oeilCB;
823
- JCheckBox lookAtCB;
883
+ cCheckBox speakerCameraCB;
884
+ cCheckBox speakerFocusCB;
885
+ cCheckBox debugCB;
886
+
887
+ cCheckBox oeilCB;
888
+ cCheckBox shadowCB;
889
+ cCheckBox autosaveCB;
890
+ cCheckBox lookAtCB;
824891
825892 // static int COLOR = 1;
826893 // static int MATERIAL = 2;
....@@ -828,9 +895,9 @@
828895
829896 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
830897
831
- JCheckBox colorCB;
832
- JCheckBox materialCB;
833
- JCheckBox textureCB;
898
+ cCheckBox colorCB;
899
+ cCheckBox materialCB;
900
+ cCheckBox textureCB;
834901
835902 public void itemStateChanged(ItemEvent e)
836903 {
....@@ -858,6 +925,7 @@
858925 } else if(e.getSource() == liveCB)
859926 {
860927 cameraView.ToggleLive();
928
+ refreshContents(false);
861929 }
862930 else if(e.getSource() == supportCB)
863931 {
....@@ -921,6 +989,14 @@
921989 else if(e.getSource() == oeilCB)
922990 {
923991 cameraView.ToggleOeil();
992
+ }
993
+ else if(e.getSource() == shadowCB)
994
+ {
995
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
996
+ }
997
+ else if(e.getSource() == autosaveCB)
998
+ {
999
+ Globals.SAVEONMAKE ^= true;
9241000 }
9251001 else if(e.getSource() == lookAtCB)
9261002 {
....@@ -1265,7 +1341,7 @@
12651341 memoryItem.addActionListener(this);
12661342 menu.add(analyzeItem = new MenuItem("Analyze"));
12671343 analyzeItem.addActionListener(this);
1268
- menu.add(dumpItem = new MenuItem("Dump"));
1344
+ menu.add(dumpItem = new MenuItem("Print"));
12691345 dumpItem.addActionListener(this);
12701346 // menu.add(pathItem = new MenuItem("From-to path"));
12711347 // pathItem.addActionListener(this);
....@@ -1406,6 +1482,7 @@
14061482 shadow.material = new cMaterial(obj.material);
14071483 shadow.material.diffuse = 0.0001f;
14081484 shadow.material.specular = 0.0001f;
1485
+ //shadow.projectedVertices[1].x = 300;
14091486
14101487 makeSomething(shadow);
14111488 }
....@@ -1955,6 +2032,30 @@
19552032 if (source == dumpItem)
19562033 {
19572034 DumpObject();
2035
+ } else
2036
+ if (source == minButton)
2037
+ {
2038
+ Minimize();
2039
+ } else
2040
+ if (source == maxButton)
2041
+ {
2042
+ Maximize();
2043
+ } else
2044
+ if (source == fullButton)
2045
+ {
2046
+ ToggleFullScreen();
2047
+ } else
2048
+ if (source == undoButton)
2049
+ {
2050
+ Undo();
2051
+ } else
2052
+ if (source == redoButton)
2053
+ {
2054
+ Redo();
2055
+ } else
2056
+ if (source == saveButton)
2057
+ {
2058
+ Save();
19582059 } else
19592060 if (source == oneStepButton)
19602061 {
....@@ -2517,7 +2618,7 @@
25172618 } else
25182619 if (source == genNormalsMESHItem)
25192620 {
2520
- GenNormals(true); // TODO
2621
+ GenNormalsMESH();
25212622 } else
25222623 if (source == genNormalsORGANItem)
25232624 {
....@@ -2582,6 +2683,22 @@
25822683 if (source == unmarkleavesItem)
25832684 {
25842685 MarkLeaves(false);
2686
+ } else
2687
+ if (source == rewindleavesItem)
2688
+ {
2689
+ RewindLeaves(true);
2690
+ } else
2691
+ if (source == unrewindleavesItem)
2692
+ {
2693
+ RewindLeaves(false);
2694
+ } else
2695
+ if (source == randomleavesItem)
2696
+ {
2697
+ RandomLeaves(true);
2698
+ } else
2699
+ if (source == unrandomleavesItem)
2700
+ {
2701
+ RandomLeaves(false);
25852702 } else
25862703 if (source == flipVItem)
25872704 {
....@@ -2849,6 +2966,24 @@
28492966 bigThree.ClearUI();
28502967 bigThree.add(centralPanel);
28512968 bigThree.FlushUI();
2969
+
2970
+ cameraView.requestFocusInWindow();
2971
+
2972
+// refreshContents(true);
2973
+//
2974
+// try
2975
+// {
2976
+// java.awt.Robot bot = new java.awt.Robot();
2977
+// int mask = InputEvent.BUTTON1_MASK;
2978
+// bot.mouseMove(100, 100);
2979
+// bot.mousePress(mask);
2980
+// bot.mouseRelease(mask);
2981
+// }
2982
+// catch (Exception e)
2983
+// {
2984
+//
2985
+// }
2986
+
28522987 } else
28532988 if (source == threeButton)
28542989 {
....@@ -2885,6 +3020,8 @@
28853020 bigThree.add(centralPanel);
28863021 bigThree.add(XYZPanel);
28873022 bigThree.FlushUI();
3023
+
3024
+ cameraView.requestFocusInWindow();
28883025 } else
28893026 if (source == fourButton)
28903027 {
....@@ -2920,6 +3057,8 @@
29203057 bigThree.ClearUI();
29213058 bigThree.add(scenePanel);
29223059 bigThree.FlushUI();
3060
+
3061
+ cameraView.requestFocusInWindow();
29233062 } else
29243063 if (source == sixButton)
29253064 {
....@@ -2956,6 +3095,8 @@
29563095 bigThree.add(scenePanel);
29573096 bigThree.add(centralPanel);
29583097 bigThree.FlushUI();
3098
+
3099
+ cameraView.requestFocusInWindow();
29593100 } else
29603101 if (source == sevenButton)
29613102 {
....@@ -2993,6 +3134,8 @@
29933134 bigThree.add(centralPanel);
29943135 bigThree.add(XYZPanel);
29953136 bigThree.FlushUI();
3137
+
3138
+ cameraView.requestFocusInWindow();
29963139 } else
29973140 if (source == rootButton)
29983141 {
....@@ -3004,6 +3147,7 @@
30043147 EditObject(obj);
30053148 }
30063149
3150
+ cameraView.requestFocusInWindow();
30073151 refreshContents(true);
30083152 } else
30093153 if (source == closeButton)
....@@ -3013,18 +3157,27 @@
30133157 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30143158 {
30153159 ab = (cRadio)e.nextElement();
3016
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3160
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30173161 {
3162
+ // Patch to avoid bug with transparency.
3163
+ if (!ab.hadMaterial)
3164
+ {
3165
+ ab.object.material = null;
3166
+ }
3167
+
30183168 buttonGroup.remove(ab);
30193169 radioPanel.remove(ab);
30203170
3021
- ab.GetObject().editWindow = null;
3171
+ //ab.GetObject().editWindow = null;
3172
+ ab.GetObject().manipWindow = null;
30223173 // ab.GetObject().objectUI = null; // ?????????
30233174
30243175 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30253176 break;
30263177 }
30273178 }
3179
+
3180
+ cameraView.requestFocusInWindow();
30283181 refreshContents(true);
30293182 } else
30303183 if (source == editItem || source == editButton)
....@@ -3128,7 +3281,9 @@
31283281 sideView.object = group;
31293282 }
31303283
3131
-// fix "+" issue group.editWindow = this;
3284
+// fix "+" issue
3285
+ //group.editWindow = this;
3286
+ group.manipWindow = this;
31323287
31333288 /*
31343289 currentLayout = radio.layout;
....@@ -3141,6 +3296,8 @@
31413296 //group.parent = null; // ROOT
31423297 //group.attributes = -1;
31433298 ResetModel();
3299
+
3300
+ cameraView.requestFocusInWindow();
31443301 refreshContents(true);
31453302 } else if (event.getSource() == editCameraItem)
31463303 {
....@@ -3164,7 +3321,6 @@
31643321 }
31653322
31663323 boolean useclient = false;
3167
- cRadio radio;
31683324
31693325 void ToggleRoot()
31703326 {
....@@ -3403,7 +3559,8 @@
34033559
34043560 int size = obj.MemorySize();
34053561
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
3562
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3563
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34073564 }
34083565 }
34093566 catch (Exception e)
....@@ -3484,6 +3641,13 @@
34843641 void GenNormals(boolean crease)
34853642 {
34863643 group.GenNormalsS(crease);
3644
+
3645
+ refreshContents();
3646
+ }
3647
+
3648
+ void GenNormalsMESH()
3649
+ {
3650
+ group.GenNormalsMeshS();
34873651
34883652 refreshContents();
34893653 }
....@@ -4111,6 +4275,18 @@
41114275 refreshContents();
41124276 }
41134277
4278
+ void RewindLeaves(boolean hide)
4279
+ {
4280
+ group.selection.RewindLeaves(hide);
4281
+ refreshContents();
4282
+ }
4283
+
4284
+ void RandomLeaves(boolean hide)
4285
+ {
4286
+ group.selection.RandomLeaves(hide);
4287
+ refreshContents();
4288
+ }
4289
+
41144290 void SetTexRes(int tr)
41154291 {
41164292 group.selection.SetTexRes(tr);
....@@ -4286,7 +4462,6 @@
42864462 //case 702: // Event.LIST_DESELECT
42874463 group.deselectAll();
42884464 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4289
- objEditor.ClearInfo(); // .GetMaterial());
42904465 if (tps != null)
42914466 {
42924467 for (int i=0; i < tps.length; i++)
....@@ -4295,10 +4470,8 @@
42954470
42964471 //if (child.parent != null)
42974472 //child.parent.addSelectee(child);
4473
+ objEditor.SetMaterial(child);
42984474 group.addSelectee(child);
4299
- objEditor.SetMaterial(child); // .GetMaterial());
4300
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4301
- System.err.println("info : " + child.GetPath());
43024475 }
43034476 }
43044477 // else
....@@ -4308,8 +4481,6 @@
43084481 // System.err.println("info : " + group.GetPath());
43094482 // }
43104483
4311
- objEditor.SetText(); // jan 2014
4312
-
43134484 if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43144485 CameraPane.flash = true;
43154486
....@@ -4333,6 +4504,26 @@
43334504
43344505 freezemodel = false;
43354506 }
4507
+
4508
+ void refreshContents(boolean cp)
4509
+ {
4510
+ if (!Globals.MOUSEDRAGGED)
4511
+ {
4512
+ objEditor.ClearInfo(); // .GetMaterial());
4513
+
4514
+ for (int i=0; i < group.selection.Size(); i++)
4515
+ {
4516
+ Object3D child = (Object3D) group.selection.get(i);
4517
+
4518
+ objEditor.AddInfo(child, this, true);
4519
+ System.err.println("info : " + child.GetPath());
4520
+ }
4521
+
4522
+ objEditor.SetText(); // jan 2014
4523
+ }
4524
+
4525
+ super.refreshContents(cp);
4526
+ }
43364527
43374528 void linkSomething(Object3D thing)
43384529 {
....@@ -4404,6 +4595,7 @@
44044595 {
44054596 if (group.selection.isEmpty())
44064597 return;
4598
+
44074599 Grafreed.clipboardIsTempGroup = false;
44084600 Composite tGroup = null;
44094601 if (group.selection.size() > 0) // 1)
....@@ -4414,6 +4606,8 @@
44144606
44154607 if (cut)
44164608 {
4609
+ if (Globals.SAVEONMAKE)
4610
+ Save();
44174611 //int indices[] = jList.getSelectedIndices();
44184612 //for (int i = indices.length - 1; i >= 0; i--)
44194613 //jList.remove(indices[i]);
....@@ -4503,8 +4697,10 @@
45034697 }
45044698
45054699 }
4700
+
45064701 if (Grafreed.clipboardIsTempGroup)
45074702 Grafreed.clipboard = tGroup;
4703
+
45084704 if (cut)
45094705 {
45104706 ResetModel();
....@@ -5129,6 +5325,12 @@
51295325 cButton clearpanelButton;
51305326 cButton unselectButton;
51315327
5328
+ cButton minButton;
5329
+ cButton maxButton;
5330
+ cButton fullButton;
5331
+ cButton undoButton;
5332
+ cButton redoButton;
5333
+ cButton saveButton;
51325334 cButton oneStepButton;
51335335
51345336 cButton screenfitButton;
....@@ -5141,14 +5343,6 @@
51415343 cButton closeButton;
51425344
51435345 cButton setsupportButton;
5144
-
5145
- cButton twoButton;
5146
- cButton sixButton;
5147
- cButton threeButton;
5148
- cButton sevenButton;
5149
- cButton fourButton; // full panel
5150
- cButton oneButton; // full XYZ
5151
- //cButton currentLayout;
51525346
51535347 //
51545348 //Composite
....@@ -5226,6 +5420,10 @@
52265420 private MenuItem showleavesItem;
52275421 private MenuItem markleavesItem;
52285422 private MenuItem unmarkleavesItem;
5423
+ private MenuItem rewindleavesItem;
5424
+ private MenuItem unrewindleavesItem;
5425
+ private MenuItem randomleavesItem;
5426
+ private MenuItem unrandomleavesItem;
52295427
52305428 private MenuItem flipVItem;
52315429 private MenuItem unflipVItem;