Browse Source

add cylinder to New Geometry options
add "centered" as checkbox to quad form

rickard 1 year ago
parent
commit
dee8c1e890

+ 78 - 0
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometryCylinderAction.java

@@ -0,0 +1,78 @@
+/*
+ *  Copyright (c) 2009-2024 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.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialAction;
+import com.jme3.gde.core.sceneexplorer.nodes.actions.NewGeometryAction;
+import com.jme3.gde.core.sceneexplorer.nodes.primitives.CreateCylinderPanel;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.shape.Cylinder;
+import com.jme3.scene.shape.Sphere;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+
+/**
+ * Action to create a new primitive (Cylinder)
+ *
+ * @author neph1
+ */
[email protected](service = NewGeometryAction.class)
+public class NewGeometryCylinderAction extends AbstractNewSpatialAction implements NewGeometryAction {
+
+    CreateCylinderPanel form;
+
+    public NewGeometryCylinderAction() {
+        name = "Cylinder";
+        form = new CreateCylinderPanel();
+    }
+
+    @Override
+    protected Spatial doCreateSpatial(Node parent) {
+        Cylinder cylinder = new Cylinder(form.getZSamples(), form.getRadialSamples(), form.getRadius(), form.getHeight(), form.isClosed(), form.isInverted());
+        Sphere s = new Sphere(form.getZSamples(), form.getRadialSamples(),
+                form.getRadius(), form.isClosed(), form.isInverted());
+        Geometry geom = form.getNewGeomPanel().handleGeometry(pm, s);
+        // parent.attachChild(geom); // was present in previous code, but should neither be necessary nor correct
+        return geom;
+    }
+
+    @Override
+    protected boolean prepareCreateSpatial() {
+        String msg = "Create new Sphere";
+        DialogDescriptor dd = new DialogDescriptor(form, msg);
+        Object result = DialogDisplayer.getDefault().notify(dd);
+        return (result == NotifyDescriptor.OK_OPTION);
+    }
+}

+ 11 - 3
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/NewGeometryQuadAction.java

@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2009-2019 jMonkeyEngine
+ *  Copyright (c) 2009-2024 jMonkeyEngine
  *  All rights reserved.
  * 
  *  Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,10 @@ import com.jme3.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialAction;
 import com.jme3.gde.core.sceneexplorer.nodes.actions.NewGeometryAction;
 import com.jme3.gde.core.sceneexplorer.nodes.primitives.CreateQuadPanel;
 import com.jme3.scene.Geometry;
+import com.jme3.scene.Mesh;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
+import com.jme3.scene.shape.CenterQuad;
 import com.jme3.scene.shape.Quad;
 import org.openide.DialogDescriptor;
 import org.openide.DialogDisplayer;
@@ -60,8 +62,14 @@ public class NewGeometryQuadAction extends AbstractNewSpatialAction implements N
 
     @Override
     protected Spatial doCreateSpatial(Node parent) {
-        Quad q = new Quad(form.getQuadWidth(), form.getQuadHeight(), form.isFlipCoords());
-        Geometry geom = form.getNewGeomPanel().handleGeometry(pm, q);
+        Mesh mesh;
+        if (form.isCentered()) {
+            mesh = new CenterQuad(form.getQuadWidth(), form.getQuadHeight(), form.isFlipCoords());
+        } else {
+            mesh = new Quad(form.getQuadWidth(), form.getQuadHeight(), form.isFlipCoords());
+        }
+        
+        Geometry geom = form.getNewGeomPanel().handleGeometry(pm, mesh);
         // parent.attachChild(geom); // was present in previous code, but should neither be necessary nor correct
         return geom;
     }

+ 10 - 0
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties

@@ -26,3 +26,13 @@ CreateLinePanel.lblStart.text=Start Point:
 CreateQuadPanel.lblHeight.text=height
 CreateQuadPanel.lblWidth.text=width
 CreateSpherePanel.lblRadialSamples.text=Radial Samples:
