Browse Source

Remove OpenGL 1 switch as it's not supported anymore since 3.1

MeFisto94 5 years ago
parent
commit
40235da683

+ 2 - 4
jme3-core/src/com/jme3/gde/core/options/Bundle.properties

@@ -1,6 +1,4 @@
 OptionsCategory_Keywords_OpenGL=opengl, graphics
 OptionsCategory_Name_OpenGL=OpenGL
-OpenGLPanel.jCheckBox1.text=Allow Using OpenGL1
-OpenGLPanel.jTextArea1.text=This allows the OpenGL windows of the SDK to be opened on OpenGL1 devices. Be warned however, the output of the windows will not necessarily show what users with OpenGL2 compatible graphics cards will see. Restart the SDK to apply the change.
-OpenGLPanel.jCheckBox2.text=Use Heavyweight Canvas
-OpenGLPanel.jTextArea2.text=This uses the heavyweight lwjgl canvas for the OpenGL window which should provide better rendering performance but might introduce instability issues and Swing ui incompatibilities on some systems. Restart the SDK to apply the change.
+OpenGLPanel.text=Use Heavyweight Canvas
+OpenGLPanel.txtHeavyweight.text=This uses the heavyweight lwjgl canvas for the OpenGL window which should provide better rendering performance but might introduce instability issues and Swing ui incompatibilities on some systems. Restart the SDK to apply the change.

+ 10 - 1
jme3-core/src/com/jme3/gde/core/options/OpenGLOptionsPanelController.java

@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2009-2010 jMonkeyEngine
+ *  Copyright (c) 2009-2020 jMonkeyEngine
  *  All rights reserved.
  * 
  *  Redistribution and use in source and binary forms, with or without
@@ -48,40 +48,49 @@ public final class OpenGLOptionsPanelController extends OptionsPanelController {
     private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
     private boolean changed;
 
+    @Override
     public void update() {
         getPanel().load();
         changed = false;
     }
 
+    @Override
     public void applyChanges() {
         getPanel().store();
         changed = false;
     }
 
+    @Override
     public void cancel() {
         // need not do anything special, if no changes have been persisted yet
     }
 
+    @Override
     public boolean isValid() {
         return getPanel().valid();
     }
 
+    @Override
     public boolean isChanged() {
         return changed;
     }
 
+    @Override
     public HelpCtx getHelpCtx() {
         return null; // new HelpCtx("...ID") if you have a help set
     }
 
+    @Override
     public JComponent getComponent(Lookup masterLookup) {
         return getPanel();
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener l) {
         pcs.addPropertyChangeListener(l);
     }
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener l) {
         pcs.removePropertyChangeListener(l);
     }

+ 16 - 50
jme3-core/src/com/jme3/gde/core/options/OpenGLPanel.form

@@ -1,4 +1,4 @@
-<?xml version="1.1" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
 
 <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   <AuxValues>
@@ -16,15 +16,15 @@
   <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">
-                  <Component id="jCheckBox2" alignment="0" min="-2" max="-2" attributes="0"/>
-                  <Component id="jScrollPane1" alignment="0" pref="370" max="32767" attributes="0"/>
-                  <Component id="jCheckBox1" alignment="0" pref="370" max="32767" attributes="0"/>
-                  <Component id="jScrollPane2" alignment="1" pref="370" max="32767" attributes="0"/>
+                  <Component id="scrollHeavyweight" pref="380" max="32767" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="chkHeavyweightCanvas" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace max="32767" attributes="0"/>
+                  </Group>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
@@ -32,72 +32,38 @@
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="0" attributes="0">
               <EmptySpace max="-2" attributes="0"/>
-              <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
+              <Component id="chkHeavyweightCanvas" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
-              <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/>
-              <EmptySpace type="separate" max="-2" attributes="0"/>
-              <Component id="jCheckBox2" min="-2" max="-2" attributes="0"/>
-              <EmptySpace max="-2" attributes="0"/>
-              <Component id="jScrollPane2" min="-2" max="-2" attributes="0"/>
-              <EmptySpace pref="61" max="32767" attributes="0"/>
+              <Component id="scrollHeavyweight" min="-2" pref="115" max="-2" attributes="0"/>
+              <EmptySpace pref="181" max="32767" attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
   </Layout>
   <SubComponents>
