.. | .. |
---|
29 | 29 | { |
---|
30 | 30 | cButton skyboxButton; |
---|
31 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
32 | | - row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF)); |
---|
33 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
34 | 34 | skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
.. | .. |
---|
46 | 46 | { |
---|
47 | 47 | cButton textureButton; |
---|
48 | 48 | final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
49 | | - row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
50 | 50 | textureButton.setToolTipText(c + count); |
---|
51 | 51 | textureButton.addActionListener(new ActionListener() |
---|
52 | 52 | { |
---|
.. | .. |
---|
347 | 347 | |
---|
348 | 348 | public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
349 | 349 | { |
---|
350 | | - JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
351 | 351 | |
---|
352 | 352 | AddSkyboxTab0(skyboxpane); |
---|
353 | 353 | AddSkyboxTab1(skyboxpane); |
---|
.. | .. |
---|
857 | 857 | hideleavesItem.addActionListener(this); |
---|
858 | 858 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
859 | 859 | showleavesItem.addActionListener(this); |
---|
860 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 860 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
861 | 861 | markleavesItem.addActionListener(this); |
---|
862 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 862 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
863 | 863 | unmarkleavesItem.addActionListener(this); |
---|
864 | 864 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
865 | 865 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
936 | 936 | cGridBag currenttab; |
---|
937 | 937 | //boolean added; // patch for jar |
---|
938 | 938 | |
---|
| 939 | + int totalcount = 0; |
---|
| 940 | + |
---|
939 | 941 | int tabcount = 0; |
---|
940 | 942 | int colcount = 0; |
---|
941 | 943 | int rowcount = 0; |
---|
.. | .. |
---|
964 | 966 | texturecount = 0; |
---|
965 | 967 | } |
---|
966 | 968 | |
---|
967 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 969 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
968 | 970 | { |
---|
969 | 971 | //if (!added) |
---|
970 | 972 | { |
---|
.. | .. |
---|
973 | 975 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
974 | 976 | } |
---|
975 | 977 | |
---|
976 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 978 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 979 | + totalcount++; |
---|
977 | 980 | |
---|
978 | 981 | if (++colcount >= columns) |
---|
979 | 982 | { |
---|
.. | .. |
---|
999 | 1002 | container.add(resourcecontainer); |
---|
1000 | 1003 | |
---|
1001 | 1004 | Grafreed.ParseResources("textures", this); |
---|
| 1005 | + |
---|
| 1006 | + // 935. System.out.println("Total = " + totalcount); |
---|
1002 | 1007 | } |
---|
1003 | 1008 | |
---|
1004 | 1009 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1038 | 1043 | oe.radioPanel.add(dummyButton); |
---|
1039 | 1044 | oe.buttonGroup.add(dummyButton); |
---|
1040 | 1045 | */ |
---|
1041 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1046 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1042 | 1047 | |
---|
1043 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1048 | + versionManagerPanel.preferredHeight = 4; |
---|
1044 | 1049 | |
---|
1045 | 1050 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1046 | 1051 | |
---|
.. | .. |
---|
1067 | 1072 | // } |
---|
1068 | 1073 | // }); |
---|
1069 | 1074 | |
---|
1070 | | - oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1071 | 1076 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1072 | 1077 | collapseButton.addActionListener(this); |
---|
1073 | 1078 | |
---|
1074 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1075 | 1080 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1076 | 1081 | maximize3DButton.addActionListener(this); |
---|
1077 | 1082 | |
---|
1078 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1079 | 1084 | twoButton.setToolTipText("Show 3D view only"); |
---|
1080 | 1085 | twoButton.addActionListener(this); |
---|
1081 | 1086 | this.fullscreenLayout = twoButton; |
---|
1082 | 1087 | |
---|
1083 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1084 | 1089 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1085 | 1090 | threeButton.addActionListener(this); |
---|
1086 | 1091 | if (Globals.ADVANCED) |
---|
1087 | 1092 | { |
---|
1088 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1093 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1094 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1090 | 1095 | sixButton.addActionListener(this); |
---|
1091 | 1096 | } |
---|
.. | .. |
---|
1094 | 1099 | // sevenButton.addActionListener(this); |
---|
1095 | 1100 | // |
---|
1096 | 1101 | |
---|
1097 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1102 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1098 | 1103 | fullButton.setToolTipText("Full-screen window"); |
---|
1099 | 1104 | fullButton.addActionListener(this); |
---|
1100 | 1105 | |
---|
1101 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1106 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1102 | 1107 | screenfitButton.setToolTipText("Screen fit"); |
---|
1103 | 1108 | screenfitButton.addActionListener(this); |
---|
1104 | 1109 | |
---|
1105 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1110 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1106 | 1111 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1107 | 1112 | restoreCameraButton.addActionListener(this); |
---|
1108 | 1113 | |
---|
1109 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1114 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1110 | 1115 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1111 | 1116 | saveVersionButton.addActionListener(this); |
---|
1112 | 1117 | |
---|
1113 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1114 | 1119 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1115 | 1120 | deleteVersionButton.addActionListener(this); |
---|
1116 | 1121 | deleteVersionButton.setEnabled(false); |
---|
1117 | 1122 | |
---|
1118 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1123 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1119 | 1124 | previousVersionButton.setToolTipText("Previous version"); |
---|
1120 | 1125 | previousVersionButton.addActionListener(this); |
---|
1121 | 1126 | previousVersionButton.setEnabled(false); |
---|
1122 | 1127 | |
---|
1123 | 1128 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1124 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | 1130 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1126 | 1131 | restoreButton.addActionListener(this); |
---|
1127 | 1132 | restoreButton.setEnabled(false); |
---|
1128 | 1133 | |
---|
1129 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1135 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1131 | 1136 | replaceButton.addActionListener(this); |
---|
1132 | 1137 | replaceButton.setEnabled(false); |
---|
1133 | 1138 | |
---|
1134 | | - copyOptionsPanel.add(updown); |
---|
| 1139 | + versionManagerPanel.add(updown); |
---|
1135 | 1140 | |
---|
1136 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1141 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1137 | 1142 | nextVersionButton.setToolTipText("Next version"); |
---|
1138 | 1143 | nextVersionButton.addActionListener(this); |
---|
1139 | 1144 | nextVersionButton.setEnabled(false); |
---|
1140 | 1145 | |
---|
1141 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1146 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1142 | 1147 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1143 | 1148 | oneStepButton.addActionListener(this); |
---|
1144 | 1149 | |
---|
.. | .. |
---|
1161 | 1166 | |
---|
1162 | 1167 | if (Globals.ADVANCED) |
---|
1163 | 1168 | { |
---|
1164 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1169 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1165 | 1170 | snapobjectButton.addActionListener(this); |
---|
1166 | 1171 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1167 | 1172 | |
---|
1168 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1173 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1169 | 1174 | fourButton.addActionListener(this); |
---|
1170 | 1175 | fourButton.setToolTipText("Show control panel only"); |
---|
1171 | 1176 | } |
---|
.. | .. |
---|
1173 | 1178 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1174 | 1179 | |
---|
1175 | 1180 | |
---|
1176 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1181 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1177 | 1182 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1178 | 1183 | rootButton.addActionListener(this); |
---|
1179 | 1184 | |
---|
1180 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1185 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1181 | 1186 | closeButton.setToolTipText("Close tab"); |
---|
1182 | 1187 | closeButton.addActionListener(this); |
---|
1183 | 1188 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1186 | 1191 | cGridBag row1 = new cGridBag(); |
---|
1187 | 1192 | |
---|
1188 | 1193 | // INSERT |
---|
1189 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1194 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1190 | 1195 | gridButton.setToolTipText("Create ground"); |
---|
1191 | 1196 | gridButton.addActionListener(this); |
---|
1192 | 1197 | |
---|
1193 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1198 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1194 | 1199 | boxButton.setToolTipText("Create box"); |
---|
1195 | 1200 | boxButton.addActionListener(this); |
---|
1196 | 1201 | |
---|
1197 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1202 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1198 | 1203 | superButton.setToolTipText("Create superellipsoid"); |
---|
1199 | 1204 | superButton.addActionListener(this); |
---|
1200 | 1205 | |
---|
1201 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1202 | 1207 | sphereButton.setToolTipText("Create sphere"); |
---|
1203 | 1208 | sphereButton.addActionListener(this); |
---|
1204 | 1209 | |
---|
1205 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1206 | 1211 | coneButton.setToolTipText("Create cone"); |
---|
1207 | 1212 | coneButton.addActionListener(this); |
---|
1208 | 1213 | |
---|
1209 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1210 | 1215 | torusButton.setToolTipText("Create torus"); |
---|
1211 | 1216 | torusButton.addActionListener(this); |
---|
1212 | 1217 | |
---|
1213 | 1218 | if (Globals.ADVANCED) |
---|
1214 | 1219 | { |
---|
1215 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1216 | 1221 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1217 | 1222 | kleinButton.addActionListener(this); |
---|
1218 | 1223 | } |
---|
1219 | 1224 | |
---|
1220 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1225 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1221 | 1226 | particlesButton.setToolTipText("Create particle system"); |
---|
1222 | 1227 | particlesButton.addActionListener(this); |
---|
1223 | 1228 | |
---|
.. | .. |
---|
1225 | 1230 | |
---|
1226 | 1231 | cGridBag row2 = new cGridBag(); |
---|
1227 | 1232 | |
---|
1228 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1233 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1229 | 1234 | groupButton.setToolTipText("Create group"); |
---|
1230 | 1235 | groupButton.addActionListener(this); |
---|
1231 | 1236 | |
---|
1232 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1237 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1233 | 1238 | compositeButton.setToolTipText("Create composite"); |
---|
1234 | 1239 | compositeButton.addActionListener(this); |
---|
1235 | 1240 | |
---|
1236 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1241 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1237 | 1242 | switchButton.setToolTipText("Create item switcher"); |
---|
1238 | 1243 | switchButton.addActionListener(this); |
---|
1239 | 1244 | |
---|
1240 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1245 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1241 | 1246 | loopButton.setToolTipText("Create loop"); |
---|
1242 | 1247 | loopButton.addActionListener(this); |
---|
1243 | 1248 | |
---|
1244 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1249 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1245 | 1250 | textureButton.setToolTipText("Create texture"); |
---|
1246 | 1251 | textureButton.addActionListener(this); |
---|
1247 | 1252 | |
---|
1248 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1253 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1249 | 1254 | overlayButton.setToolTipText("Create overlay"); |
---|
1250 | 1255 | overlayButton.addActionListener(this); |
---|
1251 | 1256 | |
---|
1252 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1257 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1253 | 1258 | lightButton.setToolTipText("Create light"); |
---|
1254 | 1259 | lightButton.addActionListener(this); |
---|
1255 | 1260 | |
---|
.. | .. |
---|
1259 | 1264 | |
---|
1260 | 1265 | CreateTexturePanel(textures); |
---|
1261 | 1266 | |
---|
1262 | | - resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
| 1267 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1268 | + |
---|
| 1269 | + if (tabCount > 0) |
---|
| 1270 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
1263 | 1271 | |
---|
1264 | 1272 | oe.toolboxPanel.add(textures); |
---|
1265 | 1273 | |
---|
.. | .. |
---|
1268 | 1276 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1269 | 1277 | |
---|
1270 | 1278 | // EDIT panel |
---|
1271 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1279 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1272 | 1280 | editButton.setToolTipText("Pin selection controls"); |
---|
1273 | 1281 | editButton.addActionListener(this); |
---|
1274 | 1282 | |
---|
1275 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1283 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1276 | 1284 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1277 | 1285 | uneditButton.addActionListener(this); |
---|
1278 | 1286 | |
---|
.. | .. |
---|
1280 | 1288 | allParamsButton.setToolTipText("Show all controls"); |
---|
1281 | 1289 | allParamsButton.addActionListener(this); |
---|
1282 | 1290 | |
---|
1283 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1291 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1284 | 1292 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1285 | 1293 | clearPanelButton.addActionListener(this); |
---|
1286 | 1294 | |
---|
.. | .. |
---|
1288 | 1296 | //unselectButton.setToolTipText("Unselect"); |
---|
1289 | 1297 | //unselectButton.addActionListener(this); |
---|
1290 | 1298 | |
---|
1291 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1299 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1292 | 1300 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1293 | 1301 | flashSelectionButton.addActionListener(this); |
---|
1294 | 1302 | |
---|
.. | .. |
---|
1311 | 1319 | |
---|
1312 | 1320 | cGridBag jSPPanel = new cGridBag(); |
---|
1313 | 1321 | |
---|
| 1322 | + jSPPanel.preferredHeight = 20; |
---|
| 1323 | + |
---|
1314 | 1324 | JScrollPane jSP; |
---|
1315 | 1325 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1316 | 1326 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1319 | 1329 | oe.treePanel.add(jSPPanel); |
---|
1320 | 1330 | oe.treePanel.Return(); |
---|
1321 | 1331 | |
---|
1322 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1332 | + oe.treePanel.add(versionManagerPanel); |
---|
1323 | 1333 | oe.treePanel.Return(); |
---|
1324 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1325 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1326 | | - sliderPane.preferredHeight = 1; |
---|
| 1334 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1335 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1336 | + versionSliderPane.preferredHeight = 3; |
---|
1327 | 1337 | |
---|
1328 | 1338 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1329 | 1339 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
3968 | 3978 | if (source == closeButton) |
---|
3969 | 3979 | { |
---|
3970 | 3980 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3981 | + Replace(); |
---|
| 3982 | + |
---|
3971 | 3983 | cRadio ab; |
---|
3972 | 3984 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3973 | 3985 | { |
---|
.. | .. |
---|
4066 | 4078 | } else |
---|
4067 | 4079 | if(source instanceof cRadio) |
---|
4068 | 4080 | { |
---|
| 4081 | + Replace(); |
---|
| 4082 | + |
---|
4069 | 4083 | group.parent = keepparent; |
---|
4070 | 4084 | group.attributes = 0; |
---|
4071 | 4085 | //group.editWindow = null; |
---|
.. | .. |
---|
4121 | 4135 | |
---|
4122 | 4136 | if (copy.versionlist == null) |
---|
4123 | 4137 | { |
---|
4124 | | - copy.versionlist = new Object3D[100]; |
---|
4125 | 4138 | copy.versionindex = -1; |
---|
4126 | 4139 | |
---|
4127 | 4140 | // Cannot work with loops |
---|
4128 | | - // To fix this issue, first mark all nodes above the root, |
---|
| 4141 | + // To fix this issue, we first mark all nodes above the root, |
---|
4129 | 4142 | // and check if any of these nodes are reachable below the root. |
---|
4130 | | - //Save(true); |
---|
| 4143 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4144 | + |
---|
| 4145 | + if (!copy.HasTags()) |
---|
| 4146 | + { |
---|
| 4147 | + copy.versionlist = new Object3D[100]; |
---|
| 4148 | + |
---|
| 4149 | + Save(true); |
---|
| 4150 | + } |
---|
| 4151 | + |
---|
| 4152 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
4131 | 4153 | } |
---|
4132 | 4154 | |
---|
4133 | 4155 | SetVersionStates(); |
---|
.. | .. |
---|
4275 | 4297 | TouchTransform(obj); |
---|
4276 | 4298 | continue; |
---|
4277 | 4299 | } |
---|
4278 | | - if ((mask&2) != 0) // Scale |
---|
| 4300 | + if ((mask&2) != 0) // Scale/rotation |
---|
4279 | 4301 | { |
---|
4280 | 4302 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4281 | 4303 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4283 | 4305 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4284 | 4306 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4285 | 4307 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4286 | | - } |
---|
4287 | | - if ((mask&4) != 0) // Rotation |
---|
4288 | | - { |
---|
4289 | | - // ? |
---|
4290 | 4308 | } |
---|
4291 | 4309 | if ((mask&1) != 0) // Translation |
---|
4292 | 4310 | { |
---|
.. | .. |
---|
5385 | 5403 | |
---|
5386 | 5404 | void refreshContents(boolean cp) |
---|
5387 | 5405 | { |
---|
| 5406 | + if (Globals.ADVANCED) |
---|
5388 | 5407 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5389 | 5408 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5390 | 5409 | { |
---|