From 71202409b878263893bafe08fddef6102a0ab95b Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sun, 25 Feb 2018 18:34:48 +0100 Subject: [PATCH] Rename some classes. --- src/main/org/insa/graphics/NodesInputPanel.java | 6 +++--- src/main/org/insa/graphics/drawing/BasicDrawing.java | 12 ++++++------ src/main/org/insa/graphics/drawing/Drawing.java | 6 +++--- .../org/insa/graphics/drawing/MapViewDrawing.java | 12 ++++++------ .../{MarkerTracker.java => MarkerOverlay.java} | 2 +- .../overlays/{OverlayTracker.java => Overlay.java} | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) rename src/main/org/insa/graphics/drawing/overlays/{MarkerTracker.java => MarkerOverlay.java} (81%) rename src/main/org/insa/graphics/drawing/overlays/{OverlayTracker.java => Overlay.java} (90%) diff --git a/src/main/org/insa/graphics/NodesInputPanel.java b/src/main/org/insa/graphics/NodesInputPanel.java index 3de18d0..6326b8d 100644 --- a/src/main/org/insa/graphics/NodesInputPanel.java +++ b/src/main/org/insa/graphics/NodesInputPanel.java @@ -26,7 +26,7 @@ import org.insa.graph.Node; import org.insa.graph.Point; import org.insa.graphics.drawing.Drawing; import org.insa.graphics.drawing.DrawingClickListener; -import org.insa.graphics.drawing.overlays.MarkerTracker; +import org.insa.graphics.drawing.overlays.MarkerOverlay; public class NodesInputPanel extends JPanel implements DrawingClickListener { @@ -64,7 +64,7 @@ public class NodesInputPanel extends JPanel implements DrawingClickListener { // Node inputs and markers. private ArrayList nodeInputs = new ArrayList<>(); - private Map markerTrackers = new IdentityHashMap(); + private Map markerTrackers = new IdentityHashMap(); // Component that can be enabled/disabled. private ArrayList components = new ArrayList<>(); @@ -176,7 +176,7 @@ public class NodesInputPanel extends JPanel implements DrawingClickListener { // Draw marker if possible Node curnode = getNodeForInput(textField); - MarkerTracker tracker = markerTrackers.getOrDefault(textField, null); + MarkerOverlay tracker = markerTrackers.getOrDefault(textField, null); if (curnode != null) { if (tracker == null) { tracker = drawing.drawMarker(curnode.getPoint(), markerColor); diff --git a/src/main/org/insa/graphics/drawing/BasicDrawing.java b/src/main/org/insa/graphics/drawing/BasicDrawing.java index 1e16aab..e53f1a3 100644 --- a/src/main/org/insa/graphics/drawing/BasicDrawing.java +++ b/src/main/org/insa/graphics/drawing/BasicDrawing.java @@ -24,9 +24,9 @@ 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.overlays.MarkerTracker; +import org.insa.graphics.drawing.overlays.MarkerOverlay; import org.insa.graphics.drawing.overlays.MarkerUtils; -import org.insa.graphics.drawing.overlays.OverlayTracker; +import org.insa.graphics.drawing.overlays.Overlay; /** * Cette implementation de la classe Dessin produit vraiment un affichage (au @@ -40,7 +40,7 @@ public class BasicDrawing extends JPanel implements Drawing { */ private static final long serialVersionUID = 96779785877771827L; - public abstract class BasicOverlay implements OverlayTracker { + public abstract class BasicOverlay implements Overlay { // Visible? protected boolean visible; @@ -68,7 +68,7 @@ public class BasicDrawing extends JPanel implements Drawing { }; - public class BasicMarker extends BasicOverlay implements MarkerTracker { + public class BasicMarker extends BasicOverlay implements MarkerOverlay { // Point of the marker. private Point point; @@ -296,12 +296,12 @@ public class BasicDrawing extends JPanel implements Drawing { } @Override - public MarkerTracker drawMarker(Point point) { + public MarkerOverlay drawMarker(Point point) { return drawMarker(point, this.overlayGraphics.getColor()); } @Override - public MarkerTracker drawMarker(Point point, Color color) { + public MarkerOverlay drawMarker(Point point, Color color) { BasicMarker marker = new BasicMarker(point, color); this.overlays.add(marker); this.repaint(); diff --git a/src/main/org/insa/graphics/drawing/Drawing.java b/src/main/org/insa/graphics/drawing/Drawing.java index 15c569a..ab4e057 100644 --- a/src/main/org/insa/graphics/drawing/Drawing.java +++ b/src/main/org/insa/graphics/drawing/Drawing.java @@ -5,7 +5,7 @@ import java.awt.Color; import org.insa.graph.Graph; import org.insa.graph.Path; import org.insa.graph.Point; -import org.insa.graphics.drawing.overlays.MarkerTracker; +import org.insa.graphics.drawing.overlays.MarkerOverlay; public interface Drawing { @@ -33,14 +33,14 @@ public interface Drawing { * * @param point */ - public MarkerTracker drawMarker(Point point); + public MarkerOverlay drawMarker(Point point); /** * Draw the given point with the given color. * * @param point */ - public MarkerTracker drawMarker(Point point, Color color); + public MarkerOverlay drawMarker(Point point, Color color); /** * Draw a point width the given width and color. Do not use this to mark diff --git a/src/main/org/insa/graphics/drawing/MapViewDrawing.java b/src/main/org/insa/graphics/drawing/MapViewDrawing.java index e3bad41..c0bd341 100644 --- a/src/main/org/insa/graphics/drawing/MapViewDrawing.java +++ b/src/main/org/insa/graphics/drawing/MapViewDrawing.java @@ -14,9 +14,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.overlays.MarkerTracker; +import org.insa.graphics.drawing.overlays.MarkerOverlay; import org.insa.graphics.drawing.overlays.MarkerUtils; -import org.insa.graphics.drawing.overlays.OverlayTracker; +import org.insa.graphics.drawing.overlays.Overlay; import org.insa.graphics.drawing.overlays.PolylineAutoScaling; import org.mapsforge.core.graphics.Bitmap; import org.mapsforge.core.graphics.GraphicFactory; @@ -48,7 +48,7 @@ public class MapViewDrawing extends MapView implements Drawing { */ private static final long serialVersionUID = 8606967833704938092L; - public class MapViewOverlayTracker implements OverlayTracker { + public class MapViewOverlayTracker implements Overlay { // Marker associated. protected Layer layer; @@ -69,7 +69,7 @@ public class MapViewDrawing extends MapView implements Drawing { }; - public class MapViewMarkerTracker extends MapViewOverlayTracker implements MarkerTracker { + public class MapViewMarkerTracker extends MapViewOverlayTracker implements MarkerOverlay { public MapViewMarkerTracker(Marker marker) { super(marker); @@ -190,12 +190,12 @@ public class MapViewDrawing extends MapView implements Drawing { } @Override - public MarkerTracker drawMarker(Point point) { + public MarkerOverlay drawMarker(Point point) { return drawMarker(point, Color.GREEN); } @Override - public MarkerTracker drawMarker(Point point, Color color) { + public MarkerOverlay drawMarker(Point point, Color color) { Bitmap bitmap = new AwtBitmap(MarkerUtils.getMarkerForColor(color)); Marker marker = new Marker(convertPoint(point), bitmap, 0, -bitmap.getHeight() / 2); getLayerManager().getLayers().add(marker); diff --git a/src/main/org/insa/graphics/drawing/overlays/MarkerTracker.java b/src/main/org/insa/graphics/drawing/overlays/MarkerOverlay.java similarity index 81% rename from src/main/org/insa/graphics/drawing/overlays/MarkerTracker.java rename to src/main/org/insa/graphics/drawing/overlays/MarkerOverlay.java index 82b43db..a761af9 100644 --- a/src/main/org/insa/graphics/drawing/overlays/MarkerTracker.java +++ b/src/main/org/insa/graphics/drawing/overlays/MarkerOverlay.java @@ -2,7 +2,7 @@ package org.insa.graphics.drawing.overlays; import org.insa.graph.Point; -public interface MarkerTracker extends OverlayTracker { +public interface MarkerOverlay extends Overlay { /** * @return The point associated with this marker. diff --git a/src/main/org/insa/graphics/drawing/overlays/OverlayTracker.java b/src/main/org/insa/graphics/drawing/overlays/Overlay.java similarity index 90% rename from src/main/org/insa/graphics/drawing/overlays/OverlayTracker.java rename to src/main/org/insa/graphics/drawing/overlays/Overlay.java index 4c150da..97e4dae 100644 --- a/src/main/org/insa/graphics/drawing/overlays/OverlayTracker.java +++ b/src/main/org/insa/graphics/drawing/overlays/Overlay.java @@ -1,6 +1,6 @@ package org.insa.graphics.drawing.overlays; -public interface OverlayTracker { +public interface Overlay { /** * Show or hide this marker - A marker should be visible when created.