Author: jerome
Date: 2008-08-16 11:38:34 +0200 (Sat, 16 Aug 2008)
New Revision: 1513

Added:
   
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/Properties.java
Modified:
   
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
   
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/IniFile.java
Log:
* Added properties class. Object return Chatter Tux properties by ini key.

Modified: 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
===================================================================
--- 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
        2008-08-16 08:50:56 UTC (rev 1512)
+++ 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
        2008-08-16 09:38:34 UTC (rev 1513)
@@ -59,6 +59,7 @@
        List<String> availableLocutors;
        int currentPitch = 120;
        IniFile ini;
+       Properties properties;
        
        //** Tux Object.
        private TuxAPI api;
@@ -70,6 +71,7 @@
                        
                        //Getting ini file.
                        this.ini = new IniFile(this.iniFile);
+                       this.properties = new 
Properties(this.ini.getHashtable());
                        
                        //Create tux api object.
                        this.api = new TuxAPI("127.0.0.1", 270);

Modified: 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/IniFile.java
===================================================================
--- 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/IniFile.java  
    2008-08-16 08:50:56 UTC (rev 1512)
+++ 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/IniFile.java  
    2008-08-16 09:38:34 UTC (rev 1513)
@@ -118,4 +118,11 @@
        public Vector<String> getKeyPropertiesAtKey(String key){
                return (Vector<String>)this.keys.get(key);
        }
+       
+       /*
+        * Return complete hash table.
+        */
+       public Hashtable<String, Vector<String>> getHashtable(){
+               return this.keys;
+       }
 }

Added: 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/Properties.java
===================================================================
--- 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/Properties.java
                           (rev 0)
+++ 
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/Properties.java
   2008-08-16 09:38:34 UTC (rev 1513)
@@ -0,0 +1,54 @@
+/* This file is part of "TuxDroid Chatter Tux tool".
+ *    Copyright 2008, kysoh
+ *    Author : Conan Jerome
+ *    eMail  : [EMAIL PROTECTED]
+ *    Site   : http://www.kysoh.com/
+ *
+ * "TuxDroid Chatter Tux tool" 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 Chatter Tux tool" 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.
+ */
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class Properties {
+       
+       private Hashtable<String, Vector<String>> hash;
+
+       public Properties(Hashtable<String, Vector<String>> hash){
+               this.hash = hash;
+       }
+       
+       public Hashtable<String, String> getProperties(String key){
+               Vector<String> vecteur = (Vector<String>)this.hash.get(key);
+               Hashtable<String, String> table = new Hashtable<String, 
String>();
+               for(String str : vecteur){
+                       String tmp = new String();
+                       String tmp2 = new String();
+                       if(str.contains("=")){
+                               int index = str.indexOf("=");
+                               tmp = str.substring(0, index - 1).replace(" ", 
""); //Getting action.
+                               tmp2 = str.substring(index + 1, str.length());
+                               if(tmp2.substring(0, 0).equals("")){
+                                       tmp2 = tmp2.substring(1);
+                               }
+                               table.put(tmp, tmp2);
+                       }
+               }
+               
+               return table;
+       }
+       
+}


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