From bed42c663d286d76a32f155049f9efabc2fdb73f Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sun, 28 Apr 2019 20:48:43 -0400 Subject: [PATCH] New UI proto --- GroupEditor.java | 758 ++++++++++++++++++++++++++++++--------------------------- 1 files changed, 402 insertions(+), 356 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index b72085f..a2fec77 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -434,6 +434,9 @@ oe.buttonGroup.add(dummyButton); */ aConstraints.gridy += 1; + + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); + oe.aConstraints.gridwidth = 1; oe.aConstraints.gridx = 0; @@ -442,76 +445,7 @@ liveCB.addItemListener(this); oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); - fastCB.setToolTipText("Fast mode"); - fastCB.addItemListener(this); - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); - supportCB.setToolTipText("Enabled rigging"); - supportCB.addItemListener(this); - - // oe.aConstraints.gridx += 1; - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); - // localCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints); - crowdCB.setToolTipText("Used for crowds"); - crowdCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); - smoothCB.setToolTipText("Snapping delay"); - smoothCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); - slowCB.setToolTipText("Smooth interpolation"); - slowCB.addItemListener(this); - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints); - boxCB.setToolTipText("Display bounding boxes"); - boxCB.addItemListener(this); - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints); - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); - zoomBoxCB.addItemListener(this); - -// oe.aConstraints.gridx += 1; -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); -// speakerMocapCB.addItemListener(this); - - if (false) - { - // handled in scripts - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); - speakerCameraCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); - speakerFocusCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); - smoothfocusCB.addItemListener(this); - } - -//oe.aConstraints.gridx += 1; -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); -// debugCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints); - oeilCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints); - lookAtCB.setToolTipText("Look-at target"); - lookAtCB.addItemListener(this); - - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); trackCB.setToolTipText("Enable tracking"); trackCB.addItemListener(this); @@ -669,6 +603,80 @@ radio.layout = sevenButton; oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); } + + void AddOptions(JPanel panel, GridBagConstraints constraints) + { + constraints.gridx = 0; + constraints.gridy = 0; + panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints); + fastCB.setToolTipText("Fast mode"); + fastCB.addItemListener(this); + constraints.gridy += 1; + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints); + supportCB.setToolTipText("Enabled rigging"); + supportCB.addItemListener(this); + + // constraints.gridy += 1; + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); + // localCB.addItemListener(this); + + constraints.gridy += 1; + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints); + crowdCB.setToolTipText("Used for crowds"); + crowdCB.addItemListener(this); + + constraints.gridy += 1; + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints); + smoothCB.setToolTipText("Snapping delay"); + smoothCB.addItemListener(this); + + constraints.gridy += 1; + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints); + slowCB.setToolTipText("Smooth interpolation"); + slowCB.addItemListener(this); + constraints.gridy += 1; + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints); + boxCB.setToolTipText("Display bounding boxes"); + boxCB.addItemListener(this); + constraints.gridy += 1; + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints); + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); + zoomBoxCB.addItemListener(this); + +// constraints.gridy += 1; +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); +// speakerMocapCB.addItemListener(this); + + if (false) + { + // handled in scripts + constraints.gridy += 1; + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints); + speakerCameraCB.addItemListener(this); + + constraints.gridy += 1; + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints); + speakerFocusCB.addItemListener(this); + + constraints.gridy += 1; + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints); + smoothfocusCB.addItemListener(this); + } + +//constraints.gridx += 1; +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); +// debugCB.addItemListener(this); + + constraints.gridy += 1; + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints); + oeilCB.addItemListener(this); + + constraints.gridy += 1; + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints); + lookAtCB.setToolTipText("Look-at target"); + lookAtCB.addItemListener(this); + + } void EditObject(Object3D obj) { @@ -1510,6 +1518,7 @@ // public void actionPerformed(ActionEvent event) // , Object arg) { + Object source = event.getSource(); /* if (event.getSource() == nameField) { @@ -1521,11 +1530,11 @@ } else */ - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) + if (source == lookAtItem || source == lookFromItem) { ScreenFit(); } else - if (event.getSource() == switchItem) + if (source == switchItem) { cVector v1 = new cVector(); cVector v2 = new cVector(); @@ -1534,11 +1543,11 @@ objEditor.cameraView.renderCamera.setAim(v2, v1); objEditor.cameraView.repaint(); } else - if (event.getSource() == rectoidItem) + if (source == rectoidItem) { makeSomething(new Box()); } else - if (event.getSource() == particleItem) + if (source == particleItem) { ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); ParticleController particleController = new ParticleController(particleGeom); @@ -1559,9 +1568,9 @@ applyExample(particleGeom, "SMOKE"); makeSomething(particleGeom); } else - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) + if (source == ragdollItem || source == ragdoll2Item) { - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); ragdoll.toParent = LA.newMatrix(); ragdoll.fromParent = LA.newMatrix(); @@ -1579,7 +1588,7 @@ } else /* */ - if (event.getSource() == heightFieldItem) + if (source == heightFieldItem) { Object3D obj = new Object3D(); @@ -1617,31 +1626,31 @@ makeSomething(obj); } else - if (event.getSource() == gridItem) + if (source == gridItem) { makeSomething(new Grid()); } else - if (event.getSource() == ellipsoidItem) + if (source == ellipsoidItem) { makeSomething(new Sphere()); } else - if (event.getSource() == coneItem) + if (source == coneItem) { makeSomething(new Cone()); } else - if (event.getSource() == torusItem) + if (source == torusItem) { makeSomething(new Torus()); } else - if (event.getSource() == superItem) + if (source == superItem) { makeSomething(new Superellipsoid()); } else - if (event.getSource() == kleinItem) + if (source == kleinItem) { makeSomething(new Klein()); } else - if (event.getSource() == blobItem) + if (source == blobItem) { Blob blob = new Blob(); BlobComponent comp = new BlobComponent(); @@ -1649,15 +1658,15 @@ //blob.retile(); makeSomething(blob); } else - if (event.getSource() == latheItem) + if (source == latheItem) { makeSomething(new Lathe()); } else - if (event.getSource() == bezierItem) + if (source == bezierItem) { makeSomething(new BezierSurface()); } else - if (event.getSource() == checkerItem) + if (source == checkerItem) { /* Object3D obj = new BezierSurface(5,8); @@ -1672,7 +1681,7 @@ */ makeSomething(new Checker()); } else - if (event.getSource() == meshItem) + if (source == meshItem) { Object3D itemtomake = new Object3D(); Object3D child; @@ -1693,35 +1702,35 @@ makeSomething(child); } } else - if (event.getSource() == springItem) + if (source == springItem) { cSpring s = new cSpring(); s.setup(); makeSomething(s); } else - if (event.getSource() == flagItem) + if (source == flagItem) { cSpring s = new cFlag(); s.setup(); makeSomething(s); } else - if (event.getSource() == lightItem) + if (source == lightItem) { makeSomething(new Light()); } else - if (event.getSource() == csgItem) + if (source == csgItem) { group(new CSG()); } else - if (event.getSource() == templateItem) + if (source == templateItem) { group(new cTemplate()); } else - if (event.getSource() == attributeItem) + if (source == attributeItem) { makeSomething(new Attribute()); } else - if (event.getSource() == pointflowItem) + if (source == pointflowItem) { makeSomething(new PointFlow()); } else @@ -1733,7 +1742,7 @@ } else */ - if (event.getSource() == superLoopItem) + if (source == superLoopItem) { Composite g = new cGroup(); for (int i=0; i<15; i++) @@ -1755,7 +1764,7 @@ group(g); } else - if (event.getSource() == loopItem) + if (source == loopItem) { Composite csg = new GroupLeaf(); csg.count = 5; @@ -1764,7 +1773,7 @@ csg.addChild(child); child.addChild(csg); } else - if (event.getSource() == doubleItem) + if (source == doubleItem) { Composite csg = new GroupLeaf(); csg.count = 5; @@ -1776,7 +1785,7 @@ csg.addChild(child); child.addChild(csg); } else - if (event.getSource() == tripleItem) + if (source == tripleItem) { Composite csg = new GroupLeaf(); csg.count = 4; @@ -1792,70 +1801,70 @@ child.addChild(csg); } else - if (event.getSource() == importGFDItem) + if (source == importGFDItem) { ImportGFD(); } else - if (event.getSource() == importVRMLX3DItem) + if (source == importVRMLX3DItem) { ImportVRMLX3D(); } else - if (event.getSource() == import3DSItem) + if (source == import3DSItem) { objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); } else - if (event.getSource() == importOBJItem) + if (source == importOBJItem) { objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); } else - if (event.getSource() == computeAOItem) + if (source == computeAOItem) { Globals.drawMode = CameraPane.OCCLUSION; Globals.theRenderer.repaint(); } else - if (event.getSource() == recompileItem) + if (source == recompileItem) { Recompile(); refreshContents(); } else - if (event.getSource() == editScriptItem) + if (source == editScriptItem) { OpenDialog(); refreshContents(); } else - if (event.getSource() == invariantsItem) + if (source == invariantsItem) { System.out.println("Invariants:"); GrafreeD.grafreeD.universe.invariants(); } else - if (event.getSource() == memoryItem) + if (source == memoryItem) { //System.out.println("Invariants:"); PrintMemory(); } else - if (event.getSource() == pathItem) + if (source == pathItem) { PrintPath(); } else - if (event.getSource() == analyzeItem) + if (source == analyzeItem) { AnalyzeObject(); } else - if (event.getSource() == dumpItem) + if (source == dumpItem) { DumpObject(); } else - if (event.getSource() == screenfitButton) + if (source == screenfitButton) { //Reload(lastConverter, lastFilename, true); ScreenFit(); } else - if (event.getSource() == screenfitpointButton) + if (source == screenfitpointButton) { //Reload(lastConverter, lastFilename, true); ScreenFitPoint(); } else - if (event.getSource() == snapobjectButton) + if (source == snapobjectButton) { //Reload(lastConverter, lastFilename, true); SnapObject(); @@ -1866,13 +1875,13 @@ // Recompile(); // refreshContents(); // } else - if (event.getSource() == gcButton) + if (source == gcButton) { System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); System.gc(); System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); } else - if (event.getSource() == editLeafItem) + if (source == editLeafItem) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -1886,62 +1895,62 @@ } refreshContents(true); } else - if (event.getSource() == openWindowItem) + if (source == openWindowItem) { EditSelection(true); } else - if (event.getSource() == cutItem || event.getSource() == clearButton) + if (source == cutItem || source == clearButton) { loadClipboard(true); } else - if (event.getSource() == duplicateItem) + if (source == duplicateItem) { Object3D keep = GrafreeD.clipboard; loadClipboard(false); paste(false); GrafreeD.clipboard = keep; } else - if (event.getSource() == cloneItem) + if (source == cloneItem) { CloneSelection(false); } else - if (event.getSource() == cloneSupportItem) + if (source == cloneSupportItem) { CloneSelection(true); } else - if (event.getSource() == copyItem) + if (source == copyItem) { loadClipboard(false); } else - if (event.getSource() == pasteItem) + if (source == pasteItem) { paste(false); } else - if (event.getSource() == pasteLinkItem) + if (source == pasteLinkItem) { pasteInto(false); } else - if (event.getSource() == pasteCloneItem) + if (source == pasteCloneItem) { pasteInto(true); } else - if (event.getSource() == pasteExpandItem) + if (source == pasteExpandItem) { paste(true); } else - if (event.getSource() == synchronizeItem) + if (source == synchronizeItem) { Overwrite(Object3D.TRANSFORM); } else - if (event.getSource() == overwriteNameItem) + if (source == overwriteNameItem) { Overwrite(Object3D.NAME); } else - if (event.getSource() == overwriteUVItem) + if (source == overwriteUVItem) { Overwrite(Object3D.UV); } else - if (event.getSource() == overwriteMatItem) + if (source == overwriteMatItem) { /* july 2015 if ((dropAttributes & Object3D.TEXTURE) == 0) @@ -1961,7 +1970,7 @@ Overwrite(dropAttributes); } - if (event.getSource() == overwriteGeoItem) + if (source == overwriteGeoItem) { Overwrite(Object3D.GEOMETRY); // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) @@ -1978,7 +1987,7 @@ // refreshContents(); // } } else - if (event.getSource() == generateMeshItem) + if (source == generateMeshItem) { //if (group.selection.size() == 1) // for (int i=0; i<group.selection.size(); i++) @@ -1989,7 +1998,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == extractGeometriesItem) + if (source == extractGeometriesItem) { boolean one = false; @@ -2016,7 +2025,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == cloneGeometriesItem) + if (source == cloneGeometriesItem) { boolean one = false; @@ -2042,7 +2051,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == shareGeometriesItem) + if (source == shareGeometriesItem) { boolean one = false; @@ -2072,7 +2081,7 @@ refreshContents(); } } else - if (event.getSource() == mergeGeometriesItem) + if (source == mergeGeometriesItem) { boolean one = false; @@ -2102,7 +2111,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == linkverticesItem) + if (source == linkverticesItem) { // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) // { @@ -2135,7 +2144,7 @@ refreshContents(); } } else - if (event.getSource() == resetsupportItem) + if (source == resetsupportItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2147,7 +2156,7 @@ refreshContents(); } else - if (event.getSource() == relinkverticesItem) + if (source == relinkverticesItem) { boolean random = CameraPane.RANDOM; CameraPane.RANDOM = false; // parse all random nodes @@ -2156,7 +2165,7 @@ refreshContents(); } else - if (event.getSource() == resetreferencesItem) + if (source == resetreferencesItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2165,7 +2174,7 @@ refreshContents(); } else - if (event.getSource() == setMasterItem) + if (source == setMasterItem) { if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) { @@ -2178,7 +2187,7 @@ refreshContents(); } } else - if (event.getSource() == poseMeshItem) + if (source == poseMeshItem) { if (group.selection.size() == 1) { @@ -2197,19 +2206,19 @@ } } else - if (event.getSource() == revertMeshItem) + if (source == revertMeshItem) { RevertMeshes(); } else - if (event.getSource() == resetMeshItem) + if (source == resetMeshItem) { ResetAll(); } else - if (event.getSource() == stepAllItem) + if (source == stepAllItem) { StepAll(); } else - if (event.getSource() == clearItem) // || event.getSource() == clearButton) + if (source == clearItem) // || event.getSource() == clearButton) { //int indices[] = jList.getSelectedIndices(); //for (int i = indices.length - 1; i >= 0; i--) @@ -2217,46 +2226,46 @@ ClearSelection(false); } else - if (event.getSource() == clearAllItem) + if (source == clearAllItem) { ClearSelection(true); } else - if (event.getSource() == grabItem) + if (source == grabItem) { group(new cGroup(), true); } else - if (event.getSource() == hideItem) + if (source == hideItem) { group(new HiddenObject()); } else - if (event.getSource() == frontItem) + if (source == frontItem) { front(); } else - if (event.getSource() == backItem) + if (source == backItem) { back(); } else - if (event.getSource() == cameraItem) + if (source == cameraItem) { makeSomething(new Camera()); } else - if (event.getSource() == compositeItem) + if (source == compositeItem) { group(new Composite()); } else - if (event.getSource() == randomItem) + if (source == randomItem) { RandomNode random = new RandomNode(); group(random); if (random.size() > 0) random.name = random.get(0).name + "Rnd"; } else - if (event.getSource() == physicsItem) + if (source == physicsItem) { group(new PhysicsNode()); } else - if (event.getSource() == frameselectorItem) + if (source == frameselectorItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2268,7 +2277,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == switchGeoItem) + if (source == switchGeoItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2280,7 +2289,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == switchTransfoItem) + if (source == switchTransfoItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2292,7 +2301,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == morphItem) + if (source == morphItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2304,7 +2313,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == scriptNodeItem) + if (source == scriptNodeItem) { boolean atleastone = false; @@ -2343,31 +2352,31 @@ } } } else - if (event.getSource() == linkerItem) + if (source == linkerItem) { group(new cLinker()); } else - if (event.getSource() == textureItem) + if (source == textureItem) { group(new TextureNode()); } else - if (event.getSource() == billboardItem) + if (source == billboardItem) { group(new BillboardNode()); } else - if (event.getSource() == shadowXItem) + if (source == shadowXItem) { CastShadow(0); } else - if (event.getSource() == shadowYItem) + if (source == shadowYItem) { CastShadow(1); } else - if (event.getSource() == shadowZItem) + if (source == shadowZItem) { CastShadow(2); } else - if (event.getSource() == ungroupItem) + if (source == ungroupItem) { //ungroup(); for (int i=0; i<group.selection.size(); i++) @@ -2379,179 +2388,179 @@ refreshContents(); } else - if (event.getSource() == genUVItem) + if (source == genUVItem) { GenUV(); } else - if (event.getSource() == genNormalsCADItem) + if (source == genNormalsCADItem) { GenNormals(true); } else - if (event.getSource() == genNormalsMESHItem) + if (source == genNormalsMESHItem) { GenNormals(true); // TODO } else - if (event.getSource() == genNormalsORGANItem) + if (source == genNormalsORGANItem) { GenNormals(false); } else - if (event.getSource() == genNormalsMINEItem) + if (source == genNormalsMINEItem) { GenNormalsMINE(); } else - if (event.getSource() == stripifyItem) + if (source == stripifyItem) { Stripify(); } else - if (event.getSource() == unstripifyItem) + if (source == unstripifyItem) { Unstripify(); } else - if (event.getSource() == trimItem) + if (source == trimItem) { Trim(); } else - if (event.getSource() == untrimItem) + if (source == untrimItem) { Untrim(); } else - if (event.getSource() == clearColorsItem) + if (source == clearColorsItem) { ClearColors(); } else - if (event.getSource() == clearMaterialsItem) + if (source == clearMaterialsItem) { ClearMaterials(); } else - if (event.getSource() == liveleavesItem) + if (source == liveleavesItem) { LiveLeaves(true); } else - if (event.getSource() == unliveleavesItem) + if (source == unliveleavesItem) { LiveLeaves(false); } else - if (event.getSource() == supportleavesItem) + if (source == supportleavesItem) { SupportLeaves(true); } else - if (event.getSource() == unsupportleavesItem) + if (source == unsupportleavesItem) { SupportLeaves(false); } else - if (event.getSource() == hideleavesItem) + if (source == hideleavesItem) { HideLeaves(true); } else - if (event.getSource() == showleavesItem) + if (source == showleavesItem) { HideLeaves(false); } else - if (event.getSource() == markleavesItem) + if (source == markleavesItem) { MarkLeaves(true); } else - if (event.getSource() == unmarkleavesItem) + if (source == unmarkleavesItem) { MarkLeaves(false); } else - if (event.getSource() == flipVItem) + if (source == flipVItem) { FlipV(true); } else - if (event.getSource() == unflipVItem) + if (source == unflipVItem) { FlipV(false); } else - if (event.getSource() == lowTexturesItem) + if (source == lowTexturesItem) { SetTexRes(0); } else - if (event.getSource() == normalTexturesItem) + if (source == normalTexturesItem) { SetTexRes(1); } else - if (event.getSource() == highTexturesItem) + if (source == highTexturesItem) { SetTexRes(2); } else - if (event.getSource() == veryhighTexturesItem) + if (source == veryhighTexturesItem) { SetTexRes(3); } else - if (event.getSource() == maxTexturesItem) + if (source == maxTexturesItem) { SetTexRes(4); } else - if (event.getSource() == panoTexturesItem) + if (source == panoTexturesItem) { SetTexRes(5); } else - if (event.getSource() == reverseNormalsItem) + if (source == reverseNormalsItem) { ReverseNormals(); } else - if (event.getSource() == parseverticesItem) + if (source == parseverticesItem) { ParseVertices(); } else - if (event.getSource() == textureFieldItem) + if (source == textureFieldItem) { TextureVertices(); } else - if (event.getSource() == alignItem) + if (source == alignItem) { Align(); } else - if (event.getSource() == mirrorItem) + if (source == mirrorItem) { MirrorPoses(); } else - if (event.getSource() == reduceMorphItem) + if (source == reduceMorphItem) { MeshReduction(false); } else - if (event.getSource() == reduce34MorphItem) + if (source == reduce34MorphItem) { MeshReduction(true); } else - if (event.getSource() == reverseTrianglesItem) + if (source == reverseTrianglesItem) { ReverseTriangles(); } else - if (event.getSource() == reduceMeshItem) + if (source == reduceMeshItem) { ReduceMesh(false); } else - if (event.getSource() == reduce34MeshItem) + if (source == reduce34MeshItem) { ReduceMesh(true); } else - if (event.getSource() == increaseMeshItem) + if (source == increaseMeshItem) { IncreaseMesh(); } else - if (event.getSource() == clipMeshItem) + if (source == clipMeshItem) { ClipMesh(); } else - if (event.getSource() == smoothMeshItem) + if (source == smoothMeshItem) { SmoothMesh(); } else - if (event.getSource() == transformgeometryItem) + if (source == transformgeometryItem) { TransformGeometry(); } else - if (event.getSource() == resetTransformItem) + if (source == resetTransformItem) { ResetTransform(); } else - if (event.getSource() == resetCentroidItem) + if (source == resetCentroidItem) { ResetCentroid(); } else - if (event.getSource() == resetParentItem) + if (source == resetParentItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2561,7 +2570,7 @@ refreshContents(); } else - if (event.getSource() == repairParentItem) + if (source == repairParentItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2575,7 +2584,7 @@ refreshContents(); } else - if (event.getSource() == repairShadowItem) + if (source == repairShadowItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2589,7 +2598,7 @@ refreshContents(); } else - if (event.getSource() == sortbysizeItem) + if (source == sortbysizeItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2601,7 +2610,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == sortbynameItem) + if (source == sortbynameItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2613,7 +2622,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == attachPigmentItem) + if (source == attachPigmentItem) { String texture = GetFile("Attach pigment"); Object3D obj; @@ -2625,7 +2634,7 @@ refreshContents(); } else - if (event.getSource() == detachPigmentItem) + if (source == detachPigmentItem) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2636,7 +2645,7 @@ refreshContents(); } else - if (event.getSource() == attachBumpItem) + if (source == attachBumpItem) { String texture = GetFile("Attach bump"); Object3D obj; @@ -2648,7 +2657,7 @@ refreshContents(); } else - if (event.getSource() == detachBumpItem) + if (source == detachBumpItem) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2659,7 +2668,7 @@ refreshContents(); } else - if (event.getSource() == pigmentBumpItem) + if (source == pigmentBumpItem) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2670,158 +2679,195 @@ refreshContents(); } else - if (event.getSource() == flashSelectionButton) + if (source == flashSelectionButton) { CameraPane.flash = true; refreshContents(); } else - if (event.getSource() == oneButton) + if (source == oneButton) { } else - if (event.getSource() == twoButton) + if (source == twoButton) { radio.layout = twoButton; // bug //gridPanel.setDividerLocation(1.0); //bigPanel.setDividerLocation(0.0); - bigThree.remove(scenePanel); - bigThree.remove(centralPanel); - bigThree.remove(XYZPanel); - aWindowConstraints.gridx = 0; - aWindowConstraints.gridy = 0; - aWindowConstraints.gridwidth = 1; - // aConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - aWindowConstraints.weightx = 0; - aWindowConstraints.weighty = 1; - //bigThree.add(jtp, aWindowConstraints); - aWindowConstraints.weightx = 1; - aWindowConstraints.gridwidth = 3; - // aConstraints.gridheight = 3; - aWindowConstraints.gridx = 1; - aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(centralPanel, aWindowConstraints); - aWindowConstraints.weightx = 0; - aWindowConstraints.gridx = 4; - aWindowConstraints.gridwidth = 1; - // aConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - //bigThree.add(XYZPanel, aWindowConstraints); - bigThree.revalidate(); +// bigThree.remove(scenePanel); +// bigThree.remove(centralPanel); +// bigThree.remove(XYZPanel); +// aWindowConstraints.gridx = 0; +// aWindowConstraints.gridy = 0; +// aWindowConstraints.gridwidth = 1; +// // aConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// aWindowConstraints.weightx = 0; +// aWindowConstraints.weighty = 1; +// //bigThree.add(jtp, aWindowConstraints); +// aWindowConstraints.weightx = 1; +// aWindowConstraints.gridwidth = 3; +// // aConstraints.gridheight = 3; +// aWindowConstraints.gridx = 1; +// aWindowConstraints.fill = GridBagConstraints.BOTH; +// bigThree.add(centralPanel, aWindowConstraints); +// aWindowConstraints.weightx = 0; +// aWindowConstraints.gridx = 4; +// aWindowConstraints.gridwidth = 1; +// // aConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// //bigThree.add(XYZPanel, aWindowConstraints); +// scenePanel.setVisible(false); +// centralPanel.setVisible(true); +// XYZPanel.setVisible(false); + bigThree.ClearUI(); + bigThree.addComponent(centralPanel); + bigThree.FlushUI(); } else - if (event.getSource() == threeButton) + if (source == threeButton) { radio.layout = threeButton; - bigThree.remove(scenePanel); - bigThree.remove(centralPanel); - bigThree.remove(XYZPanel); - aWindowConstraints.gridx = 0; - aWindowConstraints.gridy = 0; - aWindowConstraints.gridwidth = 1; - // aConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - aWindowConstraints.weightx = 0; - aWindowConstraints.weighty = 1; - //bigThree.add(jtp, aWindowConstraints); - aWindowConstraints.weightx = 1; - aWindowConstraints.gridwidth = 3; - // aConstraints.gridheight = 3; - aWindowConstraints.gridx = 1; - aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(centralPanel, aWindowConstraints); - aWindowConstraints.weightx = 0; - aWindowConstraints.gridx = 4; - aWindowConstraints.gridwidth = 1; - // aConstraints.gridheight = 3; - aConstraints.fill = GridBagConstraints.VERTICAL; - bigThree.add(XYZPanel, aWindowConstraints); - bigThree.revalidate(); + +// bigThree.remove(scenePanel); +// bigThree.remove(centralPanel); +// bigThree.remove(XYZPanel); +// aWindowConstraints.gridx = 0; +// aWindowConstraints.gridy = 0; +// aWindowConstraints.gridwidth = 1; +// // aConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// aWindowConstraints.weightx = 0; +// aWindowConstraints.weighty = 1; +// //bigThree.add(jtp, aWindowConstraints); +// aWindowConstraints.weightx = 1; +// aWindowConstraints.gridwidth = 3; +// // aConstraints.gridheight = 3; +// aWindowConstraints.gridx = 1; +// aWindowConstraints.fill = GridBagConstraints.BOTH; +// bigThree.add(centralPanel, aWindowConstraints); +// aWindowConstraints.weightx = 0; +// aWindowConstraints.gridx = 4; +// aWindowConstraints.gridwidth = 1; +// // aConstraints.gridheight = 3; +// aConstraints.fill = GridBagConstraints.VERTICAL; +// bigThree.add(XYZPanel, aWindowConstraints); +// bigThree.validate(); +// scenePanel.setVisible(false); +// centralPanel.setVisible(true); +// XYZPanel.setVisible(true); + bigThree.ClearUI(); + bigThree.addComponent(centralPanel); + bigThree.addComponent(XYZPanel); + bigThree.FlushUI(); } else - if (event.getSource() == fourButton) + if (source == fourButton) { radio.layout = fourButton; - bigThree.remove(scenePanel); - bigThree.remove(centralPanel); - bigThree.remove(XYZPanel); - aWindowConstraints.gridx = 0; - aWindowConstraints.gridy = 0; - aWindowConstraints.gridwidth = 1; - // aWindowConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.BOTH; - aWindowConstraints.weightx = 1; - aWindowConstraints.weighty = 1; - bigThree.add(scenePanel, aWindowConstraints); - aWindowConstraints.weightx = 1; - aWindowConstraints.gridwidth = 3; - // aConstraints.gridheight = 3; - aWindowConstraints.gridx = 1; - aWindowConstraints.fill = GridBagConstraints.BOTH; - //bigThree.add(cameraPanel, aWindowConstraints); - aWindowConstraints.weightx = 0; - aWindowConstraints.gridx = 4; - aWindowConstraints.gridwidth = 1; - // aWindowConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - //bigThree.add(XYZPanel, aWindowConstraints); - bigThree.revalidate(); + +// bigThree.remove(scenePanel); +// bigThree.remove(centralPanel); +// bigThree.remove(XYZPanel); +// aWindowConstraints.gridx = 0; +// aWindowConstraints.gridy = 0; +// aWindowConstraints.gridwidth = 1; +// // aWindowConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.BOTH; +// aWindowConstraints.weightx = 1; +// aWindowConstraints.weighty = 1; +// bigThree.add(scenePanel, aWindowConstraints); +// aWindowConstraints.weightx = 1; +// aWindowConstraints.gridwidth = 3; +// // aConstraints.gridheight = 3; +// aWindowConstraints.gridx = 1; +// aWindowConstraints.fill = GridBagConstraints.BOTH; +// //bigThree.add(cameraPanel, aWindowConstraints); +// aWindowConstraints.weightx = 0; +// aWindowConstraints.gridx = 4; +// aWindowConstraints.gridwidth = 1; +// // aWindowConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// //bigThree.add(XYZPanel, aWindowConstraints); +// bigThree.validate(); +// scenePanel.setVisible(true); +// centralPanel.setVisible(false); +// XYZPanel.setVisible(false); + bigThree.ClearUI(); + bigThree.addComponent(scenePanel); + bigThree.FlushUI(); } else - if (event.getSource() == sixButton) + if (source == sixButton) { radio.layout = sixButton; - bigThree.remove(scenePanel); - bigThree.remove(centralPanel); - bigThree.remove(XYZPanel); - aWindowConstraints.gridx = 0; - aWindowConstraints.gridy = 0; - aWindowConstraints.gridwidth = 1; - // aConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - aWindowConstraints.weightx = 0; - aWindowConstraints.weighty = 1; - bigThree.add(scenePanel, aWindowConstraints); - aWindowConstraints.weightx = 1; - aWindowConstraints.gridwidth = 3; - // aWindowConstraints.gridheight = 3; - aWindowConstraints.gridx = 1; - aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(centralPanel, aWindowConstraints); - aWindowConstraints.weightx = 0; - aWindowConstraints.gridx = 4; - aWindowConstraints.gridwidth = 1; - // aWindowConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - //bigThree.add(XYZPanel, aConstraints); - bigThree.revalidate(); + +// bigThree.remove(scenePanel); +// bigThree.remove(centralPanel); +// bigThree.remove(XYZPanel); +// aWindowConstraints.gridx = 0; +// aWindowConstraints.gridy = 0; +// aWindowConstraints.gridwidth = 1; +// // aConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// aWindowConstraints.weightx = 0; +// aWindowConstraints.weighty = 1; +// bigThree.add(scenePanel, aWindowConstraints); +// aWindowConstraints.weightx = 1; +// aWindowConstraints.gridwidth = 3; +// // aWindowConstraints.gridheight = 3; +// aWindowConstraints.gridx = 1; +// aWindowConstraints.fill = GridBagConstraints.BOTH; +// bigThree.add(centralPanel, aWindowConstraints); +// aWindowConstraints.weightx = 0; +// aWindowConstraints.gridx = 4; +// aWindowConstraints.gridwidth = 1; +// // aWindowConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// //bigThree.add(XYZPanel, aConstraints); +// bigThree.validate(); +// scenePanel.setVisible(true); +// centralPanel.setVisible(true); +// XYZPanel.setVisible(false); + bigThree.ClearUI(); + bigThree.addComponent(scenePanel); + bigThree.addComponent(centralPanel); + bigThree.FlushUI(); } else - if (event.getSource() == sevenButton) + if (source == sevenButton) { radio.layout = sevenButton; - bigThree.remove(scenePanel); - bigThree.remove(centralPanel); - bigThree.remove(XYZPanel); - aWindowConstraints.gridx = 0; - aWindowConstraints.gridy = 0; - aWindowConstraints.gridwidth = 1; - // aWindowConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - aWindowConstraints.weightx = 0; - aWindowConstraints.weighty = 1; - bigThree.add(scenePanel, aWindowConstraints); - aWindowConstraints.weightx = 1; - aWindowConstraints.gridwidth = 3; - // aWindowConstraints.gridheight = 3; - aWindowConstraints.gridx = 1; - aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(centralPanel, aWindowConstraints); - aWindowConstraints.weightx = 0; - aWindowConstraints.gridx = 4; - aWindowConstraints.gridwidth = 1; - // aConstraints.gridheight = 3; - aWindowConstraints.fill = GridBagConstraints.VERTICAL; - bigThree.add(XYZPanel, aWindowConstraints); - bigThree.revalidate(); + +// bigThree.remove(scenePanel); +// bigThree.remove(centralPanel); +// bigThree.remove(XYZPanel); +// aWindowConstraints.gridx = 0; +// aWindowConstraints.gridy = 0; +// aWindowConstraints.gridwidth = 1; +// // aWindowConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// aWindowConstraints.weightx = 0; +// aWindowConstraints.weighty = 1; +// bigThree.add(scenePanel, aWindowConstraints); +// aWindowConstraints.weightx = 1; +// aWindowConstraints.gridwidth = 3; +// // aWindowConstraints.gridheight = 3; +// aWindowConstraints.gridx = 1; +// aWindowConstraints.fill = GridBagConstraints.BOTH; +// bigThree.add(centralPanel, aWindowConstraints); +// aWindowConstraints.weightx = 0; +// aWindowConstraints.gridx = 4; +// aWindowConstraints.gridwidth = 1; +// // aConstraints.gridheight = 3; +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; +// bigThree.add(XYZPanel, aWindowConstraints); +// bigThree.validate(); +// scenePanel.setVisible(true); +// centralPanel.setVisible(true); +// XYZPanel.setVisible(true); + bigThree.ClearUI(); + bigThree.addComponent(scenePanel); + bigThree.addComponent(centralPanel); + bigThree.addComponent(XYZPanel); + bigThree.FlushUI(); } else - if (event.getSource() == rootButton) + if (source == rootButton) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2833,7 +2879,7 @@ refreshContents(true); } else - if (event.getSource() == closeButton) + if (source == closeButton) { //System.out.println("CLOSE: " + buttonGroup.getSelection()); cRadio ab; @@ -2854,11 +2900,11 @@ } refreshContents(true); } else - if (event.getSource() == editItem || event.getSource() == editButton) + if (source == editItem || source == editButton) { EditSelection(false); } else - if (event.getSource() == uneditButton) + if (source == uneditButton) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2875,7 +2921,7 @@ //objEditor.ResetSliders(); refreshContents(true); } else - if (event.getSource() == clearPanelButton) + if (source == clearPanelButton) { assert(copy == group); //copy.ClearUI(); @@ -2886,7 +2932,7 @@ listUI.clear(); refreshContents(true); } else - if (event.getSource() == allParamsButton) + if (source == allParamsButton) { assert(copy == group); @@ -2907,19 +2953,19 @@ refreshContents(true); } else - if (event.getSource() == unselectButton) + if (source == unselectButton) { objEditor.jTree.clearSelection(); // ?? oct 2012 GrafreeD.clipboard.clear(); objEditor.ResetSliders(); refreshContents(true); } else - if(event.getSource() instanceof cRadio) + if(source instanceof cRadio) { group.parent = keepparent; group.attributes = 0; //group.editWindow = null; - /*cRadio*/ radio = (cRadio)event.getSource(); + /*cRadio*/ radio = (cRadio)source; Object3D obj = radio.GetObject(); System.out.println("Edit " + obj); if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) -- Gitblit v1.6.2