+CreateCylinderPanel.lblRadius.text=Radius:
+CreateCylinderPanel.lblZSamples.toolTipText=
+CreateCylinderPanel.lblZSamples.text=Z-Samples:
+CreateCylinderPanel.lblRadialSamples.text=Radial Samples:
+CreateCylinderPanel.jPanel1.border.title=Sphere Specific Settings
+CreateCylinderPanel.abstractNewGeometryPanel1.border.title=General Geometry Settings
+CreateCylinderPanel.lblRadius.toolTipText=
+CreateCylinderPanel.checkClosed.text=Closed
+CreateCylinderPanel.checkInverted.text=Inverted
+CreateQuadPanel.checkCentered.text=centered

+ 192 - 0
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/primitives/CreateCylinderPanel.form

@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                  <Component id="abstractNewGeometryPanel1" max="32767" attributes="0"/>
+                  <Component id="jPanel1" max="32767" attributes="0"/>
+              </Group>
+              <EmptySpace max="32767" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="abstractNewGeometryPanel1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jPanel1" pref="174" max="32767" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Component class="com.jme3.gde.core.sceneexplorer.nodes.actions.impl.AbstractNewGeometryPanel" name="abstractNewGeometryPanel1">
+      <Properties>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
+            <TitledBorder title="General Geometry Settings">
+              <ResourceString PropertyName="titleX" bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.abstractNewGeometryPanel1.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </TitledBorder>
+          </Border>
+        </Property>
+      </Properties>
+    </Component>
+    <Container class="javax.swing.JPanel" name="jPanel1">
+      <Properties>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
+            <TitledBorder title="Sphere Specific Settings">
+              <ResourceString PropertyName="titleX" bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.jPanel1.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </TitledBorder>
+          </Border>
+        </Property>
+      </Properties>
+
+      <Layout>
+        <DimensionLayout dim="0">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <Group type="102" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" attributes="0">
+                          <Component id="lblRadialSamples" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                          <Component id="spinnerRadialSamples" max="32767" attributes="0"/>
+                      </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <Component id="lblZSamples" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace min="-2" pref="51" max="-2" attributes="0"/>
+                          <Component id="spinnerZSamples" max="32767" attributes="0"/>
+                      </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <Component id="lblRadius" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
+                          <Component id="spinnerRadius" max="32767" attributes="0"/>
+                      </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <Group type="103" groupAlignment="0" attributes="0">
+                              <Component id="checkClosed" min="-2" max="-2" attributes="0"/>
+                              <Component id="checkInverted" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                      </Group>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
+              </Group>
+          </Group>
+        </DimensionLayout>
+        <DimensionLayout dim="1">
+          <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="lblRadialSamples" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="spinnerRadialSamples" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="lblZSamples" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="spinnerZSamples" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="lblRadius" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="spinnerRadius" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                  <Component id="checkClosed" min="-2" max="-2" attributes="0"/>
+                  <EmptySpace max="32767" attributes="0"/>
+                  <Component id="checkInverted" min="-2" max="-2" attributes="0"/>
+                  <EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
+              </Group>
+          </Group>
+        </DimensionLayout>
+      </Layout>
+      <SubComponents>
+        <Component class="javax.swing.JLabel" name="lblRadialSamples">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.lblRadialSamples.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="name" type="java.lang.String" value="" noResource="true"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JSpinner" name="spinnerRadialSamples">
+          <Properties>
+            <Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
+              <SpinnerModel initial="10" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="checkClosed">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.checkClosed.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JSpinner" name="spinnerZSamples">
+          <Properties>
+            <Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
+              <SpinnerModel initial="10" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="lblZSamples">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.lblZSamples.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.lblZSamples.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="name" type="java.lang.String" value="" noResource="true"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="checkInverted">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.checkInverted.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JSpinner" name="spinnerRadius">
+          <Properties>
+            <Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
+              <SpinnerModel initial="0.5" numberType="java.lang.Float" stepSize="0.01" type="number"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="lblRadius">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.lblRadius.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateCylinderPanel.lblRadius.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="name" type="java.lang.String" value="" noResource="true"/>
+          </Properties>
+        </Component>
+      </SubComponents>
+    </Container>
+  </SubComponents>
+</Form>

