mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-09-11 11:45:27 +02:00
added favicon and finished the audit of the manual
This commit is contained in:
@@ -1,14 +1,66 @@
|
||||
package kst4contest.view;
|
||||
|
||||
import kst4contest.controller.ChatController;
|
||||
import kst4contest.model.ChatMember;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
public class GuiUtils {
|
||||
|
||||
private static final String APPLICATION_ICON_RESOURCE = "/icons/kst4contest.png";
|
||||
|
||||
private static Image applicationIcon;
|
||||
|
||||
/**
|
||||
* Applies the common KST4Contest application icon to a JavaFX stage.
|
||||
*
|
||||
* <p>The icon is loaded only once and reused for all application windows.
|
||||
* A missing icon resource must never prevent a window from opening.</p>
|
||||
*
|
||||
* @param stage stage that should receive the application icon
|
||||
*/
|
||||
public static void applyApplicationIcon(Stage stage) {
|
||||
|
||||
if (stage == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Image icon = getApplicationIcon();
|
||||
|
||||
if (icon != null && !stage.getIcons().contains(icon)) {
|
||||
stage.getIcons().add(icon);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads and caches the common KST4Contest application icon.
|
||||
*
|
||||
* @return application icon or null if the resource is unavailable
|
||||
*/
|
||||
private static Image getApplicationIcon() {
|
||||
|
||||
if (applicationIcon != null) {
|
||||
return applicationIcon;
|
||||
}
|
||||
|
||||
URL iconUrl = GuiUtils.class.getResource(APPLICATION_ICON_RESOURCE);
|
||||
|
||||
if (iconUrl == null) {
|
||||
System.err.println(
|
||||
"Application icon resource not found: "
|
||||
+ APPLICATION_ICON_RESOURCE
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
applicationIcon = new Image(iconUrl.toExternalForm());
|
||||
return applicationIcon;
|
||||
}
|
||||
|
||||
private static final String PTRN_CALLSIGNSYNTAX = "^(?:[A-Z]{1,2}[0-9]|[0-9][A-Z])[0-9A-Z]{1,3}$";
|
||||
/**
|
||||
* Checks wheter the input value of the String is numeric or not, true if yes
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kst4contest.view;
|
||||
import kst4contest.utils.VersionUtils;
|
||||
|
||||
import javafx.scene.image.Image;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
@@ -4439,6 +4440,8 @@ public class Kst4ContestApplication extends Application implements StatusUpdateL
|
||||
TextField txt_chatMessageUserInput
|
||||
) {
|
||||
Stage stage = new Stage();
|
||||
GuiUtils.applyApplicationIcon(stage);
|
||||
|
||||
stage.setTitle("Top priority candidates");
|
||||
|
||||
ListView<kst4contest.controller.ScoreService.TopCandidate> listView = new ListView<>();
|
||||
@@ -6376,7 +6379,7 @@ public class Kst4ContestApplication extends Application implements StatusUpdateL
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws InterruptedException, IOException, URISyntaxException {
|
||||
|
||||
|
||||
GuiUtils.applyApplicationIcon(primaryStage);
|
||||
|
||||
VBox pnl_inputAndSendButtons = new VBox(); //gets the sendtext field, send button and the timeline
|
||||
timelineView = new TimelineView();
|
||||
@@ -8505,6 +8508,8 @@ public class Kst4ContestApplication extends Application implements StatusUpdateL
|
||||
* Window Cluster & qso of the other
|
||||
*/
|
||||
clusterAndQSOMonStage = new Stage();
|
||||
GuiUtils.applyApplicationIcon(clusterAndQSOMonStage);
|
||||
|
||||
// clusterAndQSOMonStage.initStyle(StageStyle.UTILITY);
|
||||
clusterAndQSOMonStage.setTitle("Cluster & QSO of the other");
|
||||
SplitPane pnl_directedMSGWin = new SplitPane();
|
||||
@@ -8558,6 +8563,7 @@ public class Kst4ContestApplication extends Application implements StatusUpdateL
|
||||
* Window updates
|
||||
*/
|
||||
stage_updateStage = new Stage();
|
||||
GuiUtils.applyApplicationIcon(stage_updateStage);
|
||||
|
||||
stage_updateStage.setTitle("Update information");
|
||||
|
||||
@@ -8695,6 +8701,8 @@ public class Kst4ContestApplication extends Application implements StatusUpdateL
|
||||
*
|
||||
****************************************************************************/
|
||||
settingsStage = new Stage();
|
||||
GuiUtils.applyApplicationIcon(settingsStage);
|
||||
|
||||
settingsStage.setTitle("Change Client Settings");
|
||||
|
||||
BorderPane optionsPanel = new BorderPane();
|
||||
|
||||
@@ -13,6 +13,7 @@ import javafx.scene.layout.VBox;
|
||||
import javafx.scene.web.WebEngine;
|
||||
import javafx.scene.web.WebView;
|
||||
import javafx.stage.Stage;
|
||||
import kst4contest.view.GuiUtils;
|
||||
import netscape.javascript.JSObject;
|
||||
import kst4contest.ApplicationConstants;
|
||||
import kst4contest.locatorUtils.Location;
|
||||
@@ -179,6 +180,8 @@ public final class StationMapView {
|
||||
|
||||
public StationMapView(ChatPreferences chatPreferences) {
|
||||
this.chatPreferences = Objects.requireNonNull(chatPreferences, "chatPreferences");
|
||||
GuiUtils.applyApplicationIcon(stage);
|
||||
|
||||
try {
|
||||
tileProxyServer = new TileProxyServer();
|
||||
} catch (IOException e) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Reference in New Issue
Block a user