diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentManager.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentManager.java index aa790a819b..78e3b19cf8 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentManager.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentManager.java @@ -48,7 +48,6 @@ public class AgentManager { private boolean isAlarmOn = false; private String initialPolicy; - private String deviceMgtControlUrl, deviceMgtAnalyticUrl; private String deviceName, agentStatus; private int pushInterval; // seconds @@ -252,14 +251,6 @@ public class AgentManager { return initialPolicy; } - public String getDeviceMgtControlUrl() { - return deviceMgtControlUrl; - } - - public String getDeviceMgtAnalyticUrl() { - return deviceMgtAnalyticUrl; - } - public AgentConfiguration getAgentConfigs() { return agentConfigs; } diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/virtual/ui/AgentUI.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/virtual/ui/AgentUI.java index 96546e5b6f..963872555a 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/virtual/ui/AgentUI.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/virtual/ui/AgentUI.java @@ -43,8 +43,6 @@ public class AgentUI extends JFrame { private volatile java.util.List policyLogs = new ArrayList<>(); // Variables declaration - do not modify - private JButton btnControl; - private JButton btnView; private JCheckBox chkbxEmulate; private JCheckBox chkbxHumidityRandom; private JCheckBox chkbxHumiditySmooth; @@ -173,8 +171,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(); @@ -427,20 +423,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"); @@ -455,10 +437,6 @@ public class AgentUI extends JFrame { .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( @@ -474,11 +452,6 @@ public class AgentUI extends JFrame { 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()) ); @@ -876,30 +849,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(); VirtualHardwareManager.getInstance().setIsTemperatureRandomized(isTemperatureRandomized); diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java index 5cdedb5a6a..7d8f1dc57e 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/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/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java index 69348b1956..4ad7f0037b 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/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/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/virtual/ui/AgentUI.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/virtual/ui/AgentUI.java index 4a9b76c864..4a8e3dda95 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/virtual/ui/AgentUI.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/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/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/ui/nbproject/private/private.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/ui/nbproject/private/private.xml index 89be386ccb..9009411f0b 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/ui/nbproject/private/private.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/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