Author: jerome
Date: 2008-08-16 17:34:59 +0200 (Sat, 16 Aug 2008)
New Revision: 1519
Modified:
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
Log:
* Display all registered configuration.
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 15:10:28 UTC (rev 1518)
+++
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
2008-08-16 15:34:59 UTC (rev 1519)
@@ -28,16 +28,12 @@
import javax.swing.JComboBox;
import javax.swing.JTextArea;
import javax.swing.SpinnerListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionEvent;
-import sun.awt.SunHints.Value;
-
import com.tuxisalive.api.TuxAPI;
import com.tuxisalive.api.TuxAPIConst;
import java.awt.Dimension;
+import java.awt.Font;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -79,6 +75,7 @@
private TuxAPI api;
public ConfInterface(){
+
if(iniFile.isFile()){
//Getting ini file.
@@ -182,6 +179,25 @@
}
this.pitchSet.setModel(new SpinnerListModel(values));
+ Hashtable<String, String> storedLocutor =
this.properties.getProperties("VOICE CONFIGURATION");
+ String locutor = storedLocutor.get("locutor");
+ String pitch = storedLocutor.get("pitch");
+
+ //Displaying registered locutor configuration.
+ if(this.locutorSet.getItemCount() <= 0){
+ this.locutorSet.addItem(locutor);
+ }
+ else{
+ for(int i=0 ; i<
this.locutorSet.getItemCount(); i++){
+
if(this.locutorSet.getModel().getElementAt(i).equals(locutor)){
+
this.locutorSet.setSelectedIndex(i);
+ }
+ else this.locutorSet.addItem(locutor);
+ }
+ }
+
+ //Displaying registered pitch configuration.
+ this.pitchSet.setValue(Integer.valueOf(pitch));
}
return this.voiceConfigPanel;
}
@@ -220,26 +236,44 @@
this.parameters.setLocation(new
Point(this.parametrized.getX(), 60));
this.actionModifier.add(this.parameters);
-
+ this.parameters.setFont(new Font("Verdana", Font.BOLD,
12));
this.parametrized.addActionListener(new
ActionListener(){
public void actionPerformed(ActionEvent arg0) {
if(arg0.getActionCommand().equalsIgnoreCase("comboboxchanged")){
String key =
parametrized.getModel().getSelectedItem().toString();
- Hashtable <String, String>
values = properties.getProperties(key);
- String text = ("Action: " +
values.get("action").toString());
- String title = "";
-
if(values.get("action").equalsIgnoreCase("tts")) title = "Message: ";
- else
if(values.get("action").equalsIgnoreCase("api")) title = "Command: ";
- text += "\n" + title +
values.get("cmd");
- parameters.setText(text);
+ setAreaValues(key);
}
}
});
}
+
this.setAreaValues(this.parametrized.getSelectedItem().toString());
return this.actionModifier;
}
+
+
+ /*
+ * Sets values into parameters area.
+ */
+ public void setAreaValues(String key){
+ String title = "";
+ String text = "";
+ String action = "";
+ Hashtable <String, String> values =
properties.getProperties(key);
+
+ if(values.get("action").equalsIgnoreCase("tts")){
+ action = "Tux say a message";
+ title = "Message: ";
+ }
+ else if(values.get("action").equalsIgnoreCase("api")){
+ action = "Tux moves his body";
+ title = "Command: ";
+ }
+
+ text = "Action: " + action + "\n" + title + values.get("cmd");
+ parameters.setText(text);
+ }
}
-------------------------------------------------------------------------
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