Author: remi
Date: 2008-08-16 18:28:30 +0200 (Sat, 16 Aug 2008)
New Revision: 1521

Added:
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneWaveListFrame.java
Modified:
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneMenuBar.java
   software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
Log:
* added a frame to configure the wave list. (only the GUI)

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneMenuBar.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneMenuBar.java
 2008-08-16 16:20:16 UTC (rev 1520)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneMenuBar.java
 2008-08-16 16:28:30 UTC (rev 1521)
@@ -25,6 +25,7 @@
        private MenuItem menuItemSave;
        private MenuItem menuItemSaveAs;
        private MenuItem menuItemProperties;
+       private MenuItem menuItemWaveList;
        private MenuItem menuItemQuit;
        
        private MenuItem menuItemCreate;
@@ -51,6 +52,7 @@
                events.insert("onMenuItemSave"); //$NON-NLS-1$
                events.insert("onMenuItemSaveAs"); //$NON-NLS-1$
                events.insert("onMenuItemProperties"); //$NON-NLS-1$
+               events.insert("onMenuItemWaveList"); //$NON-NLS-1$
                events.insert("onMenuItemQuit"); //$NON-NLS-1$
                events.insert("onMenuItemCreate"); //$NON-NLS-1$
                events.insert("onMenuItemDelete"); //$NON-NLS-1$
@@ -103,6 +105,14 @@
                        }
                });
                
+               menuItemWaveList = new 
MenuItem(ATTMessages.getString("AttituneMenuBar.24")); //$NON-NLS-1$
+               menuItemWaveList.addActionListener(new ActionListener() {
+                       public void actionPerformed(ActionEvent e)
+                       {
+                               events.notify("onMenuItemWaveList", 
menuItemWaveList); //$NON-NLS-1$
+                       }
+               });
+               
                menuItemQuit = new 
MenuItem(ATTMessages.getString("AttituneMenuBar.25")); //$NON-NLS-1$
                menuItemQuit.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e)
@@ -166,6 +176,7 @@
                menuFile.add(menuItemSave);
                menuFile.add(menuItemSaveAs);
                menuFile.addSeparator();
+               menuFile.add(menuItemWaveList);
                menuFile.add(menuItemProperties);
                menuFile.addSeparator();
                menuFile.add(menuItemQuit);

Added: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneWaveListFrame.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneWaveListFrame.java
                           (rev 0)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/GUI/AttituneWaveListFrame.java
   2008-08-16 16:28:30 UTC (rev 1521)
