OSDN Git Service

fixed most of gdx-setup-ui to show ios options
authorMario Zechner <contact@badlogicgames.com>
Mon, 21 Jan 2013 23:05:36 +0000 (00:05 +0100)
committerMario Zechner <contact@badlogicgames.com>
Mon, 21 Jan 2013 23:05:36 +0000 (00:05 +0100)
extensions/gdx-setup-ui/src/aurelienribon/gdxsetupui/ui/panels/AdvancedSettingsPanel.form
extensions/gdx-setup-ui/src/aurelienribon/gdxsetupui/ui/panels/AdvancedSettingsPanel.java
extensions/gdx-setup-ui/src/aurelienribon/gdxsetupui/ui/panels/ConfigSetupPanel.form
extensions/gdx-setup-ui/src/aurelienribon/gdxsetupui/ui/panels/ConfigSetupPanel.java
extensions/gdx-setup-ui/src/aurelienribon/gdxsetupui/ui/panels/PreviewPanel.java
extensions/gdx-setup-ui/src/res/projects.zip

index 0f9aabf..450b913 100644 (file)
@@ -33,7 +33,7 @@
               <Component id="paintedPanel2" min="-2" max="-2" attributes="0"/>
               <EmptySpace type="unrelated" max="-2" attributes="0"/>
               <Component id="paintedPanel1" min="-2" max="-2" attributes="0"/>
-              <EmptySpace pref="92" max="32767" attributes="0"/>
+              <EmptySpace pref="80" max="32767" attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
       <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" alignment="0" attributes="0">
                       </Group>
                       <Group type="102" alignment="1" attributes="0">
                           <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
-                          <Component id="jLabel9" min="-2" max="-2" attributes="0"/>
+                          <Group type="103" groupAlignment="0" attributes="0">
+                              <Component id="jLabel9" alignment="1" min="-2" max="-2" attributes="0"/>
+                              <Group type="102" alignment="1" attributes="0">
+                                  <Component id="jLabel11" min="-2" pref="107" max="-2" attributes="0"/>
+                                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                                  <Component id="iosSuffixField" min="-2" pref="140" max="-2" attributes="0"/>
+                              </Group>
+                          </Group>
                       </Group>
                   </Group>
                   <EmptySpace max="-2" attributes="0"/>
                       <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="desktopSuffixField" alignment="3" min="-2" max="-2" attributes="0"/>
                   </Group>
-                  <EmptySpace type="separate" max="-2" attributes="0"/>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="iosSuffixField" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
                   <Component id="jLabel9" min="-2" max="-2" attributes="0"/>
                   <EmptySpace max="32767" attributes="0"/>
               </Group>
             <Property name="text" type="java.lang.String" value="Do not use twice the same suffix to avoid undefined behavior"/>
           </Properties>
         </Component>
+        <Component class="javax.swing.JTextField" name="iosSuffixField">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="-ios"/>
+            <Property name="name" type="java.lang.String" value="" noResource="true"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel11">
+          <Properties>
+            <Property name="horizontalAlignment" type="int" value="4"/>
+            <Property name="text" type="java.lang.String" value="iOS project suffix"/>
+          </Properties>
+        </Component>
       </SubComponents>
     </Container>
   </SubComponents>
index 2571da4..40315d8 100644 (file)
@@ -36,6 +36,7 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
                desktopSuffixField.setText(Ctx.cfgSetup.suffixDesktop);
                androidSuffixField.setText(Ctx.cfgSetup.suffixAndroid);
                htmlSuffixField.setText(Ctx.cfgSetup.suffixHtml);
+                iosSuffixField.setText(Ctx.cfgSetup.suffixIos);
                androidMinSdkField.setText(Ctx.cfgSetup.androidMinSdkVersion);
                androidTargetSdkField.setText(Ctx.cfgSetup.androidTargetSdkVersion);
                androidMaxSdkField.setText(Ctx.cfgSetup.androidMaxSdkVersion);
@@ -44,6 +45,7 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
                desktopSuffixField.addKeyListener(updateOnTypeKeyListener);
                androidSuffixField.addKeyListener(updateOnTypeKeyListener);
                htmlSuffixField.addKeyListener(updateOnTypeKeyListener);
