|
@@ -0,0 +1,200 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2019- 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 (Sphere)
|
|
|
+ *
|
|
|
+ * @author MeFisto94
|
|
|
+ */
|
|
|
+public class CreateSpherePanel extends javax.swing.JPanel {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates new form CreateBoxPanel
|
|
|
+ */
|
|
|
+ public CreateSpherePanel() {
|
|
|
+ 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 useEvenSlices() {
|
|
|
+ return checkEvenSlices.isSelected();
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isInterior() {
|
|
|
+ return checkInterior.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();
|
|
|
+ checkEvenSlices = new javax.swing.JCheckBox();
|
|
|
+ spinnerZSamples = new javax.swing.JSpinner();
|
|
|
+ lblZSamples = new javax.swing.JLabel();
|
|
|
+ checkInterior = 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(CreateSpherePanel.class, "CreateSpherePanel.abstractNewGeometryPanel1.border.title"))); // NOI18N
|
|
|
+
|
|
|
+ jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CreateSpherePanel.class, "CreateSpherePanel.jPanel1.border.title"))); // NOI18N
|
|
|
+
|
|
|
+ org.openide.awt.Mnemonics.setLocalizedText(lblRadialSamples, org.openide.util.NbBundle.getMessage(CreateSpherePanel.class, "CreateSpherePanel.lblRadialSamples.text")); // NOI18N
|
|
|
+ lblRadialSamples.setName(""); // NOI18N
|
|
|
+
|
|
|
+ spinnerRadialSamples.setModel(new javax.swing.SpinnerNumberModel(10, 1, null, 1));
|
|
|
+
|
|
|
+ org.openide.awt.Mnemonics.setLocalizedText(checkEvenSlices, org.openide.util.NbBundle.getMessage(CreateSpherePanel.class, "CreateSpherePanel.checkEvenSlices.text")); // NOI18N
|
|
|
+
|
|
|
+ spinnerZSamples.setModel(new javax.swing.SpinnerNumberModel(10, 1, null, 1));
|
|
|
+
|
|
|
+ org.openide.awt.Mnemonics.setLocalizedText(lblZSamples, org.openide.util.NbBundle.getMessage(CreateSpherePanel.class, "CreateSpherePanel.lblZSamples.text")); // NOI18N
|
|
|
+ lblZSamples.setToolTipText(org.openide.util.NbBundle.getMessage(CreateSpherePanel.class, "CreateSpherePanel.lblZSamples.toolTipText")); // NOI18N
|
|
|
+ lblZSamples.setName(""); // NOI18N
|
|
|
+
|
|
|
+ org.openide.awt.Mnemonics.setLocalizedText(checkInterior, org.openide.util.NbBundle.getMessage(CreateSpherePanel.class, "CreateSpherePanel.checkInterior.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(CreateSpherePanel.class, "CreateSpherePanel.lblRadius.text")); // NOI18N
|
|
|
+ lblRadius.setToolTipText(org.openide.util.NbBundle.getMessage(CreateSpherePanel.class, "CreateSpherePanel.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(checkEvenSlices)
|
|
|
+ .addComponent(checkInterior))
|
|
|
+ .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(checkEvenSlices)
|
|
|
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
|
+ .addComponent(checkInterior)
|
|
|
+ .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, 162, 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 checkEvenSlices;
|
|
|
+ private javax.swing.JCheckBox checkInterior;
|
|
|
+ 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
|
|
|
+}
|