[zb4osgi-changeset] [scm] ZigBee 4 OSGi repository change: r272 - /projects/zb4osgi/sandbox/michele.girolami/zigbee.CC2530.driver/src/main/java/it/cnr/isti/zigbee/dongle/CC2530/impl/MasterResetGUI.java

scm-notify at zb4osgi.aaloa.org scm-notify at zb4osgi.aaloa.org
Thu Jun 23 13:37:37 CEST 2011


Author: michele.girolami
Date: Thu Jun 23 13:37:37 2011
New Revision: 272

Log:
Added MasterGUi

Added:
    projects/zb4osgi/sandbox/michele.girolami/zigbee.CC2530.driver/src/main/java/it/cnr/isti/zigbee/dongle/CC2530/impl/MasterResetGUI.java

Added: projects/zb4osgi/sandbox/michele.girolami/zigbee.CC2530.driver/src/main/java/it/cnr/isti/zigbee/dongle/CC2530/impl/MasterResetGUI.java
==============================================================================
--- projects/zb4osgi/sandbox/michele.girolami/zigbee.CC2530.driver/src/main/java/it/cnr/isti/zigbee/dongle/CC2530/impl/MasterResetGUI.java (added)
+++ projects/zb4osgi/sandbox/michele.girolami/zigbee.CC2530.driver/src/main/java/it/cnr/isti/zigbee/dongle/CC2530/impl/MasterResetGUI.java Thu Jun 23 13:37:37 2011
@@ -1,0 +1,97 @@
+package it.cnr.isti.zigbee.dongle.tsb.impl;
+
+import java.awt.Dimension;
+
+import javax.swing.UIManager;
+
+public class MasterResetGUI extends javax.swing.JFrame {
+	DriverTSBn parentDriver;
+	public MasterResetGUI(DriverTSBn parent) {
+		parentDriver=parent;
+    	try {
+			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+		} catch (Exception e) {
+			System.err.println("Windows Look&Feel Not Found !");
+		}
+		initComponents();
+	}
+	
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">
+    private void initComponents() {
+
+        contextTabbedPane = new javax.swing.JTabbedPane();
+        contextPanel1 = new javax.swing.JPanel();
+        contextPanel1chkBox1 = new javax.swing.JCheckBox();
+        contextPanel1sendButton = new javax.swing.JButton();
+        jLabel1 = new javax.swing.JLabel();
+        txtBoxSequence = new javax.swing.JTextField();
+
+        //WINDOW
+        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+        this.setBounds(800, 660, 420, 330);
+        this.setMaximumSize(new Dimension(320, 230));
+        this.setMinimumSize(new Dimension(320, 230));
+        this.setPreferredSize(new Dimension(320, 230));
+        setResizable(true);
+        getContentPane().setLayout(null);
+
+        //TAB 1
+        contextPanel1.setLayout(null);
+        
+        txtBoxSequence.setText("Sequence");
+        contextPanel1.add(txtBoxSequence);
+        txtBoxSequence.setBounds(20, 20, 210, 23);
+
+        contextPanel1chkBox1.setText("ARMED");
+        contextPanel1.add(contextPanel1chkBox1);
+        contextPanel1chkBox1.setBounds(20, 50, 190, 23);
+
+        contextPanel1sendButton.setText("RESET");
+        contextPanel1sendButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                sendButton1ActionPerformed(evt);
+            }
+        });
+        contextPanel1.add(contextPanel1sendButton);
+        contextPanel1sendButton.setBounds(20, 80, 75, 29);
+
+        contextTabbedPane.addTab("Master Reset", contextPanel1);
+
+        //MAIN
+        getContentPane().add(contextTabbedPane);
+        contextTabbedPane.setBounds(10, 40, 300, 160);
+
+        jLabel1.setFont(new java.awt.Font("Verdana", 1, 14));
+        jLabel1.setText("Master Reset");
+        getContentPane().add(jLabel1);
+        jLabel1.setBounds(10, 10, 300, 18);
+
+        pack();
+    }// </editor-fold>                                                        
+
+    private void sendButton1ActionPerformed(java.awt.event.ActionEvent evt) {
+    	if(this.txtBoxSequence.getText().equals("1a2b3c4d")){
+    		if(this.contextPanel1chkBox1.isSelected()){
+    			//MASTER RESET!!   
+    			parentDriver.dongleMasterReset();
+    		}
+    	}else{
+    		this.txtBoxSequence.setText("Invalid");
+    	}
+    }
+
+    // Variables declaration - do not modify
+    private javax.swing.JTabbedPane contextTabbedPane;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JButton contextPanel1sendButton;
+    private javax.swing.JCheckBox contextPanel1chkBox1;
+    private javax.swing.JPanel contextPanel1;
+    private javax.swing.JTextField txtBoxSequence;
+    // End of variables declaration
+
+}




More information about the Commit mailing list