Author: remi
Date: 2008-08-13 13:53:46 +0200 (Wed, 13 Aug 2008)
New Revision: 1469

Modified:
   software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
Log:
* update

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
===================================================================
--- software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-08-13 10:32:18 UTC (rev 1468)
+++ software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-08-13 11:53:46 UTC (rev 1469)
@@ -51,6 +51,8 @@
        
        private JFileChooser fileChooser;
        
+       private boolean confirmExit = false;
+       
        {
                //Set Look & Feel
                try {
@@ -224,7 +226,7 @@
                        
                        /* Play button */
                        playButton = new ATTSButton("Play", Color.BLACK, 
"/actionButton2Enable.png");
-                       playButton.setPressedIcon(new 
ImageIcon(getClass().getResource("/actionButton2Pressed.png")));
+                       playButton.setPressedIcon(new 
ImageIcon(getClass().getResource("/actionButton2Pressed.PNG")));
                        playButton.addMouseListener(new MouseAdapter() {
                                public void mousePressed(MouseEvent evt) 
                                { 
@@ -235,7 +237,7 @@
                        
                        /* Stop button */
                        stopButton = new ATTSButton("Stop", Color.BLACK, 
"/actionButton2Enable.png");
-                       stopButton.setPressedIcon(new 
ImageIcon(getClass().getResource("/actionButton2Pressed.png")));
+                       stopButton.setPressedIcon(new 
ImageIcon(getClass().getResource("/actionButton2Pressed.PNG")));
                        stopButton.addMouseListener(new MouseAdapter() {
                                public void mousePressed(MouseEvent evt) 
                                { 
@@ -365,6 +367,7 @@
                {
                        JOptionPane.showMessageDialog(this,
                                        "You must to set some parameters in 
your attitune before to save it.\n Goto the menu <File|Properties>");
+                       confirmExit = false;
                        return;
                }
                /* Check if the current scene is the template */
@@ -446,7 +449,12 @@
                                        JOptionPane.YES_NO_OPTION);
                        if (result == JOptionPane.YES_OPTION)
                        {
+                               confirmExit = true;
                                onMenuItemSave(menuItem);
+                               if (!confirmExit)
+                               {
+                                       return;
+                               }
                        }
                }
                /* Destroy the viewer an exit the application */
@@ -459,7 +467,7 @@
         */
        public void onMenuItemCreate(MenuItem menuItem)
        {
-               System.out.println("Create");
+               onCreateButtonPressed(null);
        }
        
        /*
@@ -467,7 +475,7 @@
         */
        public void onMenuItemDelete(MenuItem menuItem)
        {
-               System.out.println("Delete");
+               onDeleteButtonPressed(null);
        }
        
        /*
@@ -475,7 +483,7 @@
         */
        public void onMenuItemCopy(MenuItem menuItem)
        {
-               System.out.println("Copy");
+               onCopyButtonPressed(null);
        }
        
        /*
@@ -483,7 +491,7 @@
         */
        public void onMenuItemPast(MenuItem menuItem)
        {
-               System.out.println("Past");
+               onPastButtonPressed(null);
        }
        
        /*
@@ -653,7 +661,15 @@
         */
        public void onDeleteButtonPressed(MouseEvent evt)
        {
-               attBlockViewer.deleteBlock(attBlockViewer.getFocusedBlock());
+               int result = JOptionPane.showConfirmDialog(
+                               this,
+                               "You are sure that do you want deleting this 
block ?",
+                               "Block deleting",
+                               JOptionPane.YES_NO_OPTION);
+               if (result == JOptionPane.YES_OPTION)
+               {
+                       
attBlockViewer.deleteBlock(attBlockViewer.getFocusedBlock());
+               }
        }
        
        /*

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
      2008-08-13 10:32:18 UTC (rev 1468)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/visual/ATTBlockViewer.java
      2008-08-13 11:53:46 UTC (rev 1469)
@@ -1401,6 +1401,12 @@
                Hashtable<String,Object> blocksStruct = getBlocksStruct();
                List<Hashtable<String,Object>> macroStruct = new 
ArrayList<Hashtable<String,Object>>();
                String key;
+               
+               if (blocksStruct.size() == 0)
+               {
+                       return;
+               }
+               
                Iterator<String> it = (Iterator<String>)blocksStruct.keys();
                Hashtable<String,Object> blockStruct;
                Hashtable<String,Object> cmdStruct;


-------------------------------------------------------------------------
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