Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
GroupEditor.java
....@@ -580,43 +580,43 @@
580580 //minButton.setToolTipText("Minimize window");
581581 //minButton.addActionListener(this);
582582
583
- oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
583
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584584 maxButton.setToolTipText("Maximize window");
585585 maxButton.addActionListener(this);
586586
587
- oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
587
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588588 fullButton.setToolTipText("Full-screen window");
589589 fullButton.addActionListener(this);
590590
591
- oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592592 undoButton.setToolTipText("Undo changes");
593593 undoButton.addActionListener(this);
594594
595
- oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
595
+ oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596596 redoButton.setToolTipText("Redo changes");
597597 redoButton.addActionListener(this);
598598
599
- oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600600 saveButton.setToolTipText("Save changes");
601601 saveButton.addActionListener(this);
602602
603
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
603
+ oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604604 liveCB.setToolTipText("Enable animation");
605605 liveCB.addItemListener(this);
606606
607
- oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
- oneStepButton.setToolTipText("Animate one step forward");
609
- oneStepButton.addActionListener(this);
610
-
611
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
607
+ oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
612608 fastCB.setToolTipText("Fast mode");
613609 fastCB.addItemListener(this);
614610
615
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", 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);
616616 trackCB.setToolTipText("Enable tracking");
617617 trackCB.addItemListener(this);
618618
619
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620620 screenfitButton.setToolTipText("Screen fit");
621621 screenfitButton.addActionListener(this);
622622
....@@ -630,8 +630,8 @@
630630 snapobjectButton.setToolTipText("Snap Object");
631631 }
632632
633
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- flashSelectionButton.setToolTipText("Show selection");
633
+ oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Highlight selection");
635635 flashSelectionButton.addActionListener(this);
636636
637637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
....@@ -808,11 +808,23 @@
808808 // debugCB.addItemListener(this);
809809
810810 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
811812 oeilCB.addItemListener(this);
812813
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
+ {
813824 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
814825 lookAtCB.setToolTipText("Look-at target");
815826 lookAtCB.addItemListener(this);
827
+ }
816828
817829 }
818830
....@@ -827,6 +839,14 @@
827839 void EditObject(Object3D obj)
828840 {
829841 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
+
830850 radioButton.SetObject(obj);
831851 radioButton.layout = sevenButton;
832852 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -848,23 +868,26 @@
848868 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
849869 }
850870
851
- JCheckBox liveCB;
852
- JCheckBox supportCB;
853
- JCheckBox localCB;
854
- JCheckBox crowdCB;
855
- JCheckBox smoothCB;
856
- JCheckBox fastCB;
857
- JCheckBox slowCB;
858
- JCheckBox boxCB;
859
- JCheckBox zoomBoxCB;
860
- JCheckBox trackCB;
861
- 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;
862882 // JCheckBox speakerMocapCB;
863
- JCheckBox speakerCameraCB;
864
- JCheckBox speakerFocusCB;
865
- JCheckBox debugCB;
866
- JCheckBox oeilCB;
867
- JCheckBox lookAtCB;
883
+ cCheckBox speakerCameraCB;
884
+ cCheckBox speakerFocusCB;
885
+ cCheckBox debugCB;
886
+
887
+ cCheckBox oeilCB;
888
+ cCheckBox shadowCB;
889
+ cCheckBox autosaveCB;
890
+ cCheckBox lookAtCB;
868891
869892 // static int COLOR = 1;
870893 // static int MATERIAL = 2;
....@@ -872,9 +895,9 @@
872895
873896 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
874897
875
- JCheckBox colorCB;
876
- JCheckBox materialCB;
877
- JCheckBox textureCB;
898
+ cCheckBox colorCB;
899
+ cCheckBox materialCB;
900
+ cCheckBox textureCB;
878901
879902 public void itemStateChanged(ItemEvent e)
880903 {
....@@ -966,6 +989,14 @@
966989 else if(e.getSource() == oeilCB)
967990 {
968991 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;
9691000 }
9701001 else if(e.getSource() == lookAtCB)
9711002 {
....@@ -3126,12 +3157,19 @@
31263157 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
31273158 {
31283159 ab = (cRadio)e.nextElement();
3129
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3160
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
31303161 {
3162
+ // Patch to avoid bug with transparency.
3163
+ if (!ab.hadMaterial)
3164
+ {
3165
+ ab.object.material = null;
3166
+ }
3167
+
31313168 buttonGroup.remove(ab);
31323169 radioPanel.remove(ab);
31333170
3134
- ab.GetObject().editWindow = null;
3171
+ //ab.GetObject().editWindow = null;
3172
+ ab.GetObject().manipWindow = null;
31353173 // ab.GetObject().objectUI = null; // ?????????
31363174
31373175 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
....@@ -3245,6 +3283,7 @@
32453283
32463284 // fix "+" issue
32473285 //group.editWindow = this;
3286
+ group.manipWindow = this;
32483287
32493288 /*
32503289 currentLayout = radio.layout;
....@@ -4567,6 +4606,7 @@
45674606
45684607 if (cut)
45694608 {
4609
+ if (Globals.SAVEONMAKE)
45704610 Save();
45714611 //int indices[] = jList.getSelectedIndices();
45724612 //for (int i = indices.length - 1; i >= 0; i--)