+                iosSuffixField.addKeyListener(updateOnTypeKeyListener);
                androidMinSdkField.addKeyListener(updateOnTypeKeyListener);
                androidTargetSdkField.addKeyListener(updateOnTypeKeyListener);
                androidMaxSdkField.addKeyListener(updateOnTypeKeyListener);
@@ -60,6 +62,7 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
                Ctx.cfgSetup.suffixCommon = coreSuffixField.getText();
                Ctx.cfgSetup.suffixDesktop = desktopSuffixField.getText();
                Ctx.cfgSetup.suffixAndroid = androidSuffixField.getText();
+                Ctx.cfgSetup.suffixIos = iosSuffixField.getText();
                Ctx.cfgSetup.androidMinSdkVersion = androidMinSdkField.getText();
                Ctx.cfgSetup.androidMaxSdkVersion = androidMaxSdkField.getText();
                Ctx.cfgSetup.androidTargetSdkVersion = androidTargetSdkField.getText();
@@ -67,6 +70,7 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
                Ctx.cfgUpdate.suffixCommon = coreSuffixField.getText();
                Ctx.cfgUpdate.suffixDesktop = desktopSuffixField.getText();
                Ctx.cfgUpdate.suffixAndroid = androidSuffixField.getText();
+                Ctx.cfgUpdate.suffixIos = iosSuffixField.getText();
                Ctx.fireCfgSetupChanged();
        }
 
@@ -125,6 +129,8 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
         jLabel3 = new javax.swing.JLabel();
         jLabel2 = new javax.swing.JLabel();
         jLabel9 = new javax.swing.JLabel();
+        iosSuffixField = new javax.swing.JTextField();
+        jLabel11 = new javax.swing.JLabel();
 
         jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
         jLabel7.setText("android:maxSdkVersion");
@@ -214,6 +220,12 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
 
         jLabel9.setText("Do not use twice the same suffix to avoid undefined behavior");
 
+        iosSuffixField.setText("-ios");
+        iosSuffixField.setName(""); // NOI18N
+
+        jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+        jLabel11.setText("iOS project suffix");
+
         javax.swing.GroupLayout paintedPanel2Layout = new javax.swing.GroupLayout(paintedPanel2);
         paintedPanel2.setLayout(paintedPanel2Layout);
         paintedPanel2Layout.setHorizontalGroup(
@@ -241,7 +253,12 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
                             .addComponent(androidSuffixField, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))
                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, paintedPanel2Layout.createSequentialGroup()
                         .addGap(0, 0, Short.MAX_VALUE)
-                        .addComponent(jLabel9)))
+                        .addGroup(paintedPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)
+                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, paintedPanel2Layout.createSequentialGroup()
+                                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                                .addComponent(iosSuffixField, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                 .addContainerGap())
         );
 