+ 200 - 0
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/primitives/CreateCylinderPanel.java

@@ -0,0 +1,200 @@
+/*
+ *  Copyright (c) 2019-2024 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.primitives;
+
+import com.jme3.gde.core.sceneexplorer.nodes.actions.impl.AbstractNewGeometryPanel;
+
+/**
+ * This is the Panel which creates a new Primitive (Cylinder)
+ *
+ * @author neph1
+ */
+public class CreateCylinderPanel extends javax.swing.JPanel {
+
+    /**
+     * Creates new form CreateBoxPanel
+     */
+    public CreateCylinderPanel() {
+        initComponents();
+    }
+
+    public AbstractNewGeometryPanel getNewGeomPanel() {
+        return abstractNewGeometryPanel1;
+    }
+
+    public int getZSamples() {
+        return (int) spinnerZSamples.getValue();
+    }
+
+    public int getRadialSamples() {
+        return (int) spinnerRadialSamples.getValue();
+    }
+
+    public float getRadius() {
+        return (float) spinnerRadius.getValue();
+    }
+
+    public boolean isClosed() {
+        return checkClosed.isSelected();
+    }
+
+    public boolean isInverted() {
+        return checkInverted.isSelected();
+    }
+
+    /**
+     * This method is called from within the constructor to initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is always
+     * regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+
+        abstractNewGeometryPanel1 = new com.jme3.gde.core.sceneexplorer.nodes.actions.impl.AbstractNewGeometryPanel();
+        jPanel1 = new javax.swing.JPanel();
+        lblRadialSamples = new javax.swing.JLabel();
+        spinnerRadialSamples = new javax.swing.JSpinner();
+        checkClosed = new javax.swing.JCheckBox();
+        spinnerZSamples = new javax.swing.JSpinner();
+        lblZSamples = new javax.swing.JLabel();
+        checkInverted = new javax.swing.JCheckBox();
+        spinnerRadius = new javax.swing.JSpinner();
+        lblRadius = new javax.swing.JLabel();
+
+        abstractNewGeometryPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.abstractNewGeometryPanel1.border.title"))); // NOI18N
+
+        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.jPanel1.border.title"))); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(lblRadialSamples, org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.lblRadialSamples.text")); // NOI18N
+        lblRadialSamples.setName(""); // NOI18N
+
+        spinnerRadialSamples.setModel(new javax.swing.SpinnerNumberModel(10, 1, null, 1));
+
+        org.openide.awt.Mnemonics.setLocalizedText(checkClosed, org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.checkClosed.text")); // NOI18N
+
+        spinnerZSamples.setModel(new javax.swing.SpinnerNumberModel(10, 1, null, 1));
+
+        org.openide.awt.Mnemonics.setLocalizedText(lblZSamples, org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.lblZSamples.text")); // NOI18N
+        lblZSamples.setToolTipText(org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.lblZSamples.toolTipText")); // NOI18N
+        lblZSamples.setName(""); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(checkInverted, org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.checkInverted.text")); // NOI18N
+
+        spinnerRadius.setModel(new javax.swing.SpinnerNumberModel(0.5f, null, null, 0.01f));
+
+        org.openide.awt.Mnemonics.setLocalizedText(lblRadius, org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.lblRadius.text")); // NOI18N
+        lblRadius.setToolTipText(org.openide.util.NbBundle.getMessage(CreateCylinderPanel.class, "CreateCylinderPanel.lblRadius.toolTipText")); // NOI18N
+        lblRadius.setName(""); // NOI18N
+
+        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+        jPanel1.setLayout(jPanel1Layout);
+        jPanel1Layout.setHorizontalGroup(
+            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel1Layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addComponent(lblRadialSamples)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                        .addComponent(spinnerRadialSamples))
+                    .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addComponent(lblZSamples)
+                        .addGap(51, 51, 51)
+                        .addComponent(spinnerZSamples))
+                    .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addComponent(lblRadius)
+                        .addGap(78, 78, 78)
+                        .addComponent(spinnerRadius))
+                    .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addComponent(checkClosed)
+                            .addComponent(checkInverted))
+                        .addGap(0, 0, Short.MAX_VALUE)))
+                .addContainerGap())
+        );
+        jPanel1Layout.setVerticalGroup(
+            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel1Layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(lblRadialSamples)
+                    .addComponent(spinnerRadialSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(lblZSamples)
+                    .addComponent(spinnerZSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(lblRadius)
+                    .addComponent(spinnerRadius, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                .addComponent(checkClosed)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(checkInverted)
+                .addGap(29, 29, 29))
+        );
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                    .addComponent(abstractNewGeometryPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(abstractNewGeometryPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, Short.MAX_VALUE))
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private com.jme3.gde.core.sceneexplorer.nodes.actions.impl.AbstractNewGeometryPanel abstractNewGeometryPanel1;
+    private javax.swing.JCheckBox checkClosed;
+    private javax.swing.JCheckBox checkInverted;
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JLabel lblRadialSamples;
+    private javax.swing.JLabel lblRadius;
+    private javax.swing.JLabel lblZSamples;
+    private javax.swing.JSpinner spinnerRadialSamples;
+    private javax.swing.JSpinner spinnerRadius;
+    private javax.swing.JSpinner spinnerZSamples;
+    // End of variables declaration//GEN-END:variables
+}

+ 20 - 8
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/primitives/CreateQuadPanel.form

@@ -32,8 +32,8 @@
               <EmptySpace max="-2" attributes="0"/>
               <Component id="abstractNewGeometryPanel1" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
-              <Component id="jPanel1" min="-2" pref="105" max="-2" attributes="0"/>
-              <EmptySpace max="32767" attributes="0"/>
+              <Component id="jPanel1" pref="136" max="32767" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
@@ -64,13 +64,9 @@
       <Layout>
         <DimensionLayout dim="0">
           <Group type="103" groupAlignment="0" attributes="0">
-              <Group type="102" alignment="0" attributes="0">
+              <Group type="102" attributes="0">
                   <EmptySpace max="-2" attributes="0"/>
                   <Group type="103" groupAlignment="0" attributes="0">
-                      <Group type="102" attributes="0">
-                          <Component id="checkFlipCoords" min="-2" max="-2" attributes="0"/>
-                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
-                      </Group>
                       <Group type="102" attributes="0">
                           <Group type="103" groupAlignment="0" attributes="0">
                               <Component id="lblHeight" alignment="0" min="-2" max="-2" attributes="0"/>
@@ -82,6 +78,13 @@
                               <Component id="spinnerY" max="32767" attributes="0"/>
                           </Group>
                       </Group>
+                      <Group type="102" attributes="0">
+                          <Group type="103" groupAlignment="0" attributes="0">
+                              <Component id="checkFlipCoords" min="-2" max="-2" attributes="0"/>
+                              <Component id="checkCentered" alignment="0" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                      </Group>
                   </Group>
                   <EmptySpace max="-2" attributes="0"/>
               </Group>
@@ -102,7 +105,9 @@
                   </Group>
                   <EmptySpace max="32767" attributes="0"/>
                   <Component id="checkFlipCoords" min="-2" max="-2" attributes="0"/>
-                  <EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Component id="checkCentered" min="-2" max="-2" attributes="0"/>
+                  <EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
               </Group>
           </Group>
         </DimensionLayout>
@@ -144,6 +149,13 @@
             </Property>
           </Properties>
         </Component>
+        <Component class="javax.swing.JCheckBox" name="checkCentered">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneexplorer/nodes/primitives/Bundle.properties" key="CreateQuadPanel.checkCentered.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
       </SubComponents>
     </Container>
   </SubComponents>

+ 20 - 8
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/primitives/CreateQuadPanel.java

@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2019- jMonkeyEngine
+ *  Copyright (c) 2019-2024 jMonkeyEngine
  *  All rights reserved.
  * 
  *  Redistribution and use in source and binary forms, with or without
@@ -62,6 +62,10 @@ public class CreateQuadPanel extends javax.swing.JPanel {
     public boolean isFlipCoords() {
         return checkFlipCoords.isSelected();
     }
+    
+    public boolean isCentered() {
+        return checkCentered.isSelected();
+    }
 
     /**
      * This method is called from within the constructor to initialize the form.
@@ -79,6 +83,7 @@ public class CreateQuadPanel extends javax.swing.JPanel {
         lblHeight = new javax.swing.JLabel();
         spinnerY = new javax.swing.JSpinner();
         checkFlipCoords = new javax.swing.JCheckBox();
+        checkCentered = new javax.swing.JCheckBox();
 
         abstractNewGeometryPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CreateQuadPanel.class, "CreateQuadPanel.abstractNewGeometryPanel1.border.title"))); // NOI18N
 
@@ -95,6 +100,8 @@ public class CreateQuadPanel extends javax.swing.JPanel {
 
         org.openide.awt.Mnemonics.setLocalizedText(checkFlipCoords, org.openide.util.NbBundle.getMessage(CreateQuadPanel.class, "CreateQuadPanel.checkFlipCoords.text")); // NOI18N
 
+        org.openide.awt.Mnemonics.setLocalizedText(checkCentered, org.openide.util.NbBundle.getMessage(CreateQuadPanel.class, "CreateQuadPanel.checkCentered.text")); // NOI18N
+
         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
         jPanel1.setLayout(jPanel1Layout);
         jPanel1Layout.setHorizontalGroup(
@@ -102,9 +109,6 @@ public class CreateQuadPanel extends javax.swing.JPanel {
             .addGroup(jPanel1Layout.createSequentialGroup()
                 .addContainerGap()
                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(jPanel1Layout.createSequentialGroup()
-                        .addComponent(checkFlipCoords)
-                        .addGap(0, 0, Short.MAX_VALUE))
                     .addGroup(jPanel1Layout.createSequentialGroup()
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(lblHeight)
@@ -112,7 +116,12 @@ public class CreateQuadPanel extends javax.swing.JPanel {
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(spinnerX)
-                            .addComponent(spinnerY))))
+                            .addComponent(spinnerY)))
+                    .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addComponent(checkFlipCoords)
+                            .addComponent(checkCentered))
+                        .addGap(0, 0, Short.MAX_VALUE)))
                 .addContainerGap())
         );
         jPanel1Layout.setVerticalGroup(
@@ -128,7 +137,9 @@ public class CreateQuadPanel extends javax.swing.JPanel {
                     .addComponent(spinnerY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 .addComponent(checkFlipCoords)
-                .addGap(35, 35, 35))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(checkCentered)
+                .addGap(8, 8, 8))
         );
 
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -148,13 +159,14 @@ public class CreateQuadPanel extends javax.swing.JPanel {
                 .addContainerGap()
                 .addComponent(abstractNewGeometryPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 136, Short.MAX_VALUE)
+                .addContainerGap())
         );
     }// </editor-fold>//GEN-END:initComponents
 
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private com.jme3.gde.core.sceneexplorer.nodes.actions.impl.AbstractNewGeometryPanel abstractNewGeometryPanel1;
+    private javax.swing.JCheckBox checkCentered;
     private javax.swing.JCheckBox checkFlipCoords;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JLabel lblHeight;