.. | .. |
---|
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); |
---|
.. | .. |
---|
415 | 415 | this.copy = this.group = group; |
---|
416 | 416 | //selectees = this.group.selectees; |
---|
417 | 417 | |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
418 | 420 | if (copy.versionlist == null) |
---|
419 | 421 | { |
---|
420 | 422 | copy.versionlist = new Object3D[100]; |
---|
421 | 423 | copy.versionindex = -1; |
---|
422 | 424 | |
---|
423 | | - Save(true); |
---|
| 425 | + //Save(true); |
---|
424 | 426 | } |
---|
425 | 427 | |
---|
426 | 428 | if(ui) |
---|
.. | .. |
---|
449 | 451 | copy.versionlist = new Object3D[100]; |
---|
450 | 452 | copy.versionindex = -1; |
---|
451 | 453 | |
---|
452 | | - Save(true); |
---|
| 454 | + //Save(true); |
---|
453 | 455 | } |
---|
454 | 456 | } |
---|
455 | 457 | |
---|
.. | .. |
---|
569 | 571 | // pasteExpandItem.addActionListener(this); |
---|
570 | 572 | //menu.add("-"); |
---|
571 | 573 | oe.jTree.popup.addSeparator(); |
---|
572 | | - |
---|
573 | | - deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
574 | | - deleteItem.addActionListener(this); |
---|
575 | 574 | |
---|
576 | 575 | if (Globals.ADVANCED) |
---|
577 | 576 | { |
---|
.. | .. |
---|
706 | 705 | setMasterItem.addActionListener(this); |
---|
707 | 706 | } |
---|
708 | 707 | |
---|
709 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
710 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
711 | | -// grabItem.addActionListener(this); |
---|
| 708 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 709 | + |
---|
712 | 710 | backItem = menu.add(new MenuItem("Back")); |
---|
713 | 711 | backItem.addActionListener(this); |
---|
714 | 712 | frontItem = menu.add(new MenuItem("Front")); |
---|
715 | 713 | frontItem.addActionListener(this); |
---|
716 | 714 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
717 | 715 | // compositeItem.addActionListener(this); |
---|
| 716 | + |
---|
| 717 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 718 | + grabItem.addActionListener(this); |
---|
718 | 719 | |
---|
719 | 720 | if (Globals.ADVANCED) |
---|
720 | 721 | { |
---|
.. | .. |
---|
723 | 724 | } |
---|
724 | 725 | ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
725 | 726 | ungroupItem.addActionListener(this); |
---|
| 727 | + |
---|
| 728 | + oe.jTree.popup.addSeparator(); |
---|
| 729 | + |
---|
| 730 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 731 | + deleteItem.addActionListener(this); |
---|
726 | 732 | |
---|
727 | 733 | // menu.add("-"); |
---|
728 | 734 | // |
---|
.. | .. |
---|
851 | 857 | hideleavesItem.addActionListener(this); |
---|
852 | 858 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
853 | 859 | showleavesItem.addActionListener(this); |
---|
854 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 860 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
855 | 861 | markleavesItem.addActionListener(this); |
---|
856 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 862 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
857 | 863 | unmarkleavesItem.addActionListener(this); |
---|
858 | 864 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
859 | 865 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
930 | 936 | cGridBag currenttab; |
---|
931 | 937 | //boolean added; // patch for jar |
---|
932 | 938 | |
---|
| 939 | + int totalcount = 0; |
---|
| 940 | + |
---|
933 | 941 | int tabcount = 0; |
---|
934 | 942 | int colcount = 0; |
---|
935 | 943 | int rowcount = 0; |
---|
.. | .. |
---|
958 | 966 | texturecount = 0; |
---|
959 | 967 | } |
---|
960 | 968 | |
---|
961 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 969 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
962 | 970 | { |
---|
963 | 971 | //if (!added) |
---|
964 | 972 | { |
---|
.. | .. |
---|
967 | 975 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
968 | 976 | } |
---|
969 | 977 | |
---|
970 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 978 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 979 | + totalcount++; |
---|
971 | 980 | |
---|
972 | 981 | if (++colcount >= columns) |
---|
973 | 982 | { |
---|
.. | .. |
---|
993 | 1002 | container.add(resourcecontainer); |
---|
994 | 1003 | |
---|
995 | 1004 | Grafreed.ParseResources("textures", this); |
---|
| 1005 | + |
---|
| 1006 | + // 935. System.out.println("Total = " + totalcount); |
---|
996 | 1007 | } |
---|
997 | 1008 | |
---|
998 | 1009 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1032 | 1043 | oe.radioPanel.add(dummyButton); |
---|
1033 | 1044 | oe.buttonGroup.add(dummyButton); |
---|
1034 | 1045 | */ |
---|
1035 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1046 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1036 | 1047 | |
---|
1037 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1048 | + versionManagerPanel.preferredHeight = 4; |
---|
1038 | 1049 | |
---|
1039 | 1050 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1040 | 1051 | |
---|
.. | .. |
---|
1061 | 1072 | // } |
---|
1062 | 1073 | // }); |
---|
1063 | 1074 | |
---|
1064 | | - 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); |
---|
1065 | 1076 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1066 | 1077 | collapseButton.addActionListener(this); |
---|
1067 | 1078 | |
---|
1068 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1069 | 1080 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1070 | 1081 | maximize3DButton.addActionListener(this); |
---|
1071 | 1082 | |
---|
1072 | | - 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); |
---|
1073 | 1084 | twoButton.setToolTipText("Show 3D view only"); |
---|
1074 | 1085 | twoButton.addActionListener(this); |
---|
1075 | 1086 | this.fullscreenLayout = twoButton; |
---|
1076 | 1087 | |
---|
1077 | | - 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); |
---|
1078 | 1089 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1079 | 1090 | threeButton.addActionListener(this); |
---|
1080 | 1091 | if (Globals.ADVANCED) |
---|
1081 | 1092 | { |
---|
1082 | | - 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); |
---|
1083 | 1094 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1084 | 1095 | sixButton.addActionListener(this); |
---|
1085 | 1096 | } |
---|
.. | .. |
---|
1088 | 1099 | // sevenButton.addActionListener(this); |
---|
1089 | 1100 | // |
---|
1090 | 1101 | |
---|
1091 | | - 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); |
---|
1092 | 1103 | fullButton.setToolTipText("Full-screen window"); |
---|
1093 | 1104 | fullButton.addActionListener(this); |
---|
1094 | 1105 | |
---|
1095 | | - 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); |
---|
1096 | 1107 | screenfitButton.setToolTipText("Screen fit"); |
---|
1097 | 1108 | screenfitButton.addActionListener(this); |
---|
1098 | 1109 | |
---|
1099 | | - 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); |
---|
1100 | 1111 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1101 | 1112 | restoreCameraButton.addActionListener(this); |
---|
1102 | 1113 | |
---|
1103 | | - 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); |
---|
1104 | 1115 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1105 | 1116 | saveVersionButton.addActionListener(this); |
---|
1106 | 1117 | |
---|
1107 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1108 | 1119 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1109 | 1120 | deleteVersionButton.addActionListener(this); |
---|
| 1121 | + deleteVersionButton.setEnabled(false); |
---|
1110 | 1122 | |
---|
1111 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1123 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1112 | 1124 | previousVersionButton.setToolTipText("Previous version"); |
---|
1113 | 1125 | previousVersionButton.addActionListener(this); |
---|
1114 | 1126 | previousVersionButton.setEnabled(false); |
---|
1115 | 1127 | |
---|
1116 | 1128 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1117 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1118 | 1130 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1119 | 1131 | restoreButton.addActionListener(this); |
---|
1120 | | - //restoreButton.setEnabled(false); |
---|
| 1132 | + restoreButton.setEnabled(false); |
---|
1121 | 1133 | |
---|
1122 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1123 | 1135 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1124 | 1136 | replaceButton.addActionListener(this); |
---|
1125 | | - //replaceButton.setEnabled(false); |
---|
| 1137 | + replaceButton.setEnabled(false); |
---|
1126 | 1138 | |
---|
1127 | | - copyOptionsPanel.add(updown); |
---|
| 1139 | + versionManagerPanel.add(updown); |
---|
1128 | 1140 | |
---|
1129 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1141 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1142 | nextVersionButton.setToolTipText("Next version"); |
---|
1131 | 1143 | nextVersionButton.addActionListener(this); |
---|
1132 | 1144 | nextVersionButton.setEnabled(false); |
---|
1133 | 1145 | |
---|
1134 | | - 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); |
---|
1135 | 1147 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1136 | 1148 | oneStepButton.addActionListener(this); |
---|
1137 | 1149 | |
---|
.. | .. |
---|
1154 | 1166 | |
---|
1155 | 1167 | if (Globals.ADVANCED) |
---|
1156 | 1168 | { |
---|
1157 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1169 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1158 | 1170 | snapobjectButton.addActionListener(this); |
---|
1159 | 1171 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1160 | 1172 | |
---|
1161 | | - 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); |
---|
1162 | 1174 | fourButton.addActionListener(this); |
---|
1163 | 1175 | fourButton.setToolTipText("Show control panel only"); |
---|
1164 | 1176 | } |
---|
.. | .. |
---|
1166 | 1178 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1167 | 1179 | |
---|
1168 | 1180 | |
---|
1169 | | - 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); |
---|
1170 | 1182 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1171 | 1183 | rootButton.addActionListener(this); |
---|
1172 | 1184 | |
---|
1173 | | - 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); |
---|
1174 | 1186 | closeButton.setToolTipText("Close tab"); |
---|
1175 | 1187 | closeButton.addActionListener(this); |
---|
1176 | 1188 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1179 | 1191 | cGridBag row1 = new cGridBag(); |
---|
1180 | 1192 | |
---|
1181 | 1193 | // INSERT |
---|
1182 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1194 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1183 | 1195 | gridButton.setToolTipText("Create ground"); |
---|
1184 | 1196 | gridButton.addActionListener(this); |
---|
1185 | 1197 | |
---|
1186 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1198 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1187 | 1199 | boxButton.setToolTipText("Create box"); |
---|
1188 | 1200 | boxButton.addActionListener(this); |
---|
1189 | 1201 | |
---|
1190 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1202 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1191 | 1203 | superButton.setToolTipText("Create superellipsoid"); |
---|
1192 | 1204 | superButton.addActionListener(this); |
---|
1193 | 1205 | |
---|
1194 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1195 | 1207 | sphereButton.setToolTipText("Create sphere"); |
---|
1196 | 1208 | sphereButton.addActionListener(this); |
---|
1197 | 1209 | |
---|
1198 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1199 | 1211 | coneButton.setToolTipText("Create cone"); |
---|
1200 | 1212 | coneButton.addActionListener(this); |
---|
1201 | 1213 | |
---|
1202 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1203 | 1215 | torusButton.setToolTipText("Create torus"); |
---|
1204 | 1216 | torusButton.addActionListener(this); |
---|
1205 | 1217 | |
---|
1206 | 1218 | if (Globals.ADVANCED) |
---|
1207 | 1219 | { |
---|
1208 | | - 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); |
---|
1209 | 1221 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1210 | 1222 | kleinButton.addActionListener(this); |
---|
1211 | 1223 | } |
---|
1212 | 1224 | |
---|
1213 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1225 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1214 | 1226 | particlesButton.setToolTipText("Create particle system"); |
---|
1215 | 1227 | particlesButton.addActionListener(this); |
---|
1216 | 1228 | |
---|
.. | .. |
---|
1218 | 1230 | |
---|
1219 | 1231 | cGridBag row2 = new cGridBag(); |
---|
1220 | 1232 | |
---|
1221 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1233 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1222 | 1234 | groupButton.setToolTipText("Create group"); |
---|
1223 | 1235 | groupButton.addActionListener(this); |
---|
1224 | 1236 | |
---|
1225 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1237 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1226 | 1238 | compositeButton.setToolTipText("Create composite"); |
---|
1227 | 1239 | compositeButton.addActionListener(this); |
---|
1228 | 1240 | |
---|
1229 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1241 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1230 | 1242 | switchButton.setToolTipText("Create item switcher"); |
---|
1231 | 1243 | switchButton.addActionListener(this); |
---|
1232 | 1244 | |
---|
1233 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1245 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1234 | 1246 | loopButton.setToolTipText("Create loop"); |
---|
1235 | 1247 | loopButton.addActionListener(this); |
---|
1236 | 1248 | |
---|
1237 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1249 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1238 | 1250 | textureButton.setToolTipText("Create texture"); |
---|
1239 | 1251 | textureButton.addActionListener(this); |
---|
1240 | 1252 | |
---|
1241 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1253 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1242 | 1254 | overlayButton.setToolTipText("Create overlay"); |
---|
1243 | 1255 | overlayButton.addActionListener(this); |
---|
1244 | 1256 | |
---|
1245 | | - 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); |
---|
1246 | 1258 | lightButton.setToolTipText("Create light"); |
---|
1247 | 1259 | lightButton.addActionListener(this); |
---|
1248 | 1260 | |
---|
.. | .. |
---|
1252 | 1264 | |
---|
1253 | 1265 | CreateTexturePanel(textures); |
---|
1254 | 1266 | |
---|
| 1267 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1268 | + |
---|
| 1269 | + if (tabCount > 0) |
---|
| 1270 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1271 | + |
---|
1255 | 1272 | oe.toolboxPanel.add(textures); |
---|
1256 | 1273 | |
---|
1257 | 1274 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1259 | 1276 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1260 | 1277 | |
---|
1261 | 1278 | // EDIT panel |
---|
1262 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1279 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1263 | 1280 | editButton.setToolTipText("Pin selection controls"); |
---|
1264 | 1281 | editButton.addActionListener(this); |
---|
1265 | 1282 | |
---|
1266 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1283 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1267 | 1284 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1268 | 1285 | uneditButton.addActionListener(this); |
---|
1269 | 1286 | |
---|
.. | .. |
---|
1271 | 1288 | allParamsButton.setToolTipText("Show all controls"); |
---|
1272 | 1289 | allParamsButton.addActionListener(this); |
---|
1273 | 1290 | |
---|
1274 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1291 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1275 | 1292 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1276 | 1293 | clearPanelButton.addActionListener(this); |
---|
1277 | 1294 | |
---|
.. | .. |
---|
1279 | 1296 | //unselectButton.setToolTipText("Unselect"); |
---|
1280 | 1297 | //unselectButton.addActionListener(this); |
---|
1281 | 1298 | |
---|
1282 | | - 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); |
---|
1283 | 1300 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1284 | 1301 | flashSelectionButton.addActionListener(this); |
---|
1285 | 1302 | |
---|
.. | .. |
---|
1302 | 1319 | |
---|
1303 | 1320 | cGridBag jSPPanel = new cGridBag(); |
---|
1304 | 1321 | |
---|
| 1322 | + jSPPanel.preferredHeight = 20; |
---|
| 1323 | + |
---|
1305 | 1324 | JScrollPane jSP; |
---|
1306 | 1325 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1307 | 1326 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1310 | 1329 | oe.treePanel.add(jSPPanel); |
---|
1311 | 1330 | oe.treePanel.Return(); |
---|
1312 | 1331 | |
---|
1313 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1332 | + oe.treePanel.add(versionManagerPanel); |
---|
1314 | 1333 | oe.treePanel.Return(); |
---|
1315 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1316 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1317 | | - sliderPane.preferredHeight = 1; |
---|
| 1334 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1335 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1336 | + versionSliderPane.preferredHeight = 3; |
---|
1318 | 1337 | |
---|
1319 | 1338 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1320 | 1339 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1504 | 1523 | |
---|
1505 | 1524 | oe.SetupViews(); |
---|
1506 | 1525 | |
---|
| 1526 | + if (Globals.DEBUG) |
---|
1507 | 1527 | System.out.println("SetupViews"); |
---|
1508 | 1528 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1509 | 1529 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
3958 | 3978 | if (source == closeButton) |
---|
3959 | 3979 | { |
---|
3960 | 3980 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3981 | + Replace(); |
---|
| 3982 | + |
---|
3961 | 3983 | cRadio ab; |
---|
3962 | 3984 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3963 | 3985 | { |
---|
.. | .. |
---|
4056 | 4078 | } else |
---|
4057 | 4079 | if(source instanceof cRadio) |
---|
4058 | 4080 | { |
---|
| 4081 | + Replace(); |
---|
| 4082 | + |
---|
4059 | 4083 | group.parent = keepparent; |
---|
4060 | 4084 | group.attributes = 0; |
---|
4061 | 4085 | //group.editWindow = null; |
---|
.. | .. |
---|
4111 | 4135 | |
---|
4112 | 4136 | if (copy.versionlist == null) |
---|
4113 | 4137 | { |
---|
4114 | | - copy.versionlist = new Object3D[100]; |
---|
4115 | 4138 | copy.versionindex = -1; |
---|
4116 | 4139 | |
---|
4117 | | - Save(true); |
---|
| 4140 | + // Cannot work with loops |
---|
| 4141 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4142 | + // and check if any of these nodes are reachable below the root. |
---|
| 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); |
---|
4118 | 4153 | } |
---|
4119 | 4154 | |
---|
4120 | 4155 | SetVersionStates(); |
---|
.. | .. |
---|
4262 | 4297 | TouchTransform(obj); |
---|
4263 | 4298 | continue; |
---|
4264 | 4299 | } |
---|
4265 | | - if ((mask&2) != 0) // Scale |
---|
| 4300 | + if ((mask&2) != 0) // Scale/rotation |
---|
4266 | 4301 | { |
---|
4267 | 4302 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4268 | 4303 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4270 | 4305 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4271 | 4306 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4272 | 4307 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4273 | | - } |
---|
4274 | | - if ((mask&4) != 0) // Rotation |
---|
4275 | | - { |
---|
4276 | | - // ? |
---|
4277 | 4308 | } |
---|
4278 | 4309 | if ((mask&1) != 0) // Translation |
---|
4279 | 4310 | { |
---|
.. | .. |
---|
5359 | 5390 | if (group.selection != null) |
---|
5360 | 5391 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5361 | 5392 | { |
---|
5362 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5393 | + Object next = e.nextElement(); |
---|
| 5394 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5363 | 5395 | { |
---|
5364 | 5396 | allComposites = false; |
---|
5365 | 5397 | break; |
---|
.. | .. |
---|
5371 | 5403 | |
---|
5372 | 5404 | void refreshContents(boolean cp) |
---|
5373 | 5405 | { |
---|
| 5406 | + if (Globals.ADVANCED) |
---|
5374 | 5407 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5375 | 5408 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5376 | 5409 | { |
---|
.. | .. |
---|
6350 | 6383 | private MenuItem transformGeometryItem; |
---|
6351 | 6384 | private MenuItem transformChildrenItem; |
---|
6352 | 6385 | private MenuItem hideItem; |
---|
6353 | | - private MenuItem grabItem; |
---|
| 6386 | + private JMenuItem grabItem; |
---|
6354 | 6387 | private MenuItem backItem; |
---|
6355 | 6388 | private MenuItem frontItem; |
---|
6356 | 6389 | private MenuItem cameraItem; |
---|