.. | .. |
---|
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 | // |
---|
.. | .. |
---|
928 | 934 | |
---|
929 | 935 | JTabbedPane resourcecontainer; |
---|
930 | 936 | cGridBag currenttab; |
---|
931 | | - boolean added; // patch for jar |
---|
| 937 | + //boolean added; // patch for jar |
---|
932 | 938 | |
---|
933 | 939 | int tabcount = 0; |
---|
934 | 940 | int colcount = 0; |
---|
.. | .. |
---|
940 | 946 | |
---|
941 | 947 | public void ResourceCallBack(String[] path) |
---|
942 | 948 | { |
---|
943 | | - for (int i = 0; i < path.length; i++) |
---|
944 | | - System.out.print(path[i] + "/"); |
---|
945 | | - System.out.println(); |
---|
| 949 | +// for (int i = 0; i < path.length; i++) |
---|
| 950 | +// System.out.print(path[i] + "/"); |
---|
| 951 | +// System.out.println(); |
---|
946 | 952 | |
---|
947 | 953 | if (//rowcount == 0 || |
---|
948 | | - path.length == 1) |
---|
| 954 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
949 | 955 | { |
---|
950 | 956 | currenttab = new cGridBag(); |
---|
951 | | - added = false; |
---|
952 | 957 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
953 | 958 | currenttab.setName(tabname); |
---|
| 959 | + //added = false; |
---|
| 960 | + resourcecontainer.add(currenttab); |
---|
| 961 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
954 | 962 | rowcount = 1; |
---|
955 | 963 | colcount = 0; |
---|
956 | 964 | texturecount = 0; |
---|
.. | .. |
---|
958 | 966 | |
---|
959 | 967 | if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
960 | 968 | { |
---|
961 | | - if (!added) |
---|
| 969 | + //if (!added) |
---|
962 | 970 | { |
---|
963 | | - added = true; |
---|
964 | | - resourcecontainer.add(currenttab); |
---|
| 971 | + //added = true; |
---|
965 | 972 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
966 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 973 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
967 | 974 | } |
---|
968 | 975 | |
---|
969 | 976 | AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
.. | .. |
---|
1064 | 1071 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1065 | 1072 | collapseButton.addActionListener(this); |
---|
1066 | 1073 | |
---|
1067 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1074 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1075 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1069 | 1076 | maximize3DButton.addActionListener(this); |
---|
1070 | 1077 | |
---|
.. | .. |
---|
1106 | 1113 | copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1107 | 1114 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1108 | 1115 | deleteVersionButton.addActionListener(this); |
---|
| 1116 | + deleteVersionButton.setEnabled(false); |
---|
1109 | 1117 | |
---|
1110 | 1118 | copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1111 | 1119 | previousVersionButton.setToolTipText("Previous version"); |
---|
.. | .. |
---|
1116 | 1124 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1117 | 1125 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1118 | 1126 | restoreButton.addActionListener(this); |
---|
1119 | | - //restoreButton.setEnabled(false); |
---|
| 1127 | + restoreButton.setEnabled(false); |
---|
1120 | 1128 | |
---|
1121 | 1129 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1122 | 1130 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1123 | 1131 | replaceButton.addActionListener(this); |
---|
1124 | | - //replaceButton.setEnabled(false); |
---|
| 1132 | + replaceButton.setEnabled(false); |
---|
1125 | 1133 | |
---|
1126 | 1134 | copyOptionsPanel.add(updown); |
---|
1127 | 1135 | |
---|
.. | .. |
---|
1186 | 1194 | boxButton.setToolTipText("Create box"); |
---|
1187 | 1195 | boxButton.addActionListener(this); |
---|
1188 | 1196 | |
---|
| 1197 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1198 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1199 | + superButton.addActionListener(this); |
---|
| 1200 | + |
---|
1189 | 1201 | row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1190 | 1202 | sphereButton.setToolTipText("Create sphere"); |
---|
1191 | 1203 | sphereButton.addActionListener(this); |
---|
.. | .. |
---|
1197 | 1209 | row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1198 | 1210 | torusButton.setToolTipText("Create torus"); |
---|
1199 | 1211 | torusButton.addActionListener(this); |
---|
1200 | | - |
---|
1201 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1202 | | - superButton.setToolTipText("Create superellipsoid"); |
---|
1203 | | - superButton.addActionListener(this); |
---|
1204 | 1212 | |
---|
1205 | 1213 | if (Globals.ADVANCED) |
---|
1206 | 1214 | { |
---|
.. | .. |
---|
1250 | 1258 | cGridBag textures = new cGridBag(); |
---|
1251 | 1259 | |
---|
1252 | 1260 | CreateTexturePanel(textures); |
---|
| 1261 | + |
---|
| 1262 | + resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
1253 | 1263 | |
---|
1254 | 1264 | oe.toolboxPanel.add(textures); |
---|
1255 | 1265 | |
---|
.. | .. |
---|
1503 | 1513 | |
---|
1504 | 1514 | oe.SetupViews(); |
---|
1505 | 1515 | |
---|
| 1516 | + if (Globals.DEBUG) |
---|
1506 | 1517 | System.out.println("SetupViews"); |
---|
1507 | 1518 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1508 | 1519 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
2164 | 2175 | shadow.material = new cMaterial(obj.material); |
---|
2165 | 2176 | shadow.material.diffuse = 0.0001f; |
---|
2166 | 2177 | shadow.material.specular = 0.0001f; |
---|
2167 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2178 | + shadow.material.opacity = 0.75f; |
---|
| 2179 | + |
---|
| 2180 | + AllocProjectedVertices(shadow); |
---|
| 2181 | + |
---|
| 2182 | + shadow.projectedVertices[1].x = 300; |
---|
2168 | 2183 | |
---|
2169 | 2184 | makeSomething(shadow); |
---|
2170 | 2185 | } |
---|
.. | .. |
---|
4109 | 4124 | copy.versionlist = new Object3D[100]; |
---|
4110 | 4125 | copy.versionindex = -1; |
---|
4111 | 4126 | |
---|
4112 | | - Save(true); |
---|
| 4127 | + // Cannot work with loops |
---|
| 4128 | + // To fix this issue, first mark all nodes above the root, |
---|
| 4129 | + // and check if any of these nodes are reachable below the root. |
---|
| 4130 | + //Save(true); |
---|
4113 | 4131 | } |
---|
4114 | 4132 | |
---|
4115 | 4133 | SetVersionStates(); |
---|
.. | .. |
---|
5354 | 5372 | if (group.selection != null) |
---|
5355 | 5373 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5356 | 5374 | { |
---|
5357 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5375 | + Object next = e.nextElement(); |
---|
| 5376 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5358 | 5377 | { |
---|
5359 | 5378 | allComposites = false; |
---|
5360 | 5379 | break; |
---|
.. | .. |
---|
6345 | 6364 | private MenuItem transformGeometryItem; |
---|
6346 | 6365 | private MenuItem transformChildrenItem; |
---|
6347 | 6366 | private MenuItem hideItem; |
---|
6348 | | - private MenuItem grabItem; |
---|
| 6367 | + private JMenuItem grabItem; |
---|
6349 | 6368 | private MenuItem backItem; |
---|
6350 | 6369 | private MenuItem frontItem; |
---|
6351 | 6370 | private MenuItem cameraItem; |
---|