.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
19 | 20 | ObjectUI, |
---|
20 | 21 | Runnable, |
---|
21 | 22 | ActionListener, |
---|
.. | .. |
---|
41 | 42 | }); |
---|
42 | 43 | } |
---|
43 | 44 | |
---|
| 45 | + public void AddTextureButton(String f, final String t, cGridBag row) |
---|
| 46 | + { |
---|
| 47 | + cButton textureButton; |
---|
| 48 | + final String path = "textures/" + f + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(f + "s"); |
---|
| 51 | + textureButton.addActionListener(new ActionListener() |
---|
| 52 | + { |
---|
| 53 | + @Override |
---|
| 54 | + public void actionPerformed(ActionEvent e) |
---|
| 55 | + { |
---|
| 56 | + ChangeTexture(path + t); |
---|
| 57 | + } |
---|
| 58 | + }); |
---|
| 59 | + } |
---|
| 60 | + |
---|
44 | 61 | public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
45 | 62 | { |
---|
46 | 63 | cGridBag tab0 = new cGridBag().setVertical(true); |
---|
.. | .. |
---|
311 | 328 | } |
---|
312 | 329 | } |
---|
313 | 330 | |
---|
314 | | - public void ChangeSkybox(String name) |
---|
| 331 | + public void ChangeSkybox(String skybox) |
---|
315 | 332 | { |
---|
316 | 333 | //cameraView.envyoff = false; |
---|
317 | | - group.skyboxname = name; |
---|
| 334 | + group.skyboxname = skybox; |
---|
318 | 335 | group.skyboxext = "jpg"; |
---|
319 | 336 | cameraView.repaint(); |
---|
320 | 337 | } |
---|
| 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 | + } |
---|
321 | 350 | |
---|
| 351 | + public void ChangeTexture(String texture) |
---|
| 352 | + { |
---|
| 353 | + cameraView.repaint(); |
---|
| 354 | + } |
---|
| 355 | + |
---|
322 | 356 | //ObjEditor objEditor; |
---|
323 | 357 | public void closeUI2() |
---|
324 | 358 | { |
---|
.. | .. |
---|
859 | 893 | buildToolsMenu(menu); |
---|
860 | 894 | } |
---|
861 | 895 | |
---|
| 896 | + JTabbedPane resourcecontainer; |
---|
| 897 | + cGridBag currenttab; |
---|
| 898 | + boolean added; // patch for jar |
---|
| 899 | + |
---|
| 900 | + int tabcount = 0; |
---|
| 901 | + int colcount = 0; |
---|
| 902 | + int rowcount = 0; |
---|
| 903 | + |
---|
| 904 | + int columns = 5; |
---|
| 905 | + int rows = 7; |
---|
| 906 | + |
---|
| 907 | + public void ResourceCallBack(String[] path) |
---|
| 908 | + { |
---|
| 909 | + for (int i = 0; i < path.length; i++) |
---|
| 910 | + System.out.print(path[i] + "/"); |
---|
| 911 | + System.out.println(); |
---|
| 912 | + if (rowcount == 0) |
---|
| 913 | + { |
---|
| 914 | + currenttab = new cGridBag(); |
---|
| 915 | + added = false; |
---|
| 916 | + String tabname = String.valueOf((char)('A'+tabcount)); |
---|
| 917 | + currenttab.setName(tabname); |
---|
| 918 | + rowcount = 1; |
---|
| 919 | + } |
---|
| 920 | + |
---|
| 921 | + if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg")) |
---|
| 922 | + { |
---|
| 923 | + if (!added) |
---|
| 924 | + { |
---|
| 925 | + added = true; |
---|
| 926 | + resourcecontainer.add(currenttab); |
---|
| 927 | + String tabname = String.valueOf((char)('A'+tabcount)); |
---|
| 928 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 929 | + } |
---|
| 930 | + |
---|
| 931 | + AddTextureButton(path[0], path[1], currenttab); |
---|
| 932 | + if (++colcount >= columns) |
---|
| 933 | + { |
---|
| 934 | + colcount = 0; |
---|
| 935 | + currenttab.Return(); |
---|
| 936 | + |
---|
| 937 | + if (rowcount++ >= rows) |
---|
| 938 | + { |
---|
| 939 | + rowcount = 0; |
---|
| 940 | + } |
---|
| 941 | + } |
---|
| 942 | + } |
---|
| 943 | + else |
---|
| 944 | + { |
---|
| 945 | +// if (!path[path.length-1].equals("icons")) |
---|
| 946 | +// resourcecontainer.Return(); |
---|
| 947 | + } |
---|
| 948 | + } |
---|
| 949 | + |
---|
| 950 | + void CreateTexturePanel(cGridBag container) |
---|
| 951 | + { |
---|
| 952 | + resourcecontainer = new JTabbedPane(); |
---|
| 953 | + container.add(resourcecontainer); |
---|
| 954 | + |
---|
| 955 | + Grafreed.ParseResources("textures", this); |
---|
| 956 | + } |
---|
862 | 957 | |
---|
863 | 958 | void SetupUI2(ObjEditor oe) |
---|
864 | 959 | { |
---|
.. | .. |
---|
948 | 1043 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
949 | 1044 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
950 | 1045 | restoreButton.addActionListener(this); |
---|
951 | | - restoreButton.setEnabled(false); |
---|
| 1046 | + //restoreButton.setEnabled(false); |
---|
952 | 1047 | |
---|
953 | 1048 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
954 | 1049 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
955 | 1050 | replaceButton.addActionListener(this); |
---|
956 | | - replaceButton.setEnabled(false); |
---|
| 1051 | + //replaceButton.setEnabled(false); |
---|
957 | 1052 | |
---|
958 | 1053 | copyOptionsPanel.add(updown); |
---|
959 | 1054 | |
---|
.. | .. |
---|
1094 | 1189 | |
---|
1095 | 1190 | oe.toolboxPanel.add(row2); |
---|
1096 | 1191 | |
---|
1097 | | - // ENVYMAPS |
---|
1098 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1099 | | - skyboxpane.preferredHeight = 100; |
---|
| 1192 | + cGridBag textures = new cGridBag(); |
---|
1100 | 1193 | |
---|
1101 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1194 | + CreateTexturePanel(textures); |
---|
1102 | 1195 | |
---|
1103 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1104 | | - skyboxpane.add(skyboxpanel); |
---|
| 1196 | + oe.toolboxPanel.add(textures); |
---|
1105 | 1197 | |
---|
1106 | | - AddSkyboxTab0(skyboxpanel); |
---|
1107 | | - AddSkyboxTab1(skyboxpanel); |
---|
1108 | | - AddSkyboxTab2(skyboxpanel); |
---|
1109 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1198 | + textures.preferredHeight = 100; |
---|
| 1199 | + |
---|
| 1200 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1110 | 1201 | |
---|
1111 | 1202 | // EDIT panel |
---|
1112 | 1203 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1118 | 1209 | uneditButton.addActionListener(this); |
---|
1119 | 1210 | |
---|
1120 | 1211 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1121 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1212 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1122 | 1213 | allParamsButton.addActionListener(this); |
---|
1123 | 1214 | |
---|
1124 | 1215 | editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1216 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1126 | 1217 | clearPanelButton.addActionListener(this); |
---|
1127 | 1218 | |
---|
1128 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1129 | | - unselectButton.setToolTipText("Unselect"); |
---|
1130 | | - unselectButton.addActionListener(this); |
---|
| 1219 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1221 | + //unselectButton.addActionListener(this); |
---|
1131 | 1222 | |
---|
1132 | 1223 | editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1133 | 1224 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
.. | .. |
---|
2617 | 2708 | { |
---|
2618 | 2709 | // Restore current version |
---|
2619 | 2710 | Restore(); |
---|
2620 | | - restoreButton.setEnabled(false); |
---|
| 2711 | + //restoreButton.setEnabled(false); |
---|
2621 | 2712 | } else |
---|
2622 | 2713 | if (source == replaceButton) |
---|
2623 | 2714 | { |
---|
2624 | 2715 | // Overwrite current version |
---|
2625 | 2716 | Replace(); |
---|
2626 | | - replaceButton.setEnabled(false); |
---|
| 2717 | + //replaceButton.setEnabled(false); |
---|
2627 | 2718 | } else |
---|
2628 | 2719 | if (source == nextVersionButton) |
---|
2629 | 2720 | { |
---|
.. | .. |
---|
5169 | 5260 | { |
---|
5170 | 5261 | editButton.setEnabled(enabled); |
---|
5171 | 5262 | uneditButton.setEnabled(enabled); |
---|
5172 | | - unselectButton.setEnabled(enabled); |
---|
| 5263 | + //unselectButton.setEnabled(enabled); |
---|
5173 | 5264 | flashSelectionButton.setEnabled(enabled); |
---|
5174 | 5265 | |
---|
5175 | 5266 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
.. | .. |
---|
5177 | 5268 | |
---|
5178 | 5269 | void refreshContents(boolean cp) |
---|
5179 | 5270 | { |
---|
5180 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5271 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5181 | 5272 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5182 | 5273 | { |
---|
5183 | 5274 | objEditor.ClearInfo(); // .GetMaterial()); |
---|