From e79247ef52a0bbb3864d46bb1e2c716005b3ecf3 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Thu, 18 Jul 2019 22:19:40 -0400 Subject: [PATCH] Move XYZ panel + icons. --- GroupEditor.java | 74 +++++++++++++++++++++--------------- 1 files changed, 43 insertions(+), 31 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index a08dc18..1e0e863 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -206,8 +206,8 @@ // pasteExpandItem = menu.add(new MenuItem("Paste expand")); // pasteExpandItem.addActionListener(this); menu.add("-"); - clearItem = menu.add(new MenuItem("Clear")); - clearItem.addActionListener(this); + deleteItem = menu.add(new MenuItem("Delete")); + deleteItem.addActionListener(this); if (Globals.ADVANCED) { @@ -433,7 +433,7 @@ genNormalsMESHItem.addActionListener(this); if (Globals.ADVANCED) { - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); genNormalsMINEItem.addActionListener(this); } stripifyItem = menu.add(new MenuItem("Stripify")); @@ -685,27 +685,28 @@ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - twoButton.setToolTipText("Show center view only"); - twoButton.addActionListener(this); - this.fullscreenLayout = twoButton; - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); fourButton.addActionListener(this); fourButton.setToolTipText("Show left panel only"); + + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + twoButton.setToolTipText("Show right view only"); + twoButton.addActionListener(this); + this.fullscreenLayout = twoButton; + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - sixButton.setToolTipText("2-column layout left"); + sixButton.setToolTipText("Show left and right"); sixButton.addActionListener(this); - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - threeButton.setToolTipText("2-column layout right"); - threeButton.addActionListener(this); - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - sevenButton.setToolTipText("3-column layout"); - sevenButton.addActionListener(this); +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); +// threeButton.setToolTipText("2-column layout right"); +// threeButton.addActionListener(this); +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); +// sevenButton.setToolTipText("3-column layout"); +// sevenButton.addActionListener(this); // - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - rootButton.setToolTipText("Edit selection in new tab"); + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + rootButton.setToolTipText("Open selection in new tab"); rootButton.addActionListener(this); oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); @@ -871,7 +872,7 @@ dgr.addDragGestureListener(this); }catch(Exception e) {} */ - radio.layout = sevenButton; + radio.layout = sixButton; // sevenButton; oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); } @@ -1013,7 +1014,7 @@ } radioButton.SetObject(obj); - radioButton.layout = sevenButton; + radioButton.layout = sixButton; // sevenButton; radioButton.SetCamera(cameraView.renderCamera, false); radioButton.addActionListener(this); radioPanel.add(radioButton); @@ -1692,6 +1693,16 @@ listUI.remove(i); } } + } + + private void EditElement(Object3D elem, boolean newWindow) + { + // if (!(elem instanceof Composite)) + // newWindow = false; + listUI.add(elem); + elem.openEditWindow(this, newWindow); //, false); + System.out.println("edit : " + elem); + elem.editWindow.refreshContents(true); // ? new } /** @@ -2658,7 +2669,7 @@ { StepAll(); } else - if (source == clearItem) // || event.getSource() == clearButton) + if (source == deleteItem) // || event.getSource() == clearButton) { //int indices[] = jList.getSelectedIndices(); //for (int i = indices.length - 1; i >= 0; i--) @@ -3553,10 +3564,10 @@ radio.layout.doClick(); ClearUnpinned(); - Grafreed.Assert(group != null); - Grafreed.Assert(group.selection != null); - SetPinStates(group.selection.size() > 0); - if (group.selection.size() == 1) + //Grafreed.Assert(group != null); + //Grafreed.Assert(group.selection != null); + SetPinStates(group.selection == null || group.selection.size() > 0); + if (group.selection == null || group.selection.size() == 1) EditSelection(false); keepparent = group.parent; // PARENT = NULL or not??? @@ -4627,6 +4638,12 @@ void EditSelection(boolean newWindow) { + if (group.selection == null) + { + EditElement(group, newWindow); // ? new + return; + } + // aConstraints.gridy = 0; for (int i=0; i<group.selection.size(); i++) { @@ -4637,12 +4654,7 @@ Object3D elem = (Object3D)group.selection.elementAt(i); if(elem != group || !newWindow) { - // if (!(elem instanceof Composite)) - // newWindow = false; - listUI.add(elem); - elem.openEditWindow(this, newWindow); //, false); - System.out.println("edit : " + elem); - elem.editWindow.refreshContents(true); // ? new + EditElement(elem, newWindow); // ? new } } } @@ -5695,7 +5707,7 @@ private MenuItem pasteLinkItem; private MenuItem pasteCloneItem; private MenuItem pasteExpandItem; - private MenuItem clearItem; + private MenuItem deleteItem; private MenuItem clearAllItem; private MenuItem genUVItem; private MenuItem genNormalsMESHItem; -- Gitblit v1.6.2