From 253ffb1ac7b375f17156648d9da46ef7f11a7532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0panger?= Date: Sat, 26 Aug 2023 14:50:36 +0200 Subject: [PATCH] some graphics details --- .../globalquake/database/SeedlinkCommunicator.java | 5 +++++ .../globalquake/database/StationDatabaseManager.java | 3 +++ .../globalquake/ui/globalquake/GlobalQuakePanel.java | 2 +- .../ui/globalquake/feature/FeatureEarthquake.java | 11 +++++++---- .../ui/settings/HypocenterAnalysisSettingsPanel.java | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/globalquake/database/SeedlinkCommunicator.java b/src/main/java/globalquake/database/SeedlinkCommunicator.java index d1833af9a..d946af81b 100644 --- a/src/main/java/globalquake/database/SeedlinkCommunicator.java +++ b/src/main/java/globalquake/database/SeedlinkCommunicator.java @@ -36,7 +36,12 @@ public static void runAvailabilityCheck(SeedlinkNetwork seedlinkNetwork, Station seedlinkNetwork.getStatus().setValue(66); parseAvailability(infoString, stationDatabase, seedlinkNetwork); + seedlinkNetwork.getStatus().setString("Finishing..."); + seedlinkNetwork.getStatus().setValue(80); reader.close(); + + seedlinkNetwork.getStatus().setString("Done"); + seedlinkNetwork.getStatus().setValue(99); } private static void parseAvailability(String infoString, StationDatabase stationDatabase, SeedlinkNetwork seedlinkNetwork) throws Exception { diff --git a/src/main/java/globalquake/database/StationDatabaseManager.java b/src/main/java/globalquake/database/StationDatabaseManager.java index ec353b54c..12a4e66ff 100644 --- a/src/main/java/globalquake/database/StationDatabaseManager.java +++ b/src/main/java/globalquake/database/StationDatabaseManager.java @@ -180,6 +180,7 @@ public void runAvailabilityCheck(List toBeUpdated, Runnable onF ExecutorService executor = Executors.newSingleThreadExecutor(); + System.err.println("HERE 2 !!!!"); Callable task = () -> { SeedlinkCommunicator.runAvailabilityCheck(seedlinkNetwork, stationDatabase); return null; @@ -188,6 +189,8 @@ public void runAvailabilityCheck(List toBeUpdated, Runnable onF Future future = executor.submit(task); future.get(SeedlinkCommunicator.SEEDLINK_TIMEOUT_SECONDS, TimeUnit.SECONDS); + System.err.println("HERE!!!!"); + seedlinkNetwork.getStatus().setString("Done"); seedlinkNetwork.getStatus().setValue(100); diff --git a/src/main/java/globalquake/ui/globalquake/GlobalQuakePanel.java b/src/main/java/globalquake/ui/globalquake/GlobalQuakePanel.java index 2d6c8a811..2e1268c62 100644 --- a/src/main/java/globalquake/ui/globalquake/GlobalQuakePanel.java +++ b/src/main/java/globalquake/ui/globalquake/GlobalQuakePanel.java @@ -266,7 +266,7 @@ private static void drawMags(Graphics2D g, Earthquake quake, int baseHeight) { String str = "Magnitude"; g.drawString(str, 10, startY - 5); - int ww = g.getFontMetrics().stringWidth(str) + 10; + int ww = g.getFontMetrics().stringWidth(str) - 12; g.drawRect(startX, startY, ww, hh); diff --git a/src/main/java/globalquake/ui/globalquake/feature/FeatureEarthquake.java b/src/main/java/globalquake/ui/globalquake/feature/FeatureEarthquake.java index 13dd95c40..7bb2d1356 100644 --- a/src/main/java/globalquake/ui/globalquake/feature/FeatureEarthquake.java +++ b/src/main/java/globalquake/ui/globalquake/feature/FeatureEarthquake.java @@ -135,16 +135,19 @@ public void render(GlobeRenderer renderer, Graphics2D graphics, RenderEntity label.setText("P Wave Arrival Inaccuracy Treshold: %d ms".formatted(sliderPWaveInaccuracy.getValue())));