.. | .. |
---|
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 | | - if (copy.versionlist == null) |
---|
419 | | - { |
---|
420 | | - copy.versionlist = new Object3D[100]; |
---|
421 | | - copy.versionindex = -1; |
---|
422 | | - |
---|
423 | | - Save(true); |
---|
424 | | - } |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
| 420 | +// if (copy.versionlist == null) |
---|
| 421 | +// { |
---|
| 422 | +// copy.versionlist = new Object3D[100]; |
---|
| 423 | +// copy.versionindex = -1; |
---|
| 424 | +// |
---|
| 425 | +// //Save(true); |
---|
| 426 | +// } |
---|
425 | 427 | |
---|
426 | 428 | if(ui) |
---|
427 | 429 | SetupUI(objEditor); |
---|
.. | .. |
---|
444 | 446 | |
---|
445 | 447 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
446 | 448 | |
---|
447 | | - if (copy.versionlist == null) |
---|
448 | | - { |
---|
449 | | - copy.versionlist = new Object3D[100]; |
---|
450 | | - copy.versionindex = -1; |
---|
451 | | - |
---|
452 | | - Save(true); |
---|
453 | | - } |
---|
| 449 | +// if (copy.versionlist == null) |
---|
| 450 | +// { |
---|
| 451 | +// copy.versionlist = new Object3D[100]; |
---|
| 452 | +// copy.versionindex = -1; |
---|
| 453 | +// |
---|
| 454 | +// //Save(true); |
---|
| 455 | +// } |
---|
454 | 456 | } |
---|
455 | 457 | |
---|
456 | 458 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
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 | // |
---|
.. | .. |
---|
829 | 835 | } |
---|
830 | 836 | |
---|
831 | 837 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 838 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 839 | + clearVersionsItem.addActionListener(this); |
---|
832 | 840 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
833 | 841 | clearMaterialsItem.addActionListener(this); |
---|
834 | 842 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
851 | 859 | hideleavesItem.addActionListener(this); |
---|
852 | 860 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
853 | 861 | showleavesItem.addActionListener(this); |
---|
854 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 862 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
855 | 863 | markleavesItem.addActionListener(this); |
---|
856 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 864 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
857 | 865 | unmarkleavesItem.addActionListener(this); |
---|
858 | 866 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
859 | 867 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
930 | 938 | cGridBag currenttab; |
---|
931 | 939 | //boolean added; // patch for jar |
---|
932 | 940 | |
---|
| 941 | + int totalcount = 0; |
---|
| 942 | + |
---|
933 | 943 | int tabcount = 0; |
---|
934 | 944 | int colcount = 0; |
---|
935 | 945 | int rowcount = 0; |
---|
.. | .. |
---|
958 | 968 | texturecount = 0; |
---|
959 | 969 | } |
---|
960 | 970 | |
---|
961 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 971 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
962 | 972 | { |
---|
963 | 973 | //if (!added) |
---|
964 | 974 | { |
---|
.. | .. |
---|
967 | 977 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
968 | 978 | } |
---|
969 | 979 | |
---|
970 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 980 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 981 | + totalcount++; |
---|
971 | 982 | |
---|
972 | 983 | if (++colcount >= columns) |
---|
973 | 984 | { |
---|
.. | .. |
---|
993 | 1004 | container.add(resourcecontainer); |
---|
994 | 1005 | |
---|
995 | 1006 | Grafreed.ParseResources("textures", this); |
---|
| 1007 | + |
---|
| 1008 | + // 935. System.out.println("Total = " + totalcount); |
---|
996 | 1009 | } |
---|
997 | 1010 | |
---|
998 | 1011 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1032 | 1045 | oe.radioPanel.add(dummyButton); |
---|
1033 | 1046 | oe.buttonGroup.add(dummyButton); |
---|
1034 | 1047 | */ |
---|
1035 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1048 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1036 | 1049 | |
---|
1037 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1050 | + versionManagerPanel.preferredHeight = 4; |
---|
1038 | 1051 | |
---|
1039 | 1052 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1040 | 1053 | |
---|
.. | .. |
---|
1061 | 1074 | // } |
---|
1062 | 1075 | // }); |
---|
1063 | 1076 | |
---|
1064 | | - 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); |
---|
1065 | 1078 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1066 | 1079 | collapseButton.addActionListener(this); |
---|
1067 | 1080 | |
---|
1068 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1081 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1069 | 1082 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1070 | 1083 | maximize3DButton.addActionListener(this); |
---|
1071 | 1084 | |
---|
1072 | | - 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); |
---|
1073 | 1086 | twoButton.setToolTipText("Show 3D view only"); |
---|
1074 | 1087 | twoButton.addActionListener(this); |
---|
1075 | 1088 | this.fullscreenLayout = twoButton; |
---|
1076 | 1089 | |
---|
1077 | | - 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); |
---|
1078 | 1091 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1079 | 1092 | threeButton.addActionListener(this); |
---|
1080 | 1093 | if (Globals.ADVANCED) |
---|
1081 | 1094 | { |
---|
1082 | | - 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); |
---|
1083 | 1096 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1084 | 1097 | sixButton.addActionListener(this); |
---|
1085 | 1098 | } |
---|
.. | .. |
---|
1088 | 1101 | // sevenButton.addActionListener(this); |
---|
1089 | 1102 | // |
---|
1090 | 1103 | |
---|
1091 | | - 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); |
---|
1092 | 1105 | fullButton.setToolTipText("Full-screen window"); |
---|
1093 | 1106 | fullButton.addActionListener(this); |
---|
1094 | 1107 | |
---|
1095 | | - 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); |
---|
1096 | 1109 | screenfitButton.setToolTipText("Screen fit"); |
---|
1097 | 1110 | screenfitButton.addActionListener(this); |
---|
1098 | 1111 | |
---|
1099 | | - 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); |
---|
1100 | 1113 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1101 | 1114 | restoreCameraButton.addActionListener(this); |
---|
1102 | 1115 | |
---|
1103 | | - 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); |
---|
1104 | 1117 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1105 | 1118 | saveVersionButton.addActionListener(this); |
---|
1106 | 1119 | |
---|
1107 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1120 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1108 | 1121 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1109 | 1122 | deleteVersionButton.addActionListener(this); |
---|
| 1123 | + deleteVersionButton.setEnabled(false); |
---|
1110 | 1124 | |
---|
1111 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1125 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1112 | 1126 | previousVersionButton.setToolTipText("Previous version"); |
---|
1113 | 1127 | previousVersionButton.addActionListener(this); |
---|
1114 | 1128 | previousVersionButton.setEnabled(false); |
---|
1115 | 1129 | |
---|
1116 | 1130 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1117 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1131 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1118 | 1132 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1119 | 1133 | restoreButton.addActionListener(this); |
---|
1120 | | - //restoreButton.setEnabled(false); |
---|
| 1134 | + restoreButton.setEnabled(false); |
---|
1121 | 1135 | |
---|
1122 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1123 | 1137 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1124 | 1138 | replaceButton.addActionListener(this); |
---|
1125 | | - //replaceButton.setEnabled(false); |
---|
| 1139 | + replaceButton.setEnabled(false); |
---|
1126 | 1140 | |
---|
1127 | | - copyOptionsPanel.add(updown); |
---|
| 1141 | + versionManagerPanel.add(updown); |
---|
1128 | 1142 | |
---|
1129 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1143 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1144 | nextVersionButton.setToolTipText("Next version"); |
---|
1131 | 1145 | nextVersionButton.addActionListener(this); |
---|
1132 | 1146 | nextVersionButton.setEnabled(false); |
---|
1133 | 1147 | |
---|
1134 | | - 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); |
---|
1135 | 1149 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1136 | 1150 | oneStepButton.addActionListener(this); |
---|
1137 | 1151 | |
---|
.. | .. |
---|
1154 | 1168 | |
---|
1155 | 1169 | if (Globals.ADVANCED) |
---|
1156 | 1170 | { |
---|
1157 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1171 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1158 | 1172 | snapobjectButton.addActionListener(this); |
---|
1159 | 1173 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1160 | 1174 | |
---|
1161 | | - 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); |
---|
1162 | 1176 | fourButton.addActionListener(this); |
---|
1163 | 1177 | fourButton.setToolTipText("Show control panel only"); |
---|
1164 | 1178 | } |
---|
.. | .. |
---|
1166 | 1180 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1167 | 1181 | |
---|
1168 | 1182 | |
---|
1169 | | - 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); |
---|
1170 | 1184 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1171 | 1185 | rootButton.addActionListener(this); |
---|
1172 | 1186 | |
---|
1173 | | - 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); |
---|
1174 | 1188 | closeButton.setToolTipText("Close tab"); |
---|
1175 | 1189 | closeButton.addActionListener(this); |
---|
1176 | 1190 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1179 | 1193 | cGridBag row1 = new cGridBag(); |
---|
1180 | 1194 | |
---|
1181 | 1195 | // INSERT |
---|
1182 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1196 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1183 | 1197 | gridButton.setToolTipText("Create ground"); |
---|
1184 | 1198 | gridButton.addActionListener(this); |
---|
1185 | 1199 | |
---|
1186 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1200 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1187 | 1201 | boxButton.setToolTipText("Create box"); |
---|
1188 | 1202 | boxButton.addActionListener(this); |
---|
1189 | 1203 | |
---|
1190 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1191 | | - sphereButton.setToolTipText("Create sphere"); |
---|
1192 | | - sphereButton.addActionListener(this); |
---|
1193 | | - |
---|
1194 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1195 | | - coneButton.setToolTipText("Create cone"); |
---|
1196 | | - coneButton.addActionListener(this); |
---|
1197 | | - |
---|
1198 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1199 | | - torusButton.setToolTipText("Create torus"); |
---|
1200 | | - torusButton.addActionListener(this); |
---|
1201 | | - |
---|
1202 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1204 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1203 | 1205 | superButton.setToolTipText("Create superellipsoid"); |
---|
1204 | 1206 | superButton.addActionListener(this); |
---|
1205 | 1207 | |
---|
| 1208 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1209 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1210 | + sphereButton.addActionListener(this); |
---|
| 1211 | + |
---|
| 1212 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1213 | + coneButton.setToolTipText("Create cone"); |
---|
| 1214 | + coneButton.addActionListener(this); |
---|
| 1215 | + |
---|
| 1216 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1217 | + torusButton.setToolTipText("Create torus"); |
---|
| 1218 | + torusButton.addActionListener(this); |
---|
| 1219 | + |
---|
1206 | 1220 | if (Globals.ADVANCED) |
---|
1207 | 1221 | { |
---|
1208 | | - 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); |
---|
1209 | 1223 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1210 | 1224 | kleinButton.addActionListener(this); |
---|
1211 | 1225 | } |
---|
1212 | 1226 | |
---|
1213 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1227 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1214 | 1228 | particlesButton.setToolTipText("Create particle system"); |
---|
1215 | 1229 | particlesButton.addActionListener(this); |
---|
1216 | 1230 | |
---|
.. | .. |
---|
1218 | 1232 | |
---|
1219 | 1233 | cGridBag row2 = new cGridBag(); |
---|
1220 | 1234 | |
---|
1221 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1235 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1222 | 1236 | groupButton.setToolTipText("Create group"); |
---|
1223 | 1237 | groupButton.addActionListener(this); |
---|
1224 | 1238 | |
---|
1225 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1239 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1226 | 1240 | compositeButton.setToolTipText("Create composite"); |
---|
1227 | 1241 | compositeButton.addActionListener(this); |
---|
1228 | 1242 | |
---|
1229 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1243 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1230 | 1244 | switchButton.setToolTipText("Create item switcher"); |
---|
1231 | 1245 | switchButton.addActionListener(this); |
---|
1232 | 1246 | |
---|
1233 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1247 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1234 | 1248 | loopButton.setToolTipText("Create loop"); |
---|
1235 | 1249 | loopButton.addActionListener(this); |
---|
1236 | 1250 | |
---|
1237 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1251 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1238 | 1252 | textureButton.setToolTipText("Create texture"); |
---|
1239 | 1253 | textureButton.addActionListener(this); |
---|
1240 | 1254 | |
---|
1241 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1255 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1242 | 1256 | overlayButton.setToolTipText("Create overlay"); |
---|
1243 | 1257 | overlayButton.addActionListener(this); |
---|
1244 | 1258 | |
---|
1245 | | - 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); |
---|
1246 | 1260 | lightButton.setToolTipText("Create light"); |
---|
1247 | 1261 | lightButton.addActionListener(this); |
---|
1248 | 1262 | |
---|
.. | .. |
---|
1252 | 1266 | |
---|
1253 | 1267 | CreateTexturePanel(textures); |
---|
1254 | 1268 | |
---|
| 1269 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1270 | + |
---|
| 1271 | + if (tabCount > 0) |
---|
| 1272 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1273 | + |
---|
1255 | 1274 | oe.toolboxPanel.add(textures); |
---|
1256 | 1275 | |
---|
1257 | 1276 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1259 | 1278 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1260 | 1279 | |
---|
1261 | 1280 | // EDIT panel |
---|
1262 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1281 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1263 | 1282 | editButton.setToolTipText("Pin selection controls"); |
---|
1264 | 1283 | editButton.addActionListener(this); |
---|
1265 | 1284 | |
---|
1266 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1285 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1267 | 1286 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1268 | 1287 | uneditButton.addActionListener(this); |
---|
1269 | 1288 | |
---|
.. | .. |
---|
1271 | 1290 | allParamsButton.setToolTipText("Show all controls"); |
---|
1272 | 1291 | allParamsButton.addActionListener(this); |
---|
1273 | 1292 | |
---|
1274 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1293 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1275 | 1294 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1276 | 1295 | clearPanelButton.addActionListener(this); |
---|
1277 | 1296 | |
---|
.. | .. |
---|
1279 | 1298 | //unselectButton.setToolTipText("Unselect"); |
---|
1280 | 1299 | //unselectButton.addActionListener(this); |
---|
1281 | 1300 | |
---|
1282 | | - 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); |
---|
1283 | 1302 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1284 | 1303 | flashSelectionButton.addActionListener(this); |
---|
1285 | 1304 | |
---|
.. | .. |
---|
1302 | 1321 | |
---|
1303 | 1322 | cGridBag jSPPanel = new cGridBag(); |
---|
1304 | 1323 | |
---|
| 1324 | + jSPPanel.preferredHeight = 20; |
---|
| 1325 | + |
---|
1305 | 1326 | JScrollPane jSP; |
---|
1306 | 1327 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1307 | 1328 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1310 | 1331 | oe.treePanel.add(jSPPanel); |
---|
1311 | 1332 | oe.treePanel.Return(); |
---|
1312 | 1333 | |
---|
1313 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1334 | + oe.treePanel.add(versionManagerPanel); |
---|
1314 | 1335 | oe.treePanel.Return(); |
---|
1315 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1316 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1317 | | - sliderPane.preferredHeight = 1; |
---|
| 1336 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1337 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1338 | + versionSliderPane.preferredHeight = 3; |
---|
1318 | 1339 | |
---|
1319 | 1340 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1320 | 1341 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1504 | 1525 | |
---|
1505 | 1526 | oe.SetupViews(); |
---|
1506 | 1527 | |
---|
| 1528 | + if (Globals.DEBUG) |
---|
1507 | 1529 | System.out.println("SetupViews"); |
---|
1508 | 1530 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1509 | 1531 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
2165 | 2187 | shadow.material = new cMaterial(obj.material); |
---|
2166 | 2188 | shadow.material.diffuse = 0.0001f; |
---|
2167 | 2189 | shadow.material.specular = 0.0001f; |
---|
2168 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2190 | + shadow.material.opacity = 0.75f; |
---|
| 2191 | + |
---|
| 2192 | + AllocProjectedVertices(shadow); |
---|
| 2193 | + |
---|
| 2194 | + shadow.projectedVertices[1].x = 300; |
---|
2169 | 2195 | |
---|
2170 | 2196 | makeSomething(shadow); |
---|
2171 | 2197 | } |
---|
.. | .. |
---|
3442 | 3468 | { |
---|
3443 | 3469 | ClearMaterials(); |
---|
3444 | 3470 | } else |
---|
| 3471 | + if (source == clearVersionsItem) |
---|
| 3472 | + { |
---|
| 3473 | + ClearVersions(); |
---|
| 3474 | + } else |
---|
3445 | 3475 | if (source == liveleavesItem) |
---|
3446 | 3476 | { |
---|
3447 | 3477 | LiveLeaves(true); |
---|
.. | .. |
---|
3954 | 3984 | if (source == closeButton) |
---|
3955 | 3985 | { |
---|
3956 | 3986 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3987 | + Replace(); |
---|
| 3988 | + |
---|
3957 | 3989 | cRadio ab; |
---|
3958 | 3990 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3959 | 3991 | { |
---|
.. | .. |
---|
4052 | 4084 | } else |
---|
4053 | 4085 | if(source instanceof cRadio) |
---|
4054 | 4086 | { |
---|
| 4087 | + Replace(); |
---|
| 4088 | + |
---|
4055 | 4089 | group.parent = keepparent; |
---|
4056 | 4090 | group.attributes = 0; |
---|
4057 | 4091 | //group.editWindow = null; |
---|
.. | .. |
---|
4107 | 4141 | |
---|
4108 | 4142 | if (copy.versionlist == null) |
---|
4109 | 4143 | { |
---|
4110 | | - copy.versionlist = new Object3D[100]; |
---|
4111 | 4144 | copy.versionindex = -1; |
---|
4112 | 4145 | |
---|
4113 | | - Save(true); |
---|
| 4146 | + // Cannot work with loops |
---|
| 4147 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4148 | + // and check if any of these nodes are reachable below the root. |
---|
| 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); |
---|
4114 | 4161 | } |
---|
4115 | 4162 | |
---|
4116 | 4163 | SetVersionStates(); |
---|
.. | .. |
---|
4258 | 4305 | TouchTransform(obj); |
---|
4259 | 4306 | continue; |
---|
4260 | 4307 | } |
---|
4261 | | - if ((mask&2) != 0) // Scale |
---|
| 4308 | + if ((mask&2) != 0) // Scale/rotation |
---|
4262 | 4309 | { |
---|
4263 | 4310 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4264 | 4311 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4266 | 4313 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4267 | 4314 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4268 | 4315 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4269 | | - } |
---|
4270 | | - if ((mask&4) != 0) // Rotation |
---|
4271 | | - { |
---|
4272 | | - // ? |
---|
4273 | 4316 | } |
---|
4274 | 4317 | if ((mask&1) != 0) // Translation |
---|
4275 | 4318 | { |
---|
.. | .. |
---|
5078 | 5121 | refreshContents(); |
---|
5079 | 5122 | } |
---|
5080 | 5123 | |
---|
| 5124 | + void ClearVersions() |
---|
| 5125 | + { |
---|
| 5126 | + group.selection.ClearVersions(); |
---|
| 5127 | + refreshContents(); |
---|
| 5128 | + } |
---|
| 5129 | + |
---|
5081 | 5130 | void FlipV(boolean flip) |
---|
5082 | 5131 | { |
---|
5083 | 5132 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5355 | 5404 | if (group.selection != null) |
---|
5356 | 5405 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5357 | 5406 | { |
---|
5358 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5407 | + Object next = e.nextElement(); |
---|
| 5408 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5359 | 5409 | { |
---|
5360 | 5410 | allComposites = false; |
---|
5361 | 5411 | break; |
---|
.. | .. |
---|
5367 | 5417 | |
---|
5368 | 5418 | void refreshContents(boolean cp) |
---|
5369 | 5419 | { |
---|
| 5420 | + if (Globals.ADVANCED) |
---|
5370 | 5421 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5371 | 5422 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5372 | 5423 | { |
---|
.. | .. |
---|
6317 | 6368 | private MenuItem clipMeshItem; |
---|
6318 | 6369 | private MenuItem smoothMeshItem; |
---|
6319 | 6370 | private MenuItem clearMaterialsItem; |
---|
| 6371 | + private MenuItem clearVersionsItem; |
---|
6320 | 6372 | |
---|
6321 | 6373 | private MenuItem liveleavesItem; |
---|
6322 | 6374 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6346 | 6398 | private MenuItem transformGeometryItem; |
---|
6347 | 6399 | private MenuItem transformChildrenItem; |
---|
6348 | 6400 | private MenuItem hideItem; |
---|
6349 | | - private MenuItem grabItem; |
---|
| 6401 | + private JMenuItem grabItem; |
---|
6350 | 6402 | private MenuItem backItem; |
---|
6351 | 6403 | private MenuItem frontItem; |
---|
6352 | 6404 | private MenuItem cameraItem; |
---|