Author: jerome
Date: 2009-02-12 00:37:22 +0100 (Thu, 12 Feb 2009)
New Revision: 3613

Added:
   
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/MoveWindowThread.java
Removed:
   
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/ResizeThread.java
Modified:
   
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Listener/MoveWindowListener.java
Log:
* Renamed ResizeThread to MoveWindowThread.

Modified: 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Listener/MoveWindowListener.java
===================================================================
--- 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Listener/MoveWindowListener.java
     2009-02-11 23:31:54 UTC (rev 3612)
+++ 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Listener/MoveWindowListener.java
     2009-02-11 23:37:22 UTC (rev 3613)
@@ -25,11 +25,11 @@
 import javax.swing.JFrame;
 import javax.swing.SwingUtilities;
 
-import com.tuxdroid.cc.Utils.ResizeThread;
+import com.tuxdroid.cc.Utils.MoveWindowThread;
 
 public class MoveWindowListener extends java.awt.event.MouseAdapter{
        
-       public ResizeThread my_graphical_thread = null;
+       public MoveWindowThread my_graphical_thread = null;
        private JFrame jFrame;
        
        /**
@@ -44,7 +44,7 @@
        public void mouseReleased(java.awt.event.MouseEvent e) {
                if (SwingUtilities.isLeftMouseButton(e)) {
                        try {
-                               ResizeThread.started = false;
+                               MoveWindowThread.started = false;
                                if(my_graphical_thread != null){
                                        my_graphical_thread = null;
                                }
@@ -57,8 +57,8 @@
        public void mousePressed(java.awt.event.MouseEvent e) {
                if (SwingUtilities.isLeftMouseButton(e)) {
                        try {
-                               my_graphical_thread = new ResizeThread(jFrame, 
e);
-                               ResizeThread.started = true;
+                               my_graphical_thread = new 
MoveWindowThread(jFrame, e);
+                               MoveWindowThread.started = true;
                                my_graphical_thread.start();
                        } catch (Exception except) {
                                except.printStackTrace();

Copied: 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/MoveWindowThread.java
 (from rev 3516, 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/ResizeThread.java)
===================================================================
--- 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/MoveWindowThread.java
                          (rev 0)
+++ 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/MoveWindowThread.java
  2009-02-11 23:37:22 UTC (rev 3613)
@@ -0,0 +1,107 @@
+/* This file is part of "TuxDroid Control Center".
+ *    Copyright 2008, kysoh
+ *    Author : Conan Jerome
+ *    eMail  : [email protected]
+ *    Site   : http://www.kysoh.com/
+ *
+ * "TuxDroid Control Center" is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * "TuxDroid Control Center" is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with "TuxDroid Control Center"; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package com.tuxdroid.cc.Utils;
+
+import java.awt.MouseInfo;
+import java.awt.event.MouseEvent;
+
+import javax.swing.JFrame;
+
+import com.tuxdroid.cc.CcCommons;
+
+
+public class MoveWindowThread extends Thread{
+       
+       private JFrame frame = null;
+       private MouseEvent event = null;
+       
+       private int x,y = -1;
+       private Object mutex = new Object();
+       private boolean test = true;
+       
+       public static boolean started = false;
+       private static int ex, ey = -1;
+       
+       /***
+        * This Runnable Thread allow to move on a frame.
+        * @param f : JFrame to move on.
+        * @param e : Triggered event.
+        */
+       public MoveWindowThread(JFrame f, MouseEvent e) {
+               super();
+               frame = f; //create an alias of the principal frame.
+               event = e; //Copying event to get mouse positions.
+       }
+       
+       /**
+        * Run the Thread object (move on the frame).
+        */
+       public void run(){
+               
+               CcCommons.logger.append("Moving Control center window ", true);
+               
+               while(MoveWindowThread.started)
+               {
+                       synchronized(this.mutex)
+                       {
+                               //getting new position on the screen
+                               try
+                               {
+                                       Thread.sleep((long)0.2);
+                                       //getting actuals mouse position.
+                                       if(((event.getX() == ex) || 
(event.getY() == ey)) && (test))
+                                               return;
+                                       
+                                       ex = event.getX();
+                                       ey = event.getY();
+                                       
+                                       x = ex;
+                                       y = ey;
+                       
+                                       //getting new position.
+                                       int x0 = 
(int)MouseInfo.getPointerInfo().getLocation().x - x;
+                                       Thread.sleep((long)1.0);
+                                       int y0 = 
(int)MouseInfo.getPointerInfo().getLocation().y - y;
+                                       
+                                       
+                                       if((x0 != x) && (y0 != y))
+                                               frame.setLocation(x0, y0); 
//apply.
+                               }
+                               catch(Exception except)
+                               {
+                                       
CcCommons.logger.appendError(except.getStackTrace());
+                                       MoveWindowThread.started = false;
+                               }
+                               catch(InternalError error)
+                               {
+                                       
CcCommons.logger.appendError(error.getStackTrace());
+                                       MoveWindowThread.started = false;
+                               }
+                       
+                               this.test = false;
+                       }
+               }
+               
+               CcCommons.logger.appendDone();
+       }
+}
\ No newline at end of file

