Add basic help page

lsafej
This commit is contained in:
Nathan McRae 2025-04-08 21:12:33 -07:00
parent af555112b2
commit ab48e726af
7 changed files with 80 additions and 1 deletions

View File

@ -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>

View File

@ -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");
}
}

View File

@ -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);
}
}
} }

View 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" />

View File

@ -66,7 +66,7 @@
<Button layoutX="209.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleSelectStationButtonPress" text="Select Station" /> <Button layoutX="209.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="49.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="49.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="532.0" layoutY="1.0" mnemonicParsing="false" text="Settings" AnchorPane.rightAnchor="49.0" />
</children> </children>
</AnchorPane> </AnchorPane>

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB