Normand Briere
2019-08-16 64e20f390e4b8e58bd0006dde8fa10fba1dac1d5
GroupEditor.java
....@@ -570,9 +570,6 @@
570570 //menu.add("-");
571571 oe.jTree.popup.addSeparator();
572572
573
- deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
574
- deleteItem.addActionListener(this);
575
-
576573 if (Globals.ADVANCED)
577574 {
578575 // Deletes the cameras...
....@@ -706,15 +703,17 @@
706703 setMasterItem.addActionListener(this);
707704 }
708705
709
- oe.menuBar.add(menu = new Menu("Group"));
710
-// grabItem = menu.add(new MenuItem("Grab"));
711
-// grabItem.addActionListener(this);
706
+ oe.menuBar.add(menu = new Menu("Order"));
707
+
712708 backItem = menu.add(new MenuItem("Back"));
713709 backItem.addActionListener(this);
714710 frontItem = menu.add(new MenuItem("Front"));
715711 frontItem.addActionListener(this);
716712 // compositeItem = menu.add(new MenuItem("Composite"));
717713 // compositeItem.addActionListener(this);
714
+
715
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
716
+ grabItem.addActionListener(this);
718717
719718 if (Globals.ADVANCED)
720719 {
....@@ -723,6 +722,11 @@
723722 }
724723 ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
725724 ungroupItem.addActionListener(this);
725
+
726
+ oe.jTree.popup.addSeparator();
727
+
728
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
729
+ deleteItem.addActionListener(this);
726730
727731 // menu.add("-");
728732 //
....@@ -928,7 +932,7 @@
928932
929933 JTabbedPane resourcecontainer;
930934 cGridBag currenttab;
931
- boolean added; // patch for jar
935
+ //boolean added; // patch for jar
932936
933937 int tabcount = 0;
934938 int colcount = 0;
....@@ -940,17 +944,19 @@
940944
941945 public void ResourceCallBack(String[] path)
942946 {
943
- for (int i = 0; i < path.length; i++)
944
- System.out.print(path[i] + "/");
945
- System.out.println();
947
+// for (int i = 0; i < path.length; i++)
948
+// System.out.print(path[i] + "/");
949
+// System.out.println();
946950
947951 if (//rowcount == 0 ||
948
- path.length == 1)
952
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
949953 {
950954 currenttab = new cGridBag();
951
- added = false;
952955 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
953956 currenttab.setName(tabname);
957
+ //added = false;
958
+ resourcecontainer.add(currenttab);
959
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
954960 rowcount = 1;
955961 colcount = 0;
956962 texturecount = 0;
....@@ -958,12 +964,11 @@
958964
959965 if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
960966 {
961
- if (!added)
967
+ //if (!added)
962968 {
963
- added = true;
964
- resourcecontainer.add(currenttab);
969
+ //added = true;
965970 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
966
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
971
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
967972 }
968973
969974 AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
....@@ -1064,7 +1069,7 @@
10641069 collapseButton.setToolTipText("Collapse toolbar");
10651070 collapseButton.addActionListener(this);
10661071
1067
- oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10681073 maximize3DButton.setToolTipText("Maximize 3D view");
10691074 maximize3DButton.addActionListener(this);
10701075
....@@ -1186,6 +1191,10 @@
11861191 boxButton.setToolTipText("Create box");
11871192 boxButton.addActionListener(this);
11881193
1194
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1195
+ superButton.setToolTipText("Create superellipsoid");
1196
+ superButton.addActionListener(this);
1197
+
11891198 row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11901199 sphereButton.setToolTipText("Create sphere");
11911200 sphereButton.addActionListener(this);
....@@ -1197,10 +1206,6 @@
11971206 row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11981207 torusButton.setToolTipText("Create torus");
11991208 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);
12041209
12051210 if (Globals.ADVANCED)
12061211 {
....@@ -1503,6 +1508,7 @@
15031508
15041509 oe.SetupViews();
15051510
1511
+ if (Globals.DEBUG)
15061512 System.out.println("SetupViews");
15071513 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
15081514 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2164,7 +2170,11 @@
21642170 shadow.material = new cMaterial(obj.material);
21652171 shadow.material.diffuse = 0.0001f;
21662172 shadow.material.specular = 0.0001f;
2167
- //shadow.projectedVertices[1].x = 300;
2173
+ shadow.material.opacity = 0.75f;
2174
+
2175
+ AllocProjectedVertices(shadow);
2176
+
2177
+ shadow.projectedVertices[1].x = 300;
21682178
21692179 makeSomething(shadow);
21702180 }
....@@ -4109,7 +4119,10 @@
41094119 copy.versionlist = new Object3D[100];
41104120 copy.versionindex = -1;
41114121
4112
- Save(true);
4122
+ // Cannot work with loops
4123
+ // To fix this issue, first mark all nodes above the root,
4124
+ // and check if any of these nodes are reachable below the root.
4125
+ //Save(true);
41134126 }
41144127
41154128 SetVersionStates();
....@@ -5354,7 +5367,8 @@
53545367 if (group.selection != null)
53555368 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53565369 {
5357
- if (!(e.nextElement() instanceof Composite))
5370
+ Object next = e.nextElement();
5371
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53585372 {
53595373 allComposites = false;
53605374 break;
....@@ -6345,7 +6359,7 @@
63456359 private MenuItem transformGeometryItem;
63466360 private MenuItem transformChildrenItem;
63476361 private MenuItem hideItem;
6348
- private MenuItem grabItem;
6362
+ private JMenuItem grabItem;
63496363 private MenuItem backItem;
63506364 private MenuItem frontItem;
63516365 private MenuItem cameraItem;