From 7827bfc63c7010e16272d94d84029c5a77361a4d Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sat, 3 Mar 2018 13:43:03 +0100 Subject: [PATCH] Reorganize code. --- src/main/org/insa/graphics/MainWindow.java | 4 ++-- .../graphics/drawing/{ => components}/BasicDrawing.java | 6 +++++- .../graphics/drawing/{ => components}/MapViewDrawing.java | 8 +++++++- .../drawing/{ => components}/ZoomAndPanListener.java | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) rename src/main/org/insa/graphics/drawing/{ => components}/BasicDrawing.java (98%) rename src/main/org/insa/graphics/drawing/{ => components}/MapViewDrawing.java (94%) rename src/main/org/insa/graphics/drawing/{ => components}/ZoomAndPanListener.java (98%) diff --git a/src/main/org/insa/graphics/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java index 10990be..0f06cbd 100644 --- a/src/main/org/insa/graphics/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -59,12 +59,12 @@ import org.insa.graph.io.BinaryPathReader; import org.insa.graph.io.GraphReader; import org.insa.graph.io.MapMismatchException; import org.insa.graphics.ShortestPathPanel.StartActionEvent; -import org.insa.graphics.drawing.BasicDrawing; import org.insa.graphics.drawing.BasicGraphPalette; import org.insa.graphics.drawing.BlackAndWhiteGraphPalette; import org.insa.graphics.drawing.Drawing; import org.insa.graphics.drawing.GraphPalette; -import org.insa.graphics.drawing.MapViewDrawing; +import org.insa.graphics.drawing.components.BasicDrawing; +import org.insa.graphics.drawing.components.MapViewDrawing; public class MainWindow extends JFrame { diff --git a/src/main/org/insa/graphics/drawing/BasicDrawing.java b/src/main/org/insa/graphics/drawing/components/BasicDrawing.java similarity index 98% rename from src/main/org/insa/graphics/drawing/BasicDrawing.java rename to src/main/org/insa/graphics/drawing/components/BasicDrawing.java index 580d9c0..75a3ee8 100644 --- a/src/main/org/insa/graphics/drawing/BasicDrawing.java +++ b/src/main/org/insa/graphics/drawing/components/BasicDrawing.java @@ -1,4 +1,4 @@ -package org.insa.graphics.drawing; +package org.insa.graphics.drawing.components; import java.awt.BasicStroke; import java.awt.Color; @@ -25,6 +25,10 @@ import org.insa.graph.Graph; import org.insa.graph.Node; import org.insa.graph.Path; import org.insa.graph.Point; +import org.insa.graphics.drawing.BasicGraphPalette; +import org.insa.graphics.drawing.Drawing; +import org.insa.graphics.drawing.DrawingClickListener; +import org.insa.graphics.drawing.GraphPalette; import org.insa.graphics.drawing.overlays.MarkerOverlay; import org.insa.graphics.drawing.overlays.MarkerUtils; import org.insa.graphics.drawing.overlays.Overlay; diff --git a/src/main/org/insa/graphics/drawing/MapViewDrawing.java b/src/main/org/insa/graphics/drawing/components/MapViewDrawing.java similarity index 94% rename from src/main/org/insa/graphics/drawing/MapViewDrawing.java rename to src/main/org/insa/graphics/drawing/components/MapViewDrawing.java index 518db1c..0365d1f 100644 --- a/src/main/org/insa/graphics/drawing/MapViewDrawing.java +++ b/src/main/org/insa/graphics/drawing/components/MapViewDrawing.java @@ -1,4 +1,4 @@ -package org.insa.graphics.drawing; +package org.insa.graphics.drawing.components; import java.awt.Color; import java.io.File; @@ -9,6 +9,9 @@ import org.insa.graph.Arc; import org.insa.graph.Graph; import org.insa.graph.Path; import org.insa.graph.Point; +import org.insa.graphics.drawing.Drawing; +import org.insa.graphics.drawing.DrawingClickListener; +import org.insa.graphics.drawing.GraphPalette; import org.insa.graphics.drawing.overlays.MarkerOverlay; import org.insa.graphics.drawing.overlays.MarkerUtils; import org.insa.graphics.drawing.overlays.Overlay; @@ -213,6 +216,9 @@ public class MapViewDrawing extends MapView implements Drawing { DisplayModel model = getModel().displayModel; this.tileSize = DEFAULT_TILE_SIZE; model.setFixedTileSize(this.tileSize); + + this.setZoomLevelMin((byte) 0); + this.setZoomLevelMax((byte) 20); } protected LatLong convertPoint(Point point) { diff --git a/src/main/org/insa/graphics/drawing/ZoomAndPanListener.java b/src/main/org/insa/graphics/drawing/components/ZoomAndPanListener.java similarity index 98% rename from src/main/org/insa/graphics/drawing/ZoomAndPanListener.java rename to src/main/org/insa/graphics/drawing/components/ZoomAndPanListener.java index 6ef699e..c52f06c 100644 --- a/src/main/org/insa/graphics/drawing/ZoomAndPanListener.java +++ b/src/main/org/insa/graphics/drawing/components/ZoomAndPanListener.java @@ -1,4 +1,4 @@ -package org.insa.graphics.drawing; +package org.insa.graphics.drawing.components; import java.awt.*; import java.awt.event.*;