[tuxdroid-svn] r1333 - in software_suite_v2: . software software/tools software/tools/tuxController
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-07-17 13:52:09
|
Author: Paul_R Date: 2008-07-17 15:52:10 +0200 (Thu, 17 Jul 2008) New Revision: 1333 Added: software_suite_v2/software/ software_suite_v2/software/tools/ software_suite_v2/software/tools/tuxController/ software_suite_v2/software/tools/tuxController/.classpath software_suite_v2/software/tools/tuxController/.project software_suite_v2/software/tools/tuxController/src/ software_suite_v2/software/tools/tuxController/src/GUI/ software_suite_v2/software/tools/tuxController/src/GUI/JVerticalLabel.java software_suite_v2/software/tools/tuxController/src/GUI/componants/ software_suite_v2/software/tools/tuxController/src/GUI/componants/advancedViewPanel.java software_suite_v2/software/tools/tuxController/src/GUI/componants/controlPanel.java software_suite_v2/software/tools/tuxController/src/GUI/componants/generalControlPanel.java software_suite_v2/software/tools/tuxController/src/GUI/componants/ledPanel.java software_suite_v2/software/tools/tuxController/src/GUI/componants/levelPanel.java software_suite_v2/software/tools/tuxController/src/GUI/componants/objects.java software_suite_v2/software/tools/tuxController/src/GUI/componants/ttsPanel.java software_suite_v2/software/tools/tuxController/src/GUI/componants/tuxPanel.java software_suite_v2/software/tools/tuxController/src/GUI/control/ software_suite_v2/software/tools/tuxController/src/GUI/control/controlTux.java software_suite_v2/software/tools/tuxController/src/GUI/control/ledsThread.java software_suite_v2/software/tools/tuxController/src/GUI/control/waitingLoop.java software_suite_v2/software/tools/tuxController/src/GUI/images/ software_suite_v2/software/tools/tuxController/src/GUI/images/flippersDown.png software_suite_v2/software/tools/tuxController/src/GUI/images/flippersUp.png software_suite_v2/software/tools/tuxController/src/GUI/images/gadget.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconBattery.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconDown.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconLeft.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconLight.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconMicro.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconRight.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconRun.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconStop.png software_suite_v2/software/tools/tuxController/src/GUI/images/iconUp.png software_suite_v2/software/tools/tuxController/src/GUI/images/leftEyeClosed.png software_suite_v2/software/tools/tuxController/src/GUI/images/leftEyeOff.png software_suite_v2/software/tools/tuxController/src/GUI/images/leftEyeOn.png software_suite_v2/software/tools/tuxController/src/GUI/images/mouthClosed.png software_suite_v2/software/tools/tuxController/src/GUI/images/mouthOpened.png software_suite_v2/software/tools/tuxController/src/GUI/images/rightEyeClosed.png software_suite_v2/software/tools/tuxController/src/GUI/images/rightEyeOff.png software_suite_v2/software/tools/tuxController/src/GUI/images/rightEyeOn.png software_suite_v2/software/tools/tuxController/src/GUI/images/spinCharging.png software_suite_v2/software/tools/tuxController/src/GUI/images/spinLeft.png software_suite_v2/software/tools/tuxController/src/GUI/images/spinOff.png software_suite_v2/software/tools/tuxController/src/GUI/images/spinRight.png software_suite_v2/software/tools/tuxController/src/GUI/mainWindow.java software_suite_v2/software/tools/tuxController/src/i18n/ software_suite_v2/software/tools/tuxController/src/i18n/bundle.java software_suite_v2/software/tools/tuxController/src/i18n/bundle.properties software_suite_v2/software/tools/tuxController/src/i18n/bundle_en_GB.properties software_suite_v2/software/tools/tuxController/src/i18n/bundle_en_US.properties software_suite_v2/software/tools/tuxController/src/i18n/bundle_fr_FR.properties software_suite_v2/software/tools/tuxController/src/tuxController/ software_suite_v2/software/tools/tuxController/src/tuxController/main.java Log: * First import of the tux controller gadget. - GUI almost done. - Functionnalities done. - Internalization : fr-FR, en-US, en-GB (default : english). The API isn't included on the source directory. To open the project, copy the java api to src/ (src/com/tuxisalive/api/). Added: software_suite_v2/software/tools/tuxController/.classpath =================================================================== --- software_suite_v2/software/tools/tuxController/.classpath (rev 0) +++ software_suite_v2/software/tools/tuxController/.classpath 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: software_suite_v2/software/tools/tuxController/.project =================================================================== --- software_suite_v2/software/tools/tuxController/.project (rev 0) +++ software_suite_v2/software/tools/tuxController/.project 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tuxController</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: software_suite_v2/software/tools/tuxController/src/GUI/JVerticalLabel.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/JVerticalLabel.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/JVerticalLabel.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,79 @@ +/* This file is part of "TuxDroid Control Center". + * Copyright 2008, kysoh + * Author : Jérôme conan + * eMail : jer...@ky... + * 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 GUI; + +import javax.swing.*; +import java.awt.*; + +public class JVerticalLabel extends JLabel{ + /** + * + */ + private static final long serialVersionUID = 1L; + private String txt; + private byte hpos = 0; + private byte vpos = 0; + private float translation = 0; + + public JVerticalLabel(String s, float trans){ + super(); + txt = s; + translation = trans; + } + + public void paintComponent(Graphics g){ + Graphics2D g2d = (Graphics2D)g; + g2d.translate(12.0, translation); + g2d.rotate(4.712389); + if(txt != null){ + g2d.drawString(txt, this.vpos, this.hpos); + } + } + + public void setBounds(Rectangle rect){ + this.setBounds(rect); + } + + public void setHorizontalAlignment(int alignement){ + this.hpos = (byte)alignement; + } + + public void setVerticalAlignment(int alignement){ + this.vpos = (byte)alignement; + } + + public void setSize(Dimension dim){ + super.setSize(dim); + setPreferredSize(dim); + setMinimumSize(dim); + repaint(); + } + + public void setSize(int width, int height){ + super.setSize(width, height); + setPreferredSize(new Dimension(width, height)); + setMinimumSize(new Dimension(width, height)); + repaint(); + } +} + Property changes on: software_suite_v2/software/tools/tuxController/src/GUI/JVerticalLabel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: software_suite_v2/software/tools/tuxController/src/GUI/componants/advancedViewPanel.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/componants/advancedViewPanel.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/componants/advancedViewPanel.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,70 @@ +/* + * TuxController - Gadget for the TuxDroid software suite. + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id:$ */ + +package GUI.componants; +import i18n.bundle; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JCheckBox; + +import GUI.mainWindow; + +/** + * Advanced view panel + * @author paul + * + */ +public class advancedViewPanel { + private mainWindow win; + + /** + * Create the advanced view panel. + * @param inst a ainWindow instance. + */ + public advancedViewPanel(mainWindow inst) { + win = inst; + createAdvancedViewSection(); + } + + /** + * Create the panel with the checkbox. + */ + private void createAdvancedViewSection() { + win.chkAdvancedView = new JCheckBox(); + win.getContentPane().add(win.chkAdvancedView, + new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.WEST, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.chkAdvancedView.setText(bundle.getString("chkAdvancedView")); //$NON-NLS-1$ + win.chkAdvancedView.setMargin(new java.awt.Insets(2, 10, 2, 1)); + + win.chkAdvancedView.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + win.chkAdvancedViewActionPerformed(evt); + } + }); + } +} Property changes on: software_suite_v2/software/tools/tuxController/src/GUI/componants/advancedViewPanel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: software_suite_v2/software/tools/tuxController/src/GUI/componants/controlPanel.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/componants/controlPanel.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/componants/controlPanel.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,476 @@ +/* + * TuxController - Gadget for the TuxDroid software suite. + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id:$ */ + +package GUI.componants; +import i18n.bundle; + +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JSeparator; +import javax.swing.JSlider; +import javax.swing.JSpinner; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import GUI.JVerticalLabel; +import GUI.mainWindow; + +/** + * Create the control panel + * @author paul + * + */ +public class controlPanel { + + private mainWindow win; + + /** + * Create the control panel. + * @param inst a mainWindow instance. + */ + public controlPanel(mainWindow inst) { + win = inst; + + createPanel(); + dummyPanel(); + + createEyesPanel(); + eyesSeparators(); + eyesObjects(); + + createMouthPanel(); + mouthSeparators(); + mouthObjects(); + + createFlippersPanel(); + flippersSeparators(); + flippersObjects(); + + createSpinPanel(); + spinSeparators(); + spinObjects(); + } + + /** + * Create the main panel. + */ + private void createPanel() { + win.panMainCtl = new JPanel(); + win.getContentPane().add(win.panMainCtl, + new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panMainCtl.setLayout(null); + + win.panCtl = new JPanel(); + win.panMainCtl.add(win.panCtl); + win.panCtl.setBounds(0, 0, 360, 390); + java.awt.Dimension panDim = new java.awt.Dimension(360, 390); + GridBagLayout panControlLayout = new GridBagLayout(); + win.panCtl.setLayout(panControlLayout); + win.panCtl.setMaximumSize(panDim); + win.panCtl.setMinimumSize(panDim); + panControlLayout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1, 0.0}; + panControlLayout.rowHeights = new int[] {10, 79, 62, 142, 97}; + panControlLayout.columnWeights = new double[] {0.0}; + panControlLayout.columnWidths = new int[] {360}; + } + + /** + * Create a dummy panel, only used for the alignment. + */ + private void dummyPanel() { + win.panDummyCtl = new JPanel(); + win.panCtl.add(win.panDummyCtl, + new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panDummyCtl.setLayout(null); + + dummySeparators(); + } + + /** + * Create the dummy separators. + */ + private void dummySeparators() { + win.sepDummy1 = new JSeparator(); + win.panDummyCtl.add(win.sepDummy1); + win.sepDummy1.setBounds(2, 4, 2, 6); + win.sepDummy1.setOrientation(SwingConstants.VERTICAL); + + win.sepDummy2 = new JSeparator(); + win.panDummyCtl.add(win.sepDummy2); + win.sepDummy2.setBounds(18, 4, 2, 6); + win.sepDummy2.setOrientation(SwingConstants.VERTICAL); + } + + /** + * Create the eyes control panel. + */ + private void createEyesPanel() { + win.panEyesCtl = new JPanel(); + win.panCtl.add(win.panEyesCtl, + new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panEyesCtl.setLayout(null); + } + + /** + * Create the eyes panel separators and label. + */ + private void eyesSeparators() { + win.sepEyes1 = new JSeparator(); + win.panEyesCtl.add(win.sepEyes1); + win.sepEyes1.setBounds(2, 0, 2, 75); + win.sepEyes1.setOrientation(SwingConstants.VERTICAL); + + win.sepEyes2 = new JSeparator(); + win.panEyesCtl.add(win.sepEyes2); + win.sepEyes2.setBounds(18, 0, 2, 75); + win.sepEyes2.setOrientation(SwingConstants.VERTICAL); + + win.lblEyes = new JVerticalLabel(bundle.getString("lblEyes"), 52); //$NON-NLS-1$ + win.panEyesCtl.add(win.lblEyes); + win.lblEyes.setBounds(2, 0, 16, 79); + } + + /** + * Create the eyes objects + */ + private void eyesObjects() { + win.btnEyesRun = new JButton(); + win.panEyesCtl.add(win.btnEyesRun); + win.btnEyesRun.setBounds(25, 27, 25, 25); + win.btnEyesRun.setContentAreaFilled(false); + win.btnEyesRun.setBorderPainted(false); + win.btnEyesRun.setIcon(win.iconRun); + win.btnEyesRun.setFocusable(false); + win.btnEyesRun.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + win.btnEyesRunMouseClicked(evt); + } + }); + + win.spinEyes = new JSpinner(); + win.panEyesCtl.add(win.spinEyes); + win.spinEyes.setModel(win.spinEyesCountModel); + win.spinEyes.setBounds(59, 27, 60, 25); + win.spinEyes.setValue(1); + + win.radEyesCount = new JRadioButton(); + win.radEyesDuring = new JRadioButton(); + win.panEyesCtl.add(win.radEyesCount); + win.panEyesCtl.add(win.radEyesDuring); + win.radEyesCount.setSelected(true); + win.radEyesCount.setText(bundle.getString("radEyesCount")); //$NON-NLS-1$ + win.radEyesDuring.setText(bundle.getString("radEyesDuring")); //$NON-NLS-1$ + win.getRadEyes().add(win.radEyesCount); + win.getRadEyes().add(win.radEyesDuring); + win.radEyesCount.setBounds(125, 20, 65, 20); + win.radEyesDuring.setBounds(125, 37, 65, 20); + win.radEyesCount.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent evt) { + win.radEyesCountStateChanged(evt); + } + }); + } + + /** + * Create the mouth panel. + */ + private void createMouthPanel() { + win.panMouthCtl = new JPanel(); + win.panCtl.add(win.panMouthCtl, + new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panMouthCtl.setLayout(null); + } + + /** + * Create the mouth panel separators and label. + */ + private void mouthSeparators() { + win.sepMouth1 = new JSeparator(); + win.panMouthCtl.add(win.sepMouth1); + win.sepMouth1.setBounds(2, 2, 2, 58); + win.sepMouth1.setOrientation(SwingConstants.VERTICAL); + + win.sepMouth2 = new JSeparator(); + win.panMouthCtl.add(win.sepMouth2); + win.sepMouth2.setBounds(18, 2, 2, 58); + win.sepMouth2.setOrientation(SwingConstants.VERTICAL); + + win.lblMouth = new JVerticalLabel(bundle.getString("lblMouth"), 48); //$NON-NLS-1$ + win.panMouthCtl.add(win.lblMouth); + win.lblMouth.setBounds(2, 0, 16, 62); + } + + /** + * Create the mouth panel objects. + */ + private void mouthObjects() { + win.btnMouthRun = new JButton(); + win.panMouthCtl.add(win.btnMouthRun); + win.btnMouthRun.setBounds(25, 19, 25, 25); + win.btnMouthRun.setContentAreaFilled(false); + win.btnMouthRun.setBorderPainted(false); + win.btnMouthRun.setIcon(win.iconRun); + win.btnMouthRun.setFocusable(false); + win.btnMouthRun.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + win.btnMouthRunMouseClicked(evt); + } + }); + + win.spinMouth = new JSpinner(); + win.panMouthCtl.add(win.spinMouth); + win.spinMouth.setModel(win.spinMouthCountModel); + win.spinMouth.setBounds(59, 19, 60, 25); + win.spinMouth.setValue(1); + + win.radMouthCount = new JRadioButton(); + win.radMouthDuring = new JRadioButton(); + win.panMouthCtl.add(win.radMouthCount); + win.panMouthCtl.add(win.radMouthDuring); + win.radMouthCount.setText(bundle.getString("radMouthCount")); //$NON-NLS-1$ + win.radMouthDuring.setText(bundle.getString("radMouthDuring")); //$NON-NLS-1$ + win.radMouthCount.setSelected(true); + win.getRadMouth().add(win.radMouthCount); + win.getRadMouth().add(win.radMouthDuring); + win.radMouthCount.setBounds(125, 12, 65, 20); + win.radMouthDuring.setBounds(125, 29, 65, 20); + win.radMouthCount.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent evt) { + win.radMouthCountStateChanged(evt); + } + }); + } + + /** + * Create the flippers panel + */ + private void createFlippersPanel() { + win.panFlippersCtl = new JPanel(); + win.panCtl.add(win.panFlippersCtl, + new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panFlippersCtl.setLayout(null); + } + + /** + * Create the flippers panel separators and label. + */ + private void flippersSeparators() { + win.sepFlippers1 = new JSeparator(); + win.panFlippersCtl.add(win.sepFlippers1); + win.sepFlippers1.setBounds(2, 2, 2, 138); + win.sepFlippers1.setOrientation(SwingConstants.VERTICAL); + + win.sepFlippers2 = new JSeparator(); + win.panFlippersCtl.add(win.sepFlippers2); + win.sepFlippers2.setBounds(18, 2, 2, 138); + win.sepFlippers2.setOrientation(SwingConstants.VERTICAL); + + win.lblFlippers = new JVerticalLabel(bundle.getString("lblFlippers"), 90); //$NON-NLS-1$ + win.panFlippersCtl.add(win.lblFlippers); + win.lblFlippers.setBounds(2, 0, 16, 142); + } + + /** + * Create the flippers objects. + */ + private void flippersObjects() { + win.btnFlippersRun = new JButton(); + win.panFlippersCtl.add(win.btnFlippersRun); + win.btnFlippersRun.setBounds(25, 59, 25, 25); + win.btnFlippersRun.setContentAreaFilled(false); + win.btnFlippersRun.setBorderPainted(false); + win.btnFlippersRun.setIcon(win.iconRun); + win.btnFlippersRun.setFocusable(false); + win.btnFlippersRun.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + win.btnFlippersRunMouseClicked(evt); + } + }); + + win.spinFlippers = new JSpinner(); + win.panFlippersCtl.add(win.spinFlippers); + win.spinFlippers.setModel(win.spinFlippersCountModel); + win.spinFlippers.setBounds(59, 59, 60, 25); + win.spinFlippers.setValue(1); + + win.slideFlippers = new JSlider(); + win.panFlippersCtl.add(win.slideFlippers); + win.slideFlippers.setBounds(220, 72, 110, 16); + win.slideFlippers.setMinimum(1); + win.slideFlippers.setMaximum(5); + win.slideFlippers.setValue(5); + win.slideFlippers.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent evt) { + win.slideFlippersStateChanged(evt); + } + }); + + win.lblFlippersSpeed = new JLabel(); + win.panFlippersCtl.add(win.lblFlippersSpeed); + win.lblFlippersSpeed.setText(bundle.getString("lblFlippersSpeed")); //$NON-NLS-1$ + win.lblFlippersSpeed.setBounds(220, 54, 110, 16); + win.lblFlippersSpeed.setHorizontalAlignment(SwingConstants.CENTER); + + win.radFlippersCount = new JRadioButton(); + win.radFlippersDuring = new JRadioButton(); + win.panFlippersCtl.add(win.radFlippersCount); + win.panFlippersCtl.add(win.radFlippersDuring); + win.radFlippersCount.setText(bundle.getString("radFlippersCount")); //$NON-NLS-1$ + win.radFlippersDuring.setText(bundle.getString("radFlippersDuring")); //$NON-NLS-1$ + win.radFlippersCount.setSelected(true); + win.getRadFlippers().add(win.radFlippersCount); + win.getRadFlippers().add(win.radFlippersDuring); + win.radFlippersCount.setBounds(125, 52, 65, 20); + win.radFlippersDuring.setBounds(125, 69, 65, 20); + win.radFlippersCount.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent evt) { + win.radFlippersCountStateChanged(evt); + } + }); + } + + /** + * Create the spin panel. + */ + private void createSpinPanel() { + win.panSpinCtl = new JPanel(); + win.panCtl.add(win.panSpinCtl, + new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panSpinCtl.setLayout(null); + } + + /** + * Create the spin panel separator and label. + */ + private void spinSeparators() { + win.sepSpin1 = new JSeparator(); + win.panSpinCtl.add(win.sepSpin1); + win.sepSpin1.setBounds(2, 2, 2, 93); + win.sepSpin1.setOrientation(SwingConstants.VERTICAL); + + win.sepSpin2 = new JSeparator(); + win.panSpinCtl.add(win.sepSpin2); + win.sepSpin2.setBounds(18, 2, 2, 93); + win.sepSpin2.setOrientation(SwingConstants.VERTICAL); + + win.lblSpin = new JVerticalLabel(bundle.getString("lblSpin"), 74); //$NON-NLS-1$ + win.panSpinCtl.add(win.lblSpin); + win.lblSpin.setBounds(2, 0, 16, 97); + } + + /** + * Create the spin objects. + */ + private void spinObjects() { + win.btnSpinRun = new JButton(); + win.panSpinCtl.add(win.btnSpinRun); + win.btnSpinRun.setBounds(25, 29, 25, 25); + win.btnSpinRun.setContentAreaFilled(false); + win.btnSpinRun.setBorderPainted(false); + win.btnSpinRun.setIcon(win.iconRun); + win.btnSpinRun.setFocusable(false); + win.btnSpinRun.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + win.btnSpinRunMouseClicked(evt); + } + }); + + win.spinSpin = new JSpinner(); + win.panSpinCtl.add(win.spinSpin); + win.spinSpin.setModel(win.spinSpinCountModel); + win.spinSpin.setBounds(59, 29, 60, 25); + win.spinSpin.setValue(1); + + win.radSpinCount = new JRadioButton(); + win.radSpinDuring = new JRadioButton(); + win.panSpinCtl.add(win.radSpinCount); + win.panSpinCtl.add(win.radSpinDuring); + win.radSpinCount.setText(bundle.getString("radSpinCount")); //$NON-NLS-1$ + win.radSpinDuring.setText(bundle.getString("radSpinDuring")); //$NON-NLS-1$ + win.radSpinCount.setSelected(true); + win.getRadSpin().add(win.radSpinCount); + win.getRadSpin().add(win.radSpinDuring); + win.radSpinCount.setBounds(125, 22, 65, 20); + win.radSpinDuring.setBounds(125, 39, 65, 20); + win.radSpinCount.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent evt) { + win.radSpinCountStateChanged(evt); + } + }); + + win.slideSpin = new JSlider(); + win.panSpinCtl.add(win.slideSpin); + win.slideSpin.setBounds(220, 43, 110, 16); + win.slideSpin.setMinimum(1); + win.slideSpin.setMaximum(5); + win.slideSpin.setValue(5); + win.slideSpin.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent evt) { + win.slideSpinStateChanged(evt); + } + }); + + win.lblSpinSpeed = new JLabel(); + win.panSpinCtl.add(win.lblSpinSpeed); + win.lblSpinSpeed.setText(bundle.getString("lblSpinSpeed")); //$NON-NLS-1$ + win.lblSpinSpeed.setBounds(220, 25, 110, 16); + win.lblSpinSpeed.setHorizontalAlignment(SwingConstants.CENTER); + + win.radSpinLeft = new JRadioButton(); + win.radSpinRight = new JRadioButton(); + win.panSpinCtl.add(win.radSpinLeft); + win.panSpinCtl.add(win.radSpinRight); + win.radSpinLeft.setText(bundle.getString("radSpinLeft")); //$NON-NLS-1$ + win.radSpinRight.setText(bundle.getString("radSpinRight")); //$NON-NLS-1$ + win.radSpinLeft.setSelected(true); + win.getRadDir().add(win.radSpinLeft); + win.getRadDir().add(win.radSpinRight); + win.radSpinLeft.setBounds(40, 60, 80, 20); + win.radSpinRight.setBounds(125, 60, 80, 20); + } +} Property changes on: software_suite_v2/software/tools/tuxController/src/GUI/componants/controlPanel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: software_suite_v2/software/tools/tuxController/src/GUI/componants/generalControlPanel.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/componants/generalControlPanel.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/componants/generalControlPanel.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,95 @@ +/* + * TuxController - Gadget for the TuxDroid software suite. + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id:$ */ + +package GUI.componants; + +import i18n.bundle; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.SwingConstants; + +import GUI.JVerticalLabel; +import GUI.mainWindow; + +public class generalControlPanel { + + private mainWindow win; + + public generalControlPanel(mainWindow inst) { + win = inst; + createPanel(); + separators(); + button(); + } + + private void createPanel() { + win.panGeneralControl = new JPanel(); + win.getContentPane().add(win.panGeneralControl, + new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panGeneralControl.setLayout(null); + } + + private void separators() { + + win.sepGeneralControl1 = new JSeparator(); + win.panGeneralControl.add(win.sepGeneralControl1); + win.sepGeneralControl1.setBounds(2, 4, 2, 86); + win.sepGeneralControl1.setOrientation(SwingConstants.VERTICAL); + + win.sepGeneralControl2 = new JSeparator(); + win.panGeneralControl.add(win.sepGeneralControl2); + win.sepGeneralControl2.setBounds(18, 4, 2, 86); + win.sepGeneralControl2.setOrientation(SwingConstants.VERTICAL); + + win.lblGeneral = new JVerticalLabel(bundle.getString("lblGeneral"), 67); //$NON-NLS-1$ + win.panGeneralControl.add(win.lblGeneral); + win.lblGeneral.setBounds(2, 0, 16, 90); + } + + private void button() { + win.btnGeneralStop = new JButton(); + win.panGeneralControl.add(win.btnGeneralStop); + win.btnGeneralStop.setBounds(8, 32, 352, 25); + win.btnGeneralStop.setContentAreaFilled(false); + win.btnGeneralStop.setBorderPainted(false); + win.btnGeneralStop.setIcon(win.iconStop); + win.btnGeneralStop.setText(bundle.getString("btnGeneral")); //$NON-NLS-1$ + win.btnGeneralStop.setHorizontalTextPosition(SwingConstants.RIGHT); + win.btnGeneralStop.setHorizontalAlignment(SwingConstants.LEFT); + win.btnGeneralStop.setFocusable(false); + win.btnGeneralStop.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + win.btnGeneralStopMouseClicked(evt); + } + }); + } + +} Property changes on: software_suite_v2/software/tools/tuxController/src/GUI/componants/generalControlPanel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: software_suite_v2/software/tools/tuxController/src/GUI/componants/ledPanel.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/componants/ledPanel.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/componants/ledPanel.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,189 @@ +/* + * TuxController - Gadget for the TuxDroid software suite. + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id:$ */ + +package GUI.componants; + +import i18n.bundle; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JSeparator; +import javax.swing.JSlider; +import javax.swing.JSpinner; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import GUI.JVerticalLabel; +import GUI.mainWindow; + +/** + * LED control panel. + * @author paul + * + */ +public class ledPanel { + private mainWindow win; + + /** + * Create the LED panel + * @param inst a mainWindow instance + */ + public ledPanel(mainWindow inst) { + win = inst; + createPanel(); + createSeparators(); + createButtons(); + createSpinners(); + createRadios(); + createSliders(); + } + + /** + * Create the panel + */ + private void createPanel() { + win.panLedsCtl = new JPanel(); + win.getContentPane().add(win.panLedsCtl, + new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panLedsCtl.setLayout(null); + } + + /** + * Create the buttons + */ + private void createButtons() { + win.btnLedsRun = new JButton(); + win.panLedsCtl.add(win.btnLedsRun); + win.btnLedsRun.setBounds(26, 24, 25, 25); + win.btnLedsRun.setContentAreaFilled(false); + win.btnLedsRun.setBorderPainted(false); + win.btnLedsRun.setIcon(win.iconRun); + win.btnLedsRun.setFocusable(false); + win.btnLedsRun.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + win.btnLedsRunMouseClicked(evt); + } + }); + } + + /** + * Create the separators + */ + private void createSeparators() { + win.sepLed1 = new JSeparator(); + win.panLedsCtl.add(win.sepLed1); + win.sepLed1.setBounds(2, 4, 2, 74); + win.sepLed1.setOrientation(SwingConstants.VERTICAL); + + win.sepLed2 = new JSeparator(); + win.panLedsCtl.add(win.sepLed2); + win.sepLed2.setBounds(18, 4, 2, 74); + win.sepLed2.setOrientation(SwingConstants.VERTICAL); + + win.lblLed = new JVerticalLabel(bundle.getString("lblLeds"), 50); //$NON-NLS-1$ + win.panLedsCtl.add(win.lblLed); + win.lblLed.setBounds(2, 2, 16, 80); + } + + /** + * Create the spinners + */ + private void createSpinners() { + win.spinLeds = new JSpinner(); + win.panLedsCtl.add(win.spinLeds); + win.spinLeds.setModel(win.spinLedsCountModel); + win.spinLeds.setBounds(59, 24, 60, 25); + win.spinLeds.setValue(1); + } + + /** + * Create the radio buttons + */ + private void createRadios() { + win.radLedsNone = new JRadioButton(); + win.radLedsFade = new JRadioButton(); + win.radLedsGradiant = new JRadioButton(); + win.panLedsCtl.add(win.radLedsNone); + win.panLedsCtl.add(win.radLedsFade); + win.panLedsCtl.add(win.radLedsGradiant); + win.radLedsNone.setSelected(true); + win.radLedsNone.setText(bundle.getString("lblLedsEffectNone")); //$NON-NLS-1$ + win.radLedsFade.setText(bundle.getString("lblLedsEffectFade")); //$NON-NLS-1$ + win.radLedsGradiant.setText(bundle.getString("lblLedsEffectGradiant")); //$NON-NLS-1$ + + win.getRadLeds().add(win.radLedsNone); + win.getRadLeds().add(win.radLedsFade); + win.getRadLeds().add(win.radLedsGradiant); + win.radLedsNone.setBounds(125, 10, 80, 20); + win.radLedsFade.setBounds(125, 27, 80, 20); + win.radLedsGradiant.setBounds(125, 44, 80, 20); + } + + /** + * Create the sliders + */ + private void createSliders() { + win.slideLedsIntensity = new JSlider(); + win.panLedsCtl.add(win.slideLedsIntensity); + win.slideLedsIntensity.setBounds(220, 20, 110, 16); + win.slideLedsIntensity.setMinimum(0); + win.slideLedsIntensity.setMaximum(10); + win.slideLedsIntensity.setValue(10); + win.slideLedsIntensity.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent evt) { + win.slideLedsIntensityStateChanged(evt); + } + }); + + win.lblLedsIntensity = new JLabel(); + win.panLedsCtl.add(win.lblLedsIntensity); + win.lblLedsIntensity.setText(bundle.getString("lblLedsIntensity")); //$NON-NLS-1$ + win.lblLedsIntensity.setBounds(220, 3, 110, 16); + win.lblLedsIntensity.setHorizontalAlignment(SwingConstants.CENTER); + + win.slideLedsSpeed = new JSlider(); + win.panLedsCtl.add(win.slideLedsSpeed); + win.slideLedsSpeed.setBounds(220, 53, 110, 16); + win.slideLedsSpeed.setMinimum(1); + win.slideLedsSpeed.setMaximum(5); + win.slideLedsSpeed.setValue(3); + win.slideLedsSpeed.setMinorTickSpacing(5); + win.slideLedsSpeed.setMajorTickSpacing(5); + + win.lblLedsBlinkSpeed = new JLabel(); + win.panLedsCtl.add(win.lblLedsBlinkSpeed); + win.lblLedsBlinkSpeed.setText(bundle.getString("lblLedsSpeed")); //$NON-NLS-1$ + win.lblLedsBlinkSpeed.setBounds(220, 35, 110, 16); + win.lblLedsBlinkSpeed.setHorizontalAlignment(SwingConstants.CENTER); + } + +} Property changes on: software_suite_v2/software/tools/tuxController/src/GUI/componants/ledPanel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: software_suite_v2/software/tools/tuxController/src/GUI/componants/levelPanel.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/componants/levelPanel.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/componants/levelPanel.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,158 @@ +/* + * TuxController - Gadget for the TuxDroid software suite. + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id:$ */ + +package GUI.componants; + +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; + +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JProgressBar; + +import GUI.mainWindow; + +public class levelPanel { + private mainWindow win; + + public levelPanel(mainWindow inst) { + win = inst; + createPanel(); + createLightSection(); + createBatterySection(); + createMicroSection(); + } + + private void createPanel() { + win.panLevelAbs = new JPanel(); + win.getContentPane().add(win.panLevelAbs, + new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panLevelAbs.setLayout(null); + + /* Create the panel */ + win.panLevel = new JPanel(); + win.panLevelAbs.add(win.panLevel); + win.panLevel.setBounds(0, 0, 406, 79); + java.awt.Dimension panDim = new java.awt.Dimension(406, 90); + GridBagLayout panLevelLayout = new GridBagLayout(); + win.panLevel.setLayout(panLevelLayout); + win.panLevel.setMaximumSize(panDim); + win.panLevel.setMinimumSize(panDim); + panLevelLayout.rowWeights = new double[] {0.1, 0.1, 0.1}; + panLevelLayout.rowHeights = new int[] {30, 30, 30}; + panLevelLayout.columnWeights = new double[] {0.0, 0.0, 0.0}; + panLevelLayout.columnWidths = new int[] {55, 260, 70}; + } + + private void createLightSection() { + win.dimProg = new java.awt.Dimension(250, 15); + win.imgLightLevel = new JLabel(); + win.imgLightLevel.setIcon(win.iconLight); + win.panLevel.add(win.imgLightLevel, + new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.NONE, + new Insets(0, 0, 0, 0), 0, 0)); + + win.progLightLevel = new JProgressBar(); + win.panLevel.add(win.progLightLevel, + new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.NONE, + new Insets(0, 0, 0, 0), 0, 0)); + win.progLightLevel.setPreferredSize(win.dimProg); + win.progLightLevel.setMinimumSize(win.dimProg); + win.progLightLevel.setMaximumSize(win.dimProg); + + win.lblLightLevel = new JLabel(); + win.panLevel.add(win.lblLightLevel, + new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.lblLightLevel.setText("0.00 %"); + win.lblLightLevel.setSize(60, 22); + } + + private void createBatterySection() { + win.imgBatteryLevel = new JLabel(); + win.panLevel.add(win.imgBatteryLevel, + new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.NONE, + new Insets(0, 0, 0, 0), 0, 0)); + win.imgBatteryLevel.setIcon(win.iconBattery); + + win.progBatteryLevel = new JProgressBar(); + win.panLevel.add(win.progBatteryLevel, + new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.NONE, + new Insets(0, 0, 0, 0), 0, 0)); + win.progBatteryLevel.setPreferredSize(win.dimProg); + win.progBatteryLevel.setMaximum(70); + win.progBatteryLevel.setMinimumSize(win.dimProg); + win.progBatteryLevel.setMaximumSize(win.dimProg); + + win.lblBatteryLevel = new JLabel(); + win.panLevel.add(win.lblBatteryLevel, + new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.lblBatteryLevel.setText("0.00 V"); + win.lblBatteryLevel.setSize(60, 22); + } + + private void createMicroSection() { + win.imgMicroLevel = new JLabel(); + win.panLevel.add(win.imgMicroLevel, + new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.NONE, + new Insets(0, 0, 0, 0), 0, 0)); + win.imgMicroLevel.setIcon(win.iconMicro); + + win.progMicroLevel = new JProgressBar(); + win.panLevel.add(win.progMicroLevel, + new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.NONE, + new Insets(0, 0, 0, 0), 0, 0)); + win.progMicroLevel.setPreferredSize(win.dimProg); + win.progMicroLevel.setMinimumSize(win.dimProg); + win.progMicroLevel.setMaximumSize(win.dimProg); + + win.lblMicroLevel = new JLabel(); + win.panLevel.add(win.lblMicroLevel, + new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.lblMicroLevel.setText("0.00 %"); + win.lblMicroLevel.setSize(60, 22); + } + +} Property changes on: software_suite_v2/software/tools/tuxController/src/GUI/componants/levelPanel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: software_suite_v2/software/tools/tuxController/src/GUI/componants/objects.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/componants/objects.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/componants/objects.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,128 @@ +/* + * TuxController - Gadget for the TuxDroid software suite. + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id:$ */ + +package GUI.componants; + +import javax.swing.DefaultComboBoxModel; + +import GUI.mainWindow; + +public class objects { + private mainWindow win; + + public objects(mainWindow inst) { + win = inst; + createImagesObjects(); + createSpinnerModels(); + createComboboxModels(); + } + + private void createImagesObjects() { + /* Spinning images */ + win.spinLeft = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/spinLeft.png")); + win.spinRight = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/spinRight.png")); + win.spinOff = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/spinOff.png")); + win.spinCharger = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/spinCharging.png")); + + /* Flippers images */ + win.flippersUp = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/flippersUp.png")); + win.flippersDown = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/flippersDown.png")); + + /* Beak images */ + win.mouthOpen = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/mouthOpened.png")); + win.mouthClose = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/mouthClosed.png")); + + /* Right eye */ + win.eyeRightOn = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/rightEyeOn.png")); + win.eyeRightOff = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/rightEyeOff.png")); + win.eyeRightClose = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/rightEyeClosed.png")); + + /* Left eye */ + win.eyeLeftOn = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/leftEyeOn.png")); + win.eyeLeftOff = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/leftEyeOff.png")); + win.eyeLeftClose = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/leftEyeClosed.png")); + + /* Buttons images */ + win.iconUp = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconUp.png")); + win.iconDown = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconDown.png")); + win.iconLeft = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconLeft.png")); + win.iconRight = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconRight.png")); + win.iconRun = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconRun.png")); + win.iconStop = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconStop.png")); + + /* Levels images */ + win.iconLight = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconLight.png")); + win.iconBattery = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconBattery.png")); + win.iconMicro = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconMicro.png")); + } + + private void createSpinnerModels() { + win.spinEyesCountModel = + new javax.swing.SpinnerNumberModel(1, 1, 127, 1); + win.spinEyesDuringModel = + new javax.swing.SpinnerNumberModel(1, 0.04, 20, 0.05); + win.spinMouthCountModel = + new javax.swing.SpinnerNumberModel(1, 1, 127, 1); + win.spinMouthDuringModel = + new javax.swing.SpinnerNumberModel(1, 0.04, 20, 0.05); + win.spinFlippersCountModel = + new javax.swing.SpinnerNumberModel(1, 1, 127, 1); + win.spinFlippersDuringModel = + new javax.swing.SpinnerNumberModel(1, 0.04, 20, 0.05); + win.spinSpinCountModel = + new javax.swing.SpinnerNumberModel(1, 1, 127, 1); + win.spinSpinDuringModel = + new javax.swing.SpinnerNumberModel(1, 0.04, 20, 0.05); + win.spinLedsCountModel = + new javax.swing.SpinnerNumberModel(1, 1, 127, 1); + win.spinTTSPitchModel = + new javax.swing.SpinnerNumberModel(100, 70, 200, 1); + } + + private void createComboboxModels() { + win.voiceList = new String[] {"No voice"}; + win.cmbVoicesModel = new DefaultComboBoxModel(win.voiceList); + } + +} Property changes on: software_suite_v2/software/tools/tuxController/src/GUI/componants/objects.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: software_suite_v2/software/tools/tuxController/src/GUI/componants/ttsPanel.java =================================================================== --- software_suite_v2/software/tools/tuxController/src/GUI/componants/ttsPanel.java (rev 0) +++ software_suite_v2/software/tools/tuxController/src/GUI/componants/ttsPanel.java 2008-07-17 13:52:10 UTC (rev 1333) @@ -0,0 +1,189 @@ +/* + * TuxController - Gadget for the TuxDroid software suite. + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id:$ */ + +package GUI.componants; +import i18n.bundle; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JSpinner; +import javax.swing.JTextArea; + +import GUI.mainWindow; + +/** + * TTS Text entry panel. + * @author paul + * + */ +public class ttsPanel { + + private mainWindow win; + + /** + * Create the TTS text entry panel. + * @param inst a mainWindow instance. + */ + public ttsPanel(mainWindow inst) { + win = inst; + + createTextPanel(); + createCheckboxPanel(); + createTextEntryPanel(); + createButtonsPanel(); + + createConfigPanel(); + createConfigObjects(); + } + + /** + * Create the panel layout. + */ + private void createTextPanel() { + win.panTTSAbs = new JPanel(); + win.getContentPane().add(win.panTTSAbs, + new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, + GridBagConstraints.NORTH, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panTTSAbs.setLayout(null); + + win.panTTS = new JPanel(); + win.panTTSAbs.add(win.panTTS); + win.panTTS.setBounds(0, 0, 406, 140); + java.awt.Dimension panDim = new java.awt.Dimension(390, 140); + GridBagLayout panTTSLayout = new GridBagLayout(); + win.panTTS.setLayout(panTTSLayout); + win.panTTS.setMaximumSize(panDim); + win.panTTS.setMinimumSize(panDim); + panTTSLayout.rowWeights = new double[] {0.1, 0.1, 0.1}; + panTTSLayout.rowHeights = new int[] {30, 70, 30}; + panTTSLayout.columnWeights = new double[] {0.0, 0.0, 0.0}; + panTTSLayout.columnWidths = new int[] {390}; + + } + + /** + * Create the enable/disable checkbox. + */ + private void createCheckboxPanel() { + win.chkTTS = new JCheckBox(); + win.panTTS.add(win.chkTTS, + new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.WEST, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.chkTTS.setText(bundle.getString("chkTTS")); //$NON-NLS-1$ + win.chkTTS.setMargin(new java.awt.Insets(2, 10, 2, 1)); + win.chkTTS.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + win.chkTTSActionPerformed(evt); + } + }); + } + + /** + * Create the text entry. + */ + private void createTextEntryPanel() { + win.textTTS = new JTextArea(); + win.panTTS.add(win.textTTS, + new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.BOTH, + new Insets(4, 4, 4, 20), 0, 0)); + win.textTTS.setText(bundle.getString("textTTS")); //$NON-NLS-1$ + win.textTTS.setSize(370, 60); + } + + /** + * Create the buttons. + */ + private void createButtonsPanel() { + win.panTTSButtons = new JPanel(); + win.panTTS.add(win.panTTSButtons, + new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, + GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + win.panTTSButtons.setLayout(null); + + win.btnTTSPlay = new JButton(); + win.panTTSButtons.add(win.btnTTSPlay); + win.btnTTSPlay.setText(bundle.getString("btnTTSPlay")); //$NON-NLS-1$ + win.btnTTSPlay.setBounds(300, 5, 70, 20); + win.btnTTSPlay.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + win.btnTTSPlayMouseClicked(evt); + } + }); + + win.btnTTSStop = new JButton(); + wi... [truncated message content] |