@@ -0,0 +1,257 @@
+package GUI;
+
+import javax.swing.*;
+import javax.swing.border.BevelBorder;
+import javax.sound.sampled.*;
+
+import com.tuxisalive.attitunes.ATTMessages;
+import com.tuxisalive.attitunes.visual.ATTBlockViewer;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import java.io.*;
+
+
+/**
+* This code was edited or generated using CloudGarden's Jigloo
+* SWT/Swing GUI Builder, which is free for non-commercial
+* use. If Jigloo is being used commercially (ie, by a corporation,
+* company or business for any purpose whatever) then you
+* should purchase a license for each developer using Jigloo.
+* Please visit www.cloudgarden.com for details.
+* Use of Jigloo implies acceptance of these licensing terms.
+* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
+* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
+* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
+*/
+
+/**
+ * 
+ */
+public class AttituneWaveListFrame extends JFrame
+{
+       private static final long serialVersionUID = 1L;
+       private ATTBlockViewer blockViewer;
+       private JLabel jLabelWaveList;
+       private JButton jButtonReplace;
+       private JButton jButtonDelete;
+       private JButton jButtonAdd;
+       private JPanel jPanelActions;
+       private JList jListWave;
+       private JScrollPane jScrollPaneWaveList;
+       private JButton jButtonClose;
+       private JPanel jPanelBottom;
+       private JPanel jPanelMain;
+
+       {
+               //Set Look & Feel
+               try {
+                       
javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
 //$NON-NLS-1$
+               } catch(Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       /**
+        * 
+        * @param blockViewer
+        */
+       public AttituneWaveListFrame(ATTBlockViewer blockViewer)
+       {
+               super();
+               this.blockViewer = blockViewer;
+               this.setIconImage(new 
ImageIcon(getClass().getResource("/icone.png")).getImage());
+               this.setTitle(ATTMessages.getString("AttituneWaveListFrame.1"));
+               this.setResizable(false);
+               /* Init the frame */
+               initGUI();
+       }
+       
+       private void initGUI() {
+               try {
+                       {
+                               GridBagLayout thisLayout1 = new GridBagLayout();
+                               thisLayout1.rowWeights = new double[] {0.0, 
0.1};
+                               thisLayout1.rowHeights = new int[] {185, 7};
+                               thisLayout1.columnWeights = new double[] {0.1};
+                               thisLayout1.columnWidths = new int[] {7};
+                               getContentPane().setLayout(thisLayout1);
+                               {
+                                       jPanelBottom = new JPanel();
+                                       GridBagLayout jPanelBottomLayout = new 
GridBagLayout();
+                                       getContentPane().add(jPanelBottom, new 
GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, 
GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+                                       jPanelBottomLayout.rowWeights = new 
double[] {0.1};
+                                       jPanelBottomLayout.rowHeights = new 
int[] {7};
+                                       jPanelBottomLayout.columnWeights = new 
double[] {0.0, 0.1, 0.1, 0.1, 0.1, 0.0};
+                                       jPanelBottomLayout.columnWidths = new 
int[] {7, 7, 7, 7, 7, 7};
+                                       
jPanelBottom.setLayout(jPanelBottomLayout);
+                                       
jPanelBottom.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
+                                       {
+                                               jButtonClose = new JButton();
+                                               jPanelBottom.add(jButtonClose, 
new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, 
GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
+                                               
jButtonClose.setText(ATTMessages.getString("AttituneWaveListFrame.5"));
+                                               
jButtonClose.addMouseListener(new MouseAdapter() {
+                                                       public void 
mousePressed(MouseEvent evt) {
+                                                               
jButtonCloseMousePressed(evt);
+                                                       }
+                                               });
+                                       }
+                               }
+                               {
+                                       jPanelMain = new JPanel();
+                                       GridBagLayout jPanelMainLayout = new 
GridBagLayout();
+                                       getContentPane().add(jPanelMain, new 
GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, 
GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+                                       
jPanelMain.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
+                                       jPanelMainLayout.rowWeights = new 
double[] {0.0, 0.1, 0.0};
+                                       jPanelMainLayout.rowHeights = new int[] 
{23, 7, 7};
+                                       jPanelMainLayout.columnWeights = new 
double[] {0.0, 0.0, 0.0, 0.1};
+                                       jPanelMainLayout.columnWidths = new 
int[] {7, 260, 7, 7};
+                                       jPanelMain.setLayout(jPanelMainLayout);
+                                       {
+                                               jLabelWaveList = new JLabel();
+                                               jPanelMain.add(jLabelWaveList, 
new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, 
GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
+                                               
jLabelWaveList.setText(ATTMessages.getString("AttituneWaveListFrame.2"));
+                                       }
+                                       {
+                                               jScrollPaneWaveList = new 
JScrollPane();
+                                               
jPanelMain.add(jScrollPaneWaveList, new GridBagConstraints(1, 1, 1, 1, 0.0, 
0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 
0), 0, 0));
+                                               
jScrollPaneWaveList.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+                                               {
+                                                       ListModel 
jListWaveModel = 
+                                                               new 
DefaultComboBoxModel(
+                                                                               
new String[] {});
+                                                       jListWave = new JList();
+                                                       
jScrollPaneWaveList.setViewportView(jListWave);
+                                                       
jListWave.setModel(jListWaveModel);
+                                               }
+                                       }
+                                       {
+                                               jPanelActions = new JPanel();
+                                               GridBagLayout 
jPanelActionsLayout = new GridBagLayout();
+                                               jPanelMain.add(jPanelActions, 
new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, 
GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+                                               jPanelActionsLayout.rowWeights 
= new double[] {0.1, 0.1, 0.1, 0.1, 0.1, 0.1};
+                                               jPanelActionsLayout.rowHeights 
= new int[] {7, 7, 7, 7, 7, 7};
+                                               
jPanelActionsLayout.columnWeights = new double[] {0.1, 0.0, 0.0};
+                                               
jPanelActionsLayout.columnWidths = new int[] {7, 0, 7};
+                                               
jPanelActions.setLayout(jPanelActionsLayout);
+                                               {
+                                                       jButtonAdd = new 
JButton();
+                                                       
jPanelActions.add(jButtonAdd, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 
0), 0, 0));
+                                                       
jButtonAdd.setText(ATTMessages.getString("AttituneWaveListFrame.3"));
+                                                       
jButtonAdd.addMouseListener(new MouseAdapter() {
+                                                               public void 
mousePressed(MouseEvent evt) {
+                                                                       
jButtonAddMousePressed(evt);
+                                                               }
+                                                       });
+                                               }
+                                               {
+                                                       jButtonDelete = new 
JButton();
+                                                       
jPanelActions.add(jButtonDelete, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, 
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 
0), 0, 0));
+                                                       
jButtonDelete.setText(ATTMessages.getString("AttituneWaveListFrame.4"));
+                                                       
jButtonDelete.addMouseListener(new MouseAdapter() {
+                                                               public void 
mousePressed(MouseEvent evt) {
+                                                                       
jButtonDeleteMousePressed(evt);
+                                                               }
+                                                       });
+                                               }
+                                               {
+                                                       jButtonReplace = new 
JButton();
+                                                       
jPanelActions.add(jButtonReplace, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 
0), 0, 0));
+                                                       
jButtonReplace.setText(ATTMessages.getString("AttituneWaveListFrame.8"));
+                                                       
jButtonReplace.addMouseListener(new MouseAdapter() {
+                                                               public void 
mousePressed(MouseEvent evt) {
+                                                                       
jButtonReplaceMousePressed(evt);
+                                                               }
+                                                       });
+                                               }
+                                       }
+                               }
+                               this.setSize(413, 250);
+                       }
+               } catch(Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       /*
+        * Check the format of a wave file
+        */
+       private boolean checkWavFormat(String waveFile)
+       {
+               File soundFile = new File(waveFile);
+               
+               if (!soundFile.exists())
+               {
+                       return false;
+               }
+ 
+               AudioInputStream audioInputStream = null;
+               try
+               {
+                       audioInputStream = 
AudioSystem.getAudioInputStream(soundFile);
+               }
+               catch (UnsupportedAudioFileException e1)
+               {
+                       return false;
+               }
+               catch (IOException e1)
+               {
+                       return false;
+               }
+ 
+               AudioFormat format = audioInputStream.getFormat();
+               
+               if (format.getSampleRate() != 8000.0)
+               {
+                       return false;
+               }
+               
+               if (format.getSampleSizeInBits() != 8)
+               {
+                       return false;
+               }
+               
+               if (format.getChannels() != 1)
+               {
+                       return false;
+               }
+
+               return true;
+       }
+       
+       /*
+        * Event on close button pressed
+        */
+       private void jButtonCloseMousePressed(MouseEvent evt)
+       {
+               this.dispose();
+       }
+       
+       /*
+        * Event on Add button pressed
+        */
+       private void jButtonAddMousePressed(MouseEvent evt)
+       {
+               System.out.println("jButtonAdd.mousePressed, event="+evt);
+       }
+       
+       /*
+        * Event on Delete button pressed
+        */
+       private void jButtonDeleteMousePressed(MouseEvent evt)
+       {
+               System.out.println("jButtonDelete.mousePressed, event="+evt);
+       }
+       
+       /*
+        * Event on Replace button pressed
+        */
+       private void jButtonReplaceMousePressed(MouseEvent evt)
+       {
+               System.out.println("jButtonReplace.mousePressed, event="+evt);
+       }
+
+}

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
===================================================================
--- software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-08-16 16:20:16 UTC (rev 1520)
+++ software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-08-16 16:28:30 UTC (rev 1521)
@@ -108,6 +108,7 @@
                        menuBar.events.register("onMenuItemSave", this, 
"onMenuItemSave"); //$NON-NLS-1$ //$NON-NLS-2$
                        menuBar.events.register("onMenuItemSaveAs", this, 
"onMenuItemSaveAs"); //$NON-NLS-1$ //$NON-NLS-2$
                        menuBar.events.register("onMenuItemProperties", this, 
"onMenuItemProperties"); //$NON-NLS-1$ //$NON-NLS-2$
+                       menuBar.events.register("onMenuItemWaveList", this, 
"onMenuItemWaveList"); //$NON-NLS-1$ //$NON-NLS-2$
                        menuBar.events.register("onMenuItemQuit", this, 
"onMenuItemQuit"); //$NON-NLS-1$ //$NON-NLS-2$
                        menuBar.events.register("onMenuItemCreate", this, 
"onMenuItemCreate"); //$NON-NLS-1$ //$NON-NLS-2$
                        menuBar.events.register("onMenuItemDelete", this, 
"onMenuItemDelete"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -584,6 +585,16 @@
        }
        
        /*
+        * Event on menu Wave list
+        */
+       public void onMenuItemWaveList(MenuItem menuItem)
+       {
+               AttituneWaveListFrame pFrame = new 
AttituneWaveListFrame(attBlockViewer);
+               pFrame.setLocationRelativeTo(null);
+               pFrame.setVisible(true);
+       }
+       
+       /*
         * Event on menu Properties
         */
        public void onMenuItemProperties(MenuItem menuItem)

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
     2008-08-16 16:20:16 UTC (rev 1520)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages.properties
     2008-08-16 16:28:30 UTC (rev 1521)
@@ -56,6 +56,7 @@
 AttituneMenuBar.19=Save
 AttituneMenuBar.21=Save As...
 AttituneMenuBar.23=Properties
+AttituneMenuBar.24=Wave list
 AttituneMenuBar.25=Quit
 AttituneMenuBar.27=Create
 AttituneMenuBar.29=Delete
@@ -69,3 +70,11 @@
 ATTBlockViewer.13=Spinning
 ATTBlockViewer.15=Sound
 ATTBlockViewer.17=TTS
+AttituneWaveListFrame.1=Attitunes studio - Wave list
+AttituneWaveListFrame.2=Wave list :
+AttituneWaveListFrame.3=Add
+AttituneWaveListFrame.4=Delete
+AttituneWaveListFrame.5=Close
+AttituneWaveListFrame.6=Only the PCM Mono 8K 8Bit wave files are supported
+AttituneWaveListFrame.7=This operation will deleting the blocks which use this 
wave file !\nContinue ?
+AttituneWaveListFrame.8=Replace

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
  2008-08-16 16:20:16 UTC (rev 1520)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/messages_fr.properties
  2008-08-16 16:28:30 UTC (rev 1521)
@@ -56,6 +56,7 @@
 AttituneMenuBar.19=Sauvegarder
 AttituneMenuBar.21=Sauvegarder sous...
 AttituneMenuBar.23=Propri�t�s
+AttituneMenuBar.24=Liste des sons
 AttituneMenuBar.25=Quitter
 AttituneMenuBar.27=Cr�er
 AttituneMenuBar.29=Supprimer
@@ -69,3 +70,11 @@
 ATTBlockViewer.13=Rotation
 ATTBlockViewer.15=Sons
 ATTBlockViewer.17=TTS
+AttituneWaveListFrame.1=Attitunes studio - Liste des sons
+AttituneWaveListFrame.2=Liste des sons :
+AttituneWaveListFrame.3=Ajouter
+AttituneWaveListFrame.4=Supprimer
+AttituneWaveListFrame.5=Fermer
+AttituneWaveListFrame.6=Seuls les fichiers son au format Wav PCM Mono 8K 8Bit 
sont support�s
+AttituneWaveListFrame.7=Cette op�ration va supprimer tout les blocs utilisant 
ce fichier son !\nVoulez-vous continuer ?
+AttituneWaveListFrame.8=Remplacer


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to