.. | .. |
---|
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); |
---|
.. | .. |
---|
417 | 417 | |
---|
418 | 418 | assert(false); |
---|
419 | 419 | |
---|
420 | | - if (copy.versionlist == null) |
---|
421 | | - { |
---|
422 | | - copy.versionlist = new Object3D[100]; |
---|
423 | | - copy.versionindex = -1; |
---|
424 | | - |
---|
425 | | - //Save(true); |
---|
426 | | - } |
---|
| 420 | +// if (copy.versionlist == null) |
---|
| 421 | +// { |
---|
| 422 | +// copy.versionlist = new Object3D[100]; |
---|
| 423 | +// copy.versionindex = -1; |
---|
| 424 | +// |
---|
| 425 | +// //Save(true); |
---|
| 426 | +// } |
---|
427 | 427 | |
---|
428 | 428 | if(ui) |
---|
429 | 429 | SetupUI(objEditor); |
---|
.. | .. |
---|
446 | 446 | |
---|
447 | 447 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
448 | 448 | |
---|
449 | | - if (copy.versionlist == null) |
---|
450 | | - { |
---|
451 | | - copy.versionlist = new Object3D[100]; |
---|
452 | | - copy.versionindex = -1; |
---|
453 | | - |
---|
454 | | - //Save(true); |
---|
455 | | - } |
---|
| 449 | +// if (copy.versionlist == null) |
---|
| 450 | +// { |
---|
| 451 | +// copy.versionlist = new Object3D[100]; |
---|
| 452 | +// copy.versionindex = -1; |
---|
| 453 | +// |
---|
| 454 | +// //Save(true); |
---|
| 455 | +// } |
---|
456 | 456 | } |
---|
457 | 457 | |
---|
458 | 458 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
835 | 835 | } |
---|
836 | 836 | |
---|
837 | 837 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 838 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 839 | + clearVersionsItem.addActionListener(this); |
---|
838 | 840 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
839 | 841 | clearMaterialsItem.addActionListener(this); |
---|
840 | 842 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
857 | 859 | hideleavesItem.addActionListener(this); |
---|
858 | 860 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
859 | 861 | showleavesItem.addActionListener(this); |
---|
860 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 862 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
861 | 863 | markleavesItem.addActionListener(this); |
---|
862 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 864 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
863 | 865 | unmarkleavesItem.addActionListener(this); |
---|
864 | 866 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
865 | 867 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
936 | 938 | cGridBag currenttab; |
---|
937 | 939 | //boolean added; // patch for jar |
---|
938 | 940 | |
---|
| 941 | + int totalcount = 0; |
---|
| 942 | + |
---|
939 | 943 | int tabcount = 0; |
---|
940 | 944 | int colcount = 0; |
---|
941 | 945 | int rowcount = 0; |
---|
.. | .. |
---|
964 | 968 | texturecount = 0; |
---|
965 | 969 | } |
---|
966 | 970 | |
---|
967 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 971 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
968 | 972 | { |
---|
969 | 973 | //if (!added) |
---|
970 | 974 | { |
---|
.. | .. |
---|
973 | 977 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
974 | 978 | } |
---|
975 | 979 | |
---|
976 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 980 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 981 | + totalcount++; |
---|
977 | 982 | |
---|
978 | 983 | if (++colcount >= columns) |
---|
979 | 984 | { |
---|
.. | .. |
---|
999 | 1004 | container.add(resourcecontainer); |
---|
1000 | 1005 | |
---|
1001 | 1006 | Grafreed.ParseResources("textures", this); |
---|
| 1007 | + |
---|
| 1008 | + // 935. System.out.println("Total = " + totalcount); |
---|
1002 | 1009 | } |
---|
1003 | 1010 | |
---|
1004 | 1011 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1038 | 1045 | oe.radioPanel.add(dummyButton); |
---|
1039 | 1046 | oe.buttonGroup.add(dummyButton); |
---|
1040 | 1047 | */ |
---|
1041 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1048 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1042 | 1049 | |
---|
1043 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1050 | + versionManagerPanel.preferredHeight = 4; |
---|
1044 | 1051 | |
---|
1045 | 1052 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1046 | 1053 | |
---|
.. | .. |
---|
1067 | 1074 | // } |
---|
1068 | 1075 | // }); |
---|
1069 | 1076 | |
---|
1070 | | - oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1071 | 1078 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1072 | 1079 | collapseButton.addActionListener(this); |
---|
1073 | 1080 | |
---|
1074 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1081 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1075 | 1082 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1076 | 1083 | maximize3DButton.addActionListener(this); |
---|
1077 | 1084 | |
---|
1078 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1085 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1079 | 1086 | twoButton.setToolTipText("Show 3D view only"); |
---|
1080 | 1087 | twoButton.addActionListener(this); |
---|
1081 | 1088 | this.fullscreenLayout = twoButton; |
---|
1082 | 1089 | |
---|
1083 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1090 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1084 | 1091 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1085 | 1092 | threeButton.addActionListener(this); |
---|
1086 | 1093 | if (Globals.ADVANCED) |
---|
1087 | 1094 | { |
---|
1088 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1095 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1096 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1090 | 1097 | sixButton.addActionListener(this); |
---|
1091 | 1098 | } |
---|
.. | .. |
---|
1094 | 1101 | // sevenButton.addActionListener(this); |
---|
1095 | 1102 | // |
---|
1096 | 1103 | |
---|
1097 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1104 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1098 | 1105 | fullButton.setToolTipText("Full-screen window"); |
---|
1099 | 1106 | fullButton.addActionListener(this); |
---|
1100 | 1107 | |
---|
1101 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1108 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1102 | 1109 | screenfitButton.setToolTipText("Screen fit"); |
---|
1103 | 1110 | screenfitButton.addActionListener(this); |
---|
1104 | 1111 | |
---|
1105 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1112 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1106 | 1113 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1107 | 1114 | restoreCameraButton.addActionListener(this); |
---|
1108 | 1115 | |
---|
1109 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1116 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1110 | 1117 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1111 | 1118 | saveVersionButton.addActionListener(this); |
---|
1112 | 1119 | |
---|
1113 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1120 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1114 | 1121 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1115 | 1122 | deleteVersionButton.addActionListener(this); |
---|
1116 | 1123 | deleteVersionButton.setEnabled(false); |
---|
1117 | 1124 | |
---|
1118 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1125 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1119 | 1126 | previousVersionButton.setToolTipText("Previous version"); |
---|
1120 | 1127 | previousVersionButton.addActionListener(this); |
---|
1121 | 1128 | previousVersionButton.setEnabled(false); |
---|
1122 | 1129 | |
---|
1123 | 1130 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1124 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1131 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | 1132 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1126 | 1133 | restoreButton.addActionListener(this); |
---|
1127 | 1134 | restoreButton.setEnabled(false); |
---|
1128 | 1135 | |
---|
1129 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1137 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1131 | 1138 | replaceButton.addActionListener(this); |
---|
1132 | 1139 | replaceButton.setEnabled(false); |
---|
1133 | 1140 | |
---|
1134 | | - copyOptionsPanel.add(updown); |
---|
| 1141 | + versionManagerPanel.add(updown); |
---|
1135 | 1142 | |
---|
1136 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1143 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1137 | 1144 | nextVersionButton.setToolTipText("Next version"); |
---|
1138 | 1145 | nextVersionButton.addActionListener(this); |
---|
1139 | 1146 | nextVersionButton.setEnabled(false); |
---|
1140 | 1147 | |
---|
1141 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1148 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1142 | 1149 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1143 | 1150 | oneStepButton.addActionListener(this); |
---|
1144 | 1151 | |
---|
.. | .. |
---|
1161 | 1168 | |
---|
1162 | 1169 | if (Globals.ADVANCED) |
---|
1163 | 1170 | { |
---|
1164 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1171 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1165 | 1172 | snapobjectButton.addActionListener(this); |
---|
1166 | 1173 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1167 | 1174 | |
---|
1168 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1175 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1169 | 1176 | fourButton.addActionListener(this); |
---|
1170 | 1177 | fourButton.setToolTipText("Show control panel only"); |
---|
1171 | 1178 | } |
---|
.. | .. |
---|
1173 | 1180 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1174 | 1181 | |
---|
1175 | 1182 | |
---|
1176 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1183 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1177 | 1184 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1178 | 1185 | rootButton.addActionListener(this); |
---|
1179 | 1186 | |
---|
1180 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1187 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1181 | 1188 | closeButton.setToolTipText("Close tab"); |
---|
1182 | 1189 | closeButton.addActionListener(this); |
---|
1183 | 1190 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1186 | 1193 | cGridBag row1 = new cGridBag(); |
---|
1187 | 1194 | |
---|
1188 | 1195 | // INSERT |
---|
1189 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1196 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1190 | 1197 | gridButton.setToolTipText("Create ground"); |
---|
1191 | 1198 | gridButton.addActionListener(this); |
---|
1192 | 1199 | |
---|
1193 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1200 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1194 | 1201 | boxButton.setToolTipText("Create box"); |
---|
1195 | 1202 | boxButton.addActionListener(this); |
---|
1196 | 1203 | |
---|
1197 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1204 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1198 | 1205 | superButton.setToolTipText("Create superellipsoid"); |
---|
1199 | 1206 | superButton.addActionListener(this); |
---|
1200 | 1207 | |
---|
1201 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1208 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1202 | 1209 | sphereButton.setToolTipText("Create sphere"); |
---|
1203 | 1210 | sphereButton.addActionListener(this); |
---|
1204 | 1211 | |
---|
1205 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1212 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1206 | 1213 | coneButton.setToolTipText("Create cone"); |
---|
1207 | 1214 | coneButton.addActionListener(this); |
---|
1208 | 1215 | |
---|
1209 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1216 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1210 | 1217 | torusButton.setToolTipText("Create torus"); |
---|
1211 | 1218 | torusButton.addActionListener(this); |
---|
1212 | 1219 | |
---|
1213 | 1220 | if (Globals.ADVANCED) |
---|
1214 | 1221 | { |
---|
1215 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1222 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1216 | 1223 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1217 | 1224 | kleinButton.addActionListener(this); |
---|
1218 | 1225 | } |
---|
1219 | 1226 | |
---|
1220 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1227 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1221 | 1228 | particlesButton.setToolTipText("Create particle system"); |
---|
1222 | 1229 | particlesButton.addActionListener(this); |
---|
1223 | 1230 | |
---|
.. | .. |
---|
1225 | 1232 | |
---|
1226 | 1233 | cGridBag row2 = new cGridBag(); |
---|
1227 | 1234 | |
---|
1228 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1235 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1229 | 1236 | groupButton.setToolTipText("Create group"); |
---|
1230 | 1237 | groupButton.addActionListener(this); |
---|
1231 | 1238 | |
---|
1232 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1239 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1233 | 1240 | compositeButton.setToolTipText("Create composite"); |
---|
1234 | 1241 | compositeButton.addActionListener(this); |
---|
1235 | 1242 | |
---|
1236 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1243 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1237 | 1244 | switchButton.setToolTipText("Create item switcher"); |
---|
1238 | 1245 | switchButton.addActionListener(this); |
---|
1239 | 1246 | |
---|
1240 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1247 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1241 | 1248 | loopButton.setToolTipText("Create loop"); |
---|
1242 | 1249 | loopButton.addActionListener(this); |
---|
1243 | 1250 | |
---|
1244 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1251 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1245 | 1252 | textureButton.setToolTipText("Create texture"); |
---|
1246 | 1253 | textureButton.addActionListener(this); |
---|
1247 | 1254 | |
---|
1248 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1255 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1249 | 1256 | overlayButton.setToolTipText("Create overlay"); |
---|
1250 | 1257 | overlayButton.addActionListener(this); |
---|
1251 | 1258 | |
---|
1252 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1259 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1253 | 1260 | lightButton.setToolTipText("Create light"); |
---|
1254 | 1261 | lightButton.addActionListener(this); |
---|
1255 | 1262 | |
---|
.. | .. |
---|
1259 | 1266 | |
---|
1260 | 1267 | CreateTexturePanel(textures); |
---|
1261 | 1268 | |
---|
| 1269 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1270 | + |
---|
| 1271 | + if (tabCount > 0) |
---|
| 1272 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1273 | + |
---|
1262 | 1274 | oe.toolboxPanel.add(textures); |
---|
1263 | 1275 | |
---|
1264 | 1276 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1266 | 1278 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1267 | 1279 | |
---|
1268 | 1280 | // EDIT panel |
---|
1269 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1281 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1270 | 1282 | editButton.setToolTipText("Pin selection controls"); |
---|
1271 | 1283 | editButton.addActionListener(this); |
---|
1272 | 1284 | |
---|
1273 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1285 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1274 | 1286 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1275 | 1287 | uneditButton.addActionListener(this); |
---|
1276 | 1288 | |
---|
.. | .. |
---|
1278 | 1290 | allParamsButton.setToolTipText("Show all controls"); |
---|
1279 | 1291 | allParamsButton.addActionListener(this); |
---|
1280 | 1292 | |
---|
1281 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1293 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1282 | 1294 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1283 | 1295 | clearPanelButton.addActionListener(this); |
---|
1284 | 1296 | |
---|
.. | .. |
---|
1286 | 1298 | //unselectButton.setToolTipText("Unselect"); |
---|
1287 | 1299 | //unselectButton.addActionListener(this); |
---|
1288 | 1300 | |
---|
1289 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1301 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1290 | 1302 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1291 | 1303 | flashSelectionButton.addActionListener(this); |
---|
1292 | 1304 | |
---|
.. | .. |
---|
1309 | 1321 | |
---|
1310 | 1322 | cGridBag jSPPanel = new cGridBag(); |
---|
1311 | 1323 | |
---|
| 1324 | + jSPPanel.preferredHeight = 20; |
---|
| 1325 | + |
---|
1312 | 1326 | JScrollPane jSP; |
---|
1313 | 1327 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1314 | 1328 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1317 | 1331 | oe.treePanel.add(jSPPanel); |
---|
1318 | 1332 | oe.treePanel.Return(); |
---|
1319 | 1333 | |
---|
1320 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1334 | + oe.treePanel.add(versionManagerPanel); |
---|
1321 | 1335 | oe.treePanel.Return(); |
---|
1322 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1323 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1324 | | - sliderPane.preferredHeight = 1; |
---|
| 1336 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1337 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1338 | + versionSliderPane.preferredHeight = 3; |
---|
1325 | 1339 | |
---|
1326 | 1340 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1327 | 1341 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
2115 | 2129 | switch(axis) |
---|
2116 | 2130 | { |
---|
2117 | 2131 | case 0 : |
---|
2118 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2119 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
2120 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2121 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2132 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2133 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2134 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2135 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
2122 | 2136 | norm = cVector.X; |
---|
2123 | 2137 | break; |
---|
2124 | 2138 | case 1 : |
---|
2125 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2126 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2127 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2128 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2139 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2140 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2141 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2142 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
2129 | 2143 | norm = cVector.Y; |
---|
2130 | 2144 | break; |
---|
2131 | 2145 | case 2 : |
---|
2132 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2133 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2134 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
2135 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2146 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2147 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2148 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2149 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
2136 | 2150 | norm = cVector.Z; |
---|
2137 | 2151 | break; |
---|
2138 | 2152 | } |
---|
.. | .. |
---|
3454 | 3468 | { |
---|
3455 | 3469 | ClearMaterials(); |
---|
3456 | 3470 | } else |
---|
| 3471 | + if (source == clearVersionsItem) |
---|
| 3472 | + { |
---|
| 3473 | + ClearVersions(); |
---|
| 3474 | + } else |
---|
3457 | 3475 | if (source == liveleavesItem) |
---|
3458 | 3476 | { |
---|
3459 | 3477 | LiveLeaves(true); |
---|
.. | .. |
---|
3966 | 3984 | if (source == closeButton) |
---|
3967 | 3985 | { |
---|
3968 | 3986 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3987 | + Replace(); |
---|
| 3988 | + |
---|
3969 | 3989 | cRadio ab; |
---|
3970 | 3990 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3971 | 3991 | { |
---|
.. | .. |
---|
4064 | 4084 | } else |
---|
4065 | 4085 | if(source instanceof cRadio) |
---|
4066 | 4086 | { |
---|
| 4087 | + Replace(); |
---|
| 4088 | + |
---|
4067 | 4089 | group.parent = keepparent; |
---|
4068 | 4090 | group.attributes = 0; |
---|
4069 | 4091 | //group.editWindow = null; |
---|
.. | .. |
---|
4119 | 4141 | |
---|
4120 | 4142 | if (copy.versionlist == null) |
---|
4121 | 4143 | { |
---|
4122 | | - copy.versionlist = new Object3D[100]; |
---|
4123 | 4144 | copy.versionindex = -1; |
---|
4124 | 4145 | |
---|
4125 | 4146 | // Cannot work with loops |
---|
4126 | | - // To fix this issue, first mark all nodes above the root, |
---|
| 4147 | + // To fix this issue, we first mark all nodes above the root, |
---|
4127 | 4148 | // and check if any of these nodes are reachable below the root. |
---|
4128 | | - //Save(true); |
---|
| 4149 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4150 | + |
---|
| 4151 | + if (copy.versionlist == null && !copy.HasTags()) |
---|
| 4152 | + { |
---|
| 4153 | + copy.versionlist = new Object3D[100]; |
---|
| 4154 | + |
---|
| 4155 | + //Save(true); |
---|
| 4156 | + } |
---|
| 4157 | + else |
---|
| 4158 | + copy.versionindex = -2; |
---|
| 4159 | + |
---|
| 4160 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
4129 | 4161 | } |
---|
4130 | 4162 | |
---|
4131 | 4163 | SetVersionStates(); |
---|
.. | .. |
---|
4273 | 4305 | TouchTransform(obj); |
---|
4274 | 4306 | continue; |
---|
4275 | 4307 | } |
---|
4276 | | - if ((mask&2) != 0) // Scale |
---|
| 4308 | + if ((mask&2) != 0) // Scale/rotation |
---|
4277 | 4309 | { |
---|
4278 | 4310 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4279 | 4311 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4281 | 4313 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4282 | 4314 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4283 | 4315 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4284 | | - } |
---|
4285 | | - if ((mask&4) != 0) // Rotation |
---|
4286 | | - { |
---|
4287 | | - // ? |
---|
4288 | 4316 | } |
---|
4289 | 4317 | if ((mask&1) != 0) // Translation |
---|
4290 | 4318 | { |
---|
.. | .. |
---|
5093 | 5121 | refreshContents(); |
---|
5094 | 5122 | } |
---|
5095 | 5123 | |
---|
| 5124 | + void ClearVersions() |
---|
| 5125 | + { |
---|
| 5126 | + group.selection.ClearVersions(); |
---|
| 5127 | + refreshContents(); |
---|
| 5128 | + } |
---|
| 5129 | + |
---|
5096 | 5130 | void FlipV(boolean flip) |
---|
5097 | 5131 | { |
---|
5098 | 5132 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5383 | 5417 | |
---|
5384 | 5418 | void refreshContents(boolean cp) |
---|
5385 | 5419 | { |
---|
| 5420 | + if (Globals.ADVANCED) |
---|
5386 | 5421 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5387 | 5422 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5388 | 5423 | { |
---|
.. | .. |
---|
6333 | 6368 | private MenuItem clipMeshItem; |
---|
6334 | 6369 | private MenuItem smoothMeshItem; |
---|
6335 | 6370 | private MenuItem clearMaterialsItem; |
---|
| 6371 | + private MenuItem clearVersionsItem; |
---|
6336 | 6372 | |
---|
6337 | 6373 | private MenuItem liveleavesItem; |
---|
6338 | 6374 | private MenuItem unliveleavesItem; |
---|