Skip to content

Commit

Permalink
some graphics details
Browse files Browse the repository at this point in the history
  • Loading branch information
xspanger3770 committed Aug 26, 2023
1 parent a5ad72a commit 253ffb1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main/java/globalquake/database/SeedlinkCommunicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public void runAvailabilityCheck(List<SeedlinkNetwork> toBeUpdated, Runnable onF

ExecutorService executor = Executors.newSingleThreadExecutor();

System.err.println("HERE 2 !!!!");
Callable<Void> task = () -> {
SeedlinkCommunicator.runAvailabilityCheck(seedlinkNetwork, stationDatabase);
return null;
Expand All @@ -188,6 +189,8 @@ public void runAvailabilityCheck(List<SeedlinkNetwork> toBeUpdated, Runnable onF
Future<Void> future = executor.submit(task);
future.get(SeedlinkCommunicator.SEEDLINK_TIMEOUT_SECONDS, TimeUnit.SECONDS);

System.err.println("HERE!!!!");

seedlinkNetwork.getStatus().setString("Done");
seedlinkNetwork.getStatus().setValue(100);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,19 @@ public void render(GlobeRenderer renderer, Graphics2D graphics, RenderEntity<Ear
}

private Color getCrossColor(double mag) {
if (mag < 2) {
if (mag < 3) {
return Color.lightGray;
}
if (mag < 4) {
return Color.green;
}
if (mag < 3.5) {
if (mag < 5) {
return Color.yellow;
}
if (mag < 5) {
if (mag < 6) {
return Color.orange;
}
if (mag < 6) {
if(mag < 7){
return Color.red;
}
return Color.magenta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private Component createSettingCorrectness() {
}

private Component createSettingPWave() {
sliderPWaveInaccuracy = createSettingsSlider(500, 3000, 1000, 100);
sliderPWaveInaccuracy = createSettingsSlider(400, 2500, 1000, 100);

JLabel label = new JLabel();
sliderPWaveInaccuracy.addChangeListener(changeEvent -> label.setText("P Wave Arrival Inaccuracy Treshold: %d ms".formatted(sliderPWaveInaccuracy.getValue())));
Expand Down

0 comments on commit 253ffb1

Please sign in to comment.