From 26180b8d4d22f5e4a1c95ce5d6d550cb9d39dbde Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sat, 24 Feb 2018 20:50:16 +0100 Subject: [PATCH] Remove top panel. --- src/main/org/insa/graphics/MainWindow.java | 19 ++----------------- .../drawing/utils/PolylineAutoScaling.java | 2 ++ 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/main/org/insa/graphics/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java index 9dd5da9..e7fc76e 100644 --- a/src/main/org/insa/graphics/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -167,19 +167,10 @@ public class MainWindow extends JFrame { this.add(mainPanel, BorderLayout.CENTER); // Top Panel - this.add(createTopPanel(), BorderLayout.NORTH); this.add(createStatusBar(), BorderLayout.SOUTH); } - private void restartThreadTimer() { - threadTimer.restart(); - } - - private void stopThreadTimer() { - threadTimer.stop(); - } - /** * @param runnable * @param canInterrupt @@ -189,7 +180,7 @@ public class MainWindow extends JFrame { currentThread.setThread(new Thread(new Runnable() { @Override public void run() { - restartThreadTimer(); + threadTimer.restart(); threadPanel.setVisible(true); runnable.run(); clearCurrentThread(); @@ -207,7 +198,7 @@ public class MainWindow extends JFrame { } protected void clearCurrentThread() { - stopThreadTimer(); + threadTimer.stop(); threadPanel.setVisible(false); currentThread.setThread(null); } @@ -521,12 +512,6 @@ public class MainWindow extends JFrame { return statusPanel; } - protected JPanel createTopPanel() { - JPanel topPanel = new JPanel(); - - return topPanel; - } - public static void main(final String[] args) { // Try to set system look and feel. diff --git a/src/main/org/insa/graphics/drawing/utils/PolylineAutoScaling.java b/src/main/org/insa/graphics/drawing/utils/PolylineAutoScaling.java index ed6992f..1c526e9 100644 --- a/src/main/org/insa/graphics/drawing/utils/PolylineAutoScaling.java +++ b/src/main/org/insa/graphics/drawing/utils/PolylineAutoScaling.java @@ -6,6 +6,7 @@ import java.util.ArrayList; import org.insa.graph.Point; import org.mapsforge.core.graphics.Canvas; import org.mapsforge.core.graphics.GraphicFactory; +import org.mapsforge.core.graphics.Style; import org.mapsforge.core.model.BoundingBox; import org.mapsforge.core.model.LatLong; import org.mapsforge.map.awt.graphics.AwtGraphicFactory; @@ -26,6 +27,7 @@ public class PolylineAutoScaling extends Polyline { public PolylineAutoScaling(int width, Color color) { super(GRAPHIC_FACTORY.createPaint(), GRAPHIC_FACTORY); getPaintStroke().setColor(PaintUtils.convertColor(color)); + getPaintStroke().setStyle(Style.STROKE); this.width = width; }