-    <Component class="javax.swing.JCheckBox" name="jCheckBox1">
+    <Component class="javax.swing.JCheckBox" name="chkHeavyweightCanvas">
       <Properties>
         <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString bundle="com/jme3/gde/core/options/Bundle.properties" key="OpenGLPanel.jCheckBox1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+          <ResourceString bundle="com/jme3/gde/core/options/Bundle.properties" key="OpenGLPanel.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>
-    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+    <Container class="javax.swing.JScrollPane" name="scrollHeavyweight">
       <AuxValues>
         <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
       </AuxValues>
 
       <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
       <SubComponents>
-        <Component class="javax.swing.JTextArea" name="jTextArea1">
+        <Component class="javax.swing.JTextArea" name="txtHeavyweight">
           <Properties>
-            <Property name="columns" type="int" value="20"/>
             <Property name="editable" type="boolean" value="false"/>
-            <Property name="lineWrap" type="boolean" value="true"/>
-            <Property name="rows" type="int" value="5"/>
-            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-              <ResourceString bundle="com/jme3/gde/core/options/Bundle.properties" key="OpenGLPanel.jTextArea1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
-            </Property>
-            <Property name="wrapStyleWord" type="boolean" value="true"/>
-            <Property name="disabledTextColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
-              <Color blue="0" green="0" red="0" type="rgb"/>
-            </Property>
-          </Properties>
-        </Component>
-      </SubComponents>
-    </Container>
-    <Component class="javax.swing.JCheckBox" name="jCheckBox2">
-      <Properties>
-        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString bundle="com/jme3/gde/core/options/Bundle.properties" key="OpenGLPanel.jCheckBox2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
-        </Property>
-      </Properties>
-    </Component>
-    <Container class="javax.swing.JScrollPane" name="jScrollPane2">
-      <AuxValues>
-        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
-      </AuxValues>
-
-      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
-      <SubComponents>
-        <Component class="javax.swing.JTextArea" name="jTextArea2">
-          <Properties>
             <Property name="columns" type="int" value="20"/>
-            <Property name="editable" type="boolean" value="false"/>
             <Property name="lineWrap" type="boolean" value="true"/>
             <Property name="rows" type="int" value="5"/>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-              <ResourceString bundle="com/jme3/gde/core/options/Bundle.properties" key="OpenGLPanel.jTextArea2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+              <ResourceString bundle="com/jme3/gde/core/options/Bundle.properties" key="OpenGLPanel.txtHeavyweight.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
             </Property>
             <Property name="wrapStyleWord" type="boolean" value="true"/>
             <Property name="disabledTextColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">

+ 31 - 54
jme3-core/src/com/jme3/gde/core/options/OpenGLPanel.java

@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2009-2010 jMonkeyEngine
+ *  Copyright (c) 2009-2020 jMonkeyEngine
  *  All rights reserved.
  * 
  *  Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,10 @@ package com.jme3.gde.core.options;
 import com.jme3.gde.core.Installer;
 import org.openide.util.NbPreferences;
 
