From ebe19b959dc2c43c08f5aa68e303a6e958567fcb Mon Sep 17 00:00:00 2001 From: GDLMadushanka Date: Mon, 12 Jun 2017 11:42:48 +0530 Subject: [PATCH] button removed --- .../agent/core/AgentConfiguration.java | 1 - .../agent/core/AgentManager.java | 9 ---- .../agent/virtual/ui/AgentUI.java | 46 ------------------- src/main/ui/nbproject/private/private.xml | 1 - 4 files changed, 57 deletions(-) diff --git a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java index 5cdedb5a6..7d8f1dc57 100644 --- a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java +++ b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java @@ -159,7 +159,6 @@ public class AgentConfiguration { public void setXmppServerName(String xmppServerName) { this.xmppServerName = xmppServerName; } - } diff --git a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java index 69348b195..4ad7f0037 100644 --- a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java +++ b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java @@ -44,7 +44,6 @@ public class AgentManager { private boolean deviceReady = false; private boolean isAlarmOn = false; - private String deviceMgtControlUrl, deviceMgtAnalyticUrl; private String deviceName, agentStatus; private int pushInterval; // seconds @@ -231,14 +230,6 @@ public class AgentManager { this.deviceReady = deviceReady; } - public String getDeviceMgtControlUrl() { - return deviceMgtControlUrl; - } - - public String getDeviceMgtAnalyticUrl() { - return deviceMgtAnalyticUrl; - } - public AgentConfiguration getAgentConfigs() { return agentConfigs; } diff --git a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/virtual/ui/AgentUI.java b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/virtual/ui/AgentUI.java index 4a9b76c86..4a8e3dda9 100644 --- a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/virtual/ui/AgentUI.java +++ b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/virtual/ui/AgentUI.java @@ -37,8 +37,6 @@ public class AgentUI extends JFrame { private JLabel picLabelBulbOn, picLabelBulbOff; // Variables declaration - do not modify - private JButton btnControl; - private JButton btnView; private JCheckBox chkbxEmulate; private JCheckBox chkbxHumidityRandom; private JCheckBox chkbxHumiditySmooth; @@ -158,8 +156,6 @@ public class AgentUI extends JFrame { chkbxTemperatureSmooth = new JCheckBox(); jPanel6 = new JPanel(); jLabel20 = new JLabel(); - btnView = new JButton(); - btnControl = new JButton(); lblStatus = new JLabel(); jPanel8 = new JPanel(); jLabel23 = new JLabel(); @@ -387,20 +383,6 @@ public class AgentUI extends JFrame { jLabel20.setText("Connection Status:"); jLabel20.setVerticalTextPosition(SwingConstants.TOP); - btnView.setText("View Device Data"); - btnView.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - btnViewMouseClicked(evt); - } - }); - - btnControl.setText("Control Device"); - btnControl.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - btnControlMouseClicked(evt); - } - }); - lblStatus.setFont(new Font("Cantarell", 1, 15)); // NOI18N lblStatus.setText("Not Connected"); @@ -414,9 +396,6 @@ public class AgentUI extends JFrame { .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblStatus, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnControl) - .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnView) .addContainerGap()) ); jPanel6Layout.setVerticalGroup( @@ -426,8 +405,6 @@ public class AgentUI extends JFrame { .addGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jLabel20, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) - .addComponent(btnView, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnControl) .addComponent(lblStatus))) .addContainerGap()) ); @@ -763,29 +740,6 @@ public class AgentUI extends JFrame { AgentManager.getInstance().setDeviceReady(true); } - private void btnControlMouseClicked(java.awt.event.MouseEvent evt) { - Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null; - if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { - try { - URI uri = new URI(AgentManager.getInstance().getDeviceMgtControlUrl()); - desktop.browse(uri); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - private void btnViewMouseClicked(java.awt.event.MouseEvent evt) { - Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null; - if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { - try { - URI uri = new URI(AgentManager.getInstance().getDeviceMgtAnalyticUrl()); - desktop.browse(uri); - } catch (Exception e) { - e.printStackTrace(); - } - } - } private void chkbxTemperatureRandomActionPerformed(java.awt.event.ActionEvent evt) { isTemperatureRandomized = chkbxTemperatureRandom.isSelected(); diff --git a/src/main/ui/nbproject/private/private.xml b/src/main/ui/nbproject/private/private.xml index 89be386cc..9009411f0 100644 --- a/src/main/ui/nbproject/private/private.xml +++ b/src/main/ui/nbproject/private/private.xml @@ -4,7 +4,6 @@ file:/home/lahiru/WSO2IOT/carbon-device-mgt-plugins/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/VirtualAgentUI.java - file:/home/lahiru/WSO2IOT/carbon-device-mgt-plugins/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.java