Compare commits
2 Commits
3658252e80
...
3a1a6223bf
Author | SHA1 | Date | |
---|---|---|---|
3a1a6223bf | |||
ab48e726af |
5
pom.xml
5
pom.xml
@ -57,6 +57,11 @@
|
|||||||
<artifactId>javafx-controls</artifactId>
|
<artifactId>javafx-controls</artifactId>
|
||||||
<version>${javafx.version}</version>
|
<version>${javafx.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openjfx</groupId>
|
||||||
|
<artifactId>javafx-web</artifactId>
|
||||||
|
<version>${javafx.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openjfx</groupId>
|
<groupId>org.openjfx</groupId>
|
||||||
<artifactId>javafx-fxml</artifactId>
|
<artifactId>javafx-fxml</artifactId>
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package name.nathanmcrae.numbersstation;
|
||||||
|
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.web.WebView;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class HelpController {
|
||||||
|
private static final Logger logger = Logger.getLogger(Main.class.getName());
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
WebView webView;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void initialize() throws Exception {
|
||||||
|
logger.info("20250407T222451");
|
||||||
|
String url = HelpController.class.getResource("/help-index.html").toExternalForm();
|
||||||
|
webView.getEngine().load(url);
|
||||||
|
logger.info("20250407T222456");
|
||||||
|
}
|
||||||
|
}
|
@ -40,6 +40,7 @@ import javafx.stage.Stage;
|
|||||||
public class MainController implements Initializable {
|
public class MainController implements Initializable {
|
||||||
private static final Logger logger = Logger.getLogger(Main.class.getName());
|
private static final Logger logger = Logger.getLogger(Main.class.getName());
|
||||||
|
|
||||||
|
private Stage helpStage;
|
||||||
private Stage settingsStage;
|
private Stage settingsStage;
|
||||||
private Stage selectStationStage;
|
private Stage selectStationStage;
|
||||||
private MainSettings settings;
|
private MainSettings settings;
|
||||||
@ -373,4 +374,25 @@ public class MainController implements Initializable {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void handleHelpButtonPress() {
|
||||||
|
try {
|
||||||
|
if (helpStage == null) {
|
||||||
|
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/HelpView.fxml"));
|
||||||
|
Parent root = fxmlLoader.load();
|
||||||
|
helpStage = new Stage();
|
||||||
|
helpStage.setTitle("Numbers Station Help");
|
||||||
|
helpStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
|
||||||
|
helpStage.setScene(new Scene(root));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (helpStage.isShowing()) {
|
||||||
|
helpStage.toFront();
|
||||||
|
} else {
|
||||||
|
helpStage.show();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while opening help", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
6
src/main/resources/HelpView.fxml
Normal file
6
src/main/resources/HelpView.fxml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.web.WebView?>
|
||||||
|
|
||||||
|
|
||||||
|
<WebView fx:id="webView" prefHeight="391.0" prefWidth="440.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="name.nathanmcrae.numbersstation.HelpController" />
|
@ -63,11 +63,11 @@
|
|||||||
<children>
|
<children>
|
||||||
<AnchorPane>
|
<AnchorPane>
|
||||||
<children>
|
<children>
|
||||||
<Button layoutX="209.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleSelectStationButtonPress" text="Select Station" />
|
<Button layoutX="228.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleSelectStationButtonPress" text="Select Station" />
|
||||||
<Label layoutY="5.0" prefHeight="17.0" prefWidth="49.0" text="Station: " />
|
<Label layoutY="5.0" prefHeight="17.0" prefWidth="60.0" text="Station: " />
|
||||||
<TextField fx:id="stationNameField" editable="false" layoutX="49.0" prefHeight="25.0" prefWidth="153.0" style="-fx-background-color: #EEEEEE; -fx-border-color: #AAAAAA;" text="My Station" />
|
<TextField fx:id="stationNameField" editable="false" layoutX="68.0" prefHeight="25.0" prefWidth="153.0" style="-fx-background-color: #EEEEEE; -fx-border-color: #AAAAAA;" text="My Station" />
|
||||||
<Button layoutX="602.0" layoutY="1.0" mnemonicParsing="false" text="Help" AnchorPane.rightAnchor="0.0" />
|
<Button layoutX="602.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleHelpButtonPress" text="Help" AnchorPane.rightAnchor="0.0" />
|
||||||
<Button layoutX="532.0" layoutY="1.0" mnemonicParsing="false" text="Settings" AnchorPane.rightAnchor="49.0" />
|
<Button layoutX="516.0" layoutY="1.0" mnemonicParsing="false" text="Settings" AnchorPane.rightAnchor="52.0" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
<AnchorPane prefHeight="50.0" prefWidth="640.0" GridPane.rowIndex="1">
|
<AnchorPane prefHeight="50.0" prefWidth="640.0" GridPane.rowIndex="1">
|
||||||
@ -77,7 +77,7 @@
|
|||||||
<Font size="14.0" />
|
<Font size="14.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<Label fx:id="lastRetrievedLabel" layoutX="183.0" layoutY="14.0" text="2024-12-25T12:59:47" AnchorPane.leftAnchor="183.0" AnchorPane.topAnchor="14.0">
|
<Label fx:id="lastRetrievedLabel" layoutX="201.0" layoutY="15.0" text="2024-12-25T12:59:47" AnchorPane.leftAnchor="201.0" AnchorPane.topAnchor="15.0">
|
||||||
<font>
|
<font>
|
||||||
<Font size="14.0" />
|
<Font size="14.0" />
|
||||||
</font>
|
</font>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<Button layoutX="358.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleAddButtonPress" prefHeight="25.0" prefWidth="26.0" text="+" AnchorPane.rightAnchor="55.0" AnchorPane.topAnchor="17.0" />
|
<Button layoutX="358.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleAddButtonPress" prefHeight="25.0" prefWidth="26.0" text="+" AnchorPane.rightAnchor="55.0" AnchorPane.topAnchor="17.0" />
|
||||||
<Button layoutX="391.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleRemoveButtonPress" prefHeight="25.0" prefWidth="25.0" text="-" AnchorPane.rightAnchor="21.0" AnchorPane.topAnchor="17.0" />
|
<Button layoutX="391.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleRemoveButtonPress" prefHeight="25.0" prefWidth="25.0" text="-" AnchorPane.rightAnchor="21.0" AnchorPane.topAnchor="17.0" />
|
||||||
<ListView fx:id="stationListView" layoutX="14.0" layoutY="57.0" prefHeight="301.0" prefWidth="409.0" AnchorPane.bottomAnchor="42.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="57.0" />
|
<ListView fx:id="stationListView" layoutX="14.0" layoutY="57.0" prefHeight="301.0" prefWidth="409.0" AnchorPane.bottomAnchor="42.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="57.0" />
|
||||||
<Button layoutX="313.0" layoutY="365.0" mnemonicParsing="false" onAction="#handleSelectButtonPress" text="Select" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="76.5" />
|
<Button layoutX="293.0" layoutY="366.0" mnemonicParsing="false" onAction="#handleSelectButtonPress" text="Select" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="85.0" />
|
||||||
<Button layoutX="370.0" layoutY="365.0" mnemonicParsing="false" onAction="#handleCancelButtonPress" text="Cancel" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="15.5" />
|
<Button layoutX="370.0" layoutY="365.0" mnemonicParsing="false" onAction="#handleCancelButtonPress" text="Cancel" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="15.5" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<FlowPane alignment="CENTER_LEFT" prefHeight="41.0" prefWidth="640.0">
|
<FlowPane alignment="CENTER_LEFT" prefHeight="41.0" prefWidth="640.0">
|
||||||
<children>
|
<children>
|
||||||
<Label prefHeight="17.0" prefWidth="49.0" text="Station: " />
|
<Label prefHeight="17.0" prefWidth="58.0" text="Station: " />
|
||||||
<TextField fx:id="stationNameField" style="-fx-border-color: #AAAAAA;" text="My Station">
|
<TextField fx:id="stationNameField" style="-fx-border-color: #AAAAAA;" text="My Station">
|
||||||
<FlowPane.margin>
|
<FlowPane.margin>
|
||||||
<Insets right="10.0" />
|
<Insets right="10.0" />
|
||||||
@ -40,9 +40,9 @@
|
|||||||
<Separator prefWidth="200.0" />
|
<Separator prefWidth="200.0" />
|
||||||
<AnchorPane prefHeight="77.0" prefWidth="578.0">
|
<AnchorPane prefHeight="77.0" prefWidth="578.0">
|
||||||
<children>
|
<children>
|
||||||
<FlowPane alignment="CENTER_LEFT" layoutX="8.0" layoutY="7.0" prefHeight="63.0" prefWidth="216.0">
|
<FlowPane alignment="CENTER_LEFT" layoutX="8.0" layoutY="7.0" prefHeight="63.0" prefWidth="229.0">
|
||||||
<children>
|
<children>
|
||||||
<Label prefHeight="38.0" prefWidth="103.0" text="Digit group size: (only for display)" textAlignment="RIGHT" textOverrun="CLIP" wrapText="true">
|
<Label prefHeight="38.0" prefWidth="116.0" text="Digit group size: (only for display)" textAlignment="RIGHT" textOverrun="CLIP" wrapText="true">
|
||||||
<FlowPane.margin>
|
<FlowPane.margin>
|
||||||
<Insets right="10.0" />
|
<Insets right="10.0" />
|
||||||
</FlowPane.margin>
|
</FlowPane.margin>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
<Spinner fx:id="digitsPerGroupSpinner" editable="true" prefHeight="25.0" prefWidth="96.0" />
|
<Spinner fx:id="digitsPerGroupSpinner" editable="true" prefHeight="25.0" prefWidth="96.0" />
|
||||||
</children>
|
</children>
|
||||||
</FlowPane>
|
</FlowPane>
|
||||||
<FlowPane alignment="CENTER_LEFT" layoutX="233.0" layoutY="7.0" prefHeight="63.0" prefWidth="216.0">
|
<FlowPane alignment="CENTER_LEFT" layoutX="244.0" layoutY="7.0" prefHeight="63.0" prefWidth="216.0">
|
||||||
<children>
|
<children>
|
||||||
<Label prefHeight="38.0" prefWidth="109.0" text="Message length:" textAlignment="RIGHT" textOverrun="CLIP">
|
<Label prefHeight="38.0" prefWidth="109.0" text="Message length:" textAlignment="RIGHT" textOverrun="CLIP">
|
||||||
<FlowPane.margin>
|
<FlowPane.margin>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
<TextField fx:id="usernameField" layoutX="245.0" layoutY="95.0" prefHeight="25.0" prefWidth="124.0" AnchorPane.rightAnchor="209.0" />
|
<TextField fx:id="usernameField" layoutX="245.0" layoutY="95.0" prefHeight="25.0" prefWidth="124.0" AnchorPane.rightAnchor="209.0" />
|
||||||
<PasswordField fx:id="passwordField" layoutX="444.0" layoutY="95.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="0.0" />
|
<PasswordField fx:id="passwordField" layoutX="444.0" layoutY="95.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="0.0" />
|
||||||
<TextField fx:id="externalProgramCommandField" layoutX="-2.0" layoutY="131.0" prefHeight="25.0" prefWidth="580.0" AnchorPane.leftAnchor="-2.0" AnchorPane.rightAnchor="0.0" />
|
<TextField fx:id="externalProgramCommandField" layoutX="-2.0" layoutY="131.0" prefHeight="25.0" prefWidth="580.0" AnchorPane.leftAnchor="-2.0" AnchorPane.rightAnchor="0.0" />
|
||||||
<Button fx:id="testConnectionButton" layoutX="464.0" layoutY="7.0" mnemonicParsing="false" onAction="#handleTestConnectionButtonPress" text="Test connection" />
|
<Button fx:id="testConnectionButton" layoutX="464.0" layoutY="7.0" mnemonicParsing="false" onAction="#handleTestConnectionButtonPress" text="Test connection" AnchorPane.rightAnchor="0.0" />
|
||||||
<Label fx:id="connectionTestStatusLabel" alignment="CENTER_RIGHT" layoutX="136.0" layoutY="11.0" prefHeight="17.0" prefWidth="317.0" textAlignment="RIGHT" AnchorPane.leftAnchor="136.0" AnchorPane.rightAnchor="125.0" />
|
<Label fx:id="connectionTestStatusLabel" alignment="CENTER_RIGHT" layoutX="136.0" layoutY="11.0" prefHeight="17.0" prefWidth="317.0" textAlignment="RIGHT" AnchorPane.leftAnchor="136.0" AnchorPane.rightAnchor="125.0" />
|
||||||
|
|
||||||
</children>
|
</children>
|
||||||
|
25
src/main/resources/help-index.html
Normal file
25
src/main/resources/help-index.html
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Numbers Station Help</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The Numbers Station application is a tool to upload messages to a website/blog on a regular schedule. For why you would want this, see <a href="#motivation">Motivation</a>. To get started, see <a href="#quick-start">Quick Start</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<img src="overview.png"/>
|
||||||
|
|
||||||
|
<h2>Quick Start</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Do it!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Motivation</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Because it's fun
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
src/main/resources/overview.png
Normal file
BIN
src/main/resources/overview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
Loading…
x
Reference in New Issue
Block a user