From 64e20f390e4b8e58bd0006dde8fa10fba1dac1d5 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Fri, 16 Aug 2019 13:25:19 -0400 Subject: [PATCH] Fix box and VR keys. --- GroupEditor.java | 43 ++++++++++++++++++++++++++++--------------- 1 files changed, 28 insertions(+), 15 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index 651e8a8..cff60a6 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -570,9 +570,6 @@ //menu.add("-"); oe.jTree.popup.addSeparator(); - deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); - deleteItem.addActionListener(this); - if (Globals.ADVANCED) { // Deletes the cameras... @@ -706,15 +703,17 @@ setMasterItem.addActionListener(this); } - oe.menuBar.add(menu = new Menu("Group")); -// grabItem = menu.add(new MenuItem("Grab")); -// grabItem.addActionListener(this); + oe.menuBar.add(menu = new Menu("Order")); + backItem = menu.add(new MenuItem("Back")); backItem.addActionListener(this); frontItem = menu.add(new MenuItem("Front")); frontItem.addActionListener(this); // compositeItem = menu.add(new MenuItem("Composite")); // compositeItem.addActionListener(this); + + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); + grabItem.addActionListener(this); if (Globals.ADVANCED) { @@ -723,6 +722,11 @@ } ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); ungroupItem.addActionListener(this); + + oe.jTree.popup.addSeparator(); + + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); + deleteItem.addActionListener(this); // menu.add("-"); // @@ -1065,7 +1069,7 @@ collapseButton.setToolTipText("Collapse toolbar"); collapseButton.addActionListener(this); - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); maximize3DButton.setToolTipText("Maximize 3D view"); maximize3DButton.addActionListener(this); @@ -1187,6 +1191,10 @@ boxButton.setToolTipText("Create box"); boxButton.addActionListener(this); + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + superButton.setToolTipText("Create superellipsoid"); + superButton.addActionListener(this); + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); sphereButton.setToolTipText("Create sphere"); sphereButton.addActionListener(this); @@ -1198,10 +1206,6 @@ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); torusButton.setToolTipText("Create torus"); torusButton.addActionListener(this); - - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - superButton.setToolTipText("Create superellipsoid"); - superButton.addActionListener(this); if (Globals.ADVANCED) { @@ -1504,6 +1508,7 @@ oe.SetupViews(); + if (Globals.DEBUG) System.out.println("SetupViews"); DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? @@ -2165,7 +2170,11 @@ shadow.material = new cMaterial(obj.material); shadow.material.diffuse = 0.0001f; shadow.material.specular = 0.0001f; - //shadow.projectedVertices[1].x = 300; + shadow.material.opacity = 0.75f; + + AllocProjectedVertices(shadow); + + shadow.projectedVertices[1].x = 300; makeSomething(shadow); } @@ -4110,7 +4119,10 @@ copy.versionlist = new Object3D[100]; copy.versionindex = -1; - Save(true); + // Cannot work with loops + // To fix this issue, first mark all nodes above the root, + // and check if any of these nodes are reachable below the root. + //Save(true); } SetVersionStates(); @@ -5355,7 +5367,8 @@ if (group.selection != null) for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { - if (!(e.nextElement() instanceof Composite)) + Object next = e.nextElement(); + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) { allComposites = false; break; @@ -6346,7 +6359,7 @@ private MenuItem transformGeometryItem; private MenuItem transformChildrenItem; private MenuItem hideItem; - private MenuItem grabItem; + private JMenuItem grabItem; private MenuItem backItem; private MenuItem frontItem; private MenuItem cameraItem; -- Gitblit v1.6.2