Merge pull request #150 from davidB/sdk_scene_addprimitives

SDK: scene add primitives (2)
experimental
normen 11 years ago
commit 2e4a7a300e
  1. 112
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometry.java
  2. 22
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometryBoxAction.java
  3. 23
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometryLineAction.java
  4. 37
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometryQuadAction.java
  5. 2
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometrySettings.java
  6. 218
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometrySettingsTopComponent.form
  7. 203
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometrySettingsTopComponent.java
  8. 29
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometrySphereAction.java

@ -1,112 +0,0 @@
/*
* Copyright (c) 2009-2010 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.jme3.gde.core.sceneexplorer.nodes.actions.impl;
import com.jme3.asset.AssetManager;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Quaternion;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Line;
import com.jme3.scene.shape.Quad;
import com.jme3.scene.shape.Sphere;
/**
*
* @author david.bernard.31
*/
public class NewGeometry {
public static Material material(AssetManager assetManaget, NewGeometrySettings cfg) {
Material mat = new Material(assetManaget, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
return mat;
}
public static Geometry box(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Box b = new Box(cfg.getBoxX(), cfg.getBoxY(), cfg.getBoxZ());
b.setMode(cfg.getBoxMode());
Geometry geom = new Geometry(cfg.getBoxName(), b);
geom.setMaterial(material(assetManager, cfg));
return geom;
}
public static Geometry sphere(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Sphere b = new Sphere(
cfg.getSphereZSamples()
, cfg.getSpherRadialSamples()
, cfg.getSphereRadius()
, cfg.getSphereUseEvenSlices()
, cfg.getSphereInterior()
);
b.setMode(cfg.getSphereMode());
Geometry geom = new Geometry(cfg.getSphereName(), b);
geom.setMaterial(material(assetManager, cfg));
return geom;
}
public static Geometry line(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Line b = new Line(cfg.getLineStart(), cfg.getLineEnd());
b.setMode(cfg.getLineMode());
Geometry geom = new Geometry(cfg.getLineName(), b);
geom.setMaterial(material(assetManager, cfg));
return geom;
}
public static Geometry quad(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Quad b = new Quad(cfg.getQuadWidth(), cfg.getQuadHeight(), cfg.getQuadFlipCoords());
b.setMode(cfg.getQuadMode());
Geometry geom = new Geometry(cfg.getQuadName(), b);
switch(cfg.getQuadPlan()) {
case XZ: {
Quaternion q = new Quaternion();
q.fromAngles((float)Math.PI/-2f, 0.0f, 0.0f);
geom.setLocalRotation(q);
break;
}
case YZ: {
Quaternion q = new Quaternion();
q.fromAngles(0.0f, (float)Math.PI/-2f, 0.0f);
geom.setLocalRotation(q);
break;
}
}
geom.setMaterial(material(assetManager, cfg));
return geom;
}
}

@ -31,11 +31,15 @@
*/
package com.jme3.gde.core.sceneexplorer.nodes.actions.impl;
import com.jme3.asset.AssetManager;
import com.jme3.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialAction;
import com.jme3.gde.core.sceneexplorer.nodes.actions.NewGeometryAction;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
/**
*
@ -50,8 +54,24 @@ public class NewGeometryBoxAction extends AbstractNewSpatialAction implements Ne
@Override
protected Spatial doCreateSpatial(Node parent) {
Geometry geom = NewGeometry.box(pm);
Geometry geom = box(pm);
parent.attachChild(geom);
return geom;
}
static Material material(AssetManager assetManaget, NewGeometrySettings cfg) {
Material mat = new Material(assetManaget, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
return mat;
}
static Geometry box(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Box b = new Box(cfg.getBoxX(), cfg.getBoxY(), cfg.getBoxZ());
b.setMode(cfg.getBoxMode());
Geometry geom = new Geometry(cfg.getBoxName(), b);
geom.setMaterial(material(assetManager, cfg));
return geom;
}
}

@ -31,11 +31,15 @@
*/
package com.jme3.gde.core.sceneexplorer.nodes.actions.impl;
import com.jme3.asset.AssetManager;
import com.jme3.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialAction;
import com.jme3.gde.core.sceneexplorer.nodes.actions.NewGeometryAction;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Line;
/**
*
@ -50,8 +54,25 @@ public class NewGeometryLineAction extends AbstractNewSpatialAction implements N
@Override
protected Spatial doCreateSpatial(Node parent) {
Geometry geom = NewGeometry.line(pm);
Geometry geom = line(pm);
parent.attachChild(geom);
return geom;
}
static Material material(AssetManager assetManaget, NewGeometrySettings cfg) {
Material mat = new Material(assetManaget, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
return mat;
}
static Geometry line(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Line b = new Line(cfg.getLineStart(), cfg.getLineEnd());
b.setMode(cfg.getLineMode());
Geometry geom = new Geometry(cfg.getLineName(), b);
geom.setMaterial(material(assetManager, cfg));
return geom;
}
}

@ -31,11 +31,16 @@
*/
package com.jme3.gde.core.sceneexplorer.nodes.actions.impl;
import com.jme3.asset.AssetManager;
import com.jme3.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialAction;
import com.jme3.gde.core.sceneexplorer.nodes.actions.NewGeometryAction;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Quaternion;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Quad;
/**
*
@ -50,8 +55,38 @@ public class NewGeometryQuadAction extends AbstractNewSpatialAction implements N
@Override
protected Spatial doCreateSpatial(Node parent) {
Geometry geom = NewGeometry.quad(pm);
Geometry geom = quad(pm);
parent.attachChild(geom);
return geom;
}
static Material material(AssetManager assetManaget, NewGeometrySettings cfg) {
Material mat = new Material(assetManaget, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
return mat;
}
static Geometry quad(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Quad b = new Quad(cfg.getQuadWidth(), cfg.getQuadHeight(), cfg.getQuadFlipCoords());
b.setMode(cfg.getQuadMode());
Geometry geom = new Geometry(cfg.getQuadName(), b);
switch(cfg.getQuadPlan()) {
case XZ: {
Quaternion q = new Quaternion();
q.fromAngles((float)Math.PI/-2f, 0.0f, 0.0f);
geom.setLocalRotation(q);
break;
}
case YZ: {
Quaternion q = new Quaternion();
q.fromAngles(0.0f, (float)Math.PI/-2f, 0.0f);
geom.setLocalRotation(q);
break;
}
}
geom.setMaterial(material(assetManager, cfg));
return geom;
}
}

@ -355,7 +355,7 @@ public class NewGeometrySettings implements Serializable, PreferenceChangeListen
}
protected Mode getMode(String baseName) {
return Mode.values()[pref.getInt(baseName, Mode.Lines.ordinal())];
return Mode.values()[pref.getInt(baseName, Mode.Triangles.ordinal())];
}
public void putMode(String baseName, Mode value) {

@ -54,23 +54,22 @@
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="boxXLabel" min="-2" max="-2" attributes="0"/>
<Component id="boxZLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="boxXSpinner" min="-2" pref="62" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="boxZSpinner" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="boxYLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="boxYSpinner" min="-2" pref="62" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
<Component id="boxZLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="boxZSpinner" min="-2" pref="62" max="-2" attributes="0"/>
<Component id="boxYSpinner" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="boxNameTextField" pref="426" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="boxModeComboBox" pref="133" max="32767" attributes="0"/>
<Component id="boxXLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="boxXSpinner" max="32767" attributes="0"/>
</Group>
<Component id="boxModeComboBox" alignment="0" pref="224" max="32767" attributes="0"/>
<Component id="boxNameTextField" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
@ -80,20 +79,25 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="boxNameTextField" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="boxModeComboBox" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="boxNameTextField" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="boxModeComboBox" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxXSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxXLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxXSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxYLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxYSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxZSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxZLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxZSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="197" max="32767" attributes="0"/>
<EmptySpace pref="233" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -185,48 +189,32 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="sphereNameTextField" max="32767" attributes="0"/>
<Component id="sphereNameTextField" max="32767" attributes="0"/>
<Component id="sphereRadiusLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="sphereModeComboBox" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sphereRadialSamplesLabel" min="-2" max="-2" attributes="0"/>
<Component id="sphereZSamplesLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="sphereUseEvenSlicesLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="sphereInteriorLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="sphereModeComboBox" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sphereZSamplesLabel" min="-2" max="-2" attributes="0"/>
<Component id="sphereZSamplesSpinner" pref="111" max="32767" attributes="0"/>
<Component id="sphereRadialSamplesSpinner" max="32767" attributes="0"/>
<Component id="sphereRadiusSpinner" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sphereRadialSamplesLabel" min="-2" max="-2" attributes="0"/>
<Component id="sphereRadiusLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sphereRadiusSpinner" alignment="0" min="-2" pref="62" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="sphereRadialSamplesSpinner" min="-2" pref="62" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="sphereUseEvenSlicesLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="sphereZSamplesSpinner" min="-2" pref="62" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="144" max="-2" attributes="0"/>
<Component id="sphereInteriorLabel" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sphereInteriorCheckBox" min="-2" max="-2" attributes="0"/>
<Component id="sphereUseEvenSlicesCheckBox" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="sphereInteriorCheckBox" min="-2" max="-2" attributes="0"/>
<Component id="sphereUseEvenSlicesCheckBox" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="164" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -236,35 +224,36 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="sphereNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sphereModeComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="sphereRadialSamplesLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sphereRadialSamplesSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sphereUseEvenSlicesLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="sphereUseEvenSlicesCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="sphereNameTextField" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Component id="sphereModeComboBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="sphereRadialSamplesLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sphereRadialSamplesSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="sphereZSamplesLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sphereZSamplesSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="sphereRadiusLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sphereRadiusSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sphereZSamplesLabel" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="sphereZSamplesSpinner" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="sphereInteriorLabel" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="sphereInteriorCheckBox" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="sphereUseEvenSlicesLabel" min="-2" max="-2" attributes="0"/>
<Component id="sphereUseEvenSlicesCheckBox" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="sphereRadiusSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sphereRadiusLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sphereInteriorLabel" min="-2" max="-2" attributes="0"/>
<Component id="sphereInteriorCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="147" max="32767" attributes="0"/>
<EmptySpace pref="184" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -382,32 +371,25 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="quadNameTextField" max="32767" attributes="0"/>
<Component id="quadModeComboBox" alignment="1" max="32767" attributes="0"/>
<Component id="quadNameTextField" alignment="0" max="32767" attributes="0"/>
<Component id="jComboBox2" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="quadFlipCoordLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="quadModeComboBox" min="-2" max="-2" attributes="0"/>
<Component id="quadFlipCoordCheckBox" min="-2" pref="101" max="-2" attributes="0"/>
<EmptySpace min="0" pref="39" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="quadFlipCoordLabel" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jComboBox2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="quadWidthLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="quadWidthLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="quadHeightLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" pref="38" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="quadFlipCoordCheckBox" alignment="0" min="-2" pref="101" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="quadWidthSpinner" min="-2" pref="101" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="quadHeightLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="quadHeightSpinner" min="-2" pref="101" max="-2" attributes="0"/>
</Group>
<Component id="quadHeightSpinner" max="32767" attributes="0"/>
<Component id="quadWidthSpinner" max="32767" attributes="0"/>
</Group>
<EmptySpace min="0" pref="176" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -418,24 +400,27 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="quadNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="quadModeComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="quadNameTextField" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Component id="quadModeComboBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jComboBox2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="quadWidthLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="quadWidthSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="quadHeightLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="quadHeightSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jComboBox2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="quadFlipCoordLabel" min="-2" max="-2" attributes="0"/>
<Component id="quadFlipCoordCheckBox" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="166" max="32767" attributes="0"/>
<EmptySpace pref="201" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -527,23 +512,20 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="lineNameTextField" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="lineNameTextField" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
<Component id="lineEndLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lineEndTextField" max="32767" attributes="0"/>
</Group>
<Component id="jComboBox1" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="lineStartLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lineStartTextField" min="-2" pref="109" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
<Component id="lineEndLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lineEndTextField" min="-2" pref="123" max="-2" attributes="0"/>
<EmptySpace min="0" pref="169" max="32767" attributes="0"/>
<Component id="lineStartTextField" pref="177" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -554,18 +536,20 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lineNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Component id="lineNameTextField" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lineStartLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lineStartTextField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lineEndLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lineEndTextField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="203" max="32767" attributes="0"/>
<EmptySpace pref="259" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>

@ -53,7 +53,7 @@ import org.openide.windows.TopComponent;
//iconBase="SET/PATH/TO/ICON/HERE",
persistenceType = TopComponent.PERSISTENCE_ALWAYS
)
@TopComponent.Registration(mode = "output", openAtStartup = false)
@TopComponent.Registration(mode = "commonpalette", openAtStartup = false)
@ActionID(category = "Window", id = "com.jme3.gde.core.sceneexplorer.nodes.actions.impl.NewGeometrySettingsTopComponent")
@ActionReference(path = "Menu/Window" /*, position = 333 */)
@TopComponent.OpenActionRegistration(
@ -62,7 +62,7 @@ import org.openide.windows.TopComponent;
)
@Messages({
"CTL_NewGeometrySettingsAction=NewGeometrySettings",
"CTL_NewGeometrySettingsTopComponent=NewGeometrySettings Window",
"CTL_NewGeometrySettingsTopComponent=NewGeometrySettings",
"HINT_NewGeometrySettingsTopComponent=This is a NewGeometrySettings window"
})
public final class NewGeometrySettingsTopComponent extends TopComponent {
@ -176,39 +176,41 @@ public final class NewGeometrySettingsTopComponent extends TopComponent {
.addContainerGap()
.addGroup(boxPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(boxPanelLayout.createSequentialGroup()
.addComponent(boxXLabel)
.addComponent(boxZLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boxXSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(26, 26, 26)
.addComponent(boxZSpinner))
.addGroup(boxPanelLayout.createSequentialGroup()
.addComponent(boxYLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boxYSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)
.addComponent(boxZLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boxZSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(boxYSpinner))
.addGroup(boxPanelLayout.createSequentialGroup()
.addComponent(boxNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 426, Short.MAX_VALUE)
.addComponent(boxXLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boxModeComboBox, 0, 133, Short.MAX_VALUE)))
.addComponent(boxXSpinner))
.addComponent(boxModeComboBox, 0, 224, Short.MAX_VALUE)
.addComponent(boxNameTextField, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
boxPanelLayout.setVerticalGroup(
boxPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, boxPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(boxPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(boxNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(boxModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(boxNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boxModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addGroup(boxPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(boxXSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(boxXLabel)
.addComponent(boxXSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(boxPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(boxYLabel)
.addComponent(boxYSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(boxZSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(boxZLabel))
.addContainerGap(197, Short.MAX_VALUE))
.addComponent(boxYSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(boxPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(boxZLabel)
.addComponent(boxZSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(233, Short.MAX_VALUE))
);
jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(NewGeometrySettingsTopComponent.class, "NewGeometrySettingsTopComponent.boxPanel.TabConstraints.tabTitle"), boxPanel); // NOI18N
@ -262,63 +264,55 @@ public final class NewGeometrySettingsTopComponent extends TopComponent {
.addGroup(spherePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(spherePanelLayout.createSequentialGroup()
.addComponent(sphereNameTextField)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(sphereModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(sphereNameTextField)
.addComponent(sphereRadiusLabel)
.addComponent(sphereModeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(spherePanelLayout.createSequentialGroup()
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sphereRadialSamplesLabel)
.addComponent(sphereZSamplesLabel)
.addComponent(sphereUseEvenSlicesLabel)
.addComponent(sphereInteriorLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sphereZSamplesSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
.addComponent(sphereRadialSamplesSpinner)
.addComponent(sphereRadiusSpinner)
.addGroup(spherePanelLayout.createSequentialGroup()
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sphereRadialSamplesLabel)
.addComponent(sphereRadiusLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sphereRadiusSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(spherePanelLayout.createSequentialGroup()
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(spherePanelLayout.createSequentialGroup()
.addComponent(sphereRadialSamplesSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(sphereUseEvenSlicesLabel))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, spherePanelLayout.createSequentialGroup()
.addComponent(sphereZSamplesSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(144, 144, 144)
.addComponent(sphereInteriorLabel)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sphereInteriorCheckBox)
.addComponent(sphereUseEvenSlicesCheckBox))))))
.addGap(0, 164, Short.MAX_VALUE)))
.addComponent(sphereInteriorCheckBox)
.addComponent(sphereUseEvenSlicesCheckBox))
.addGap(0, 0, Short.MAX_VALUE)))))
.addContainerGap())
);
spherePanelLayout.setVerticalGroup(
spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(spherePanelLayout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(spherePanelLayout.createSequentialGroup()
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(sphereNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sphereModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(4, 4, 4)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(sphereRadialSamplesLabel)
.addComponent(sphereRadialSamplesSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sphereUseEvenSlicesLabel)))
.addComponent(sphereUseEvenSlicesCheckBox))
.addContainerGap()
.addComponent(sphereNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(3, 3, 3)
.addComponent(sphereModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(sphereRadialSamplesLabel)
.addComponent(sphereRadialSamplesSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(sphereZSamplesLabel)
.addComponent(sphereZSamplesSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(8, 8, 8)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(sphereRadiusLabel)
.addComponent(sphereRadiusSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sphereZSamplesLabel, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(sphereZSamplesSpinner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sphereInteriorLabel, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(sphereInteriorCheckBox, javax.swing.GroupLayout.Alignment.TRAILING))
.addComponent(sphereUseEvenSlicesLabel)
.addComponent(sphereUseEvenSlicesCheckBox))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(sphereRadiusSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sphereRadiusLabel))
.addContainerGap(147, Short.MAX_VALUE))
.addGroup(spherePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sphereInteriorLabel)
.addComponent(sphereInteriorCheckBox))
.addContainerGap(184, Short.MAX_VALUE))
);
jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(NewGeometrySettingsTopComponent.class, "NewGeometrySettingsTopComponent.spherePanel.TabConstraints.tabTitle"), spherePanel); // NOI18N
@ -366,48 +360,46 @@ public final class NewGeometrySettingsTopComponent extends TopComponent {
.addGroup(quadPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(quadModeComboBox, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(quadNameTextField)
.addComponent(jComboBox2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(quadPanelLayout.createSequentialGroup()
.addComponent(quadNameTextField)
.addComponent(quadFlipCoordLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(quadModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(quadFlipCoordCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 39, Short.MAX_VALUE))
.addGroup(quadPanelLayout.createSequentialGroup()
.addGroup(quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(quadFlipCoordLabel)
.addGroup(quadPanelLayout.createSequentialGroup()
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(quadWidthLabel)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(quadWidthLabel)
.addComponent(quadHeightLabel))
.addGap(38, 38, 38)
.addGroup(quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(quadFlipCoordCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(quadPanelLayout.createSequentialGroup()
.addComponent(quadWidthSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(quadHeightLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(quadHeightSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 176, Short.MAX_VALUE)))
.addComponent(quadHeightSpinner)
.addComponent(quadWidthSpinner))))
.addContainerGap())
);
quadPanelLayout.setVerticalGroup(
quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(quadPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(quadNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(quadModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(quadNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addComponent(quadModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(8, 8, 8)
.addGroup(quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(quadWidthLabel)
.addComponent(quadWidthSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(quadWidthSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(quadHeightLabel)
.addComponent(quadHeightSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(quadHeightSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(quadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(quadFlipCoordLabel)
.addComponent(quadFlipCoordCheckBox))
.addContainerGap(166, Short.MAX_VALUE))
.addContainerGap(201, Short.MAX_VALUE))
);
jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(NewGeometrySettingsTopComponent.class, "NewGeometrySettingsTopComponent.quadPanel.TabConstraints.tabTitle"), quadPanel); // NOI18N
@ -437,38 +429,37 @@ public final class NewGeometrySettingsTopComponent extends TopComponent {
linePanel.setLayout(linePanelLayout);
linePanelLayout.setHorizontalGroup(
linePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(linePanelLayout.createSequentialGroup()
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, linePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(linePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(linePanelLayout.createSequentialGroup()
.addComponent(lineNameTextField)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(linePanelLayout.createSequentialGroup()
.addComponent(lineStartLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lineStartTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(78, 78, 78)
.addGroup(linePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lineNameTextField)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, linePanelLayout.createSequentialGroup()
.addComponent(lineEndLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lineEndTextField))
.addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, linePanelLayout.createSequentialGroup()
.addComponent(lineStartLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lineEndTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 169, Short.MAX_VALUE)))
.addComponent(lineStartTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)))
.addContainerGap())
);
linePanelLayout.setVerticalGroup(
linePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(linePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(linePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lineNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(1, 1, 1)
.addComponent(lineNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(linePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lineStartLabel)
.addComponent(lineStartTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lineStartTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(8, 8, 8)
.addGroup(linePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lineEndLabel)
.addComponent(lineEndTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(203, Short.MAX_VALUE))
.addContainerGap(259, Short.MAX_VALUE))
);
jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(NewGeometrySettingsTopComponent.class, "NewGeometrySettingsTopComponent.linePanel.TabConstraints.tabTitle"), linePanel); // NOI18N

@ -31,11 +31,15 @@
*/
package com.jme3.gde.core.sceneexplorer.nodes.actions.impl;
import com.jme3.asset.AssetManager;
import com.jme3.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialAction;
import com.jme3.gde.core.sceneexplorer.nodes.actions.NewGeometryAction;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Sphere;
/**
*
@ -50,8 +54,31 @@ public class NewGeometrySphereAction extends AbstractNewSpatialAction implements
@Override
protected Spatial doCreateSpatial(Node parent) {
Geometry geom = NewGeometry.sphere(pm);
Geometry geom = sphere(pm);
parent.attachChild(geom);
return geom;
}
static Material material(AssetManager assetManaget, NewGeometrySettings cfg) {
Material mat = new Material(assetManaget, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
return mat;
}
static Geometry sphere(AssetManager assetManager) {
NewGeometrySettings cfg = new NewGeometrySettings();
Sphere b = new Sphere(
cfg.getSphereZSamples()
, cfg.getSpherRadialSamples()
, cfg.getSphereRadius()
, cfg.getSphereUseEvenSlices()
, cfg.getSphereInterior()
);
b.setMode(cfg.getSphereMode());
Geometry geom = new Geometry(cfg.getSphereName(), b);
geom.setMaterial(material(assetManager, cfg));
return geom;
}
}

Loading…
Cancel
Save