@@ -264,7 +281,11 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
                     .addComponent(htmlSuffixField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                     .addComponent(jLabel2)
                     .addComponent(desktopSuffixField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
-                .addGap(18, 18, 18)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(paintedPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jLabel11)
+                    .addComponent(iosSuffixField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addGap(4, 4, 4)
                 .addComponent(jLabel9)
                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
@@ -287,7 +308,7 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
                 .addComponent(paintedPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                 .addComponent(paintedPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(92, Short.MAX_VALUE))
+                .addContainerGap(80, Short.MAX_VALUE))
         );
     }// </editor-fold>//GEN-END:initComponents
 
@@ -299,8 +320,10 @@ public class AdvancedSettingsPanel extends javax.swing.JPanel {
     private javax.swing.JTextField coreSuffixField;
     private javax.swing.JTextField desktopSuffixField;
     private javax.swing.JTextField htmlSuffixField;
+    private javax.swing.JTextField iosSuffixField;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel10;
+    private javax.swing.JLabel jLabel11;
     private javax.swing.JLabel jLabel2;
     private javax.swing.JLabel jLabel3;
     private javax.swing.JLabel jLabel4;
index 79a944a..7431492 100644 (file)
@@ -11,7 +11,7 @@
     <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"/>
-    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,22,0,0,1,77"/>
+    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,30,0,0,1,77"/>
   </AuxValues>
 
   <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
                               <Component id="genAndroidPrjChk" alignment="0" min="-2" max="-2" attributes="0"/>
                               <Component id="genDesktopPrjChk" alignment="0" min="-2" max="-2" attributes="0"/>
                               <Component id="genHtmlPrjChk" alignment="0" min="-2" max="-2" attributes="0"/>
+                              <Component id="genIosPrjChk" alignment="0" min="-2" max="-2" attributes="0"/>
                           </Group>
                           <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
                       </Group>
                   <Component id="genDesktopPrjChk" min="-2" max="-2" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
                   <Component id="genHtmlPrjChk" min="-2" max="-2" attributes="0"/>
-                  <EmptySpace type="separate" max="-2" attributes="0"/>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Component id="genIosPrjChk" min="-2" max="-2" attributes="0"/>
+                  <EmptySpace max="-2" attributes="0"/>
                   <Component id="advancedSettingsLabel" min="-2" max="-2" attributes="0"/>
                   <EmptySpace max="32767" attributes="0"/>
               </Group>
             <Property name="text" type="java.lang.String" value="Generate the html project"/>
           </Properties>
         </Component>
+        <Component class="aurelienribon.ui.CompactCheckBox" name="genIosPrjChk">
+          <Properties>
+            <Property name="selected" type="boolean" value="true"/>
+            <Property name="text" type="java.lang.String" value="Generate the ios project"/>
+          </Properties>
+        </Component>
       </SubComponents>
     </Container>
   </SubComponents>
index 9b02be0..b4bbf4e 100644 (file)
@@ -70,6 +70,7 @@ public class ConfigSetupPanel extends javax.swing.JPanel {
                genDesktopPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});
                genAndroidPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});
                genHtmlPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});
