├── .gitignore ├── .nb-gradle-properties ├── LICENSE ├── README.md ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jitpack.yml ├── settings.gradle └── src ├── android ├── AndroidManifest.xml ├── icon.svg ├── java │ └── com │ │ └── adr │ │ └── helloiot │ │ └── HelloPlatformAndroid.java └── res │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-ldpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ └── mipmap-xxxhdpi │ └── ic_launcher.png └── main ├── java └── com │ └── adr │ ├── helloiot │ ├── ApplicationDevicesUnits.java │ ├── ApplicationTopicsManager.java │ ├── ApplicationUnitPages.java │ ├── ApplicationUnitPagesBasic.java │ ├── BaseSubProperties.java │ ├── Beeper.java │ ├── Bridge.java │ ├── BridgeConfig.java │ ├── Buzzer.java │ ├── ClientLoginNode.java │ ├── CodeUnit.java │ ├── ConfigProperties.java │ ├── ConfigSubProperties.java │ ├── ConnectUI.java │ ├── DevicesUnits.java │ ├── HelloIoTApp.java │ ├── HelloIoTException.java │ ├── HelloPlatform.java │ ├── HelloPlatformDesktop.java │ ├── IOSupplier.java │ ├── LauncherClient.java │ ├── LauncherPlatform.java │ ├── MainApp.java │ ├── MainAppClient.java │ ├── MainAppPlatform.java │ ├── MainListener.java │ ├── MainManager.java │ ├── MainManagerClient.java │ ├── MainManagerPlatform.java │ ├── MainNode.java │ ├── ManagerComposed.java │ ├── ManagerProtocol.java │ ├── SSLProtocol.java │ ├── Style.java │ ├── SubProperties.java │ ├── TimeIndicator.java │ ├── TopicInfoBuilder.java │ ├── TopicsGallery.java │ ├── TopicsTab.java │ ├── TopicsTemplate.java │ ├── device │ │ ├── DeviceCommand.java │ │ ├── DeviceNumber.java │ │ ├── DeviceSend.java │ │ ├── DeviceSet.java │ │ ├── DeviceSimple.java │ │ ├── DeviceSimulator.java │ │ ├── DeviceStatus.java │ │ ├── DeviceSubscribe.java │ │ ├── DeviceSwitch.java │ │ ├── Engine.java │ │ ├── Light.java │ │ ├── MessageStatus.java │ │ ├── Plug.java │ │ ├── SystemDeviceTimer.java │ │ ├── Temperature.java │ │ ├── Thermostat.java │ │ ├── Toggle.java │ │ ├── TransmitterNumber.java │ │ ├── TransmitterSimple.java │ │ ├── TreePublish.java │ │ └── TreePublishSubscribe.java │ ├── graphic │ │ ├── Bulb.java │ │ ├── IconBrightness.java │ │ ├── IconColor.java │ │ ├── IconNull.java │ │ ├── IconStatus.java │ │ ├── IconSwitch.java │ │ ├── IconText.java │ │ ├── IconToggle.java │ │ ├── ImageIntensity.java │ │ ├── Padlock.java │ │ └── Power.java │ ├── local │ │ ├── BridgeLocal.java │ │ └── ManagerLocal.java │ ├── media │ │ ├── Clip.java │ │ ├── ClipFactory.java │ │ ├── CommandClip.java │ │ ├── CommandClipFactory.java │ │ ├── SilentClip.java │ │ ├── SilentClipFactory.java │ │ ├── StandardClip.java │ │ └── StandardClipFactory.java │ ├── mqtt │ │ ├── BridgeMQTT.java │ │ ├── ConnectMQTT.java │ │ ├── MQTTProperty.java │ │ └── ManagerMQTT.java │ ├── properties │ │ └── VarProperties.java │ ├── scripting │ │ ├── Nashorn.java │ │ ├── Rhino.java │ │ ├── Script.java │ │ └── ScriptExecException.java │ ├── topicinfo │ │ ├── EditNodeFormat.java │ │ ├── GaugeNodeFormat.java │ │ ├── TopicInfo.java │ │ ├── TopicInfoCode.java │ │ ├── TopicInfoCodeNode.java │ │ ├── TopicInfoEdit.java │ │ ├── TopicInfoEditNode.java │ │ ├── TopicInfoFactory.java │ │ ├── TopicInfoFactoryCode.java │ │ ├── TopicInfoFactoryEdit.java │ │ ├── TopicInfoFactoryGauge.java │ │ ├── TopicInfoFactoryMessagesPublish.java │ │ ├── TopicInfoFactoryMessagesSubscribe.java │ │ ├── TopicInfoFactorySend.java │ │ ├── TopicInfoFactorySwitch.java │ │ ├── TopicInfoFactoryView.java │ │ ├── TopicInfoGauge.java │ │ ├── TopicInfoGaugeNode.java │ │ ├── TopicInfoMessagesPublish.java │ │ ├── TopicInfoMessagesPublishNode.java │ │ ├── TopicInfoMessagesSubscribe.java │ │ ├── TopicInfoMessagesSubscribeNode.java │ │ ├── TopicInfoNode.java │ │ ├── TopicInfoPublicationSubscription.java │ │ ├── TopicInfoSend.java │ │ ├── TopicInfoSwitch.java │ │ ├── TopicInfoSwitchNode.java │ │ └── TopicInfoView.java │ ├── tradfri │ │ ├── BridgeTradfri.java │ │ ├── ConnectTradfri.java │ │ ├── FindTradfri.java │ │ ├── ManagerTradfri.java │ │ ├── TradfriConstants.java │ │ └── TradfriException.java │ ├── unit │ │ ├── ButtonBase.java │ │ ├── ButtonEngine.java │ │ ├── ButtonPageSelect.java │ │ ├── ButtonPair.java │ │ ├── ButtonPassword.java │ │ ├── ButtonScript.java │ │ ├── ButtonSend.java │ │ ├── ButtonSimple.java │ │ ├── ButtonsSpinner.java │ │ ├── ChartNode.java │ │ ├── ChartSerie.java │ │ ├── ChartSerieListener.java │ │ ├── ControlIntensity.java │ │ ├── EditAreaEvent.java │ │ ├── EditAreaStatus.java │ │ ├── EditAreaView.java │ │ ├── EditEvent.java │ │ ├── EditStatus.java │ │ ├── EditView.java │ │ ├── GaugeType.java │ │ ├── LabelSection.java │ │ ├── LogView.java │ │ ├── MessageCell.java │ │ ├── MessageItem.java │ │ ├── MessagesPage.java │ │ ├── PublicationsPage.java │ │ ├── ReceiverBase.java │ │ ├── ReceiverScript.java │ │ ├── ScriptCode.java │ │ ├── SecurityKeyboard.java │ │ ├── ShapeChartArea.java │ │ ├── SliderSimple.java │ │ ├── StartFlow.java │ │ ├── StartLine.java │ │ ├── Tile.java │ │ ├── UnitPage.java │ │ ├── UnitsContainer.java │ │ ├── UnitsContainerClassic.java │ │ ├── UnitsContainerEmpty.java │ │ ├── UnitsContainerFull.java │ │ ├── ViewChart.java │ │ ├── ViewGauge.java │ │ ├── ViewNumberChart.java │ │ ├── ViewNumberProgress.java │ │ ├── ViewSimple.java │ │ └── ViewText.java │ ├── util │ │ ├── CompletableAsync.java │ │ ├── CryptUtils.java │ │ ├── Dialogs.java │ │ ├── ExternalFonts.java │ │ ├── FXMLNames.java │ │ └── HTTPUtils.java │ └── weather │ │ ├── BridgeTime.java │ │ └── ManagerTime.java │ ├── helloiotext │ └── home │ │ ├── DevicesManager.java │ │ ├── HomeConfig.java │ │ └── SecurityManager.java │ └── helloiotlib │ ├── app │ ├── EventMessage.java │ ├── IoTApp.java │ ├── TopicManager.java │ └── TopicSubscription.java │ ├── device │ ├── Device.java │ ├── DevicePredicate.java │ ├── DeviceProvider.java │ └── ListDevice.java │ ├── format │ ├── MiniVar.java │ ├── MiniVarBoolean.java │ ├── MiniVarBytes.java │ ├── MiniVarDouble.java │ ├── MiniVarInt.java │ ├── MiniVarLong.java │ ├── MiniVarString.java │ ├── StringFormat.java │ ├── StringFormatBase64.java │ ├── StringFormatDecimal.java │ ├── StringFormatHex.java │ ├── StringFormatIdentity.java │ ├── StringFormatInt.java │ ├── StringFormatJSONPretty.java │ ├── StringFormatLong.java │ ├── StringFormatPath.java │ └── StringFormatSwitch.java │ └── unit │ ├── Unit.java │ └── Units.java └── resources ├── META-INF └── services │ ├── com.adr.helloiot.ApplicationDevicesUnits │ └── com.adr.helloiot.ApplicationUnitPages └── com └── adr ├── helloiot ├── fxml │ ├── basic.properties │ ├── basic_es.properties │ ├── clientlogin.properties │ ├── clientlogin_es.properties │ ├── connectmqtt.fxml │ ├── connectmqtt.properties │ ├── connectmqtt_es.properties │ ├── connectmqtt_mobile.fxml │ ├── connecttradfri.fxml │ ├── connecttradfri.properties │ ├── connecttradfri_es.properties │ ├── connecttradfri_mobile.fxml │ ├── findtradfri.fxml │ ├── findtradfri.properties │ ├── findtradfri_es.properties │ ├── main.fxml │ ├── main.properties │ ├── main_es.properties │ ├── messages.properties │ ├── messages_es.properties │ ├── publications.properties │ ├── publications_es.properties │ ├── securitykeyboard.fxml │ ├── topicinfocodenode.fxml │ ├── topicinfocodenode.properties │ ├── topicinfocodenode_es.properties │ ├── topicinfocodenode_mobile.fxml │ ├── topicinfoeditnode.fxml │ ├── topicinfoeditnode.properties │ ├── topicinfoeditnode_es.properties │ ├── topicinfoeditnode_mobile.fxml │ ├── topicinfogaugenode.fxml │ ├── topicinfogaugenode.properties │ ├── topicinfogaugenode_es.properties │ ├── topicinfogaugenode_mobile.fxml │ ├── topicinfomessagespublishnode.fxml │ ├── topicinfomessagespublishnode.properties │ ├── topicinfomessagespublishnode_es.properties │ ├── topicinfomessagespublishnode_mobile.fxml │ ├── topicinfomessagessubscribenode.fxml │ ├── topicinfomessagessubscribenode.properties │ ├── topicinfomessagessubscribenode_es.properties │ ├── topicinfomessagessubscribenode_mobile.fxml │ ├── topicinfoswitchnode.fxml │ ├── topicinfoswitchnode.properties │ ├── topicinfoswitchnode_es.properties │ └── topicinfoswitchnode_mobile.fxml ├── panes │ ├── mosquitto.fxml │ ├── mosquitto.properties │ ├── mosquitto_es.properties │ └── mosquitto_mobile.fxml ├── res │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ ├── mipmap-ldpi │ │ └── ic_launcher.png │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ └── mipmap-xxxhdpi │ │ └── ic_launcher.png ├── resources │ ├── devices.properties │ ├── devices_es.properties │ ├── helloiot.properties │ └── helloiot_es.properties ├── samples │ ├── bulb.unit │ ├── bulball.unit │ ├── bulbdim.unit │ └── bulbdimtemperature.unit ├── sounds │ ├── beep-01a.wav │ ├── beep-04.wav │ ├── beep-09.wav │ ├── beep-25.wav │ ├── beep-28.wav │ ├── button-4.wav │ ├── button-41.wav │ └── telephone-ring-03a.wav └── styles │ ├── Roboto-Bold.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-Regular.ttf │ ├── SourceCodePro-Black.ttf │ ├── SourceCodePro-Bold.ttf │ ├── SourceCodePro-ExtraLight.ttf │ ├── SourceCodePro-Light.ttf │ ├── SourceCodePro-Medium.ttf │ ├── SourceCodePro-Regular.ttf │ ├── SourceCodePro-Semibold.ttf │ ├── SourceSansPro-Black.ttf │ ├── SourceSansPro-BlackItalic.ttf │ ├── SourceSansPro-Bold.ttf │ ├── SourceSansPro-BoldItalic.ttf │ ├── SourceSansPro-ExtraLight.ttf │ ├── SourceSansPro-ExtraLightItalic.ttf │ ├── SourceSansPro-Italic.ttf │ ├── SourceSansPro-Light.ttf │ ├── SourceSansPro-LightItalic.ttf │ ├── SourceSansPro-Regular.ttf │ ├── SourceSansPro-SemiBold.ttf │ ├── SourceSansPro-SemiBoldItalic.ttf │ ├── empty.css │ ├── empty.hover.css │ ├── fullscreen.css │ ├── loading.css │ ├── loadingdialog.css │ ├── main-dark.css │ ├── main-dark.hover.css │ ├── main-light.css │ ├── main-light.hover.css │ ├── main.css │ ├── main.hover.css │ ├── root.css │ ├── root.hover.css │ └── topicinfodialog.css └── helloiotext └── fxml ├── home.properties └── home_es.properties /.gitignore: -------------------------------------------------------------------------------- 1 | # build application files 2 | /helloiot.properties 3 | /Californium.properties 4 | /my-release-key.jks 5 | /target/ 6 | /nbproject/ 7 | /.gradle/ 8 | /build/ 9 | /private/ 10 | /bin/ 11 | -------------------------------------------------------------------------------- /.nb-gradle-properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk11 3 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | rootProject.name = 'helloiot' 20 | -------------------------------------------------------------------------------- /src/android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/android/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/src/android/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/src/android/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/src/android/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/src/android/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/src/android/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/src/android/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/ApplicationDevicesUnits.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import com.adr.helloiotlib.unit.Unit; 22 | import com.adr.helloiotlib.device.Device; 23 | import java.util.List; 24 | 25 | /** 26 | * 27 | * @author adrian 28 | */ 29 | public interface ApplicationDevicesUnits { 30 | 31 | public List getDevices(); 32 | 33 | public List getUnits(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/ApplicationUnitPages.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import com.adr.helloiot.unit.UnitPage; 22 | import java.util.List; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public interface ApplicationUnitPages { 29 | 30 | public List getUnitPages(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/BaseSubProperties.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import java.util.Properties; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public class BaseSubProperties implements SubProperties { 28 | 29 | private final Properties properties = new Properties(); 30 | 31 | @Override 32 | public String getProperty(String key) { 33 | return properties.getProperty(key); 34 | } 35 | 36 | @Override 37 | public String getProperty(String key, String defaultValue) { 38 | return properties.getProperty(key, defaultValue); 39 | } 40 | 41 | @Override 42 | public void setProperty(String key, String value) { 43 | properties.setProperty(key, value); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/Bridge.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import com.adr.helloiot.properties.VarProperties; 22 | 23 | public interface Bridge { 24 | public ConnectUI createConnectUI(); 25 | public boolean hasManager(VarProperties properties); 26 | public ManagerProtocol createManager(VarProperties properties); 27 | public void readConfiguration(VarProperties config, SubProperties configprops); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/BridgeConfig.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | public class BridgeConfig { 22 | 23 | private final Bridge bridge; 24 | private final String root; 25 | private final String prefix; 26 | 27 | public BridgeConfig(Bridge bridge, String root, String prefix) { 28 | this.bridge = bridge; 29 | this.root = root; 30 | this.prefix = prefix; 31 | } 32 | 33 | public Bridge getBridge() { 34 | return bridge; 35 | } 36 | 37 | public String getRoot() { 38 | return root; 39 | } 40 | 41 | public String getPrefix() { 42 | return prefix; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/CodeUnit.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class CodeUnit { 26 | 27 | private String name; 28 | private String code; 29 | 30 | /** 31 | * @return the name 32 | */ 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | /** 38 | * @param name the name to set 39 | */ 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | /** 45 | * @return the code 46 | */ 47 | public String getCode() { 48 | return code; 49 | } 50 | 51 | /** 52 | * @param code the code to set 53 | */ 54 | public void setCode(String code) { 55 | this.code = code; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/ConfigSubProperties.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class ConfigSubProperties implements SubProperties { 26 | 27 | private final ConfigProperties properties; 28 | private final String prefix; 29 | 30 | public ConfigSubProperties(ConfigProperties properties, String prefix) { 31 | this.properties = properties; 32 | this.prefix = prefix; 33 | } 34 | 35 | @Override 36 | public String getProperty(String key) { 37 | return properties.getProperty(prefix + key); 38 | } 39 | 40 | @Override 41 | public String getProperty(String key, String defaultValue) { 42 | return properties.getProperty(prefix + key, defaultValue); 43 | } 44 | 45 | @Override 46 | public void setProperty(String key, String value) { 47 | properties.setProperty(prefix + key, value); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/ConnectUI.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import javafx.scene.Node; 22 | 23 | public interface ConnectUI { 24 | public void loadConfig(SubProperties configprops); 25 | public void saveConfig(SubProperties configprops); 26 | public Node getNode(); 27 | public void requestFocus(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/DevicesUnits.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import com.adr.helloiotlib.device.Device; 22 | import com.adr.helloiotlib.unit.Unit; 23 | import java.util.ArrayList; 24 | import java.util.List; 25 | 26 | /** 27 | * 28 | * @author adrian 29 | */ 30 | public class DevicesUnits { 31 | 32 | private final List units; 33 | private final List devices; 34 | 35 | public DevicesUnits() { 36 | this.devices = new ArrayList(); 37 | this.units = new ArrayList(); 38 | } 39 | 40 | public DevicesUnits(List devices, List units) { 41 | this.devices = devices; 42 | this.units = units; 43 | } 44 | 45 | public List getUnits() { 46 | return units; 47 | } 48 | 49 | public List getDevices() { 50 | return devices; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/HelloIoTException.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class HelloIoTException extends Exception { 26 | 27 | public HelloIoTException(String message) { 28 | super(message); 29 | } 30 | 31 | public HelloIoTException(String message, Throwable t) { 32 | super(message, t); 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return getLocalizedMessage(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/HelloPlatformDesktop.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import com.adr.helloiot.scripting.Nashorn; 22 | import com.adr.helloiot.scripting.Script; 23 | import java.io.File; 24 | import java.io.IOException; 25 | import java.nio.file.Files; 26 | import java.nio.file.Path; 27 | import java.nio.file.Paths; 28 | 29 | public class HelloPlatformDesktop extends HelloPlatform { 30 | 31 | @Override 32 | public String getHome() { 33 | return System.getProperty("HELLOIOT_HOME"); 34 | } 35 | 36 | @Override 37 | public File getFile(String file) throws IOException { 38 | String home = getHome(); 39 | String homepath = (home == null || home.isEmpty()) 40 | ? System.getProperty("user.home") 41 | : home; 42 | Path root = Paths.get(homepath, ".helloiot"); 43 | 44 | Files.createDirectories(root); 45 | 46 | return root.resolve(file).toFile(); 47 | } 48 | 49 | @Override 50 | public boolean isFullScreen() { 51 | return false; 52 | } 53 | 54 | @Override 55 | public Script getNewScript() { 56 | return new Nashorn(); 57 | } 58 | 59 | @Override 60 | public void keepON() { 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/IOSupplier.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import java.io.IOException; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | @FunctionalInterface 28 | public interface IOSupplier { 29 | T get() throws IOException; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/LauncherClient.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | public class LauncherClient { 22 | public static void main(String[] args) { 23 | com.adr.helloiot.MainAppClient.main(args); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/LauncherPlatform.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | public class LauncherPlatform { 22 | public static void main(String[] args) { 23 | com.adr.helloiot.MainAppPlatform.main(args); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/MainAppClient.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | public class MainAppClient extends MainApp { 22 | 23 | @Override 24 | protected MainManager createManager() { 25 | return new MainManagerClient(); // 26 | } 27 | 28 | /** 29 | * The main() method is ignored in correctly deployed JavaFX application. 30 | * main() serves only as fallback in case the application can not be 31 | * launched through deployment artifacts, e.g., in IDEs with limited FX 32 | * support. NetBeans ignores main(). 33 | * 34 | * @param args the command line arguments 35 | */ 36 | public static void main(String[] args) { 37 | // Locale.setDefault(Locale.US); 38 | launch(args); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/MainAppPlatform.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | public class MainAppPlatform extends MainApp { 22 | 23 | @Override 24 | protected MainManager createManager() { 25 | return new MainManagerPlatform(); // 26 | } 27 | 28 | /** 29 | * The main() method is ignored in correctly deployed JavaFX application. 30 | * main() serves only as fallback in case the application can not be 31 | * launched through deployment artifacts, e.g., in IDEs with limited FX 32 | * support. NetBeans ignores main(). 33 | * 34 | * @param args the command line arguments 35 | */ 36 | public static void main(String[] args) { 37 | launch(args); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/MainListener.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public interface MainListener { 26 | 27 | public void showConnecting(); 28 | 29 | public void hideConnecting(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/MainManager.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import javafx.application.Application.Parameters; 22 | import javafx.scene.layout.StackPane; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public interface MainManager { 29 | 30 | public void construct(StackPane root, Parameters params); 31 | public void destroy(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/ManagerProtocol.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import com.adr.helloiotlib.app.EventMessage; 22 | import com.adr.helloiotlib.format.MiniVar; 23 | import java.util.Map; 24 | import java.util.function.Consumer; 25 | 26 | /** 27 | * 28 | * @author adrian 29 | */ 30 | public interface ManagerProtocol { 31 | 32 | void registerTopicsManager(Consumer consumer, Consumer lost); 33 | void registerSubscription(String topic, Map messageProperties); 34 | void connect(); 35 | void disconnect(); 36 | void publish(EventMessage message); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/SSLProtocol.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public enum SSLProtocol { 26 | 27 | TLSv1("TLSv1"), 28 | TLSv11("TLSv1.1"), 29 | TLSv12("TLSv1.2"), 30 | TLSv13("TLSv1.3"), 31 | SSL_TLS("SSL_TLS"), 32 | SSLv3("SSLv3"); 33 | 34 | private final String displayname; 35 | 36 | private SSLProtocol(String displayname) { 37 | this.displayname = displayname; 38 | } 39 | 40 | public String getDisplayName() { 41 | return displayname; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return displayname; 47 | } 48 | 49 | public static SSLProtocol valueOfDefault(String v) { 50 | try { 51 | return valueOf(v); 52 | } catch (java.lang.IllegalArgumentException e) { 53 | return TLSv12; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/SubProperties.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public interface SubProperties { 26 | public String getProperty(String key); 27 | public String getProperty(String key, String defaultValue); 28 | public void setProperty(String key, String value); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/TopicsTab.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot; 20 | 21 | import com.adr.helloiot.topicinfo.TopicInfo; 22 | import com.google.common.util.concurrent.ListenableFuture; 23 | import java.util.function.Consumer; 24 | import javafx.event.ActionEvent; 25 | import javafx.scene.Node; 26 | 27 | public interface TopicsTab { 28 | public String getText(); 29 | public Node getNode(); 30 | public void setActionOK(Consumer actionok); 31 | public ListenableFuture createSelected(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/DeviceSend.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiotlib.format.MiniVar; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public interface DeviceSend { 28 | public void sendStatus(MiniVar status); 29 | public void sendStatus(String event); 30 | public void sendStatus(MiniVar status, long delay); 31 | public void sendStatus(String event, long delay); 32 | public boolean hasTimer(); 33 | public void cancelTimer(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/DeviceSimulator.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiot.mqtt.MQTTProperty; 22 | import com.adr.helloiotlib.app.EventMessage; 23 | import java.util.Objects; 24 | 25 | /** 26 | * 27 | * @author adrian 28 | */ 29 | public class DeviceSimulator extends DeviceSubscribe { 30 | 31 | public DeviceSimulator() { 32 | MQTTProperty.setRetained(this, true); 33 | } 34 | 35 | @Override 36 | public String getDeviceName() { 37 | return resources.getString("devicename.devicesimulator"); 38 | } 39 | 40 | @Override 41 | protected void consumeMessage(EventMessage message) { 42 | if (Objects.equals(this.getTopic(), getTopicPublish())) { 43 | return; // No need to mirror the message if topics are equal 44 | } 45 | EventMessage sendmessage = new EventMessage(getTopicPublish(), message.getMessage(), getMessageProperties()); 46 | manager.publish(sendmessage); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/Engine.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import com.adr.helloiot.graphic.IconStatus; 23 | import com.adr.helloiot.graphic.Power; 24 | 25 | /** 26 | * 27 | * @author adrian 28 | */ 29 | public class Engine extends DeviceSwitch { 30 | 31 | public static final IconStatus ICONENGINE = new Power(IconFontGlyph.FA_SOLID_COG); 32 | 33 | @Override 34 | public String getDeviceName() { 35 | return resources.getString("devicename.engine"); 36 | } 37 | 38 | @Override 39 | public IconStatus getIconStatus() { 40 | return ICONENGINE; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/Light.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiot.graphic.Bulb; 22 | import com.adr.helloiot.graphic.IconStatus; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public class Light extends DeviceSwitch { 29 | 30 | public static final IconStatus ICONBULB = new Bulb(); 31 | 32 | @Override 33 | public String getDeviceName() { 34 | return resources.getString("devicename.light"); 35 | } 36 | 37 | @Override 38 | public IconStatus getIconStatus() { 39 | return ICONBULB; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/MessageStatus.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiotlib.format.StringFormatSwitch; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public class MessageStatus extends DeviceSubscribe { 28 | 29 | public MessageStatus() { 30 | this.setFormat(new StringFormatSwitch()); 31 | } 32 | 33 | @Override 34 | public String getDeviceName() { 35 | return resources.getString("devicename.messagestatus"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/Plug.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import com.adr.helloiot.graphic.IconStatus; 23 | import com.adr.helloiot.graphic.Power; 24 | 25 | /** 26 | * 27 | * @author adrian 28 | */ 29 | public class Plug extends DeviceSwitch { 30 | 31 | public static final IconStatus ICONPLUG = new Power(IconFontGlyph.FA_SOLID_PLUG); 32 | 33 | @Override 34 | public String getDeviceName() { 35 | return resources.getString("devicename.plug"); 36 | } 37 | 38 | @Override 39 | public IconStatus getIconStatus() { 40 | return ICONPLUG; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/Temperature.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiotlib.format.StringFormatDecimal; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public class Temperature extends TransmitterNumber { 28 | 29 | public Temperature() { 30 | setLevelMin(-40.0); 31 | setLevelMax(70.0); 32 | setFormat(StringFormatDecimal.DEGREES); 33 | } 34 | 35 | @Override 36 | public String getDeviceName() { 37 | return resources.getString("devicename.temperature"); 38 | } 39 | 40 | @Override 41 | public String getUnit() { 42 | return "°C"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/Thermostat.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiotlib.format.StringFormatDecimal; 22 | 23 | public class Thermostat extends DeviceNumber { 24 | 25 | public Thermostat() { 26 | setLevelMin(15.0); 27 | setLevelMax(29.0); 28 | setIncrement(0.2); 29 | setFormat(StringFormatDecimal.DEGREES); 30 | } 31 | 32 | @Override 33 | public String getDeviceName() { 34 | return resources.getString("devicename.thermostat"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/Toggle.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiot.graphic.IconStatus; 22 | import com.adr.helloiot.graphic.IconToggle; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public class Toggle extends DeviceSwitch { 29 | 30 | public static final IconStatus ICONTOGGLE = new IconToggle(); 31 | 32 | @Override 33 | public String getDeviceName() { 34 | return resources.getString("devicename.toggle"); 35 | } 36 | 37 | @Override 38 | public IconStatus getIconStatus() { 39 | return ICONTOGGLE; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/device/TransmitterNumber.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.device; 20 | 21 | import com.adr.helloiotlib.format.StringFormatDecimal; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public class TransmitterNumber extends TransmitterSimple { 28 | 29 | private double levelmax = 100.0; 30 | private double levelmin = 0.0; 31 | 32 | public TransmitterNumber() { 33 | super(); 34 | setFormat(StringFormatDecimal.DECIMAL); 35 | } 36 | 37 | @Override 38 | public String getDeviceName() { 39 | return resources.getString("devicename.transmitternumber"); 40 | } 41 | 42 | public String getUnit() { 43 | return ""; 44 | } 45 | 46 | public final void setLevelMax(double levelmax) { 47 | this.levelmax = levelmax; 48 | } 49 | 50 | public final double getLevelMax() { 51 | return levelmax; 52 | } 53 | 54 | public final void setLevelMin(double levelmin) { 55 | this.levelmin = levelmin; 56 | } 57 | 58 | public final double getLevelMin() { 59 | return levelmin; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/Bulb.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import com.adr.fonticon.IconBuilder; 23 | import com.adr.fonticon.IconFont; 24 | import com.adr.fonticon.decorator.LightOff; 25 | import com.adr.fonticon.decorator.LightOn; 26 | import javafx.scene.Node; 27 | 28 | /** 29 | * 30 | * @author adrian 31 | */ 32 | public class Bulb extends IconSwitch { 33 | 34 | private IconFont icon; 35 | 36 | public Bulb(IconFont icon) { 37 | this.icon = icon; 38 | } 39 | 40 | public Bulb() { 41 | this(IconFontGlyph.FA_SOLID_LIGHTBULB); 42 | } 43 | 44 | @Override 45 | protected Node buildIconOn() { 46 | return IconBuilder.create(icon, 56.0).apply(new LightOn()).build(); 47 | } 48 | 49 | @Override 50 | protected Node buildIconOff() { 51 | return IconBuilder.create(icon, 56.0).apply(new LightOff()).build(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/IconBrightness.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import com.adr.fonticon.IconBuilder; 23 | import com.adr.fonticon.IconFont; 24 | import com.adr.helloiotlib.format.StringFormat; 25 | import javafx.scene.Node; 26 | import javafx.scene.paint.Color; 27 | 28 | /** 29 | * 30 | * @author adrian 31 | */ 32 | public class IconBrightness extends IconStatus { 33 | 34 | private IconFont icon; 35 | private Color color; 36 | 37 | public IconBrightness(IconFont icon) { 38 | this.icon = icon; 39 | this.color = Color.YELLOW; 40 | } 41 | 42 | public IconBrightness() { 43 | this(IconFontGlyph.FA_SOLID_LIGHTBULB); 44 | } 45 | 46 | @Override 47 | public Node buildIcon(StringFormat format, byte[] value) { 48 | 49 | ImageIntensity img = new ImageIntensity(IconBuilder.create(icon, 56.0).color(color).build()); 50 | img.setBarFill(Color.BLUE); 51 | img.setWidth(format.value(value).asDouble()); 52 | 53 | return img; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/IconColor.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import com.adr.fonticon.IconBuilder; 23 | import com.adr.fonticon.IconFont; 24 | import com.adr.helloiotlib.format.StringFormat; 25 | import javafx.scene.Node; 26 | import javafx.scene.paint.Color; 27 | 28 | /** 29 | * 30 | * @author adrian 31 | */ 32 | public class IconColor extends IconStatus { 33 | 34 | private IconFont icon; 35 | 36 | public IconColor(IconFont icon) { 37 | this.icon = icon; 38 | } 39 | 40 | public IconColor() { 41 | this(IconFontGlyph.FA_SOLID_LIGHTBULB); 42 | } 43 | 44 | @Override 45 | public Node buildIcon(StringFormat format, byte[] value) { 46 | Color c; 47 | try { 48 | c = Color.valueOf(format.value(value).asString()); 49 | } catch (Exception e) { 50 | c = Color.BLACK; 51 | } 52 | return IconBuilder.create(icon, 48.0).color(c).build(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/IconNull.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.helloiotlib.format.StringFormat; 22 | import javafx.scene.Node; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public class IconNull extends IconStatus { 29 | 30 | @Override 31 | public Node buildIcon(StringFormat format, byte[] value) { 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/IconSwitch.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.helloiotlib.format.StringFormat; 22 | import javafx.scene.Node; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public abstract class IconSwitch extends IconStatus { 29 | 30 | @Override 31 | public final Node buildIcon(StringFormat format, byte[] value) { 32 | if (format.value(value).asBoolean()) { 33 | return buildIconOn(); 34 | } else { 35 | return buildIconOff(); 36 | } 37 | } 38 | 39 | protected abstract Node buildIconOn(); 40 | 41 | protected abstract Node buildIconOff(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/IconText.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.helloiot.util.ExternalFonts; 22 | import com.adr.helloiotlib.format.StringFormat; 23 | import javafx.scene.Node; 24 | import javafx.scene.effect.BlurType; 25 | import javafx.scene.effect.DropShadow; 26 | import javafx.scene.paint.Color; 27 | import javafx.scene.text.Font; 28 | import javafx.scene.text.FontWeight; 29 | import javafx.scene.text.Text; 30 | 31 | /** 32 | * 33 | * @author adrian 34 | */ 35 | public class IconText extends IconStatus { 36 | 37 | @Override 38 | public Node buildIcon(StringFormat format, byte[] value) { 39 | Text t = new Text(format.format(format.value(value))); 40 | t.setFont(Font.font(ExternalFonts.SOURCESANSPRO_BLACK, FontWeight.BOLD, 32.0)); 41 | t.setFill(Color.WHITE); 42 | 43 | DropShadow dropShadow = new DropShadow(); 44 | dropShadow.setRadius(4.0); 45 | dropShadow.setColor(Color.BLACK /* valueOf("#4b5157")*/); 46 | dropShadow.setBlurType(BlurType.ONE_PASS_BOX); 47 | t.setEffect(dropShadow); 48 | 49 | return t; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/IconToggle.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import com.adr.fonticon.IconBuilder; 23 | import com.adr.fonticon.IconFont; 24 | import javafx.scene.Node; 25 | import javafx.scene.paint.Color; 26 | 27 | /** 28 | * 29 | * @author adrian 30 | */ 31 | public class IconToggle extends IconSwitch { 32 | 33 | private final IconFont iconon; 34 | private final IconFont iconoff; 35 | 36 | public IconToggle(IconFont iconon, IconFont iconoff) { 37 | this.iconon = iconon; 38 | this.iconoff = iconoff; 39 | } 40 | 41 | public IconToggle() { 42 | this(IconFontGlyph.FA_SOLID_TOGGLE_ON, IconFontGlyph.FA_SOLID_TOGGLE_OFF); 43 | } 44 | 45 | @Override 46 | protected Node buildIconOn() { 47 | return IconBuilder.create(iconon, 48.0).color(Color.LIME).build(); 48 | } 49 | 50 | @Override 51 | protected Node buildIconOff() { 52 | return IconBuilder.create(iconoff, 48.0).color(Color.DARKGREY).build(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/graphic/Power.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.graphic; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import com.adr.fonticon.IconBuilder; 23 | import com.adr.fonticon.IconFont; 24 | import javafx.scene.Node; 25 | import javafx.scene.paint.Color; 26 | 27 | /** 28 | * 29 | * @author adrian 30 | */ 31 | public class Power extends IconSwitch { 32 | 33 | private IconFont icon; 34 | private Color color; 35 | 36 | public Power(IconFont icon, Color color) { 37 | this.icon = icon; 38 | this.color = color; 39 | } 40 | 41 | public Power(IconFont icon) { 42 | this(icon, Color.LIME); 43 | } 44 | 45 | public Power() { 46 | this(IconFontGlyph.FA_SOLID_POWER_OFF, Color.LIME); 47 | } 48 | 49 | @Override 50 | protected Node buildIconOn() { 51 | return IconBuilder.create(icon, 48.0).color(color).build(); 52 | } 53 | 54 | @Override 55 | protected Node buildIconOff() { 56 | return IconBuilder.create(icon, 48.0).color(Color.DARKGRAY).build(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/local/BridgeLocal.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.local; 20 | 21 | import com.adr.helloiot.Bridge; 22 | import com.adr.helloiot.ConnectUI; 23 | import com.adr.helloiot.ManagerProtocol; 24 | import com.adr.helloiot.SubProperties; 25 | import com.adr.helloiot.properties.VarProperties; 26 | 27 | public class BridgeLocal implements Bridge { 28 | 29 | @Override 30 | public ConnectUI createConnectUI() { 31 | return null; 32 | } 33 | 34 | @Override 35 | public boolean hasManager(VarProperties properties) { 36 | return true; 37 | } 38 | 39 | @Override 40 | public ManagerProtocol createManager(VarProperties properties) { 41 | return new ManagerLocal("localmainapp"); 42 | } 43 | 44 | @Override 45 | public void readConfiguration(VarProperties config, SubProperties configprops) { 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/media/Clip.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.media; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public interface Clip { 26 | 27 | public void play(); 28 | 29 | public void stop(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/media/ClipFactory.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.media; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public interface ClipFactory { 26 | 27 | public Clip createClip(String url, int cyclecount); 28 | 29 | public default Clip createClip(String url) { 30 | return createClip(url, 1); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/media/CommandClipFactory.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.media; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class CommandClipFactory implements ClipFactory { 26 | 27 | @Override 28 | public Clip createClip(String url, int cyclecount) { 29 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/media/SilentClip.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.media; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class SilentClip implements Clip { 26 | 27 | @Override 28 | public void play() { 29 | } 30 | 31 | @Override 32 | public void stop() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/media/SilentClipFactory.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.media; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class SilentClipFactory implements ClipFactory { 26 | 27 | @Override 28 | public Clip createClip(String url, int cyclecount) { 29 | return new SilentClip(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/media/StandardClip.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.media; 20 | 21 | import javafx.scene.media.AudioClip; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public class StandardClip implements Clip { 28 | 29 | private final AudioClip clip; 30 | 31 | StandardClip(String url, int cyclecount) { 32 | clip = new AudioClip(url); 33 | clip.setCycleCount(cyclecount); 34 | } 35 | 36 | @Override 37 | public void play() { 38 | clip.play(); 39 | } 40 | 41 | @Override 42 | public void stop() { 43 | clip.stop(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/media/StandardClipFactory.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.media; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class StandardClipFactory implements ClipFactory { 26 | 27 | @Override 28 | public Clip createClip(String url, int cyclecount) { 29 | return new StandardClip(url, cyclecount); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/mqtt/MQTTProperty.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.mqtt; 20 | 21 | import com.adr.helloiotlib.device.Device; 22 | import com.adr.helloiotlib.format.MiniVarBoolean; 23 | import com.adr.helloiotlib.format.MiniVarInt; 24 | 25 | /** 26 | * 27 | * @author adrian 28 | */ 29 | public class MQTTProperty { 30 | 31 | private MQTTProperty() { 32 | } 33 | 34 | public static void setQos(Device device, int value) { 35 | device.getMessageProperties().put("mqtt.qos", new MiniVarInt(value)); 36 | } 37 | 38 | public static int getQos(Device device) { 39 | return device.getMessageProperties().get("mqtt.qos").asInt(); 40 | } 41 | 42 | public static void setRetained(Device device, boolean value) { 43 | device.getMessageProperties().put("mqtt.retained", value ? MiniVarBoolean.TRUE : MiniVarBoolean.FALSE); 44 | } 45 | 46 | public static boolean isRetained(Device device) { 47 | return device.getMessageProperties().get("mqtt.retained").asBoolean(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/scripting/Script.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.scripting; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public abstract class Script { 28 | public abstract void putScopeObject(String name, Object obj) throws ScriptExecException; 29 | public abstract void putScopeFunction(String name, Object obj, String method, int params) throws ScriptExecException; 30 | public abstract void putScopeMap(Map params) throws ScriptExecException; 31 | public abstract Object exec(String script) throws ScriptExecException; 32 | 33 | protected final String createArgs(int params) { 34 | StringBuilder result = new StringBuilder(); 35 | for (int i = 0; i < params; i++) { 36 | if (i > 0) { 37 | result.append(", "); 38 | } 39 | result.append("p"); 40 | result.append(Integer.toString(i)); 41 | } 42 | return result.toString(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/scripting/ScriptExecException.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.scripting; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class ScriptExecException extends RuntimeException { 26 | 27 | public ScriptExecException() { 28 | } 29 | 30 | public ScriptExecException(String msg) { 31 | super(msg); 32 | } 33 | 34 | public ScriptExecException(Throwable t) { 35 | super(t); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/topicinfo/TopicInfo.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.topicinfo; 20 | 21 | import com.adr.helloiot.DevicesUnits; 22 | import com.adr.helloiot.HelloIoTException; 23 | import com.adr.helloiot.SubProperties; 24 | import javafx.beans.property.ReadOnlyProperty; 25 | 26 | public interface TopicInfo { 27 | 28 | public TopicInfoFactory getFactory(); 29 | 30 | public ReadOnlyProperty getLabel(); 31 | 32 | public void load(SubProperties properties); 33 | public void store(SubProperties properties); 34 | 35 | public DevicesUnits getDevicesUnits() throws HelloIoTException; 36 | 37 | public TopicInfoNode getEditNode(); 38 | public void writeToEditNode(); 39 | public void readFromEditNode(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/topicinfo/TopicInfoFactory.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.topicinfo; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | 23 | public interface TopicInfoFactory { 24 | 25 | public String getType(); 26 | public String getTypeName(); 27 | public IconFontGlyph getGlyph(); 28 | public TopicInfoNode getTopicInfoNode(); 29 | 30 | public TopicInfo create(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/topicinfo/TopicInfoFactoryCode.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.topicinfo; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import java.util.ResourceBundle; 23 | 24 | public class TopicInfoFactoryCode implements TopicInfoFactory { 25 | 26 | private TopicInfoCodeNode codenode = null; 27 | private final String name; 28 | 29 | public TopicInfoFactoryCode() { 30 | ResourceBundle resources = ResourceBundle.getBundle("com/adr/helloiot/fxml/clientlogin"); 31 | name = resources.getString("label.topicinfo.Code"); 32 | } 33 | 34 | @Override 35 | public String getType() { 36 | return "Code"; 37 | } 38 | 39 | @Override 40 | public String getTypeName() { 41 | return name; 42 | } 43 | 44 | @Override 45 | public TopicInfoNode getTopicInfoNode() { 46 | return codenode; 47 | } 48 | 49 | @Override 50 | public TopicInfo create() { 51 | if (codenode == null) { 52 | codenode = new TopicInfoCodeNode(); 53 | } 54 | return new TopicInfoCode(this, codenode); 55 | } 56 | 57 | @Override 58 | public IconFontGlyph getGlyph() { 59 | return IconFontGlyph.FA_SOLID_CODE; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/topicinfo/TopicInfoFactoryEdit.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.topicinfo; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import java.util.ResourceBundle; 23 | 24 | public class TopicInfoFactoryEdit implements TopicInfoFactory { 25 | 26 | private TopicInfoEditNode editnode = null; 27 | private final String name; 28 | 29 | public TopicInfoFactoryEdit() { 30 | ResourceBundle resources = ResourceBundle.getBundle("com/adr/helloiot/fxml/clientlogin"); 31 | name = resources.getString("label.topicinfo.Edit"); 32 | } 33 | 34 | @Override 35 | public String getType() { 36 | return "Edit"; 37 | } 38 | 39 | @Override 40 | public String getTypeName() { 41 | return name; 42 | } 43 | 44 | @Override 45 | public TopicInfoNode getTopicInfoNode() { 46 | return editnode; 47 | } 48 | 49 | @Override 50 | public TopicInfo create() { 51 | if (editnode == null) { 52 | editnode = new TopicInfoEditNode(); 53 | } 54 | return new TopicInfoEdit(this, editnode); 55 | } 56 | 57 | @Override 58 | public IconFontGlyph getGlyph() { 59 | return IconFontGlyph.FA_SOLID_PENCIL_ALT; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/topicinfo/TopicInfoFactoryGauge.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.topicinfo; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import java.util.ResourceBundle; 23 | 24 | public class TopicInfoFactoryGauge implements TopicInfoFactory { 25 | 26 | private TopicInfoGaugeNode editnode = null; 27 | private final String name; 28 | 29 | public TopicInfoFactoryGauge() { 30 | ResourceBundle resources = ResourceBundle.getBundle("com/adr/helloiot/fxml/clientlogin"); 31 | name = resources.getString("label.topicinfo.Gauge"); 32 | } 33 | 34 | @Override 35 | public String getType() { 36 | return "Gauge"; 37 | } 38 | 39 | @Override 40 | public String getTypeName() { 41 | return name; 42 | } 43 | 44 | @Override 45 | public TopicInfoNode getTopicInfoNode() { 46 | return editnode; 47 | } 48 | 49 | @Override 50 | public TopicInfo create() { 51 | if (editnode == null) { 52 | editnode = new TopicInfoGaugeNode(); 53 | } 54 | return new TopicInfoGauge(this, editnode); 55 | } 56 | 57 | @Override 58 | public IconFontGlyph getGlyph() { 59 | return IconFontGlyph.FA_SOLID_TACHOMETER_ALT; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/topicinfo/TopicInfoFactorySwitch.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.topicinfo; 20 | 21 | import com.adr.fonticon.IconFontGlyph; 22 | import java.util.ResourceBundle; 23 | 24 | public class TopicInfoFactorySwitch implements TopicInfoFactory { 25 | 26 | private TopicInfoSwitchNode switchnode = null; 27 | private final String name; 28 | 29 | public TopicInfoFactorySwitch() { 30 | ResourceBundle resources = ResourceBundle.getBundle("com/adr/helloiot/fxml/clientlogin"); 31 | name = resources.getString("label.topicinfo.Switch"); 32 | } 33 | 34 | @Override 35 | public String getType() { 36 | return "Switch"; 37 | } 38 | 39 | @Override 40 | public String getTypeName() { 41 | return name; 42 | } 43 | 44 | @Override 45 | public TopicInfoNode getTopicInfoNode() { 46 | return switchnode; 47 | } 48 | 49 | @Override 50 | public TopicInfo create() { 51 | if (switchnode == null) { 52 | switchnode = new TopicInfoSwitchNode(); 53 | } 54 | return new TopicInfoSwitch(this, switchnode); 55 | } 56 | 57 | @Override 58 | public IconFontGlyph getGlyph() { 59 | return IconFontGlyph.FA_SOLID_TOGGLE_ON; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/topicinfo/TopicInfoNode.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.topicinfo; 20 | 21 | import javafx.scene.Node; 22 | 23 | public interface TopicInfoNode { 24 | 25 | public void useUpdateCurrent(Runnable updatecurrent); 26 | public Node getNode(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/tradfri/FindTradfri.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.tradfri; 20 | 21 | import com.adr.hellocommon.utils.FXMLUtil; 22 | import javafx.fxml.FXML; 23 | import javafx.scene.Node; 24 | import javafx.scene.control.Label; 25 | import javafx.scene.control.TextField; 26 | 27 | /** 28 | * 29 | * @author adrian 30 | */ 31 | public class FindTradfri { 32 | 33 | private Node root; 34 | @FXML private Label host; 35 | @FXML private TextField psk; 36 | 37 | public FindTradfri(String host) { 38 | root = FXMLUtil.load(this, "/com/adr/helloiot/fxml/findtradfri.fxml", "com/adr/helloiot/fxml/findtradfri"); 39 | this.host.setText(host); 40 | } 41 | 42 | public String getPSK() { 43 | return psk.getText(); 44 | } 45 | 46 | public Node getNode() { 47 | return root; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/tradfri/TradfriException.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.tradfri; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public class TradfriException extends Exception { 26 | 27 | public TradfriException(Throwable t) { 28 | super(t); 29 | } 30 | 31 | public TradfriException(String msg) { 32 | super(msg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/ButtonPageSelect.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import com.adr.helloiotlib.app.IoTApp; 22 | import com.adr.helloiot.device.DeviceSimple; 23 | import javafx.event.ActionEvent; 24 | 25 | /** 26 | * 27 | * @author adrian 28 | */ 29 | public class ButtonPageSelect extends ButtonBase { 30 | 31 | protected String page = null; 32 | 33 | public void setPage(String page) { 34 | this.page = page; 35 | } 36 | 37 | public String getPage() { 38 | return page; 39 | } 40 | 41 | @Override 42 | protected void doRun(ActionEvent event) { 43 | ((DeviceSimple) app.getDevice(IoTApp.SYS_UNITPAGE_ID)).sendStatus(page); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/ButtonSend.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import com.adr.helloiot.device.DeviceSend; 22 | import javafx.event.ActionEvent; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public class ButtonSend extends ButtonBase { 29 | 30 | private DeviceSend device = null; 31 | private String message = null; 32 | 33 | public DeviceSend getDevice() { 34 | return device; 35 | } 36 | 37 | public void setDevice(DeviceSend device) { 38 | this.device = device; 39 | } 40 | 41 | public String getMessage() { 42 | return message; 43 | } 44 | 45 | public void setMessage(String message) { 46 | this.message = message; 47 | } 48 | 49 | @Override 50 | protected void doRun(ActionEvent event) { 51 | device.sendStatus(message); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/ChartSerieListener.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | public interface ChartSerieListener { 22 | public void handleData(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/EditAreaEvent.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import javafx.scene.Node; 22 | import javafx.scene.control.Button; 23 | import javafx.scene.control.TextArea; 24 | import javafx.scene.layout.HBox; 25 | import javafx.scene.layout.Priority; 26 | 27 | /** 28 | * 29 | * @author adrian 30 | */ 31 | public class EditAreaEvent extends EditEvent { 32 | 33 | @Override 34 | public Node constructContent() { 35 | HBox hboxroot = new HBox(); 36 | hboxroot.setSpacing(6.0); 37 | 38 | payload = new TextArea(); 39 | payload.getStyleClass().add("unitinputarea"); 40 | payload.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); 41 | payload.setPrefHeight(100.0); 42 | HBox.setHgrow(payload, Priority.SOMETIMES); 43 | 44 | 45 | fireaction = new Button(); 46 | fireaction.setFocusTraversable(false); 47 | fireaction.setMnemonicParsing(false); 48 | fireaction.getStyleClass().add("unitbutton"); 49 | fireaction.setOnAction(this::onSendEvent); 50 | 51 | hboxroot.getChildren().addAll(payload, fireaction); 52 | 53 | initialize(); 54 | return hboxroot; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/EditAreaView.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import javafx.geometry.Pos; 22 | import javafx.scene.Node; 23 | import javafx.scene.control.TextArea; 24 | import javafx.scene.layout.BorderPane; 25 | import javafx.scene.layout.StackPane; 26 | 27 | /** 28 | * 29 | * @author adrian 30 | */ 31 | public class EditAreaView extends EditView { 32 | 33 | @Override 34 | public Node constructContent() { 35 | 36 | StackPane stackpaneroot = new StackPane(); 37 | stackpaneroot.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); 38 | 39 | BorderPane borderpane = new BorderPane(); 40 | 41 | statusview = new TextArea(); 42 | statusview.setEditable(false); 43 | statusview.setFocusTraversable(false); 44 | statusview.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); 45 | statusview.setPrefHeight(100.0); 46 | statusview.getStyleClass().add("unitinputview"); 47 | BorderPane.setAlignment(statusview, Pos.CENTER); 48 | 49 | borderpane.setCenter(statusview); 50 | 51 | stackpaneroot.getChildren().add(borderpane); 52 | 53 | initialize(); 54 | return stackpaneroot; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/LabelSection.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import com.adr.helloiotlib.unit.Unit; 22 | import com.adr.helloiotlib.app.IoTApp; 23 | import java.util.ResourceBundle; 24 | import javafx.scene.Node; 25 | import javafx.scene.control.Label; 26 | import javafx.scene.layout.HBox; 27 | import javafx.scene.layout.Priority; 28 | 29 | /** 30 | * 31 | * @author adrian 32 | */ 33 | public class LabelSection extends Label implements Unit { 34 | 35 | protected boolean confirm = false; 36 | protected ResourceBundle resources = ResourceBundle.getBundle("com/adr/helloiot/fxml/basic"); 37 | 38 | public LabelSection() { 39 | 40 | this.getStyleClass().add("labelsection"); 41 | HBox.setHgrow(this, Priority.SOMETIMES); 42 | setMaxSize(Integer.MAX_VALUE, Integer.MAX_VALUE); 43 | setFocusTraversable(false); 44 | } 45 | 46 | @Override 47 | public void construct(IoTApp app) { 48 | } 49 | 50 | @Override 51 | public void destroy() { 52 | } 53 | 54 | @Override 55 | public Node getNode() { 56 | return this; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/MessageCell.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import com.adr.helloiotlib.app.EventMessage; 22 | import javafx.geometry.Insets; 23 | import javafx.scene.control.ListCell; 24 | 25 | /** 26 | * 27 | * @author adrian 28 | */ 29 | public class MessageCell extends ListCell { 30 | 31 | @Override 32 | public void updateItem(EventMessage item, boolean empty) { 33 | super.updateItem(item, empty); 34 | setPrefWidth(10.0); 35 | setPadding(Insets.EMPTY); 36 | if (item == null) { 37 | setGraphic(null); 38 | setText(null); 39 | } else { 40 | setGraphic(new MessageItem(item)); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/ReceiverBase.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import com.adr.helloiotlib.unit.Unit; 22 | import com.adr.helloiotlib.app.IoTApp; 23 | import com.adr.helloiot.device.DeviceSubscribe; 24 | import javafx.scene.Node; 25 | 26 | /** 27 | * 28 | * @author adrian 29 | */ 30 | public abstract class ReceiverBase implements Unit { 31 | 32 | private DeviceSubscribe device = null; 33 | protected IoTApp app; 34 | 35 | // The Subscribe is the abstract method 36 | // @Subscribe 37 | // public void receivedStatus(EventStatus message) { 38 | // } 39 | 40 | @Override 41 | public void construct(IoTApp app) { 42 | this.app = app; 43 | device.subscribeStatus(this); 44 | } 45 | 46 | @Override 47 | public void destroy() { 48 | device.unsubscribeStatus(this); 49 | } 50 | 51 | public void setDevice(DeviceSubscribe device) { 52 | this.device = device; 53 | } 54 | 55 | public DeviceSubscribe getDevice() { 56 | return device; 57 | } 58 | 59 | @Override 60 | public Node getNode() { 61 | return null; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/StartFlow.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import com.adr.helloiotlib.unit.Unit; 22 | import com.adr.helloiotlib.app.IoTApp; 23 | import javafx.scene.Node; 24 | import javafx.scene.layout.Region; 25 | 26 | /** 27 | * 28 | * @author adrian 29 | */ 30 | @Deprecated 31 | public class StartFlow extends Region implements Unit { 32 | 33 | public StartFlow() { 34 | UnitPage.setLayout(this, "StartFlow"); 35 | } 36 | 37 | @Override 38 | public Node getNode() { 39 | return this; 40 | } 41 | 42 | @Override 43 | public void construct(IoTApp app) { 44 | } 45 | 46 | @Override 47 | public void destroy() { 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/StartLine.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import com.adr.helloiotlib.unit.Unit; 22 | import com.adr.helloiotlib.app.IoTApp; 23 | import javafx.scene.Node; 24 | import javafx.scene.layout.Region; 25 | 26 | /** 27 | * 28 | * @author adrian 29 | */ 30 | @Deprecated 31 | public class StartLine extends Region implements Unit { 32 | 33 | public StartLine() { 34 | UnitPage.setLayout(this, "StartLine"); 35 | } 36 | 37 | @Override 38 | public Node getNode() { 39 | return this; 40 | } 41 | 42 | @Override 43 | public void construct(IoTApp app) { 44 | } 45 | 46 | @Override 47 | public void destroy() { 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/unit/UnitsContainer.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.unit; 20 | 21 | import javafx.scene.Node; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public interface UnitsContainer { 28 | Node getNode(); 29 | void showNode(); 30 | void addLayout(String layout); 31 | void addChildren(Node n); 32 | default boolean isEmpty() { 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/util/ExternalFonts.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.util; 20 | 21 | import javafx.scene.text.Font; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public class ExternalFonts { 28 | 29 | public static final String SOURCESANSPRO_BLACK; 30 | public static final String SOURCESANSPRO_BOLD; 31 | public static final String SOURCESANSPRO_REGULAR; 32 | 33 | static { 34 | try { 35 | SOURCESANSPRO_BLACK = Font.loadFont(ExternalFonts.class.getResourceAsStream("/com/adr/helloiot/styles/SourceSansPro-Black.ttf"), 10.0).getName(); 36 | SOURCESANSPRO_BOLD = Font.loadFont(ExternalFonts.class.getResourceAsStream("/com/adr/helloiot/styles/SourceSansPro-Bold.ttf"), 10.0).getName(); 37 | SOURCESANSPRO_REGULAR = Font.loadFont(ExternalFonts.class.getResourceAsStream("/com/adr/helloiot/styles/SourceSansPro-Regular.ttf"), 10.0).getName(); 38 | } catch (Exception e) { 39 | throw new RuntimeException(e); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/util/FXMLNames.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.util; 20 | 21 | import com.adr.hellocommon.utils.FXMLUtil; 22 | import com.adr.helloiot.HelloPlatform; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public class FXMLNames { 29 | public static final T load(Object controller, String resource) { 30 | return FXMLUtil.load(controller, "/" + resource + (HelloPlatform.getInstance().isPhone() ? "_mobile.fxml" : ".fxml"), resource); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiot/weather/BridgeTime.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiot.weather; 20 | 21 | import com.adr.helloiot.Bridge; 22 | import com.adr.helloiot.ConnectUI; 23 | import com.adr.helloiot.ManagerProtocol; 24 | import com.adr.helloiot.SubProperties; 25 | import com.adr.helloiot.properties.VarProperties; 26 | 27 | public class BridgeTime implements Bridge { 28 | 29 | @Override 30 | public ConnectUI createConnectUI() { 31 | return null; 32 | } 33 | 34 | @Override 35 | public boolean hasManager(VarProperties properties) { 36 | return true; 37 | } 38 | 39 | @Override 40 | public ManagerProtocol createManager(VarProperties properties) { 41 | return new ManagerTime(properties); 42 | } 43 | 44 | @Override 45 | public void readConfiguration(VarProperties config, SubProperties configprops) { 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiotlib/app/IoTApp.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiotlib.app; 20 | 21 | import com.adr.helloiotlib.device.Device; 22 | import com.adr.helloiotlib.device.ListDevice; 23 | 24 | public interface IoTApp { 25 | public final static String SYS_VALUE_ID = "SYSVALUESID"; 26 | public final static String SYS_TIME_ID = "SYSTIMEID"; 27 | 28 | public final static String SYS_UNITPAGE_ID = "SYSUNITPAGEID"; 29 | public final static String SYS_BEEPER_ID = "SYSBEEPERID"; 30 | public final static String SYS_BUZZER_ID = "SYSBUZZERID"; 31 | 32 | public ListDevice getAllDevices(); 33 | public Device getDevice(String id); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiotlib/app/TopicManager.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiotlib.app; 20 | 21 | import com.adr.helloiotlib.format.MiniVar; 22 | import java.util.Map; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public interface TopicManager { 29 | public void publish(EventMessage message); 30 | public TopicSubscription subscribe(String topic, Map properties); 31 | public void unsubscribe(TopicSubscription s); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiotlib/app/TopicSubscription.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | 19 | package com.adr.helloiotlib.app; 20 | 21 | import java.util.function.Consumer; 22 | 23 | /** 24 | * 25 | * @author adrian 26 | */ 27 | public class TopicSubscription { 28 | 29 | private final String topic; 30 | private Consumer consumer = null; 31 | 32 | public TopicSubscription(String topic) { 33 | this.topic = topic; 34 | } 35 | 36 | public String getTopic() { 37 | return topic; 38 | } 39 | 40 | public void consume(EventMessage message) { 41 | if (consumer != null) { 42 | consumer.accept(message); 43 | } 44 | } 45 | 46 | public void setConsumer(Consumer consumer) { 47 | this.consumer = consumer; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiotlib/device/DevicePredicate.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiotlib.device; 20 | 21 | @FunctionalInterface 22 | public interface DevicePredicate { 23 | public boolean test(T t); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiotlib/device/DeviceProvider.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiotlib.device; 20 | 21 | @FunctionalInterface 22 | public interface DeviceProvider { 23 | public void accept(T t); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiotlib/format/MiniVar.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2019 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiotlib.format; 20 | 21 | /** 22 | * 23 | * @author adrian 24 | */ 25 | public interface MiniVar { 26 | public boolean isEmpty(); 27 | public String asString(); 28 | public int asInt(); 29 | public long asLong(); 30 | public double asDouble(); 31 | public boolean asBoolean(); 32 | public byte[] asBytes(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/adr/helloiotlib/unit/Unit.java: -------------------------------------------------------------------------------- 1 | // HelloIoT is a dashboard creator for MQTT 2 | // Copyright (C) 2017-2018 Adrián Romero Corchado. 3 | // 4 | // This file is part of HelloIot. 5 | // 6 | // HelloIot is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // HelloIot is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with HelloIot. If not, see . 18 | // 19 | package com.adr.helloiotlib.unit; 20 | 21 | import com.adr.helloiotlib.app.IoTApp; 22 | import javafx.scene.Node; 23 | 24 | /** 25 | * 26 | * @author adrian 27 | */ 28 | public interface Unit { 29 | 30 | public void construct(IoTApp app); 31 | public void destroy(); 32 | public Node getNode(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/com.adr.helloiot.ApplicationDevicesUnits: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianromero/helloiot/6f801363a0e8349d984b11c7b9d28c432fdadb9e/src/main/resources/META-INF/services/com.adr.helloiot.ApplicationDevicesUnits -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/com.adr.helloiot.ApplicationUnitPages: -------------------------------------------------------------------------------- 1 | com.adr.helloiot.ApplicationUnitPagesBasic -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/basic.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | 20 | message.confirm=Do you want to execute this action? 21 | message.erroraction=There has been an error running this action. 22 | message.nocode=There is no action to execute. 23 | message.nomessage=There is no message to publish. 24 | message.wrongpassword=The password is wrong, please try again. 25 | label.newpassword=Enter the new password 26 | label.repeatpassword=Repeat the password 27 | message.passworchangesuccess=The password has been changed successfully. 28 | message.passworchangeerror=Passwords must be the same, please try again. 29 | label.sendevent=Send event 30 | label.sendstatus=Send status 31 | message.valueerror=The value entered is not valid. -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/basic_es.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | message.confirm=\u00bfQuiere ejecutar esta acci\u00f3n? 20 | message.erroraction=Ha sucedido un error al ejecutar esta acci\u00f3n. 21 | message.nocode=No hay acci\u00f3n que ejecutar. 22 | message.nomessage=No hay mensaje que publicar. 23 | message.wrongpassword=La clave es err\u00f3nea, por favor vuelva a intentarlo. 24 | label.newpassword=Escriba la nueva clave 25 | label.repeatpassword=Repita la clave 26 | message.passworchangesuccess=La clave se ha cambiado correctamente. 27 | message.passworchangeerror=Las claves deben ser iguales, por favor vuelva a intentarlo. 28 | label.sendevent=Enviar evento 29 | label.sendstatus=Enviar estado 30 | message.valueerror=El valor introducido no es v\u00e1lido. -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/clientlogin.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017-2019 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | label.clientlogin = Client configuration 20 | 21 | tab.connection = Connections 22 | 23 | button.connect = Connect 24 | label.properties = Properties 25 | 26 | label.no=No 27 | label.yes=Yes 28 | 29 | tab.devicesunits = Units 30 | label.empty = Empty 31 | 32 | tab.configuration = Configuration 33 | label.style = Style 34 | 35 | label.topicinfo.Edit = Edit 36 | label.topicinfo.View = View 37 | label.topicinfo.Send = Send 38 | label.topicinfo.Switch = Switch 39 | label.topicinfo.Code = Code 40 | label.topicinfo.MessagesSubscribe = Subscribe 41 | label.topicinfo.MessagesPublish = Publish 42 | label.topicinfo.Gauge = Gauge 43 | 44 | title.new = New 45 | title.gallery = Gallery 46 | title.templates = Templates 47 | exception.cannotloadtemplateslist = Cannot load templates list 48 | exception.cannotloadunit = Cannot load new unit 49 | 50 | button.tradfri = Tradfri 51 | title.tradfridiscovery = Tradfri discovery 52 | message.notradfriconnection = Cannot connect to tradfri gateway. Configure connection. 53 | 54 | style.PRETTY = Pretty 55 | style.LIGHT = Light 56 | style.DARK = Dark 57 | style.CLASSIC = Classic -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/clientlogin_es.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017-2019 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | label.clientlogin = Configuraci\u00f3n de cliente 20 | 21 | tab.connection = Conexiones 22 | 23 | button.connect = Conectar 24 | label.properties = Propiedades 25 | 26 | label.no=No 27 | label.yes=S\u00ed 28 | 29 | tab.devicesunits = Unidades 30 | label.empty = Vac\u00edo 31 | 32 | tab.configuration = Configuraci\u00f3n 33 | label.style = Estilo 34 | 35 | label.topicinfo.Edit = Editor 36 | label.topicinfo.View = Visor 37 | label.topicinfo.Send = Env\u00edar 38 | label.topicinfo.Switch = Interruptor 39 | label.topicinfo.Code = C\u00f3digo 40 | label.topicinfo.MessagesSubscribe = Subscribir 41 | label.topicinfo.MessagesPublish = Publicar 42 | label.topicinfo.Gauge = Indicador 43 | 44 | title.new = Nuevo 45 | title.gallery = Galer\u00eda 46 | title.templates = Plantillas 47 | exception.cannotloadtemplateslist = No se ha podido cargar la lista de plantillas 48 | exception.cannotloadunit = No se ha podido cargar la nueva unidad 49 | 50 | button.tradfri = Tradfri 51 | title.tradfridiscovery = Descubriendo Tradfri 52 | message.notradfriconnection = No se ha podido conectar a la pasarela Tradfri. Configure la conexi\u00f3n. 53 | 54 | style.PRETTY = Lindo 55 | style.LIGHT = Luminoso 56 | style.DARK = Oscuro 57 | style.CLASSIC = Cl\u00e1sico -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/connectmqtt.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017-2018 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | 20 | label.mqttbroker = MQTT broker 21 | label.host = Host 22 | label.port = Port 23 | label.ssl = SSL 24 | label.websockets = WebSockets 25 | label.protocol = Protocol 26 | label.keystore = Key store 27 | label.keystorepassword = Password 28 | label.truststore = Trust store 29 | label.truststorepassword = Password 30 | label.credentials = Credentials 31 | label.username = User name 32 | label.password = Password 33 | label.clientid = Client ID 34 | label.version = Version 35 | label.default = Default 36 | label.extendedproperties = Extended properties 37 | label.timeout = Connection timeout 38 | label.keepalive = Keep alive interval 39 | label.maxinflight = Max inflight 40 | label.brokerpane = Broker pane 41 | label.brokernone = None 42 | label.brokermosquitto = Mosquitto 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/connectmqtt_es.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017-2018 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | 20 | label.mqttbroker = Agente MQTT 21 | label.host = Servidor 22 | label.port = Puerto 23 | label.ssl = SSL 24 | label.websockets = WebSockets 25 | label.protocol = Protocolo 26 | label.keystore = Almac\u00e9n de claves 27 | label.keystorepassword = Clave 28 | label.truststore = Almac\u00e9n de confianza 29 | label.truststorepassword = Clave 30 | label.credentials = Credenciales 31 | label.username = Usuario 32 | label.password = Clave 33 | label.clientid = ID de cliente 34 | label.version = Versi\u00f3n 35 | label.default = Defecto 36 | label.extendedproperties = Otras propiedades 37 | label.timeout = Tiempo de espera 38 | label.keepalive = Intervalo de espera 39 | label.maxinflight = M\u00e1x. en el aire 40 | label.brokerpane = Panel de agente 41 | label.brokernone = Ninguno 42 | label.brokermosquitto = Mosquitto -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/connecttradfri.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017-2018 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | 20 | label.tradfrigateway = Tradfri gateway 21 | label.host = Host 22 | label.identity = Identity 23 | 24 | button.find = Find 25 | button.generate = Generate 26 | 27 | message.cannotfindtradfri = Cannot find the Tradfri gateway 28 | message.cannotgenerateidentity = Cannot generate a new identity -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/connecttradfri_es.properties: -------------------------------------------------------------------------------- 1 | # HelloIoT is a dashboard creator for MQTT 2 | # Copyright (C) 2017-2018 Adri\u00e1n Romero Corchado. 3 | # 4 | # This file is part of HelloIot. 5 | # 6 | # HelloIot is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # HelloIot is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with HelloIot. If not, see . 18 | # 19 | 20 | label.tradfrigateway = Pasarela Tradfri 21 | label.host = Servidor 22 | label.identity = Identidad 23 | 24 | button.find = Buscar 25 | button.generate = Generar 26 | 27 | message.cannotfindtradfri = No se ha podido encontrar la pasarela Tradfri 28 | message.cannotgenerateidentity = No se ha podido generar una nueva identidad -------------------------------------------------------------------------------- /src/main/resources/com/adr/helloiot/fxml/connecttradfri_mobile.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |