From c209bbe1cf788c9af3dcffea7667c830170a3f1f Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Wed, 01 May 2019 20:30:51 -0400 Subject: [PATCH] Complete advanced mode. --- GroupEditor.java | 1090 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 596 insertions(+), 494 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index b72085f..56e3aff 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -12,6 +12,7 @@ import com.jme.math.Vector3f; import com.jme.renderer.ColorRGBA; +import grafeme.ui.*; //import buoy.widget.BFileChooser; class GroupEditor extends ObjEditor implements //iParse, //iCallBack, @@ -149,6 +150,8 @@ void SetupMenu2(ObjEditor oe) { + if (Globals.ADVANCED) + { oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); //cameraMenu.add(switchItem = new MenuItem("Reverse View")); @@ -160,36 +163,48 @@ lookAtItem.addActionListener(this); //lookFromItem.addActinoListener(this); //switchItem.addActionListener(this); + } + Menu menu; oe.menuBar.add(menu = new Menu("Edit")); //editItem = menu.add(new MenuItem("Edit")); //editItem.addActionListener(this); duplicateItem = menu.add(new MenuItem("Duplicate")); duplicateItem.addActionListener(this); - menu.add("-"); - cloneItem = menu.add(new MenuItem("Clone")); - cloneItem.addActionListener(this); - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); - cloneSupportItem.addActionListener(this); - menu.add("-"); cutItem = menu.add(new MenuItem("Cut")); cutItem.addActionListener(this); copyItem = menu.add(new MenuItem("Copy")); copyItem.addActionListener(this); pasteItem = menu.add(new MenuItem("Paste")); pasteItem.addActionListener(this); + menu.add("-"); + cloneItem = menu.add(new MenuItem("Clone")); + cloneItem.addActionListener(this); + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); + cloneSupportItem.addActionListener(this); + menu.add("-"); + pasteIntoItem = menu.add(new MenuItem("Paste into")); + pasteIntoItem.addActionListener(this); pasteLinkItem = menu.add(new MenuItem("Paste link")); pasteLinkItem.addActionListener(this); pasteCloneItem = menu.add(new MenuItem("Paste clone")); pasteCloneItem.addActionListener(this); // pasteExpandItem = menu.add(new MenuItem("Paste expand")); // pasteExpandItem.addActionListener(this); + menu.add("-"); clearItem = menu.add(new MenuItem("Clear")); clearItem.addActionListener(this); + + if (Globals.ADVANCED) + { + // Deletes the cameras... clearAllItem = menu.add(new MenuItem("Clear All")); clearAllItem.addActionListener(this); + } oe.menuBar.add(menu = new Menu("Setting")); + if (Globals.ADVANCED) + { resetMeshItem = menu.add(new MenuItem("Reset All")); resetMeshItem.addActionListener(this); stepAllItem = menu.add(new MenuItem("Step All")); @@ -199,6 +214,7 @@ resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); resetreferencesItem.addActionListener(this); menu.add("-"); + } overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); overwriteGeoItem.addActionListener(this); overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); @@ -210,19 +226,26 @@ overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); overwriteUVItem.addActionListener(this); menu.add("-"); + if (Globals.ADVANCED) + { generateMeshItem = menu.add(new MenuItem("Generate Meshes")); generateMeshItem.addActionListener(this); poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); poseMeshItem.addActionListener(this); menu.add("-"); + } resetsupportItem = menu.add(new MenuItem("Reset support")); resetsupportItem.addActionListener(this); linkverticesItem = menu.add(new MenuItem("Link to Support")); linkverticesItem.addActionListener(this); relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); relinkverticesItem.addActionListener(this); + + if (Globals.ADVANCED) + { setMasterItem = menu.add(new MenuItem("Set Master Mesh")); setMasterItem.addActionListener(this); + } oe.menuBar.add(menu = new Menu("Group")); grabItem = menu.add(new MenuItem("Grab")); @@ -233,27 +256,31 @@ frontItem.addActionListener(this); compositeItem = menu.add(new MenuItem("Composite")); compositeItem.addActionListener(this); - hideItem = menu.add(new MenuItem("Hide")); + hideItem = menu.add(new MenuItem("Hidden Group")); hideItem.addActionListener(this); ungroupItem = menu.add(new MenuItem("Ungroup")); ungroupItem.addActionListener(this); menu.add("-"); - randomItem = menu.add(new MenuItem("Random")); + randomItem = menu.add(new MenuItem("Switch node")); randomItem.addActionListener(this); - physicsItem = menu.add(new MenuItem("Physics")); - physicsItem.addActionListener(this); - frameselectorItem = menu.add(new MenuItem("Frame Selector")); - frameselectorItem.addActionListener(this); switchGeoItem = menu.add(new MenuItem("Switch Geometry")); switchGeoItem.addActionListener(this); switchTransfoItem = menu.add(new MenuItem("Switch Transform")); switchTransfoItem.addActionListener(this); - morphItem = menu.add(new MenuItem("Morph")); + morphItem = menu.add(new MenuItem("Morph Group")); morphItem.addActionListener(this); + + if (Globals.ADVANCED) + { + physicsItem = menu.add(new MenuItem("Physics")); + physicsItem.addActionListener(this); + frameselectorItem = menu.add(new MenuItem("Frame Selector")); + frameselectorItem.addActionListener(this); scriptNodeItem = menu.add(new MenuItem("Script Node")); scriptNodeItem.addActionListener(this); cameraItem = menu.add(new MenuItem("Camera")); cameraItem.addActionListener(this); + } oe.menuBar.add(menu = new Menu("Object")); textureItem = menu.add(new MenuItem("Texture")); @@ -268,15 +295,18 @@ shadowYItem.addActionListener(this); shadowZItem = menu.add(new MenuItem("Shadow Z")); shadowZItem.addActionListener(this); + if (Globals.ADVANCED) + { linkerItem = menu.add(new MenuItem("Linker")); linkerItem.addActionListener(this); - templateItem = menu.add(new MenuItem("Template")); - templateItem.addActionListener(this); attributeItem = menu.add(new MenuItem("Attribute")); attributeItem.addActionListener(this); + templateItem = menu.add(new MenuItem("Template")); + templateItem.addActionListener(this); pointflowItem = menu.add(new MenuItem("Point Flow")); pointflowItem.addActionListener(this); menu.add("-"); + } resetTransformItem = menu.add(new MenuItem("Reset Transform")); resetTransformItem.addActionListener(this); resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); @@ -293,8 +323,11 @@ genNormalsCADItem.addActionListener(this); genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); genNormalsMESHItem.addActionListener(this); + if (Globals.ADVANCED) + { genNormalsMINEItem = menu.add(new MenuItem("My Normals")); genNormalsMINEItem.addActionListener(this); + } stripifyItem = menu.add(new MenuItem("Stripify")); stripifyItem.addActionListener(this); unstripifyItem = menu.add(new MenuItem("Unstripify")); @@ -316,10 +349,14 @@ reduce34MeshItem.addActionListener(this); increaseMeshItem = menu.add(new MenuItem("Increase mesh")); increaseMeshItem.addActionListener(this); - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); - smoothMeshItem.addActionListener(this); clipMeshItem = menu.add(new MenuItem("Clip mesh")); clipMeshItem.addActionListener(this); + + if (Globals.ADVANCED) + { + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); + smoothMeshItem.addActionListener(this); + } oe.menuBar.add(menu = new Menu("Attributes")); clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); @@ -329,10 +366,13 @@ liveleavesItem.addActionListener(this); unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); unliveleavesItem.addActionListener(this); + if (Globals.ADVANCED) + { supportleavesItem = menu.add(new MenuItem("Support Leaves")); supportleavesItem.addActionListener(this); unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); unsupportleavesItem.addActionListener(this); + } hideleavesItem = menu.add(new MenuItem("Hide Leaves")); hideleavesItem.addActionListener(this); showleavesItem = menu.add(new MenuItem("Show Leaves")); @@ -375,6 +415,8 @@ sortbysizeItem.addActionListener(this); sortbynameItem = menu.add(new MenuItem("Sort by name")); sortbynameItem.addActionListener(this); + if (Globals.ADVANCED) + { menu.add("-"); extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); extractGeometriesItem.addActionListener(this); @@ -384,11 +426,11 @@ shareGeometriesItem.addActionListener(this); mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); mergeGeometriesItem.addActionListener(this); + } oe.menuBar.add(menu = new Menu("Insert")); buildCreateMenu(menu); - oe.menuBar.add(menu = new Menu("Include")); importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); importGFDItem.addActionListener(this); @@ -433,176 +475,98 @@ oe.radioPanel.add(dummyButton); oe.buttonGroup.add(dummyButton); */ - aConstraints.gridy += 1; - oe.aConstraints.gridwidth = 1; - oe.aConstraints.gridx = 0; + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); liveCB.setToolTipText("Enabled animation"); liveCB.addItemListener(this); - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); + oneStepButton.setToolTipText("Animate one step forward"); + oneStepButton.addActionListener(this); + + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); 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); - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); + oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); screenfitButton.setToolTipText("Screen fit"); screenfitButton.addActionListener(this); - oe.aConstraints.gridx += 1; + // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); // screenfitpointButton.addActionListener(this); -// oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); - snapobjectButton.addActionListener(this); - snapobjectButton.setToolTipText("Snap Object"); - oe.aConstraints.gridx += 1; - //aConstraints.gridx = 0; - //aConstraints.gridy += 1; - oe.aConstraints.weighty = 0; - oe.aConstraints.gridwidth = 1; - - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); + if (Globals.ADVANCED) + { + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); + snapobjectButton.addActionListener(this); + snapobjectButton.setToolTipText("Snap Object"); + } + + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); flashSelectionButton.setToolTipText("Show selection"); flashSelectionButton.addActionListener(this); - oe.toolbarPanel.add(new cButton(" ", false)); + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); - oe.aConstraints.gridx += 1; - oe.aConstraints.weighty = 0; - oe.aConstraints.gridwidth = 1; - - // - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); + oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); twoButton.setToolTipText("Show center view only"); twoButton.addActionListener(this); - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); + oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); fourButton.addActionListener(this); fourButton.setToolTipText("Show left panel only"); - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); sixButton.setToolTipText("2-column layout left"); sixButton.addActionListener(this); - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); + 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("+|+|+")); //, oe.aConstraints); + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); sevenButton.setToolTipText("3-column layout"); sevenButton.addActionListener(this); // - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); - rootButton.setToolTipText("Edit object in new tab"); + oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); + rootButton.setToolTipText("Edit selection in new tab"); rootButton.addActionListener(this); - oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); + + oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); closeButton.setToolTipText("Close tab"); closeButton.addActionListener(this); //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); //clearButton.addActionListener(this); - oe.aConstraints.gridx += 1; - oe.aConstraints.gridx = 1; // - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); + cGridBag commandsPanel = new cGridBag(); + + commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); + editButton.setToolTipText("Edit selection"); editButton.addActionListener(this); - oe.aConstraints.gridx += 1; - oe.aConstraints.weighty = 0; - oe.aConstraints.gridwidth = 1; - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); + commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); + uneditButton.setToolTipText("Unedit selection"); uneditButton.addActionListener(this); - oe.aConstraints.gridx += 1; - oe.aConstraints.weighty = 0; - oe.aConstraints.gridwidth = 1; - - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); - clearPanelButton.addActionListener(this); - - oe.aConstraints.gridx += 1; - oe.aConstraints.weighty = 0; - oe.aConstraints.gridwidth = 1; - - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); + allParamsButton.setToolTipText("Edit all params"); allParamsButton.addActionListener(this); - oe.aConstraints.gridx += 1; - oe.aConstraints.weighty = 0; - oe.aConstraints.gridwidth = 1; - - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); + commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); + clearPanelButton.setToolTipText("Clear edit panel"); + clearPanelButton.addActionListener(this); + + commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); + unselectButton.setToolTipText("Unselect"); unselectButton.addActionListener(this); + commandsPanel.preferredHeight = 1; + + oe.treePanel.add(commandsPanel); + oe.treePanel.Return(); + // oe.aConstraints.gridx += 1; // oe.aConstraints.weighty = 0; // oe.aConstraints.gridwidth = 1; @@ -614,40 +578,37 @@ // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); // gcButton.addActionListener(this); - oe.aConstraints.gridx = 0; - oe.aConstraints.gridy += 1; - - //ctrlPanel.add(objList = new List(5, true)); - oe.aConstraints.gridwidth = 100; - // oe.aConstraints.gridheight = 100; - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; - oe.aConstraints.gridheight = 1; - oe.aConstraints.weighty = 0.5; - oe.aConstraints.gridx = 0; - JScrollPane jSP; + cGridBag jSPPanel = new cGridBag(); + + JScrollPane jSP; //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); ResetModel(); - oe.aConstraints.weighty = 0.5; - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; - oe.aConstraints.gridy += 1; - oe.aConstraints.gridwidth = 1; + + oe.treePanel.add(jSPPanel); + oe.treePanel.Return(); - oe.aConstraints.weighty = 0; - oe.aConstraints.gridwidth = 2; - - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); + cGridBag copyOptionsPanel = new cGridBag(); + + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); + colorCB.setToolTipText("Copy color when dropped"); colorCB.addItemListener(this); - oe.aConstraints.gridx += 2; - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); + + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); + materialCB.setToolTipText("Copy material when dropped"); materialCB.addItemListener(this); - oe.aConstraints.gridx += 2; - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); + + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); + textureCB.setToolTipText("Copy texture when dropped"); textureCB.addItemListener(this); - oe.aConstraints.gridx = 0; - oe.aConstraints.gridy += 1; + copyOptionsPanel.preferredHeight = 1; + oe.treePanel.add(copyOptionsPanel); + oe.treePanel.Return(); +// mainPanel.setDividerLocation(0.5); //1.0); +// mainPanel.setResizeWeight(0.5); + //jList.addListSelectionListener(this); oe.jTree.addTreeSelectionListener(this); //jTree.setRootVisible(false); @@ -669,6 +630,78 @@ radio.layout = sevenButton; oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); } + + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) + { + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); + boxCB.setToolTipText("Display bounding boxes"); + boxCB.addItemListener(this); + + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); + zoomBoxCB.addItemListener(this); + + if (Globals.ADVANCED) + { + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); + supportCB.setToolTipText("Enable rigging"); + supportCB.addItemListener(this); + + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); + // localCB.addItemListener(this); + + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); + crowdCB.setToolTipText("Used for crowds"); + crowdCB.addItemListener(this); + + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); + smoothCB.setToolTipText("Snapping delay"); + smoothCB.addItemListener(this); + + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); + slowCB.setToolTipText("Smooth interpolation"); + slowCB.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); + + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); + oeilCB.addItemListener(this); + + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); + lookAtCB.setToolTipText("Look-at target"); + lookAtCB.addItemListener(this); + + } + + cGridBag fill = new cGridBag(); + + fill.preferredHeight = 200; + + panel.add(fill); + + } void EditObject(Object3D obj) { @@ -951,11 +984,11 @@ { loadClipboard(true); objEditor.jTree.setSelectionPath(destinationPath); - pasteInto(false); + pasteInto(false, false); } else { loadClipboard(false); objEditor.jTree.setSelectionPath(destinationPath); - pasteInto(false); // true); // ??? + pasteInto(false, false); // true); // ??? } } public void dropActionChanged(DropTargetDragEvent dtde) @@ -1077,27 +1110,33 @@ kleinItem.addActionListener(this); particleItem = menu.add(new MenuItem("Particle system")); particleItem.addActionListener(this); + if (Globals.ADVANCED) + { ragdollItem = menu.add(new MenuItem("Rag Walk")); ragdollItem.addActionListener(this); ragdoll2Item = menu.add(new MenuItem("Rag Fall")); ragdoll2Item.addActionListener(this); + } menu.add("-"); - meshItem = menu.add(new MenuItem("Mesh")); + meshItem = menu.add(new MenuItem("Dynamic Mesh")); meshItem.addActionListener(this); // meshGroupItem = menu.add(new MenuItem("Mesh Group")); // meshGroupItem.addActionListener(this); + if (Globals.ADVANCED) + { springItem = menu.add(new MenuItem("Spring")); springItem.addActionListener(this); flagItem = menu.add(new MenuItem("Flag")); flagItem.addActionListener(this); - bezierItem = menu.add(new MenuItem("Patch")); - bezierItem.addActionListener(this); - checkerItem = menu.add(new MenuItem("Checker")); - checkerItem.addActionListener(this); blobItem = menu.add(new MenuItem("Blob")); blobItem.addActionListener(this); latheItem = menu.add(new MenuItem("Lathe")); latheItem.addActionListener(this); + } + bezierItem = menu.add(new MenuItem("Bezier Patch")); + bezierItem.addActionListener(this); + overlayItem = menu.add(new MenuItem("Overlay")); + overlayItem.addActionListener(this); lightItem = menu.add(new MenuItem("Light")); lightItem.addActionListener(this); menu.add("-"); @@ -1107,25 +1146,26 @@ loopItem.addActionListener(this); doubleItem = menu.add(new MenuItem("Fork")); doubleItem.addActionListener(this); + if (Globals.ADVANCED) + { tripleItem = menu.add(new MenuItem("Trident")); tripleItem.addActionListener(this); + } } void buildToolsMenu(Menu menu) { menu.add(animationItem = new CheckboxMenuItem("Animation...")); animationItem.addItemListener(this); - animationItem.setState(CameraPane.ANIMATION); + animationItem.setState(Globals.ANIMATION); menu.add("-"); parseverticesItem = menu.add(new MenuItem("Multiplicity")); parseverticesItem.addActionListener(this); textureFieldItem = menu.add(new MenuItem("Texture Field")); textureFieldItem.addActionListener(this); - alignItem = menu.add(new MenuItem("Align")); + alignItem = menu.add(new MenuItem("Align Object")); alignItem.addActionListener(this); - mirrorItem = menu.add(new MenuItem("Mirror Poses")); - mirrorItem.addActionListener(this); reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); reduceMorphItem.addActionListener(this); reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); @@ -1133,8 +1173,12 @@ menu.add(computeAOItem = new MenuItem("Compute AO")); computeAOItem.addActionListener(this); - menu.add("-"); + if (Globals.ADVANCED) + { + mirrorItem = menu.add(new MenuItem("Mirror Poses")); + mirrorItem.addActionListener(this); + menu.add("-"); menu.add(memoryItem = new MenuItem("Memory Usage")); memoryItem.addActionListener(this); menu.add(analyzeItem = new MenuItem("Analyze")); @@ -1157,6 +1201,7 @@ menu.add("-"); menu.add(editScriptItem = new MenuItem("Edit Script...")); editScriptItem.addActionListener(this); + } } void ScreenFit() @@ -1510,6 +1555,7 @@ // public void actionPerformed(ActionEvent event) // , Object arg) { + Object source = event.getSource(); /* if (event.getSource() == nameField) { @@ -1521,11 +1567,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 +1580,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 +1605,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 +1625,7 @@ } else /* */ - if (event.getSource() == heightFieldItem) + if (source == heightFieldItem) { Object3D obj = new Object3D(); @@ -1617,31 +1663,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 +1695,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 == overlayItem) { /* Object3D obj = new BezierSurface(5,8); @@ -1672,7 +1718,7 @@ */ makeSomething(new Checker()); } else - if (event.getSource() == meshItem) + if (source == meshItem) { Object3D itemtomake = new Object3D(); Object3D child; @@ -1693,35 +1739,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 +1779,7 @@ } else */ - if (event.getSource() == superLoopItem) + if (source == superLoopItem) { Composite g = new cGroup(); for (int i=0; i<15; i++) @@ -1755,7 +1801,7 @@ group(g); } else - if (event.getSource() == loopItem) + if (source == loopItem) { Composite csg = new GroupLeaf(); csg.count = 5; @@ -1764,7 +1810,7 @@ csg.addChild(child); child.addChild(csg); } else - if (event.getSource() == doubleItem) + if (source == doubleItem) { Composite csg = new GroupLeaf(); csg.count = 5; @@ -1776,7 +1822,7 @@ csg.addChild(child); child.addChild(csg); } else - if (event.getSource() == tripleItem) + if (source == tripleItem) { Composite csg = new GroupLeaf(); csg.count = 4; @@ -1792,70 +1838,75 @@ 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 == oneStepButton) + { + Globals.ONESTEP = true; + cameraView.repaint(); + } else + 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 +1917,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 +1937,66 @@ } 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 == pasteIntoItem) { - pasteInto(false); + pasteInto(true, false); } else - if (event.getSource() == pasteCloneItem) + if (source == pasteLinkItem) { - pasteInto(true); + pasteInto(false, false); } else - if (event.getSource() == pasteExpandItem) + if (source == pasteCloneItem) + { + pasteInto(true, true); + } else + 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 +2016,7 @@ Overwrite(dropAttributes); } - if (event.getSource() == overwriteGeoItem) + if (source == overwriteGeoItem) { Overwrite(Object3D.GEOMETRY); // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) @@ -1978,7 +2033,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 +2044,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == extractGeometriesItem) + if (source == extractGeometriesItem) { boolean one = false; @@ -2016,7 +2071,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == cloneGeometriesItem) + if (source == cloneGeometriesItem) { boolean one = false; @@ -2042,7 +2097,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == shareGeometriesItem) + if (source == shareGeometriesItem) { boolean one = false; @@ -2072,7 +2127,7 @@ refreshContents(); } } else - if (event.getSource() == mergeGeometriesItem) + if (source == mergeGeometriesItem) { boolean one = false; @@ -2102,7 +2157,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == linkverticesItem) + if (source == linkverticesItem) { // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) // { @@ -2125,38 +2180,38 @@ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); for (int i=0; i<group.selection.size(); i++) { - boolean random = CameraPane.RANDOM; - CameraPane.RANDOM = false; // parse all random nodes + boolean random = CameraPane.SWITCH; + CameraPane.SWITCH = false; // parse all random nodes group.selection.get(i).linkVerticesThis(content); // group.selection.get(i).setMasterThis(content); // should be identity - CameraPane.RANDOM = random; + CameraPane.SWITCH = random; } Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); refreshContents(); } } else - if (event.getSource() == resetsupportItem) + if (source == resetsupportItem) { for (int i=0; i<group.selection.size(); i++) { - boolean random = CameraPane.RANDOM; - CameraPane.RANDOM = false; // parse all random nodes + boolean random = CameraPane.SWITCH; + CameraPane.SWITCH = false; // parse all random nodes group.selection.get(i).linkVerticesThis(null); - CameraPane.RANDOM = random; + CameraPane.SWITCH = random; } refreshContents(); } else - if (event.getSource() == relinkverticesItem) + if (source == relinkverticesItem) { - boolean random = CameraPane.RANDOM; - CameraPane.RANDOM = false; // parse all random nodes + boolean random = CameraPane.SWITCH; + CameraPane.SWITCH = false; // parse all random nodes group.selection.RelinkToSupport(); - CameraPane.RANDOM = random; + CameraPane.SWITCH = random; refreshContents(); } else - if (event.getSource() == resetreferencesItem) + if (source == resetreferencesItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2165,7 +2220,7 @@ refreshContents(); } else - if (event.getSource() == setMasterItem) + if (source == setMasterItem) { if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) { @@ -2178,7 +2233,7 @@ refreshContents(); } } else - if (event.getSource() == poseMeshItem) + if (source == poseMeshItem) { if (group.selection.size() == 1) { @@ -2197,19 +2252,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 +2272,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"; + random.name = random.get(0).name + "Switch"; } 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 +2323,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == switchGeoItem) + if (source == switchGeoItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2280,7 +2335,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == switchTransfoItem) + if (source == switchTransfoItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2292,7 +2347,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == morphItem) + if (source == morphItem) { for (int i=0; i<group.selection.size(); i++) { @@ -2304,7 +2359,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == scriptNodeItem) + if (source == scriptNodeItem) { boolean atleastone = false; @@ -2343,31 +2398,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 +2434,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 +2616,7 @@ refreshContents(); } else - if (event.getSource() == repairParentItem) + if (source == repairParentItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2575,7 +2630,7 @@ refreshContents(); } else - if (event.getSource() == repairShadowItem) + if (source == repairShadowItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2589,7 +2644,7 @@ refreshContents(); } else - if (event.getSource() == sortbysizeItem) + if (source == sortbysizeItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2601,7 +2656,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == sortbynameItem) + if (source == sortbynameItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -2613,7 +2668,7 @@ ResetModel(); refreshContents(); } else - if (event.getSource() == attachPigmentItem) + if (source == attachPigmentItem) { String texture = GetFile("Attach pigment"); Object3D obj; @@ -2625,7 +2680,7 @@ refreshContents(); } else - if (event.getSource() == detachPigmentItem) + if (source == detachPigmentItem) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2636,7 +2691,7 @@ refreshContents(); } else - if (event.getSource() == attachBumpItem) + if (source == attachBumpItem) { String texture = GetFile("Attach bump"); Object3D obj; @@ -2648,7 +2703,7 @@ refreshContents(); } else - if (event.getSource() == detachBumpItem) + if (source == detachBumpItem) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2659,7 +2714,7 @@ refreshContents(); } else - if (event.getSource() == pigmentBumpItem) + if (source == pigmentBumpItem) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2670,158 +2725,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.add(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.add(centralPanel); + bigThree.add(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.add(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.add(scenePanel); + bigThree.add(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.add(scenePanel); + bigThree.add(centralPanel); + bigThree.add(XYZPanel); + bigThree.FlushUI(); } else - if (event.getSource() == rootButton) + if (source == rootButton) { Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2833,7 +2925,7 @@ refreshContents(true); } else - if (event.getSource() == closeButton) + if (source == closeButton) { //System.out.println("CLOSE: " + buttonGroup.getSelection()); cRadio ab; @@ -2854,11 +2946,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();) { @@ -2870,12 +2962,12 @@ child.editWindow = null; // ??????????? } - objEditor.ctrlPanel.revalidate(); + objEditor.ctrlPanel.FlushUI(); //objEditor.jTree.clearSelection(); //objEditor.ResetSliders(); refreshContents(true); } else - if (event.getSource() == clearPanelButton) + if (source == clearPanelButton) { assert(copy == group); //copy.ClearUI(); @@ -2886,7 +2978,7 @@ listUI.clear(); refreshContents(true); } else - if (event.getSource() == allParamsButton) + if (source == allParamsButton) { assert(copy == group); @@ -2907,19 +2999,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) @@ -3589,11 +3681,11 @@ SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); - boolean random = CameraPane.RANDOM; - CameraPane.RANDOM = false; // parse all random nodes + boolean random = CameraPane.SWITCH; + CameraPane.SWITCH = false; // parse all random nodes lowres.linkVerticesThis(null); lowres.linkVerticesThis(sn); - CameraPane.RANDOM = random; + CameraPane.SWITCH = random; System.err.flush(); @@ -4078,12 +4170,12 @@ System.err.println("info : " + child.GetPath()); } } - else - { - objEditor.SetMaterial(group); // .GetMaterial()); - objEditor.AddInfo(group, this, true); // .GetMaterial()); - System.err.println("info : " + group.GetPath()); - } +// else +// { +// objEditor.SetMaterial(group); // .GetMaterial()); +// objEditor.AddInfo(group, this, true); // .GetMaterial()); +// System.err.println("info : " + group.GetPath()); +// } objEditor.SetText(); // jan 2014 @@ -4351,7 +4443,7 @@ refreshContents(); } - void pasteInto(boolean copyit) + void pasteInto(boolean copyit, boolean clone) { // if (GrafreeD.clipboard == null) // return; @@ -4380,7 +4472,14 @@ if (copyit) { // paste(false); - CloneClipboard(false); // sept 2014 + if (clone) + { + CloneClipboard(false); // sept 2014 + } + else + { + paste(false); + } } else { @@ -4924,10 +5023,12 @@ cButton flashSelectionButton; cButton editButton; cButton uneditButton; + JCheckBox allParamsButton; cButton clearpanelButton; - cButton allParamsButton; cButton unselectButton; + cButton oneStepButton; + cButton screenfitButton; cButton screenfitpointButton; cButton snapobjectButton; @@ -4982,6 +5083,7 @@ private MenuItem mergeGeometriesItem; private MenuItem copyItem; private MenuItem pasteItem; + private MenuItem pasteIntoItem; private MenuItem pasteLinkItem; private MenuItem pasteCloneItem; private MenuItem pasteExpandItem; @@ -5079,7 +5181,7 @@ private MenuItem blobItem; private MenuItem latheItem; private MenuItem bezierItem; - private MenuItem checkerItem; + private MenuItem overlayItem; private MenuItem meshItem; // private MenuItem meshGroupItem; private MenuItem springItem; -- Gitblit v1.6.2