From c624fd9dfd25df99f75be9f35a3a428b66793bc4 Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sat, 24 Feb 2018 13:46:47 +0100 Subject: [PATCH] Regoranized package. --- ...WeaklyConnectedComponentGraphicObserver.java | 2 +- .../org/insa/{base => graphics}/MainWindow.java | 12 ++++++------ .../{ => graphics}/drawing/BasicDrawing.java | 2 +- .../drawing/BasicGraphPalette.java | 2 +- .../drawing/BlackAndWhiteGraphPalette.java | 2 +- .../insa/{ => graphics}/drawing/Drawing.java | 2 +- .../drawing/DrawingClickListener.java | 2 +- .../{ => graphics}/drawing/GraphPalette.java | 2 +- .../{ => graphics}/drawing/MapViewDrawing.java | 4 ++-- .../drawing/ZoomAndPanListener.java | 2 +- .../drawing/utils/MarkerUtils.java | 17 +++-------------- 11 files changed, 19 insertions(+), 30 deletions(-) rename src/main/org/insa/{base => graphics}/MainWindow.java (96%) rename src/main/org/insa/{ => graphics}/drawing/BasicDrawing.java (99%) rename src/main/org/insa/{ => graphics}/drawing/BasicGraphPalette.java (98%) rename src/main/org/insa/{ => graphics}/drawing/BlackAndWhiteGraphPalette.java (93%) rename src/main/org/insa/{ => graphics}/drawing/Drawing.java (98%) rename src/main/org/insa/{ => graphics}/drawing/DrawingClickListener.java (81%) rename src/main/org/insa/{ => graphics}/drawing/GraphPalette.java (94%) rename src/main/org/insa/{ => graphics}/drawing/MapViewDrawing.java (96%) rename src/main/org/insa/{ => graphics}/drawing/ZoomAndPanListener.java (99%) rename src/main/org/insa/{ => graphics}/drawing/utils/MarkerUtils.java (91%) diff --git a/src/main/org/insa/algo/weakconnectivity/WeaklyConnectedComponentGraphicObserver.java b/src/main/org/insa/algo/weakconnectivity/WeaklyConnectedComponentGraphicObserver.java index c2657ce..c7d272f 100644 --- a/src/main/org/insa/algo/weakconnectivity/WeaklyConnectedComponentGraphicObserver.java +++ b/src/main/org/insa/algo/weakconnectivity/WeaklyConnectedComponentGraphicObserver.java @@ -3,8 +3,8 @@ package org.insa.algo.weakconnectivity; import java.awt.Color; import java.util.ArrayList; -import org.insa.drawing.Drawing; import org.insa.graph.Node; +import org.insa.graphics.drawing.Drawing; public class WeaklyConnectedComponentGraphicObserver implements WeaklyConnectedComponentObserver { diff --git a/src/main/org/insa/base/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java similarity index 96% rename from src/main/org/insa/base/MainWindow.java rename to src/main/org/insa/graphics/MainWindow.java index 34da2b0..b668efb 100644 --- a/src/main/org/insa/base/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -1,4 +1,4 @@ -package org.insa.base; +package org.insa.graphics; import java.awt.BorderLayout; import java.awt.Color; @@ -46,11 +46,6 @@ import org.insa.algo.shortestpath.ShortestPathSolution; import org.insa.algo.weakconnectivity.WeaklyConnectedComponentGraphicObserver; import org.insa.algo.weakconnectivity.WeaklyConnectedComponentsAlgorithm; import org.insa.algo.weakconnectivity.WeaklyConnectedComponentsData; -import org.insa.drawing.BasicDrawing; -import org.insa.drawing.BlackAndWhiteGraphPalette; -import org.insa.drawing.Drawing; -import org.insa.drawing.DrawingClickListener; -import org.insa.drawing.MapViewDrawing; import org.insa.graph.Graph; import org.insa.graph.Node; import org.insa.graph.Path; @@ -61,6 +56,11 @@ import org.insa.graph.io.BinaryGraphReaderV2; import org.insa.graph.io.BinaryPathReader; import org.insa.graph.io.MapMismatchException; import org.insa.graph.io.Openfile; +import org.insa.graphics.drawing.BasicDrawing; +import org.insa.graphics.drawing.BlackAndWhiteGraphPalette; +import org.insa.graphics.drawing.Drawing; +import org.insa.graphics.drawing.DrawingClickListener; +import org.insa.graphics.drawing.MapViewDrawing; public class MainWindow extends JFrame { diff --git a/src/main/org/insa/drawing/BasicDrawing.java b/src/main/org/insa/graphics/drawing/BasicDrawing.java similarity index 99% rename from src/main/org/insa/drawing/BasicDrawing.java rename to src/main/org/insa/graphics/drawing/BasicDrawing.java index 7320436..57b9c3f 100644 --- a/src/main/org/insa/drawing/BasicDrawing.java +++ b/src/main/org/insa/graphics/drawing/BasicDrawing.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import java.awt.BasicStroke; import java.awt.Color; diff --git a/src/main/org/insa/drawing/BasicGraphPalette.java b/src/main/org/insa/graphics/drawing/BasicGraphPalette.java similarity index 98% rename from src/main/org/insa/drawing/BasicGraphPalette.java rename to src/main/org/insa/graphics/drawing/BasicGraphPalette.java index 2d82f04..76f7739 100644 --- a/src/main/org/insa/drawing/BasicGraphPalette.java +++ b/src/main/org/insa/graphics/drawing/BasicGraphPalette.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import java.awt.Color; diff --git a/src/main/org/insa/drawing/BlackAndWhiteGraphPalette.java b/src/main/org/insa/graphics/drawing/BlackAndWhiteGraphPalette.java similarity index 93% rename from src/main/org/insa/drawing/BlackAndWhiteGraphPalette.java rename to src/main/org/insa/graphics/drawing/BlackAndWhiteGraphPalette.java index 2d095d5..9b5a1ab 100644 --- a/src/main/org/insa/drawing/BlackAndWhiteGraphPalette.java +++ b/src/main/org/insa/graphics/drawing/BlackAndWhiteGraphPalette.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import java.awt.Color; diff --git a/src/main/org/insa/drawing/Drawing.java b/src/main/org/insa/graphics/drawing/Drawing.java similarity index 98% rename from src/main/org/insa/drawing/Drawing.java rename to src/main/org/insa/graphics/drawing/Drawing.java index 79e222f..2bb21d8 100644 --- a/src/main/org/insa/drawing/Drawing.java +++ b/src/main/org/insa/graphics/drawing/Drawing.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import java.awt.Color; diff --git a/src/main/org/insa/drawing/DrawingClickListener.java b/src/main/org/insa/graphics/drawing/DrawingClickListener.java similarity index 81% rename from src/main/org/insa/drawing/DrawingClickListener.java rename to src/main/org/insa/graphics/drawing/DrawingClickListener.java index 35ce18d..2e2203c 100644 --- a/src/main/org/insa/drawing/DrawingClickListener.java +++ b/src/main/org/insa/graphics/drawing/DrawingClickListener.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import org.insa.graph.Point; diff --git a/src/main/org/insa/drawing/GraphPalette.java b/src/main/org/insa/graphics/drawing/GraphPalette.java similarity index 94% rename from src/main/org/insa/drawing/GraphPalette.java rename to src/main/org/insa/graphics/drawing/GraphPalette.java index 13ae445..c7378d4 100644 --- a/src/main/org/insa/drawing/GraphPalette.java +++ b/src/main/org/insa/graphics/drawing/GraphPalette.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import java.awt.Color; diff --git a/src/main/org/insa/drawing/MapViewDrawing.java b/src/main/org/insa/graphics/drawing/MapViewDrawing.java similarity index 96% rename from src/main/org/insa/drawing/MapViewDrawing.java rename to src/main/org/insa/graphics/drawing/MapViewDrawing.java index dc57d98..72d54d0 100644 --- a/src/main/org/insa/drawing/MapViewDrawing.java +++ b/src/main/org/insa/graphics/drawing/MapViewDrawing.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import java.awt.Color; import java.awt.event.MouseAdapter; @@ -12,11 +12,11 @@ import java.util.UUID; import javax.swing.JFileChooser; import javax.swing.filechooser.FileNameExtensionFilter; -import org.insa.drawing.utils.MarkerUtils; 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.utils.MarkerUtils; import org.mapsforge.core.graphics.Bitmap; import org.mapsforge.core.graphics.GraphicFactory; import org.mapsforge.core.graphics.Paint; diff --git a/src/main/org/insa/drawing/ZoomAndPanListener.java b/src/main/org/insa/graphics/drawing/ZoomAndPanListener.java similarity index 99% rename from src/main/org/insa/drawing/ZoomAndPanListener.java rename to src/main/org/insa/graphics/drawing/ZoomAndPanListener.java index 0259307..6ef699e 100644 --- a/src/main/org/insa/drawing/ZoomAndPanListener.java +++ b/src/main/org/insa/graphics/drawing/ZoomAndPanListener.java @@ -1,4 +1,4 @@ -package org.insa.drawing; +package org.insa.graphics.drawing; import java.awt.*; import java.awt.event.*; diff --git a/src/main/org/insa/drawing/utils/MarkerUtils.java b/src/main/org/insa/graphics/drawing/utils/MarkerUtils.java similarity index 91% rename from src/main/org/insa/drawing/utils/MarkerUtils.java rename to src/main/org/insa/graphics/drawing/utils/MarkerUtils.java index 74f8fb2..e76125d 100644 --- a/src/main/org/insa/drawing/utils/MarkerUtils.java +++ b/src/main/org/insa/graphics/drawing/utils/MarkerUtils.java @@ -1,18 +1,13 @@ -package org.insa.drawing.utils; +package org.insa.graphics.drawing.utils; import java.awt.Color; import java.awt.image.BufferedImage; -import java.util.HashMap; -import java.util.Map; import org.mapsforge.core.graphics.Bitmap; import org.mapsforge.map.awt.graphics.AwtBitmap; public class MarkerUtils { - // Marker - private static Map MARKER_BITMAPS = new HashMap(); - /** * Return a color mapping with the given color as the main color. * @@ -30,10 +25,6 @@ public class MarkerUtils { * @return */ public static Bitmap getMarkerForColor(Color color) { - if (MARKER_BITMAPS.containsKey(color)) { - return MARKER_BITMAPS.get(color); - } - // create image BufferedImage image = new BufferedImage(MARKER_MASK[0].length, MARKER_MASK.length, BufferedImage.TYPE_INT_ARGB); @@ -44,10 +35,8 @@ public class MarkerUtils { } } - // Create Bitmap, add it to map and return it. - Bitmap bitmap = new AwtBitmap(image); - MARKER_BITMAPS.put(color, bitmap); - return bitmap; + // Create Bitmap and return it. + return new AwtBitmap(image); } // Mask