[tuxdroid-svn] r1428 - in software_suite_v2/software/tools/tuxController/trunk/src/GUI: . componen
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-07-30 13:31:37
|
Author: Paul_R Date: 2008-07-30 15:31:40 +0200 (Wed, 30 Jul 2008) New Revision: 1428 Added: software_suite_v2/software/tools/tuxController/trunk/src/GUI/images/iconRadioOff.png software_suite_v2/software/tools/tuxController/trunk/src/GUI/images/iconRadioOn.png Modified: software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/levelPanel.java software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/objects.java software_suite_v2/software/tools/tuxController/trunk/src/GUI/control/controlTux.java software_suite_v2/software/tools/tuxController/trunk/src/GUI/mainWindow.java Log: * Added the RF State icon instead of the micro icon. Also hide the micro progress bar and percent label * Aligned the TTS checkbox Modified: software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/levelPanel.java =================================================================== --- software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/levelPanel.java 2008-07-30 13:06:26 UTC (rev 1427) +++ software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/levelPanel.java 2008-07-30 13:31:40 UTC (rev 1428) @@ -127,14 +127,14 @@ } private void createMicroSection() { - win.imgMicroLevel = new JLabel(); - win.panLevel.add(win.imgMicroLevel, + win.imgRFState = new JLabel(); + win.panLevel.add(win.imgRFState, 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.imgRFState.setIcon(win.iconRFOff); + win.progMicroLevel = new JProgressBar(); win.panLevel.add(win.progMicroLevel, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, @@ -144,6 +144,7 @@ win.progMicroLevel.setPreferredSize(win.dimProg); win.progMicroLevel.setMinimumSize(win.dimProg); win.progMicroLevel.setMaximumSize(win.dimProg); + win.progMicroLevel.setVisible(false); win.lblMicroLevel = new JLabel(); win.panLevel.add(win.lblMicroLevel, @@ -153,6 +154,7 @@ new Insets(0, 0, 0, 0), 0, 0)); win.lblMicroLevel.setText("0.00 %"); win.lblMicroLevel.setSize(60, 22); + win.lblMicroLevel.setVisible(false); } } Modified: software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/objects.java =================================================================== --- software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/objects.java 2008-07-30 13:06:26 UTC (rev 1427) +++ software_suite_v2/software/tools/tuxController/trunk/src/GUI/components/objects.java 2008-07-30 13:31:40 UTC (rev 1428) @@ -95,6 +95,12 @@ "/GUI/images/iconBattery.png")); win.iconMicro = new javax.swing.ImageIcon(getClass().getResource( "/GUI/images/iconMicro.png")); + + /* RF Image */ + win.iconRFOff = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconRadioOff.png")); + win.iconRFOn = new javax.swing.ImageIcon(getClass().getResource( + "/GUI/images/iconRadioOn.png")); } private void createSpinnerModels() { Modified: software_suite_v2/software/tools/tuxController/trunk/src/GUI/control/controlTux.java =================================================================== --- software_suite_v2/software/tools/tuxController/trunk/src/GUI/control/controlTux.java 2008-07-30 13:06:26 UTC (rev 1427) +++ software_suite_v2/software/tools/tuxController/trunk/src/GUI/control/controlTux.java 2008-07-30 13:31:40 UTC (rev 1428) @@ -69,6 +69,8 @@ onLightLevelEvent((String)tux.status.requestOne("light_level")[0], 0.0); onBatteryLevelEvent((String)tux.status.requestOne("battery_level")[0], 0.0); + win.refreshRFState(tux.radio.getConnected()); + onVoiceListChanged(); } @@ -113,7 +115,7 @@ "onSpinCounter"); tux.event.handler.register(TuxAPIConst.ST_NAME_RADIO_STATE, this, - "onRadioConnected", "True", null); + "onRadioConnected", null, null); } /* EYES CONTROL ----------------------------------------------------------*/ @@ -619,9 +621,14 @@ tux.spinning.rightOnAsync(0.25); } - // BUG : this function didn't work ! public void onRadioConnected(String value, Double delay) { - this.refreshGUI(); - win.refreshVoiceList(tux.tts.getVoices()); + if (value.equalsIgnoreCase("True")) { + this.refreshGUI(); + win.refreshRFState(true); + win.refreshVoiceList(tux.tts.getVoices()); + } + else { + win.refreshRFState(false); + } } } Added: software_suite_v2/software/tools/tuxController/trunk/src/GUI/images/iconRadioOff.png =================================================================== (Binary files differ) Property changes on: software_suite_v2/software/tools/tuxController/trunk/src/GUI/images/iconRadioOff.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: software_suite_v2/software/tools/tuxController/trunk/src/GUI/images/iconRadioOn.png =================================================================== (Binary files differ) Property changes on: software_suite_v2/software/tools/tuxController/trunk/src/GUI/images/iconRadioOn.png ___________________________________________________________________ Name: svn:mime-type + image/png Modified: software_suite_v2/software/tools/tuxController/trunk/src/GUI/mainWindow.java =================================================================== --- software_suite_v2/software/tools/tuxController/trunk/src/GUI/mainWindow.java 2008-07-30 13:06:26 UTC (rev 1427) +++ software_suite_v2/software/tools/tuxController/trunk/src/GUI/mainWindow.java 2008-07-30 13:31:40 UTC (rev 1428) @@ -125,13 +125,13 @@ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - dimWin = new java.awt.Dimension(430, 590); // 396, 592 + dimWin = new java.awt.Dimension(430, 600); // 396, 592 this.setPreferredSize(new java.awt.Dimension(430, 600)); // 756, 591 this.setMinimumSize(dimWin); this.setSize(dimWin); this.setResizable(false); thisLayout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1}; - thisLayout.rowHeights = new int[] {80, 390, 90, 30}; + thisLayout.rowHeights = new int[] {80, 390, 90, 40}; thisLayout.columnWeights = new double[] {0.0, 0.0, 1.0}; thisLayout.columnWidths = new int[] {430, 1, 1}; getContentPane().setLayout(thisLayout); @@ -158,17 +158,17 @@ } else if (!chkAdvancedView.isSelected() && !chkTTS.isSelected()) { - dimWin.setSize(430, 590); + dimWin.setSize(430, 600); thisLayout.columnWidths = new int[] {430, 1, 1}; - thisLayout.rowHeights = new int[] {80, 390, 90, 30}; + thisLayout.rowHeights = new int[] {80, 390, 90, 40}; this.setSize(dimWin); this.setResizable(false); } else if (chkAdvancedView.isSelected() && !chkTTS.isSelected()) { - dimWin.setSize(790, 590); + dimWin.setSize(790, 600); thisLayout.columnWidths = new int[] {430, 360, 1}; - thisLayout.rowHeights = new int[] {80, 390, 90, 30}; + thisLayout.rowHeights = new int[] {80, 390, 90, 40}; this.setSize(dimWin); this.setResizable(false); } @@ -731,6 +731,17 @@ this.lblBatteryLevel.setText(String.format("%.2f", //$NON-NLS-1$ Float.parseFloat(fvalue) / 1000) +" V"); //$NON-NLS-1$ } + + /** + * Refresh : Refresh the RF State + * @param state + */ + public void refreshRFState(Boolean state) { + if (state) + this.imgRFState.setIcon(iconRFOn); + else + this.imgRFState.setIcon(iconRFOff); + } /* MISC FUNCTIONS -----------------------------------------------------------*/ public ButtonGroup getRadLeds() { @@ -820,7 +831,7 @@ public JLabel imgMouth; public JLabel imgLeftEye; public JLabel imgRightEye; - public JLabel imgMicroLevel; + public JLabel imgRFState; public JLabel imgBatteryLevel; public JLabel imgLightLevel; public JLabel lblBatteryLevel; @@ -960,6 +971,8 @@ public javax.swing.ImageIcon iconLight; public javax.swing.ImageIcon iconBattery; public javax.swing.ImageIcon iconMicro; + public javax.swing.ImageIcon iconRFOff; + public javax.swing.ImageIcon iconRFOn; /* Misc objects */ public java.awt.Dimension dimWin; |