+                genIosPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});
 
                advancedSettingsLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                advancedSettingsLabel.addMouseListener(new MouseAdapter() {
@@ -118,6 +119,7 @@ public class ConfigSetupPanel extends javax.swing.JPanel {
                Ctx.cfgSetup.isDesktopIncluded = genDesktopPrjChk.isSelected();
                Ctx.cfgSetup.isAndroidIncluded = genAndroidPrjChk.isSelected();
                Ctx.cfgSetup.isHtmlIncluded = genHtmlPrjChk.isSelected();
+                Ctx.cfgSetup.isIosIncluded = genIosPrjChk.isSelected();
                Ctx.fireCfgSetupChanged();
        }
 
@@ -229,6 +231,7 @@ public class ConfigSetupPanel extends javax.swing.JPanel {
         genAndroidPrjChk = new aurelienribon.ui.CompactCheckBox();
         genDesktopPrjChk = new aurelienribon.ui.CompactCheckBox();
         genHtmlPrjChk = new aurelienribon.ui.CompactCheckBox();
+        genIosPrjChk = new aurelienribon.ui.CompactCheckBox();
 
         setLayout(new java.awt.BorderLayout());
 
@@ -288,6 +291,9 @@ public class ConfigSetupPanel extends javax.swing.JPanel {
         genHtmlPrjChk.setSelected(true);
         genHtmlPrjChk.setText("Generate the html project");
 
+        genIosPrjChk.setSelected(true);
+        genIosPrjChk.setText("Generate the ios project");
+
         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
         jPanel1.setLayout(jPanel1Layout);
         jPanel1Layout.setHorizontalGroup(
@@ -322,7 +328,8 @@ public class ConfigSetupPanel extends javax.swing.JPanel {
                             .addComponent(genCorePrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                             .addComponent(genAndroidPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                             .addComponent(genDesktopPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                            .addComponent(genHtmlPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addComponent(genHtmlPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                            .addComponent(genIosPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                         .addGap(0, 0, Short.MAX_VALUE)))
                 .addContainerGap())
         );
@@ -354,7 +361,9 @@ public class ConfigSetupPanel extends javax.swing.JPanel {
                 .addComponent(genDesktopPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(genHtmlPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addGap(18, 18, 18)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(genIosPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(advancedSettingsLabel)
                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
@@ -372,6 +381,7 @@ public class ConfigSetupPanel extends javax.swing.JPanel {
     private aurelienribon.ui.CompactCheckBox genCorePrjChk;
     private aurelienribon.ui.CompactCheckBox genDesktopPrjChk;
     private aurelienribon.ui.CompactCheckBox genHtmlPrjChk;
+    private aurelienribon.ui.CompactCheckBox genIosPrjChk;
     private javax.swing.JPanel headerPanel;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel2;
index 5fa3249..f6e3233 100644 (file)
@@ -114,12 +114,14 @@ public class PreviewPanel extends javax.swing.JPanel {
                        DefaultMutableTreeNode desktopPrjNode = nodes.get("#DIR#prj-desktop");
                        DefaultMutableTreeNode androidPrjNode = nodes.get("#DIR#prj-android");
                        DefaultMutableTreeNode htmlPrjNode = nodes.get("#DIR#prj-html");
+                        DefaultMutableTreeNode iosPrjNode = nodes.get("#DIR#prj-ios");
 
                        rootNode.removeAllChildren();
                        rootNode.add(commonPrjNode);
                        if (Ctx.cfgSetup.isDesktopIncluded) rootNode.add(desktopPrjNode);
                        if (Ctx.cfgSetup.isAndroidIncluded) rootNode.add(androidPrjNode);
                        if (Ctx.cfgSetup.isHtmlIncluded) rootNode.add(htmlPrjNode);
+                        if (Ctx.cfgSetup.isIosIncluded) rootNode.add(iosPrjNode);
 
                        updateSrc();
                        updateLibs();
@@ -222,6 +224,7 @@ public class PreviewPanel extends javax.swing.JPanel {
                        DefaultMutableTreeNode desktopLibsNode = nodes.get("#DIR#prj-desktop/libs");
                        DefaultMutableTreeNode androidLibsNode = nodes.get("#DIR#prj-android/libs");
                        DefaultMutableTreeNode htmlLibsNode = nodes.get("#DIR#prj-html/war/WEB-INF/lib");
+                        DefaultMutableTreeNode iosLibsNode = nodes.get("#DIR#prj-ios/libs");
                        DefaultMutableTreeNode dataNode = nodes.get("#DIR#prj-android/assets");
 
                        commonLibsNode.removeAllChildren();
@@ -236,7 +239,8 @@ public class PreviewPanel extends javax.swing.JPanel {
                                for (String path : def.libsDesktop) pathToNodes(path, desktopLibsNode);
                                for (String path : def.libsAndroid) pathToNodes(path, androidLibsNode);
                                for (String path : def.libsHtml) pathToNodes(path, htmlLibsNode);
-                               for (String path : def.data) pathToNodes(path, dataNode);
+                                for (String path : def.libsIos) pathToNodes(path, iosLibsNode);
+                               for (String path : def.data) pathToNodes(path, dataNode);                              
                        }
                }
 
@@ -279,6 +283,7 @@ public class PreviewPanel extends javax.swing.JPanel {
                                        if (isDir && name.equals("prj-desktop")) name = Ctx.cfgSetup.projectName + Ctx.cfgSetup.suffixDesktop;
                                        if (isDir && name.equals("prj-android")) name = Ctx.cfgSetup.projectName + Ctx.cfgSetup.suffixAndroid;
                                        if (isDir && name.equals("prj-html")) name = Ctx.cfgSetup.projectName + Ctx.cfgSetup.suffixHtml;
+                                        if (isDir && name.equals("prj-ios")) name = Ctx.cfgSetup.projectName + Ctx.cfgSetup.suffixIos;
 
                                        label.setText(FilenameUtils.getName(name));
                                        label.setIcon(isDir ? Res.getImage("gfx/ic_folder.png") : Res.getImage("gfx/ic_file.png"));
index eb60945..9201409 100755 (executable)
Binary files a/extensions/gdx-setup-ui/src/res/projects.zip and b/extensions/gdx-setup-ui/src/res/projects.zip differ