+/**
+ * A Settings Panel to control various openGL Settings (i.e. the used renderer)
+ * @author normenhansen
+ */
 final class OpenGLPanel extends javax.swing.JPanel {
 
     private final OpenGLOptionsPanelController controller;
@@ -52,34 +56,21 @@ final class OpenGLPanel extends javax.swing.JPanel {
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
     private void initComponents() {
 
-        jCheckBox1 = new javax.swing.JCheckBox();
-        jScrollPane1 = new javax.swing.JScrollPane();
-        jTextArea1 = new javax.swing.JTextArea();
-        jCheckBox2 = new javax.swing.JCheckBox();
-        jScrollPane2 = new javax.swing.JScrollPane();
-        jTextArea2 = new javax.swing.JTextArea();
-
-        org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, org.openide.util.NbBundle.getMessage(OpenGLPanel.class, "OpenGLPanel.jCheckBox1.text")); // NOI18N
-
-        jTextArea1.setColumns(20);
-        jTextArea1.setEditable(false);
-        jTextArea1.setLineWrap(true);
-        jTextArea1.setRows(5);
-        jTextArea1.setText(org.openide.util.NbBundle.getMessage(OpenGLPanel.class, "OpenGLPanel.jTextArea1.text")); // NOI18N
-        jTextArea1.setWrapStyleWord(true);
-        jTextArea1.setDisabledTextColor(new java.awt.Color(0, 0, 0));
-        jScrollPane1.setViewportView(jTextArea1);
+        chkHeavyweightCanvas = new javax.swing.JCheckBox();
+        scrollHeavyweight = new javax.swing.JScrollPane();
+        txtHeavyweight = new javax.swing.JTextArea();
 
-        org.openide.awt.Mnemonics.setLocalizedText(jCheckBox2, org.openide.util.NbBundle.getMessage(OpenGLPanel.class, "OpenGLPanel.jCheckBox2.text")); // NOI18N
+        org.openide.awt.Mnemonics.setLocalizedText(chkHeavyweightCanvas, org.openide.util.NbBundle.getMessage(OpenGLPanel.class, "OpenGLPanel.text")); // NOI18N
+        chkHeavyweightCanvas.setName(""); // NOI18N
 
-        jTextArea2.setColumns(20);
-        jTextArea2.setEditable(false);
-        jTextArea2.setLineWrap(true);
-        jTextArea2.setRows(5);
-        jTextArea2.setText(org.openide.util.NbBundle.getMessage(OpenGLPanel.class, "OpenGLPanel.jTextArea2.text")); // NOI18N
-        jTextArea2.setWrapStyleWord(true);
-        jTextArea2.setDisabledTextColor(new java.awt.Color(0, 0, 0));
-        jScrollPane2.setViewportView(jTextArea2);
+        txtHeavyweight.setEditable(false);
+        txtHeavyweight.setColumns(20);
+        txtHeavyweight.setLineWrap(true);
+        txtHeavyweight.setRows(5);
+        txtHeavyweight.setText(org.openide.util.NbBundle.getMessage(OpenGLPanel.class, "OpenGLPanel.txtHeavyweight.text")); // NOI18N
+        txtHeavyweight.setWrapStyleWord(true);
+        txtHeavyweight.setDisabledTextColor(new java.awt.Color(0, 0, 0));
+        scrollHeavyweight.setViewportView(txtHeavyweight);
 
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         this.setLayout(layout);
@@ -88,39 +79,28 @@ final class OpenGLPanel extends javax.swing.JPanel {
             .addGroup(layout.createSequentialGroup()
                 .addContainerGap()
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(jCheckBox2)
-                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE)
-                    .addComponent(jCheckBox1, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE)
-                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE))
-                .addContainerGap())
+                    .addComponent(scrollHeavyweight, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(chkHeavyweightCanvas)
+                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
         );
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(layout.createSequentialGroup()
                 .addContainerGap()
-                .addComponent(jCheckBox1)
+                .addComponent(chkHeavyweightCanvas)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addGap(18, 18, 18)
-                .addComponent(jCheckBox2)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(61, Short.MAX_VALUE))
+                .addComponent(scrollHeavyweight, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap(181, Short.MAX_VALUE))
         );
     }// </editor-fold>//GEN-END:initComponents
 
     void load() {
-        jCheckBox1.setSelected("true".equals(NbPreferences.forModule(Installer.class).get("use_opengl_1", "false")));
-        jCheckBox2.setSelected("true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false")));
+        chkHeavyweightCanvas.setSelected("true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false")));
     }
 
     void store() {
-        if(jCheckBox1.isSelected()){
-            NbPreferences.forModule(Installer.class).put("use_opengl_1", "true");
-        }else{
-            NbPreferences.forModule(Installer.class).put("use_opengl_1", "false");
-        }
-        if(jCheckBox2.isSelected()){
+        if(chkHeavyweightCanvas.isSelected()){
             NbPreferences.forModule(Installer.class).put("use_lwjgl_canvas", "true");
         }else{
             NbPreferences.forModule(Installer.class).put("use_lwjgl_canvas", "false");
@@ -128,15 +108,12 @@ final class OpenGLPanel extends javax.swing.JPanel {
     }
 
     boolean valid() {
-        // TODO check whether form is consistent and complete
+        // There is nothing here that could be in an invalid state
         return true;
     }
     // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.JCheckBox jCheckBox1;
-    private javax.swing.JCheckBox jCheckBox2;
-    private javax.swing.JScrollPane jScrollPane1;
-    private javax.swing.JScrollPane jScrollPane2;
-    private javax.swing.JTextArea jTextArea1;
-    private javax.swing.JTextArea jTextArea2;
+    private javax.swing.JCheckBox chkHeavyweightCanvas;
+    private javax.swing.JScrollPane scrollHeavyweight;
+    private javax.swing.JTextArea txtHeavyweight;
     // End of variables declaration//GEN-END:variables
 }