Deleted: 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/ResizeThread.java
===================================================================
--- 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/ResizeThread.java
      2009-02-11 23:31:54 UTC (rev 3612)
+++ 
software_suite_v2/software/control_center/trunk/control_center/sources/com/tuxdroid/cc/Utils/ResizeThread.java
      2009-02-11 23:37:22 UTC (rev 3613)
@@ -1,107 +0,0 @@
-/* This file is part of "TuxDroid Control Center".
- *    Copyright 2008, kysoh
- *    Author : Conan Jerome
- *    eMail  : [email protected]
- *    Site   : http://www.kysoh.com/
- *
- * "TuxDroid Control Center" is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * "TuxDroid Control Center" is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with "TuxDroid Control Center"; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package com.tuxdroid.cc.Utils;
-
-import java.awt.MouseInfo;
-import java.awt.event.MouseEvent;
-
-import javax.swing.JFrame;
-
-import com.tuxdroid.cc.CcCommons;
-
-
-public class ResizeThread extends Thread{
-       
-       private JFrame frame = null;
-       private MouseEvent event = null;
-       
-       private int x,y = -1;
-       private Object mutex = new Object();
-       private boolean test = true;
-       
-       public static boolean started = false;
-       private static int ex, ey = -1;
-       
-       /***
-        * This Runnable Thread allow to move on a frame.
-        * @param f : JFrame to move on.
-        * @param e : Triggered event.
-        */
-       public ResizeThread(JFrame f, MouseEvent e) {
-               super();
-               frame = f; //create an alias of the principal frame.
-               event = e; //Copying event to get mouse positions.
-       }
-       
-       /**
-        * Run the Thread object (move on the frame).
-        */
-       public void run(){
-               
-               CcCommons.logger.append("Moving Control center window ", true);
-               
-               while(ResizeThread.started)
-               {
-                       synchronized(this.mutex)
-                       {
-                               //getting new position on the screen
-                               try
-                               {
-                                       Thread.sleep((long)0.2);
-                                       //getting actuals mouse position.
-                                       if(((event.getX() == ex) || 
(event.getY() == ey)) && (test))
-                                               return;
-                                       
-                                       ex = event.getX();
-                                       ey = event.getY();
-                                       
-                                       x = ex;
-                                       y = ey;
-                       
-                                       //getting new position.
-                                       int x0 = 
(int)MouseInfo.getPointerInfo().getLocation().x - x;
-                                       Thread.sleep((long)1.0);
-                                       int y0 = 
(int)MouseInfo.getPointerInfo().getLocation().y - y;
-                                       
-                                       
-                                       if((x0 != x) && (y0 != y))
-                                               frame.setLocation(x0, y0); 
//apply.
-                               }
-                               catch(Exception except)
-                               {
-                                       
CcCommons.logger.appendError(except.getStackTrace());
-                                       ResizeThread.started = false;
-                               }
-                               catch(InternalError error)
-                               {
-                                       
CcCommons.logger.appendError(error.getStackTrace());
-                                       ResizeThread.started = false;
-                               }
-                       
-                               this.test = false;
-                       }
-               }
-               
-               CcCommons.logger.appendDone();
-       }
-}
\ No newline at end of file


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to