.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
19 | | - Grafreed.iResourceCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
20 | 20 | ObjectUI, |
---|
21 | 21 | Runnable, |
---|
22 | 22 | ActionListener, |
---|
.. | .. |
---|
31 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
32 | 32 | row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
33 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
34 | | - skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
36 | 36 | { |
---|
37 | 37 | @Override |
---|
.. | .. |
---|
42 | 42 | }); |
---|
43 | 43 | } |
---|
44 | 44 | |
---|
| 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 | + |
---|
45 | 61 | public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
46 | 62 | { |
---|
47 | 63 | cGridBag tab0 = new cGridBag().setVertical(true); |
---|
.. | .. |
---|
57 | 73 | cGridBag row5 = new cGridBag(); |
---|
58 | 74 | cGridBag row6 = new cGridBag(); |
---|
59 | 75 | |
---|
60 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
61 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
62 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
63 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
312 | 328 | } |
---|
313 | 329 | } |
---|
314 | 330 | |
---|
315 | | - public void CallBack(String[] path) |
---|
316 | | - { |
---|
317 | | - for (int i = 0; i < path.length; i++) |
---|
318 | | - { |
---|
319 | | - System.out.print(path[i] + "/"); |
---|
320 | | - } |
---|
321 | | - |
---|
322 | | - System.out.println(); |
---|
323 | | - } |
---|
324 | | - |
---|
325 | 331 | public void ChangeSkybox(String skybox) |
---|
326 | 332 | { |
---|
327 | | - //cameraView.envyoff = false; |
---|
328 | | - group.skyboxname = skybox; |
---|
329 | | - group.skyboxext = "jpg"; |
---|
330 | | - cameraView.repaint(); |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
| 346 | + } |
---|
331 | 347 | |
---|
332 | | - Grafreed.ParseResources("textures", this); |
---|
| 348 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 349 | + { |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 351 | + |
---|
| 352 | + AddSkyboxTab0(skyboxpane); |
---|
| 353 | + AddSkyboxTab1(skyboxpane); |
---|
| 354 | + AddSkyboxTab2(skyboxpane); |
---|
| 355 | + AddSkyboxTab3(skyboxpane); |
---|
| 356 | + |
---|
| 357 | + skyboxPanel.add(skyboxpane); |
---|
333 | 358 | } |
---|
334 | 359 | |
---|
| 360 | + public void ChangeTexture(String texture) |
---|
| 361 | + { |
---|
| 362 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 363 | + { |
---|
| 364 | + Object3D obj = group.selection.get(i); |
---|
| 365 | + obj.SetPigmentTexture("@" + texture); |
---|
| 366 | + } |
---|
| 367 | + |
---|
| 368 | + refreshContents(); |
---|
| 369 | + } |
---|
| 370 | + |
---|
| 371 | + public void Show3DView() |
---|
| 372 | + { |
---|
| 373 | + // bug |
---|
| 374 | + //gridPanel.setDividerLocation(1.0); |
---|
| 375 | + //bigPanel.setDividerLocation(0.0); |
---|
| 376 | + bigThree.ClearUI(); |
---|
| 377 | + bigThree.add(centralPanel); |
---|
| 378 | + bigThree.FlushUI(); |
---|
| 379 | + } |
---|
| 380 | + |
---|
335 | 381 | //ObjEditor objEditor; |
---|
336 | 382 | public void closeUI2() |
---|
337 | 383 | { |
---|
.. | .. |
---|
373 | 419 | { |
---|
374 | 420 | copy.versionlist = new Object3D[100]; |
---|
375 | 421 | copy.versionindex = -1; |
---|
| 422 | + |
---|
| 423 | + Save(true); |
---|
376 | 424 | } |
---|
377 | 425 | |
---|
378 | 426 | if(ui) |
---|
.. | .. |
---|
604 | 652 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
605 | 653 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
606 | 654 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
607 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
608 | 655 | oe.cameraMenu.add("-"); |
---|
609 | 656 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
610 | 657 | openWindowItem.addActionListener(this); |
---|
611 | | - editLeafItem.addActionListener(this); |
---|
612 | 658 | lookAtItem.addActionListener(this); |
---|
613 | 659 | //lookFromItem.addActinoListener(this); |
---|
614 | 660 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
856 | 902 | shareGeometriesItem.addActionListener(this); |
---|
857 | 903 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
858 | 904 | mergeGeometriesItem.addActionListener(this); |
---|
| 905 | + menu.add("-"); |
---|
| 906 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 907 | + editLeafItem.addActionListener(this); |
---|
859 | 908 | if (Globals.ADVANCED) |
---|
860 | 909 | { |
---|
861 | 910 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
872 | 921 | buildToolsMenu(menu); |
---|
873 | 922 | } |
---|
874 | 923 | |
---|
| 924 | + JTabbedPane resourcecontainer; |
---|
| 925 | + cGridBag currenttab; |
---|
| 926 | + boolean added; // patch for jar |
---|
| 927 | + |
---|
| 928 | + int tabcount = 0; |
---|
| 929 | + int colcount = 0; |
---|
| 930 | + int rowcount = 0; |
---|
| 931 | + int texturecount = 0; |
---|
| 932 | + |
---|
| 933 | + int columns = 5; |
---|
| 934 | + int rows = 7; |
---|
| 935 | + |
---|
| 936 | + public void ResourceCallBack(String[] path) |
---|
| 937 | + { |
---|
| 938 | +// for (int i = 0; i < path.length; i++) |
---|
| 939 | +// System.out.print(path[i] + "/"); |
---|
| 940 | +// System.out.println(); |
---|
| 941 | + |
---|
| 942 | + if (//rowcount == 0 || |
---|
| 943 | + path.length == 1) |
---|
| 944 | + { |
---|
| 945 | + currenttab = new cGridBag(); |
---|
| 946 | + added = false; |
---|
| 947 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 948 | + currenttab.setName(tabname); |
---|
| 949 | + rowcount = 1; |
---|
| 950 | + colcount = 0; |
---|
| 951 | + texturecount = 0; |
---|
| 952 | + } |
---|
| 953 | + |
---|
| 954 | + if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 955 | + { |
---|
| 956 | + if (!added) |
---|
| 957 | + { |
---|
| 958 | + added = true; |
---|
| 959 | + resourcecontainer.add(currenttab); |
---|
| 960 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 961 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 962 | + } |
---|
| 963 | + |
---|
| 964 | + AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 965 | + |
---|
| 966 | + if (++colcount >= columns) |
---|
| 967 | + { |
---|
| 968 | + colcount = 0; |
---|
| 969 | + currenttab.Return(); |
---|
| 970 | + |
---|
| 971 | + if (rowcount++ >= rows) |
---|
| 972 | + { |
---|
| 973 | + rowcount = 0; |
---|
| 974 | + } |
---|
| 975 | + } |
---|
| 976 | + } |
---|
| 977 | + else |
---|
| 978 | + { |
---|
| 979 | +// if (!path[path.length-1].equals("icons")) |
---|
| 980 | +// resourcecontainer.Return(); |
---|
| 981 | + } |
---|
| 982 | + } |
---|
| 983 | + |
---|
| 984 | + void CreateTexturePanel(cGridBag container) |
---|
| 985 | + { |
---|
| 986 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 987 | + container.add(resourcecontainer); |
---|
| 988 | + |
---|
| 989 | + Grafreed.ParseResources("textures", this); |
---|
| 990 | + } |
---|
875 | 991 | |
---|
876 | 992 | void SetupUI2(ObjEditor oe) |
---|
877 | 993 | { |
---|
.. | .. |
---|
890 | 1006 | //new Exception().printStackTrace(); |
---|
891 | 1007 | |
---|
892 | 1008 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
893 | | - oe.aConstraints.weightx = 1; |
---|
894 | | - oe.aConstraints.weighty = 0; |
---|
895 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
896 | | - oe.aConstraints.gridwidth = 100; |
---|
897 | | - oe.aConstraints.gridheight = 1; |
---|
898 | 1009 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
899 | 1010 | |
---|
900 | 1011 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
927 | 1038 | |
---|
928 | 1039 | if (Globals.ADVANCED) |
---|
929 | 1040 | { |
---|
930 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
931 | | - maxButton.setToolTipText("Maximize window"); |
---|
932 | | - maxButton.addActionListener(this); |
---|
| 1041 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1042 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1043 | +// maxButton.addActionListener(this); |
---|
933 | 1044 | } |
---|
| 1045 | + |
---|
| 1046 | +// cButton gcButton; |
---|
| 1047 | +// |
---|
| 1048 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1049 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1050 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1051 | +// { |
---|
| 1052 | +// public void actionPerformed(ActionEvent e) |
---|
| 1053 | +// { |
---|
| 1054 | +// System.gc(); |
---|
| 1055 | +// } |
---|
| 1056 | +// }); |
---|
| 1057 | + |
---|
| 1058 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1059 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1060 | + collapseButton.addActionListener(this); |
---|
| 1061 | + |
---|
| 1062 | + oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1063 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1064 | + maximize3DButton.addActionListener(this); |
---|
| 1065 | + |
---|
| 1066 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1067 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1068 | + twoButton.addActionListener(this); |
---|
| 1069 | + this.fullscreenLayout = twoButton; |
---|
| 1070 | + |
---|
| 1071 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1073 | + threeButton.addActionListener(this); |
---|
| 1074 | + if (Globals.ADVANCED) |
---|
| 1075 | + { |
---|
| 1076 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1078 | + sixButton.addActionListener(this); |
---|
| 1079 | + } |
---|
| 1080 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1081 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1082 | +// sevenButton.addActionListener(this); |
---|
| 1083 | + // |
---|
934 | 1084 | |
---|
935 | 1085 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
936 | 1086 | fullButton.setToolTipText("Full-screen window"); |
---|
.. | .. |
---|
975 | 1125 | nextVersionButton.addActionListener(this); |
---|
976 | 1126 | nextVersionButton.setEnabled(false); |
---|
977 | 1127 | |
---|
978 | | - oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
979 | | - liveCB.setToolTipText("Enable animation"); |
---|
980 | | - liveCB.addItemListener(this); |
---|
981 | | - |
---|
982 | 1128 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
983 | 1129 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
984 | 1130 | oneStepButton.addActionListener(this); |
---|
985 | 1131 | |
---|
| 1132 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 1133 | + liveCB.setToolTipText("Enable animation"); |
---|
| 1134 | + liveCB.addItemListener(this); |
---|
| 1135 | + |
---|
986 | 1136 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
987 | 1137 | fastCB.setToolTipText("Fast mode"); |
---|
988 | 1138 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
1009 | 1159 | |
---|
1010 | 1160 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1011 | 1161 | |
---|
1012 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1013 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
1014 | | - twoButton.addActionListener(this); |
---|
1015 | | - this.fullscreenLayout = twoButton; |
---|
1016 | | - |
---|
1017 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1018 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
1019 | | - threeButton.addActionListener(this); |
---|
1020 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1021 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
1022 | | - sixButton.addActionListener(this); |
---|
1023 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1024 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
1025 | | -// sevenButton.addActionListener(this); |
---|
1026 | | - // |
---|
1027 | 1162 | |
---|
1028 | 1163 | oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1029 | 1164 | rootButton.setToolTipText("Open selection in new tab"); |
---|
.. | .. |
---|
1039 | 1174 | |
---|
1040 | 1175 | // INSERT |
---|
1041 | 1176 | row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1042 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1177 | + gridButton.setToolTipText("Create ground"); |
---|
1043 | 1178 | gridButton.addActionListener(this); |
---|
1044 | 1179 | |
---|
1045 | 1180 | row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1107 | 1242 | |
---|
1108 | 1243 | oe.toolboxPanel.add(row2); |
---|
1109 | 1244 | |
---|
1110 | | - // ENVYMAPS |
---|
1111 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1112 | | - skyboxpane.preferredHeight = 100; |
---|
| 1245 | + cGridBag textures = new cGridBag(); |
---|
1113 | 1246 | |
---|
1114 | | - oe.skyboxPanel.add(skyboxpane); |
---|
| 1247 | + CreateTexturePanel(textures); |
---|
1115 | 1248 | |
---|
1116 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1117 | | - skyboxpane.add(skyboxpanel); |
---|
| 1249 | + oe.toolboxPanel.add(textures); |
---|
1118 | 1250 | |
---|
1119 | | - AddSkyboxTab0(skyboxpanel); |
---|
1120 | | - AddSkyboxTab1(skyboxpanel); |
---|
1121 | | - AddSkyboxTab2(skyboxpanel); |
---|
1122 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1251 | + textures.preferredHeight = 100; |
---|
| 1252 | + |
---|
| 1253 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1123 | 1254 | |
---|
1124 | 1255 | // EDIT panel |
---|
1125 | 1256 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1131 | 1262 | uneditButton.addActionListener(this); |
---|
1132 | 1263 | |
---|
1133 | 1264 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1134 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1265 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1135 | 1266 | allParamsButton.addActionListener(this); |
---|
1136 | 1267 | |
---|
1137 | 1268 | editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1138 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1269 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1139 | 1270 | clearPanelButton.addActionListener(this); |
---|
1140 | 1271 | |
---|
1141 | 1272 | //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1335 | 1466 | |
---|
1336 | 1467 | void EditObject(Object3D obj) |
---|
1337 | 1468 | { |
---|
| 1469 | + assert(obj instanceof Composite); |
---|
| 1470 | + |
---|
| 1471 | +// if (obj.versionlist == null) |
---|
| 1472 | +// { |
---|
| 1473 | +// obj.versionlist = new Object3D[100]; |
---|
| 1474 | +// obj.versionindex = -1; |
---|
| 1475 | +// } |
---|
| 1476 | + |
---|
1338 | 1477 | cRadio radioButton = new cRadio(obj.name); |
---|
1339 | 1478 | |
---|
1340 | 1479 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1725 | 1864 | TreePath path; |
---|
1726 | 1865 | |
---|
1727 | 1866 | public TransferableTreePath(TreePath tp) { |
---|
1728 | | - path = tp; |
---|
| 1867 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1868 | + for (int i=0; i<objs.length; i++) |
---|
| 1869 | + { |
---|
| 1870 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1871 | + } |
---|
| 1872 | + path = new TreePath(objs); |
---|
1729 | 1873 | } |
---|
1730 | 1874 | |
---|
1731 | 1875 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2618 | 2762 | if (source == fullButton) |
---|
2619 | 2763 | { |
---|
2620 | 2764 | ToggleFullScreen(); |
---|
| 2765 | + } else |
---|
| 2766 | + if (source == collapseButton) |
---|
| 2767 | + { |
---|
| 2768 | + this.expandedLayout = radio.layout; |
---|
| 2769 | + CollapseToolbar(); |
---|
| 2770 | + } else |
---|
| 2771 | + if (source == maximize3DButton) |
---|
| 2772 | + { |
---|
| 2773 | + this.expandedLayout = radio.layout; |
---|
| 2774 | + radio.layout = twoButton; |
---|
| 2775 | + Show3DView(); |
---|
| 2776 | + CollapseToolbar(); |
---|
2621 | 2777 | } else |
---|
2622 | 2778 | if (source == previousVersionButton) |
---|
2623 | 2779 | { |
---|
.. | .. |
---|
3570 | 3726 | if (CameraPane.FULLSCREEN) |
---|
3571 | 3727 | fullscreenLayout = radio.layout; |
---|
3572 | 3728 | |
---|
3573 | | - // bug |
---|
3574 | | - //gridPanel.setDividerLocation(1.0); |
---|
3575 | | - //bigPanel.setDividerLocation(0.0); |
---|
3576 | | -// bigThree.remove(scenePanel); |
---|
3577 | | -// bigThree.remove(centralPanel); |
---|
3578 | | -// bigThree.remove(XYZPanel); |
---|
3579 | | -// aWindowConstraints.gridx = 0; |
---|
3580 | | -// aWindowConstraints.gridy = 0; |
---|
3581 | | -// aWindowConstraints.gridwidth = 1; |
---|
3582 | | -// // aConstraints.gridheight = 3; |
---|
3583 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3584 | | -// aWindowConstraints.weightx = 0; |
---|
3585 | | -// aWindowConstraints.weighty = 1; |
---|
3586 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3587 | | -// aWindowConstraints.weightx = 1; |
---|
3588 | | -// aWindowConstraints.gridwidth = 3; |
---|
3589 | | -// // aConstraints.gridheight = 3; |
---|
3590 | | -// aWindowConstraints.gridx = 1; |
---|
3591 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3592 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3593 | | -// aWindowConstraints.weightx = 0; |
---|
3594 | | -// aWindowConstraints.gridx = 4; |
---|
3595 | | -// aWindowConstraints.gridwidth = 1; |
---|
3596 | | -// // aConstraints.gridheight = 3; |
---|
3597 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3598 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3599 | | -// scenePanel.setVisible(false); |
---|
3600 | | -// centralPanel.setVisible(true); |
---|
3601 | | -// XYZPanel.setVisible(false); |
---|
3602 | | - bigThree.ClearUI(); |
---|
3603 | | - bigThree.add(centralPanel); |
---|
3604 | | - bigThree.FlushUI(); |
---|
| 3729 | + Show3DView(); |
---|
3605 | 3730 | |
---|
3606 | 3731 | cameraView.requestFocusInWindow(); |
---|
3607 | 3732 | |
---|
.. | .. |
---|
3787 | 3912 | } else |
---|
3788 | 3913 | if (source == rootButton) |
---|
3789 | 3914 | { |
---|
| 3915 | + Replace(); |
---|
3790 | 3916 | Object3D obj; |
---|
3791 | 3917 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3792 | 3918 | { |
---|
.. | .. |
---|
3923 | 4049 | |
---|
3924 | 4050 | copy = group; |
---|
3925 | 4051 | |
---|
3926 | | - SetUndoStates(); |
---|
3927 | | - |
---|
3928 | 4052 | //Globals.theRenderer.object = group; |
---|
3929 | 4053 | if(!useclient) |
---|
3930 | 4054 | { |
---|
.. | .. |
---|
3952 | 4076 | */ |
---|
3953 | 4077 | radio.layout.doClick(); |
---|
3954 | 4078 | |
---|
| 4079 | + assert(copy instanceof Composite); |
---|
| 4080 | + |
---|
| 4081 | + if (copy.versionlist == null) |
---|
| 4082 | + { |
---|
| 4083 | + copy.versionlist = new Object3D[100]; |
---|
| 4084 | + copy.versionindex = -1; |
---|
| 4085 | + |
---|
| 4086 | + Save(true); |
---|
| 4087 | + } |
---|
| 4088 | + |
---|
| 4089 | + SetVersionStates(); |
---|
| 4090 | + |
---|
3955 | 4091 | ClearUnpinned(); |
---|
3956 | 4092 | |
---|
3957 | 4093 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
5186 | 5322 | flashSelectionButton.setEnabled(enabled); |
---|
5187 | 5323 | |
---|
5188 | 5324 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5325 | + |
---|
| 5326 | + boolean allComposites = true; |
---|
| 5327 | + |
---|
| 5328 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5329 | + { |
---|
| 5330 | + if (!(e.nextElement() instanceof Composite)) |
---|
| 5331 | + { |
---|
| 5332 | + allComposites = false; |
---|
| 5333 | + break; |
---|
| 5334 | + } |
---|
| 5335 | + } |
---|
| 5336 | + |
---|
| 5337 | + rootButton.setEnabled(allComposites); |
---|
5189 | 5338 | } |
---|
5190 | 5339 | |
---|
5191 | 5340 | void refreshContents(boolean cp) |
---|
.. | .. |
---|
5200 | 5349 | Object3D child = (Object3D) group.selection.get(i); |
---|
5201 | 5350 | |
---|
5202 | 5351 | objEditor.AddInfo(child, this, true); |
---|
5203 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5352 | +// System.err.println("info : " + child.GetPath()); |
---|
5204 | 5353 | } |
---|
5205 | 5354 | |
---|
5206 | 5355 | objEditor.SetText(); // jan 2014 |
---|