From: Debayan Sutradhar Date: Sun, 06 Jun 2021 21:10:43 +0530 Subject: javadoc work --- javadoc work --- --- 'a/src/main/java/com/stream_pi/util/alert/StreamPiAlert.java' +++ b/src/main/java/com/stream_pi/util/alert/StreamPiAlert.java @@ -290,10 +290,11 @@ public class StreamPiAlert return contentPane; } + private Node popupNode; + /** - * Adds the Alert Box to the parent node + * Shows the alert */ - private Node popupNode; public void show() { Platform.runLater(()-> @@ -328,11 +329,19 @@ public class StreamPiAlert private static boolean isShowPopup = false; + /** + * Sets whether Alert will act as a popup when shown. + * In other words, the parent window (Server/Client) will act as a popup and appear on top + * of all windows, if this is set true + */ public static void setIsShowPopup(boolean isShowPopup) { StreamPiAlert.isShowPopup = isShowPopup; } + /** + * @return Returns if alert system acts as a popup or not + */ public static boolean isIsShowPopup() { return isShowPopup; --- 'a/src/main/java/com/stream_pi/util/alert/StreamPiAlertListener.java' +++ b/src/main/java/com/stream_pi/util/alert/StreamPiAlertListener.java @@ -19,7 +19,8 @@ package com.stream_pi.util.alert; /** * Alert Listener. Triggered when a button on StreamPiAlert is clicked. */ -public abstract class StreamPiAlertListener { +public abstract class StreamPiAlertListener +{ /** * @param buttonClicked Button choice which was clicked */ --- 'a/src/main/java/com/stream_pi/util/alert/StreamPiAlertType.java' +++ b/src/main/java/com/stream_pi/util/alert/StreamPiAlertType.java @@ -19,7 +19,8 @@ package com.stream_pi.util.alert; /** * Stream-Pi Alert Type Enumerator */ -public enum StreamPiAlertType { +public enum StreamPiAlertType +{ /** * Information Type Alert */ --- 'a/src/main/java/com/stream_pi/util/checkforupdates/CheckForUpdates.java' +++ b/src/main/java/com/stream_pi/util/checkforupdates/CheckForUpdates.java @@ -1,3 +1,19 @@ +/* +Stream-Pi - Free & Open-Source Modular Cross-Platform Programmable Macro Pad +Copyright (C) 2019-2021 Debayan Sutradhar (rnayabed), Samuel Quiñones (SamuelQuinones) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Originally Written by : Debayan Sutradhar (rnayabed) +*/ + package com.stream_pi.util.checkforupdates; import com.google.gson.JsonObject; @@ -17,6 +33,9 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; +/** + * Update checker class + */ public class CheckForUpdates extends Task { @@ -25,6 +44,13 @@ public class CheckForUpdates extends Tas private final Version currentVersion; private final UpdateHyperlinkOnClick updateHyperlinkOnClick; + /** + * Constructor to start Check For Updates + * @param checkForUpdatesButton "Check For Updates" UI Button + * @param platformType Platform Type + * @param currentVersion Current Version of the Server/Client Application + * @param updateHyperlinkOnClick Handler for aftermath of successful update check + */ public CheckForUpdates(Button checkForUpdatesButton, PlatformType platformType, Version currentVersion, UpdateHyperlinkOnClick updateHyperlinkOnClick) { --- 'a/src/main/java/com/stream_pi/util/checkforupdates/UpdateHyperlinkOnClick.java' +++ b/src/main/java/com/stream_pi/util/checkforupdates/UpdateHyperlinkOnClick.java @@ -1,16 +1,42 @@ +/* +Stream-Pi - Free & Open-Source Modular Cross-Platform Programmable Macro Pad +Copyright (C) 2019-2021 Debayan Sutradhar (rnayabed), Samuel Quiñones (SamuelQuinones) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Originally Written by : Debayan Sutradhar (rnayabed) +*/ + package com.stream_pi.util.checkforupdates; import javafx.event.ActionEvent; import javafx.event.EventHandler; +/** + * Handler for after update check succeeds + */ public abstract class UpdateHyperlinkOnClick implements EventHandler { private String URL; + + /** + * @param URL URL to download page for new release + */ public void setURL(String URL) { this.URL = URL; } + /** + * @return Returns URL to download page for new release + */ public String getURL() { return URL; --- 'a/src/main/java/com/stream_pi/util/combobox/StreamPiComboBox.java' +++ b/src/main/java/com/stream_pi/util/combobox/StreamPiComboBox.java @@ -16,7 +16,6 @@ Originally Written by : Debayan Sutradha package com.stream_pi.util.combobox; -import java.util.ArrayList; import java.util.List; import com.stream_pi.util.uihelper.SpaceFiller; @@ -47,7 +46,8 @@ public class StreamPiComboBox extends * Sets the parent where the Combo Box will be shown * @param parent StackPane where the Combo Box dialog will be shown */ - public static void setParent(StackPane parent) { + public static void setParent(StackPane parent) + { stackPaneParent = parent; stackPaneParent.getStyleClass().add("combo_box_pane_parent"); stackPaneParent.getChildren().addListener((ListChangeListener) c -> @@ -98,8 +98,6 @@ public class StreamPiComboBox extends */ private void setup() { - buttons = new ArrayList<>(); - getStyleClass().add("combo_box"); setOnMouseClicked(event -> show()); @@ -127,15 +125,12 @@ public class StreamPiComboBox extends } private int currentIndex = 0; - private List buttons; /** * @return Final Scroll Pane */ public ScrollPane getPopupScrollPane() { - buttons.clear(); - ScrollPane scrollPane = new ScrollPane(); scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); @@ -170,7 +165,6 @@ public class StreamPiComboBox extends destroy(); }); vBox.getChildren().addAll(optionButton); - buttons.add(optionButton); } return scrollPane; @@ -238,9 +232,7 @@ public class StreamPiComboBox extends */ public void destroy() { - Platform.runLater(()->{ - stackPaneParent.getChildren().remove(popupNode); - }); + Platform.runLater(()-> stackPaneParent.getChildren().remove(popupNode)); } private StreamPiComboBoxFactory streamPiComboBoxFactory; --- 'a/src/main/java/com/stream_pi/util/combobox/StreamPiComboBoxListener.java' +++ b/src/main/java/com/stream_pi/util/combobox/StreamPiComboBoxListener.java @@ -19,7 +19,8 @@ package com.stream_pi.util.combobox; /** * Combo Box Listener. Triggered when an option in Combo Box is clicked. */ -public abstract class StreamPiComboBoxListener { +public abstract class StreamPiComboBoxListener +{ /** * @param selectedItem Choice which was clicked */ --- 'a/src/main/java/com/stream_pi/util/comms/Message.java' +++ b/src/main/java/com/stream_pi/util/comms/Message.java @@ -1,7 +1,26 @@ +/* +Stream-Pi - Free & Open-Source Modular Cross-Platform Programmable Macro Pad +Copyright (C) 2019-2021 Debayan Sutradhar (rnayabed), Samuel Quiñones (SamuelQuinones) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Originally Written by : Debayan Sutradhar (rnayabed) +*/ + package com.stream_pi.util.comms; import java.io.Serializable; +/** + * Message class to be sent between Server and Client using sockets + */ public class Message implements Serializable { private static final long SerialVersionUID = 2004200019671976L; @@ -14,26 +33,42 @@ public class Message implements Serializ private double doubleValue; private double[] doubleArrValue; + /** + * Default Constructor for Message + * @param header Message Header Text + */ public Message(String header) { this.header = header; } + /** + * @param doubleArrValue Double Array + */ public void setDoubleArrValue(double... doubleArrValue) { this.doubleArrValue = doubleArrValue; } + /** + * @return Double Array + */ public double[] getDoubleArrValue() { return doubleArrValue; } + /** + * @param doubleValue Double argument + */ public void setDoubleValue(double doubleValue) { this.doubleValue = doubleValue; } + /** + * @return Double argument + */ public double getDoubleValue() { return doubleValue;