Author: jerome
Date: 2008-08-16 19:46:17 +0200 (Sat, 16 Aug 2008)
New Revision: 1523
Modified:
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/.classpath
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
Log:
* Added edit configuration panel.
* Set plastic3D look and feel.
Modified:
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/.classpath
===================================================================
--- software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/.classpath
2008-08-16 16:31:17 UTC (rev 1522)
+++ software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/.classpath
2008-08-16 17:46:17 UTC (rev 1523)
@@ -3,5 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/TuxAPI"/>
+ <classpathentry kind="lib" path="C:/Users/pc/Desktop/looks-2.1.4.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
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 16:31:17 UTC (rev 1522)
+++
software_suite_v2/software/tools/chatterTux/trunk/Chatter_tux/src/ConfInterface.java
2008-08-16 17:46:17 UTC (rev 1523)
@@ -35,7 +35,6 @@
import com.tuxisalive.api.TuxAPI;
import com.tuxisalive.api.TuxAPIConst;
-import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Point;
@@ -56,6 +55,8 @@
private JPanel voiceConfigPanel;
private JPanel actionModifier;
private JPanel buttonsPanel;
+ private JPanel editPanel;
+ private JPanel addPanel;
/* Server functions objects */
private JRadioButton startServer;
@@ -63,6 +64,8 @@
private ButtonGroup group;
private JButton ok;
private JButton cancel;
+ private JButton okEdition; //TODO
+ private JButton okAdd; //TODO
/* Voice configuration */
private JComboBox locutorSet;
@@ -89,7 +92,7 @@
public ConfInterface(){
if(iniFile.isFile()){
-
+
//Getting ini file.
this.ini = new IniFile(this.iniFile);
this.properties = new
Properties(this.ini.getHashtable());
@@ -140,8 +143,16 @@
//Gets frame.
public JFrame getFrame(){
if(this.frame == null){
+
+ //Set Look & Feel
+ try {
+
javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
//$NON-NLS-1$
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
frame = new JFrame("Chatter Tux configuration");
- frame.setSize(new Dimension(400, 400));
+ frame.setSize(new Dimension(400, 500));
frame.setPreferredSize(frame.getSize());
frame.add(this.getJContentPane());
@@ -158,6 +169,10 @@
this.jContentPane.setLayout(null);
this.jContentPane.add(this.getVoiceConfigurationPanel());
this.jContentPane.add(this.getActionsPanel());
+ //Adding edition and add Chatter Tux entries panel.
+ this.jContentPane.add(this.getEditPanel());
+ //this.jContentPane.add(this.getAddEntry());
+
this.jContentPane.add(this.getButtonsPanel());
}
return jContentPane;
@@ -265,6 +280,7 @@
if(arg0.getActionCommand().equalsIgnoreCase("comboboxchanged")){
String key =
parametrized.getModel().getSelectedItem().toString();
setAreaValues(key);
+ //TODO set edition panel values
from selected key.
}
}
@@ -275,6 +291,7 @@
}
+ //Gets the start server radio button.
public JRadioButton getStartServer(){
if(this.startServer == null){
this.startServer = new JRadioButton("Start Chatter");
@@ -285,7 +302,7 @@
return this.startServer;
}
-
+ //Gets the stop server radio button.
public JRadioButton getStopServer(){
if(this.stopServer == null){
this.stopServer = new JRadioButton("Stop Chatter");
@@ -297,6 +314,7 @@
}
+ //Gets confirm button.
public JButton getOkButton(){
if(this.ok == null){
this.ok = new JButton("Ok");
@@ -312,6 +330,7 @@
}
+ //Gets stop button.
public JButton getCancelButton(){
if(this.cancel == null){
this.cancel = new JButton("Cancel");
@@ -327,7 +346,8 @@
return this.cancel;
}
-
+
+ //Gets the actions buttons panel.
public JPanel getButtonsPanel(){
if(this.buttonsPanel == null){
this.buttonsPanel = new JPanel();
@@ -336,13 +356,57 @@
this.buttonsPanel.add(this.getCancelButton());
this.buttonsPanel.setSize(this.actionModifier.getWidth(), this.ok.getHeight()
+8);
this.buttonsPanel.setPreferredSize(this.buttonsPanel.getSize());
- int x = this.actionModifier.getX();
- int y = this.actionModifier.getY() + 4 +
this.actionModifier.getHeight();
+ int x = this.editPanel.getX();
+ int y = this.editPanel.getY() + 4 +
this.actionModifier.getHeight();
this.buttonsPanel.setLocation(new Point(x, y));
}
return this.buttonsPanel;
}
+
+ //TODO
+ //Gets Edit panel.
+ public JPanel getEditPanel(){
+ if(this.editPanel == null){
+ this.editPanel = new JPanel();
+ this.editPanel.setLayout(null);
+ this.editPanel.setSize(this.actionModifier.getWidth(),
this.actionModifier.getHeight());
+
this.editPanel.setPreferredSize(this.editPanel.getSize());
+
this.editPanel.setBorder(BorderFactory.createTitledBorder("Modify"));
+ this.editPanel.setVisible(true);
+
+ //Gettin button.
+ this.okEdition = new JButton("Save");
+ this.okEdition.setSize(new Dimension(73,23));
+
this.okEdition.setPreferredSize(this.okEdition.getSize());
+ this.okEdition.addMouseListener(new
java.awt.event.MouseAdapter(){
+ public void
mousePressed(java.awt.event.MouseEvent event){
+ storeAsIni();
+ }
+ });
+ this.okEdition.setLocation(new Point(294, 2));
+ this.editPanel.add(this.okEdition);
+ int x = this.actionModifier.getX();
+ int y = this.actionModifier.getY() + 4 +
this.actionModifier.getHeight();
+ this.editPanel.setLocation(new Point(x, y));
+ }
+ return this.editPanel;
+ }
+
+ //TODO
+ //Gets new Chatter Tux entry panel.
+ public JPanel getAddEntry(){
+ if(this.addPanel == null){
+
+ }
+ return this.addPanel;
+ }
+
+ // TODO Store to ini file.
+ public void storeAsIni(){
+
+ }
+
/*****************************************************************************/
/** Other internals functions. ********************************************/
/*
@@ -366,9 +430,17 @@
text = "Action: " + action + "\n" + title + values.get("cmd");
parameters.setText(text);
}
-
+ /*
+ * Set modify panel values.
+ */
+ //TODO
+ public void setEditPanelValues(String action){
+
+ }
+
+
private class ServerControlActionListener implements ActionListener{
public void actionPerformed(ActionEvent e) {
@@ -382,4 +454,4 @@
}
}
-}
+}
\ No newline at end of file
-------------------------------------------------------------------------
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