Normand Briere
2019-08-12 8f1afe25ea8fc8801aab66331c32a50859a758c2
GroupEditor.java
....@@ -16,6 +16,7 @@
1616 //import buoy.widget.BFileChooser;
1717
1818 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1920 ObjectUI,
2021 Runnable,
2122 ActionListener,
....@@ -41,6 +42,22 @@
4142 });
4243 }
4344
45
+ public void AddTextureButton(String f, String c, final String t, int count, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(c + count);
51
+ textureButton.addActionListener(new ActionListener()
52
+ {
53
+ @Override
54
+ public void actionPerformed(ActionEvent e)
55
+ {
56
+ ChangeTexture(path + t);
57
+ }
58
+ });
59
+ }
60
+
4461 public void AddSkyboxTab0(JTabbedPane skyboxpanel)
4562 {
4663 cGridBag tab0 = new cGridBag().setVertical(true);
....@@ -311,14 +328,47 @@
311328 }
312329 }
313330
314
- public void ChangeSkybox(String name)
331
+ public void ChangeSkybox(String skybox)
315332 {
316333 //cameraView.envyoff = false;
317
- group.skyboxname = name;
334
+ group.skyboxname = skybox;
318335 group.skyboxext = "jpg";
319336 cameraView.repaint();
320337 }
338
+
339
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
340
+ {
341
+ JTabbedPane skyboxpane = new JTabbedPane();
342
+
343
+ AddSkyboxTab0(skyboxpane);
344
+ AddSkyboxTab1(skyboxpane);
345
+ AddSkyboxTab2(skyboxpane);
346
+ AddSkyboxTab3(skyboxpane);
347
+
348
+ skyboxPanel.add(skyboxpane);
349
+ }
321350
351
+ public void ChangeTexture(String texture)
352
+ {
353
+ for (int i=0; i<group.selection.size(); i++)
354
+ {
355
+ Object3D obj = group.selection.get(i);
356
+ obj.SetPigmentTexture("@" + texture);
357
+ }
358
+
359
+ refreshContents();
360
+ }
361
+
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
+
322372 //ObjEditor objEditor;
323373 public void closeUI2()
324374 {
....@@ -360,6 +410,8 @@
360410 {
361411 copy.versionlist = new Object3D[100];
362412 copy.versionindex = -1;
413
+
414
+ Save(true);
363415 }
364416
365417 if(ui)
....@@ -591,11 +643,9 @@
591643 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
592644 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
593645 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
594
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
595646 oe.cameraMenu.add("-");
596647 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
597648 openWindowItem.addActionListener(this);
598
- editLeafItem.addActionListener(this);
599649 lookAtItem.addActionListener(this);
600650 //lookFromItem.addActinoListener(this);
601651 //switchViewItem.addActionListener(this);
....@@ -843,6 +893,9 @@
843893 shareGeometriesItem.addActionListener(this);
844894 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
845895 mergeGeometriesItem.addActionListener(this);
896
+ menu.add("-");
897
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
898
+ editLeafItem.addActionListener(this);
846899 if (Globals.ADVANCED)
847900 {
848901 // Pretty much the same as duplicate and clone.
....@@ -859,6 +912,73 @@
859912 buildToolsMenu(menu);
860913 }
861914
915
+ JTabbedPane resourcecontainer;
916
+ cGridBag currenttab;
917
+ boolean added; // patch for jar
918
+
919
+ int tabcount = 0;
920
+ int colcount = 0;
921
+ int rowcount = 0;
922
+ int texturecount = 0;
923
+
924
+ int columns = 5;
925
+ int rows = 7;
926
+
927
+ public void ResourceCallBack(String[] path)
928
+ {
929
+// for (int i = 0; i < path.length; i++)
930
+// System.out.print(path[i] + "/");
931
+// System.out.println();
932
+
933
+ if (//rowcount == 0 ||
934
+ path.length == 1)
935
+ {
936
+ currenttab = new cGridBag();
937
+ added = false;
938
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
939
+ currenttab.setName(tabname);
940
+ rowcount = 1;
941
+ colcount = 0;
942
+ texturecount = 0;
943
+ }
944
+
945
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
946
+ {
947
+ if (!added)
948
+ {
949
+ added = true;
950
+ resourcecontainer.add(currenttab);
951
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
952
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
953
+ }
954
+
955
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
956
+
957
+ if (++colcount >= columns)
958
+ {
959
+ colcount = 0;
960
+ currenttab.Return();
961
+
962
+ if (rowcount++ >= rows)
963
+ {
964
+ rowcount = 0;
965
+ }
966
+ }
967
+ }
968
+ else
969
+ {
970
+// if (!path[path.length-1].equals("icons"))
971
+// resourcecontainer.Return();
972
+ }
973
+ }
974
+
975
+ void CreateTexturePanel(cGridBag container)
976
+ {
977
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
978
+ container.add(resourcecontainer);
979
+
980
+ Grafreed.ParseResources("textures", this);
981
+ }
862982
863983 void SetupUI2(ObjEditor oe)
864984 {
....@@ -877,11 +997,6 @@
877997 //new Exception().printStackTrace();
878998
879999 oe.radioPanel = new JPanel(new GridBagLayout());
880
- oe.aConstraints.weightx = 1;
881
- oe.aConstraints.weighty = 0;
882
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
883
- oe.aConstraints.gridwidth = 100;
884
- oe.aConstraints.gridheight = 1;
8851000 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8861001
8871002 oe.buttonGroup = new ButtonGroup();
....@@ -914,10 +1029,49 @@
9141029
9151030 if (Globals.ADVANCED)
9161031 {
917
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
- maxButton.setToolTipText("Maximize window");
919
- maxButton.addActionListener(this);
1032
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+// maxButton.setToolTipText("Maximize window");
1034
+// maxButton.addActionListener(this);
9201035 }
1036
+
1037
+// cButton gcButton;
1038
+//
1039
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+// gcButton.setToolTipText("Garbage collect");
1041
+// gcButton.addActionListener(new ActionListener()
1042
+// {
1043
+// public void actionPerformed(ActionEvent e)
1044
+// {
1045
+// System.gc();
1046
+// }
1047
+// });
1048
+
1049
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ collapseButton.setToolTipText("Collapse toolbar");
1051
+ collapseButton.addActionListener(this);
1052
+
1053
+ oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1054
+ maximize3DButton.setToolTipText("Maximize 3D view");
1055
+ maximize3DButton.addActionListener(this);
1056
+
1057
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
+ twoButton.setToolTipText("Show 3D view only");
1059
+ twoButton.addActionListener(this);
1060
+ this.fullscreenLayout = twoButton;
1061
+
1062
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ threeButton.setToolTipText("Show controls and 3D view");
1064
+ threeButton.addActionListener(this);
1065
+ if (Globals.ADVANCED)
1066
+ {
1067
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ sixButton.setToolTipText("Show 3D view and controls");
1069
+ sixButton.addActionListener(this);
1070
+ }
1071
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+// sevenButton.setToolTipText("3-column layout");
1073
+// sevenButton.addActionListener(this);
1074
+ //
9211075
9221076 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
9231077 fullButton.setToolTipText("Full-screen window");
....@@ -931,41 +1085,45 @@
9311085 restoreCameraButton.setToolTipText("Restore viewpoint");
9321086 restoreCameraButton.addActionListener(this);
9331087
934
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
- saveButton.setToolTipText("Duplicate current version");
936
- saveButton.addActionListener(this);
1088
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1089
+ saveVersionButton.setToolTipText("Duplicate current version");
1090
+ saveVersionButton.addActionListener(this);
9371091
938
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
- undoButton.setToolTipText("Previous version");
940
- undoButton.addActionListener(this);
941
- undoButton.setEnabled(false);
1092
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1093
+ deleteVersionButton.setToolTipText("Delete current version");
1094
+ deleteVersionButton.addActionListener(this);
1095
+
1096
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1097
+ previousVersionButton.setToolTipText("Previous version");
1098
+ previousVersionButton.addActionListener(this);
1099
+ previousVersionButton.setEnabled(false);
9421100
9431101 cGridBag updown = new cGridBag().setVertical(true);
9441102 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
9451103 restoreButton.setToolTipText("Undo (restore current version)");
9461104 restoreButton.addActionListener(this);
947
- restoreButton.setEnabled(false);
1105
+ //restoreButton.setEnabled(false);
9481106
9491107 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
9501108 replaceButton.setToolTipText("Save (replace current version)");
9511109 replaceButton.addActionListener(this);
952
- replaceButton.setEnabled(false);
1110
+ //replaceButton.setEnabled(false);
9531111
9541112 copyOptionsPanel.add(updown);
9551113
956
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
- redoButton.setToolTipText("Next version");
958
- redoButton.addActionListener(this);
959
- redoButton.setEnabled(false);
1114
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1115
+ nextVersionButton.setToolTipText("Next version");
1116
+ nextVersionButton.addActionListener(this);
1117
+ nextVersionButton.setEnabled(false);
1118
+
1119
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ oneStepButton.setToolTipText("Animate one step forward");
1121
+ oneStepButton.addActionListener(this);
9601122
9611123 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
9621124 liveCB.setToolTipText("Enable animation");
9631125 liveCB.addItemListener(this);
9641126
965
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
966
- oneStepButton.setToolTipText("Animate one step forward");
967
- oneStepButton.addActionListener(this);
968
-
9691127 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
9701128 fastCB.setToolTipText("Fast mode");
9711129 fastCB.addItemListener(this);
....@@ -992,21 +1150,6 @@
9921150
9931151 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
9941152
995
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
- twoButton.setToolTipText("Show 3D view only");
997
- twoButton.addActionListener(this);
998
- this.fullscreenLayout = twoButton;
999
-
1000
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
- threeButton.setToolTipText("Show controls and 3D view");
1002
- threeButton.addActionListener(this);
1003
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
- sixButton.setToolTipText("Show 3D view and controls");
1005
- sixButton.addActionListener(this);
1006
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
-// sevenButton.setToolTipText("3-column layout");
1008
-// sevenButton.addActionListener(this);
1009
- //
10101153
10111154 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10121155 rootButton.setToolTipText("Open selection in new tab");
....@@ -1022,7 +1165,7 @@
10221165
10231166 // INSERT
10241167 row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
- gridButton.setToolTipText("Create grid");
1168
+ gridButton.setToolTipText("Create ground");
10261169 gridButton.addActionListener(this);
10271170
10281171 row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1090,19 +1233,15 @@
10901233
10911234 oe.toolboxPanel.add(row2);
10921235
1093
- // ENVYMAPS
1094
- cGridBag skyboxpane = new cGridBag();
1095
- skyboxpane.preferredHeight = 100;
1236
+ cGridBag textures = new cGridBag();
10961237
1097
- oe.toolboxPanel.add(skyboxpane);
1238
+ CreateTexturePanel(textures);
10981239
1099
- JTabbedPane skyboxpanel = new JTabbedPane();
1100
- skyboxpane.add(skyboxpanel);
1240
+ oe.toolboxPanel.add(textures);
11011241
1102
- AddSkyboxTab0(skyboxpanel);
1103
- AddSkyboxTab1(skyboxpanel);
1104
- AddSkyboxTab2(skyboxpanel);
1105
- AddSkyboxTab3(skyboxpanel);
1242
+ textures.preferredHeight = 100;
1243
+
1244
+ CreateSkyboxPanel(oe.skyboxPanel);
11061245
11071246 // EDIT panel
11081247 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1114,16 +1253,16 @@
11141253 uneditButton.addActionListener(this);
11151254
11161255 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
- allParamsButton.setToolTipText("Show all controle");
1256
+ allParamsButton.setToolTipText("Show all controls");
11181257 allParamsButton.addActionListener(this);
11191258
11201259 editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
- clearPanelButton.setToolTipText("Clear edit panel");
1260
+ clearPanelButton.setToolTipText("Clear all controls");
11221261 clearPanelButton.addActionListener(this);
11231262
1124
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
- unselectButton.setToolTipText("Unselect");
1126
- unselectButton.addActionListener(this);
1263
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1264
+ //unselectButton.setToolTipText("Unselect");
1265
+ //unselectButton.addActionListener(this);
11271266
11281267 editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11291268 flashSelectionButton.setToolTipText("Highlight selection");
....@@ -1318,6 +1457,14 @@
13181457
13191458 void EditObject(Object3D obj)
13201459 {
1460
+ assert(obj instanceof Composite);
1461
+
1462
+ if (obj.versionlist == null)
1463
+ {
1464
+ obj.versionlist = new Object3D[100];
1465
+ obj.versionindex = -1;
1466
+ }
1467
+
13211468 cRadio radioButton = new cRadio(obj.name);
13221469
13231470 // June 2019. Patch to avoid bug with transparency.
....@@ -1708,7 +1855,12 @@
17081855 TreePath path;
17091856
17101857 public TransferableTreePath(TreePath tp) {
1711
- path = tp;
1858
+ Object[] objs = new Object[tp.getPathCount()];
1859
+ for (int i=0; i<objs.length; i++)
1860
+ {
1861
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1862
+ }
1863
+ path = new TreePath(objs);
17121864 }
17131865
17141866 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2571,7 +2723,7 @@
25712723 if (source == invariantsItem)
25722724 {
25732725 System.out.println("Invariants:");
2574
- Grafreed.grafreeD.universe.invariants();
2726
+ Grafreed.grafreed.universe.invariants();
25752727 } else
25762728 if (source == memoryItem)
25772729 {
....@@ -2602,35 +2754,52 @@
26022754 {
26032755 ToggleFullScreen();
26042756 } else
2605
- if (source == undoButton)
2757
+ if (source == collapseButton)
2758
+ {
2759
+ this.expandedLayout = radio.layout;
2760
+ CollapseToolbar();
2761
+ } else
2762
+ if (source == maximize3DButton)
2763
+ {
2764
+ this.expandedLayout = radio.layout;
2765
+ radio.layout = twoButton;
2766
+ Show3DView();
2767
+ CollapseToolbar();
2768
+ } else
2769
+ if (source == previousVersionButton)
26062770 {
26072771 // Go to previous version
26082772 //if (!Undo())
26092773 //java.awt.Toolkit.getDefaultToolkit().beep();
2610
- Undo();
2774
+ PreviousVersion();
26112775 } else
26122776 if (source == restoreButton)
26132777 {
26142778 // Restore current version
26152779 Restore();
2616
- restoreButton.setEnabled(false);
2780
+ //restoreButton.setEnabled(false);
26172781 } else
26182782 if (source == replaceButton)
26192783 {
26202784 // Overwrite current version
26212785 Replace();
2622
- replaceButton.setEnabled(false);
2786
+ //replaceButton.setEnabled(false);
26232787 } else
2624
- if (source == redoButton)
2788
+ if (source == nextVersionButton)
26252789 {
26262790 // Go to next version
2627
- Redo();
2791
+ NextVersion();
26282792 } else
2629
- if (source == saveButton)
2793
+ if (source == saveVersionButton)
26302794 {
26312795 // Save a new version
26322796 if (!Save(true))
26332797 java.awt.Toolkit.getDefaultToolkit().beep();
2798
+ } else
2799
+ if (source == deleteVersionButton)
2800
+ {
2801
+ // Delete a new version
2802
+ DeleteVersion();
26342803 } else
26352804 if (source == oneStepButton)
26362805 {
....@@ -2685,11 +2854,11 @@
26852854 } else
26862855 if (source == undoItem)
26872856 {
2688
- Undo();
2857
+ PreviousVersion();
26892858 } else
26902859 if (source == redoItem)
26912860 {
2692
- Redo();
2861
+ NextVersion();
26932862 } else
26942863 if (source == duplicateItem)
26952864 {
....@@ -3548,38 +3717,7 @@
35483717 if (CameraPane.FULLSCREEN)
35493718 fullscreenLayout = radio.layout;
35503719
3551
- // bug
3552
- //gridPanel.setDividerLocation(1.0);
3553
- //bigPanel.setDividerLocation(0.0);
3554
-// bigThree.remove(scenePanel);
3555
-// bigThree.remove(centralPanel);
3556
-// bigThree.remove(XYZPanel);
3557
-// aWindowConstraints.gridx = 0;
3558
-// aWindowConstraints.gridy = 0;
3559
-// aWindowConstraints.gridwidth = 1;
3560
-// // aConstraints.gridheight = 3;
3561
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3562
-// aWindowConstraints.weightx = 0;
3563
-// aWindowConstraints.weighty = 1;
3564
-// //bigThree.add(jtp, aWindowConstraints);
3565
-// aWindowConstraints.weightx = 1;
3566
-// aWindowConstraints.gridwidth = 3;
3567
-// // aConstraints.gridheight = 3;
3568
-// aWindowConstraints.gridx = 1;
3569
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3570
-// bigThree.add(centralPanel, aWindowConstraints);
3571
-// aWindowConstraints.weightx = 0;
3572
-// aWindowConstraints.gridx = 4;
3573
-// aWindowConstraints.gridwidth = 1;
3574
-// // aConstraints.gridheight = 3;
3575
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3576
-// //bigThree.add(XYZPanel, aWindowConstraints);
3577
-// scenePanel.setVisible(false);
3578
-// centralPanel.setVisible(true);
3579
-// XYZPanel.setVisible(false);
3580
- bigThree.ClearUI();
3581
- bigThree.add(centralPanel);
3582
- bigThree.FlushUI();
3720
+ Show3DView();
35833721
35843722 cameraView.requestFocusInWindow();
35853723
....@@ -3765,6 +3903,7 @@
37653903 } else
37663904 if (source == rootButton)
37673905 {
3906
+ Replace();
37683907 Object3D obj;
37693908 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
37703909 {
....@@ -3901,8 +4040,6 @@
39014040
39024041 copy = group;
39034042
3904
- SetUndoStates();
3905
-
39064043 //Globals.theRenderer.object = group;
39074044 if(!useclient)
39084045 {
....@@ -3930,6 +4067,8 @@
39304067 */
39314068 radio.layout.doClick();
39324069
4070
+ SetUndoStates();
4071
+
39334072 ClearUnpinned();
39344073
39354074 //Grafreed.Assert(group != null);
....@@ -5160,15 +5299,28 @@
51605299 {
51615300 editButton.setEnabled(enabled);
51625301 uneditButton.setEnabled(enabled);
5163
- unselectButton.setEnabled(enabled);
5302
+ //unselectButton.setEnabled(enabled);
51645303 flashSelectionButton.setEnabled(enabled);
51655304
51665305 clearPanelButton.setEnabled(!listUI.isEmpty());
5306
+
5307
+ boolean allComposites = true;
5308
+
5309
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5310
+ {
5311
+ if (!(e.nextElement() instanceof Composite))
5312
+ {
5313
+ allComposites = false;
5314
+ break;
5315
+ }
5316
+ }
5317
+
5318
+ rootButton.setEnabled(allComposites);
51675319 }
51685320
51695321 void refreshContents(boolean cp)
51705322 {
5171
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5323
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
51725324 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
51735325 {
51745326 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5178,7 +5330,7 @@
51785330 Object3D child = (Object3D) group.selection.get(i);
51795331
51805332 objEditor.AddInfo(child, this, true);
5181
- System.err.println("info : " + child.GetPath());
5333
+// System.err.println("info : " + child.GetPath());
51825334 }
51835335
51845336 objEditor.SetText(); // jan 2014
....@@ -6004,7 +6156,6 @@
60046156
60056157 cButton restoreCameraButton;
60066158
6007
- cButton saveButton;
60086159 cButton oneStepButton;
60096160
60106161 cButton groupButton;