Normand Briere
2019-08-12 b1d79b74514041a059b454a9f6fc3970773c0cb8
GroupEditor.java
....@@ -359,6 +359,16 @@
359359 refreshContents();
360360 }
361361
362
+ public void Show3DView()
363
+ {
364
+ // bug
365
+ //gridPanel.setDividerLocation(1.0);
366
+ //bigPanel.setDividerLocation(0.0);
367
+ bigThree.ClearUI();
368
+ bigThree.add(centralPanel);
369
+ bigThree.FlushUI();
370
+ }
371
+
362372 //ObjEditor objEditor;
363373 public void closeUI2()
364374 {
....@@ -984,11 +994,6 @@
984994 //new Exception().printStackTrace();
985995
986996 oe.radioPanel = new JPanel(new GridBagLayout());
987
- oe.aConstraints.weightx = 1;
988
- oe.aConstraints.weighty = 0;
989
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
990
- oe.aConstraints.gridwidth = 100;
991
- oe.aConstraints.gridheight = 1;
992997 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
993998
994999 oe.buttonGroup = new ButtonGroup();
....@@ -1025,6 +1030,45 @@
10251030 maxButton.setToolTipText("Maximize window");
10261031 maxButton.addActionListener(this);
10271032 }
1033
+
1034
+ cButton gcButton;
1035
+
1036
+ oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ gcButton.setToolTipText("Garbage collect");
1038
+ gcButton.addActionListener(new ActionListener()
1039
+ {
1040
+ public void actionPerformed(ActionEvent e)
1041
+ {
1042
+ System.gc();
1043
+ }
1044
+ });
1045
+
1046
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ collapseButton.setToolTipText("Collapse toolbar");
1048
+ collapseButton.addActionListener(this);
1049
+
1050
+ oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ maximize3DButton.setToolTipText("Maximize 3D view");
1052
+ maximize3DButton.addActionListener(this);
1053
+
1054
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ twoButton.setToolTipText("Show 3D view only");
1056
+ twoButton.addActionListener(this);
1057
+ this.fullscreenLayout = twoButton;
1058
+
1059
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1060
+ threeButton.setToolTipText("Show controls and 3D view");
1061
+ threeButton.addActionListener(this);
1062
+ if (Globals.ADVANCED)
1063
+ {
1064
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ sixButton.setToolTipText("Show 3D view and controls");
1066
+ sixButton.addActionListener(this);
1067
+ }
1068
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1069
+// sevenButton.setToolTipText("3-column layout");
1070
+// sevenButton.addActionListener(this);
1071
+ //
10281072
10291073 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10301074 fullButton.setToolTipText("Full-screen window");
....@@ -1069,14 +1113,14 @@
10691113 nextVersionButton.addActionListener(this);
10701114 nextVersionButton.setEnabled(false);
10711115
1072
- oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1073
- liveCB.setToolTipText("Enable animation");
1074
- liveCB.addItemListener(this);
1075
-
10761116 oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10771117 oneStepButton.setToolTipText("Animate one step forward");
10781118 oneStepButton.addActionListener(this);
10791119
1120
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1121
+ liveCB.setToolTipText("Enable animation");
1122
+ liveCB.addItemListener(this);
1123
+
10801124 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
10811125 fastCB.setToolTipText("Fast mode");
10821126 fastCB.addItemListener(this);
....@@ -1103,21 +1147,6 @@
11031147
11041148 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11051149
1106
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1107
- twoButton.setToolTipText("Show 3D view only");
1108
- twoButton.addActionListener(this);
1109
- this.fullscreenLayout = twoButton;
1110
-
1111
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
- threeButton.setToolTipText("Show controls and 3D view");
1113
- threeButton.addActionListener(this);
1114
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1115
- sixButton.setToolTipText("Show 3D view and controls");
1116
- sixButton.addActionListener(this);
1117
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
-// sevenButton.setToolTipText("3-column layout");
1119
-// sevenButton.addActionListener(this);
1120
- //
11211150
11221151 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11231152 rootButton.setToolTipText("Open selection in new tab");
....@@ -1815,7 +1844,12 @@
18151844 TreePath path;
18161845
18171846 public TransferableTreePath(TreePath tp) {
1818
- path = tp;
1847
+ Object[] objs = new Object[tp.getPathCount()];
1848
+ for (int i=0; i<objs.length; i++)
1849
+ {
1850
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1851
+ }
1852
+ path = new TreePath(objs);
18191853 }
18201854
18211855 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2708,6 +2742,18 @@
27082742 if (source == fullButton)
27092743 {
27102744 ToggleFullScreen();
2745
+ } else
2746
+ if (source == collapseButton)
2747
+ {
2748
+ this.expandedLayout = radio.layout;
2749
+ CollapseToolbar();
2750
+ } else
2751
+ if (source == maximize3DButton)
2752
+ {
2753
+ this.expandedLayout = radio.layout;
2754
+ radio.layout = twoButton;
2755
+ Show3DView();
2756
+ CollapseToolbar();
27112757 } else
27122758 if (source == previousVersionButton)
27132759 {
....@@ -3660,38 +3706,7 @@
36603706 if (CameraPane.FULLSCREEN)
36613707 fullscreenLayout = radio.layout;
36623708
3663
- // bug
3664
- //gridPanel.setDividerLocation(1.0);
3665
- //bigPanel.setDividerLocation(0.0);
3666
-// bigThree.remove(scenePanel);
3667
-// bigThree.remove(centralPanel);
3668
-// bigThree.remove(XYZPanel);
3669
-// aWindowConstraints.gridx = 0;
3670
-// aWindowConstraints.gridy = 0;
3671
-// aWindowConstraints.gridwidth = 1;
3672
-// // aConstraints.gridheight = 3;
3673
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3674
-// aWindowConstraints.weightx = 0;
3675
-// aWindowConstraints.weighty = 1;
3676
-// //bigThree.add(jtp, aWindowConstraints);
3677
-// aWindowConstraints.weightx = 1;
3678
-// aWindowConstraints.gridwidth = 3;
3679
-// // aConstraints.gridheight = 3;
3680
-// aWindowConstraints.gridx = 1;
3681
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3682
-// bigThree.add(centralPanel, aWindowConstraints);
3683
-// aWindowConstraints.weightx = 0;
3684
-// aWindowConstraints.gridx = 4;
3685
-// aWindowConstraints.gridwidth = 1;
3686
-// // aConstraints.gridheight = 3;
3687
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3688
-// //bigThree.add(XYZPanel, aWindowConstraints);
3689
-// scenePanel.setVisible(false);
3690
-// centralPanel.setVisible(true);
3691
-// XYZPanel.setVisible(false);
3692
- bigThree.ClearUI();
3693
- bigThree.add(centralPanel);
3694
- bigThree.FlushUI();
3709
+ Show3DView();
36953710
36963711 cameraView.requestFocusInWindow();
36973712
....@@ -5290,7 +5305,7 @@
52905305 Object3D child = (Object3D) group.selection.get(i);
52915306
52925307 objEditor.AddInfo(child, this, true);
5293
- System.err.println("info : " + child.GetPath());
5308
+// System.err.println("info : " + child.GetPath());
52945309 }
52955310
52965311 objEditor.SetText(); // jan 2014