From e36047725ce3217618d4e5807ac7c8769b9e3598 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Mon, 17 Jun 2019 19:45:55 -0400 Subject: [PATCH] Split pigment bump. --- GroupEditor.java | 101 +++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 78 insertions(+), 23 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index 5d4b4bf..4f34e39 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -154,11 +154,12 @@ oe.menuBar.add(menu = new Menu("Edit")); //editItem = menu.add(new MenuItem("Edit")); //editItem.addActionListener(this); - undoItem = menu.add(new MenuItem("Undo")); - undoItem.addActionListener(this); - redoItem = menu.add(new MenuItem("Redo")); - redoItem.addActionListener(this); - menu.add("-"); + +// undoItem = menu.add(new MenuItem("Undo")); +// undoItem.addActionListener(this); +// redoItem = menu.add(new MenuItem("Redo")); +// redoItem.addActionListener(this); +// menu.add("-"); duplicateItem = menu.add(new MenuItem("Duplicate")); duplicateItem.addActionListener(this); cloneItem = menu.add(new MenuItem("Clone")); @@ -202,7 +203,7 @@ //zBufferItem.addActionListener(this); //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); //normalLensItem.addActionListener(this); - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); revertCameraItem.addActionListener(this); cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); @@ -266,7 +267,7 @@ // animationItem.addItemListener(this); // animationItem.setState(CameraPane.ANIMATION); cameraMenu.add("-"); - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); editCameraItem.addActionListener(this); if (Globals.ADVANCED) @@ -555,6 +556,18 @@ oe.buttonGroup.add(dummyButton); */ //this.AddOptions(oe.toolbarPanel, oe.aConstraints); + + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + undoButton.setToolTipText("Undo changes"); + undoButton.addActionListener(this); + + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + redoButton.setToolTipText("Redo changes"); + redoButton.addActionListener(this); + + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + saveButton.setToolTipText("Save changes"); + saveButton.addActionListener(this); oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); liveCB.setToolTipText("Enable animation"); @@ -858,6 +871,7 @@ } else if(e.getSource() == liveCB) { cameraView.ToggleLive(); + refreshContents(false); } else if(e.getSource() == supportCB) { @@ -1265,7 +1279,7 @@ memoryItem.addActionListener(this); menu.add(analyzeItem = new MenuItem("Analyze")); analyzeItem.addActionListener(this); - menu.add(dumpItem = new MenuItem("Dump")); + menu.add(dumpItem = new MenuItem("Print")); dumpItem.addActionListener(this); // menu.add(pathItem = new MenuItem("From-to path")); // pathItem.addActionListener(this); @@ -1956,6 +1970,18 @@ { DumpObject(); } else + if (source == undoButton) + { + Undo(); + } else + if (source == redoButton) + { + Redo(); + } else + if (source == saveButton) + { + Save(); + } else if (source == oneStepButton) { Globals.ONESTEP = true; @@ -2517,7 +2543,7 @@ } else if (source == genNormalsMESHItem) { - GenNormals(true); // TODO + GenNormalsMESH(); } else if (source == genNormalsORGANItem) { @@ -3041,7 +3067,7 @@ child.CloseUI(); listUI.remove(child); - child.editWindow = null; // ??????????? + //child.editWindow = null; // ??????????? } objEditor.ctrlPanel.FlushUI(); //objEditor.jTree.clearSelection(); @@ -3128,7 +3154,8 @@ sideView.object = group; } -// fix "+" issue group.editWindow = this; +// fix "+" issue + group.editWindow = this; /* currentLayout = radio.layout; @@ -3403,7 +3430,8 @@ int size = obj.MemorySize(); - System.err.println((size/1024) + " KB is the size of " + obj); + //System.err.println((size/1024) + " KB is the size of " + obj); + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); } } catch (Exception e) @@ -3484,6 +3512,13 @@ void GenNormals(boolean crease) { group.GenNormalsS(crease); + + refreshContents(); + } + + void GenNormalsMESH() + { + group.GenNormalsMeshS(); refreshContents(); } @@ -4286,7 +4321,6 @@ //case 702: // Event.LIST_DESELECT group.deselectAll(); TreePath tps[] = objEditor.jTree.getSelectionPaths(); - objEditor.ClearInfo(); // .GetMaterial()); if (tps != null) { for (int i=0; i < tps.length; i++) @@ -4295,10 +4329,8 @@ //if (child.parent != null) //child.parent.addSelectee(child); + objEditor.SetMaterial(child); group.addSelectee(child); - objEditor.SetMaterial(child); // .GetMaterial()); - objEditor.AddInfo(child, this, true); // .GetMaterial()); - System.err.println("info : " + child.GetPath()); } } // else @@ -4308,17 +4340,13 @@ // System.err.println("info : " + group.GetPath()); // } - objEditor.SetText(); // jan 2014 - - Object3D object = (Object3D) tps[0].getLastPathComponent(); - - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera)) + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) CameraPane.flash = true; - if (tps != null && tps.length > 0 && object instanceof Camera) + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) // a camera { - if (object != Globals.theRenderer.LightCamera()) + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) { CameraPane.camerachangeframe = 0; // don't refuse it Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); @@ -4335,6 +4363,26 @@ freezemodel = false; } + + void refreshContents(boolean cp) + { + if (!Globals.MOUSEDRAGGED) + { + objEditor.ClearInfo(); // .GetMaterial()); + + for (int i=0; i < group.selection.Size(); i++) + { + Object3D child = (Object3D) group.selection.get(i); + + objEditor.AddInfo(child, this, true); + System.err.println("info : " + child.GetPath()); + } + + objEditor.SetText(); // jan 2014 + } + + super.refreshContents(cp); + } void linkSomething(Object3D thing) { @@ -4406,6 +4454,7 @@ { if (group.selection.isEmpty()) return; + Grafreed.clipboardIsTempGroup = false; Composite tGroup = null; if (group.selection.size() > 0) // 1) @@ -4416,6 +4465,7 @@ if (cut) { + Save(); //int indices[] = jList.getSelectedIndices(); //for (int i = indices.length - 1; i >= 0; i--) //jList.remove(indices[i]); @@ -4505,8 +4555,10 @@ } } + if (Grafreed.clipboardIsTempGroup) Grafreed.clipboard = tGroup; + if (cut) { ResetModel(); @@ -5131,6 +5183,9 @@ cButton clearpanelButton; cButton unselectButton; + cButton saveButton; + cButton undoButton; + cButton redoButton; cButton oneStepButton; cButton screenfitButton; -- Gitblit v1.6.2