Regoranized package.

This commit is contained in:
Holt59 2018-02-24 13:46:47 +01:00
parent 4a5ac5ad58
commit c624fd9dfd
11 changed files with 19 additions and 30 deletions

View File

@ -3,8 +3,8 @@ package org.insa.algo.weakconnectivity;
import java.awt.Color; import java.awt.Color;
import java.util.ArrayList; import java.util.ArrayList;
import org.insa.drawing.Drawing;
import org.insa.graph.Node; import org.insa.graph.Node;
import org.insa.graphics.drawing.Drawing;
public class WeaklyConnectedComponentGraphicObserver implements WeaklyConnectedComponentObserver { public class WeaklyConnectedComponentGraphicObserver implements WeaklyConnectedComponentObserver {

View File

@ -1,4 +1,4 @@
package org.insa.base; package org.insa.graphics;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; 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.WeaklyConnectedComponentGraphicObserver;
import org.insa.algo.weakconnectivity.WeaklyConnectedComponentsAlgorithm; import org.insa.algo.weakconnectivity.WeaklyConnectedComponentsAlgorithm;
import org.insa.algo.weakconnectivity.WeaklyConnectedComponentsData; 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.Graph;
import org.insa.graph.Node; import org.insa.graph.Node;
import org.insa.graph.Path; 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.BinaryPathReader;
import org.insa.graph.io.MapMismatchException; import org.insa.graph.io.MapMismatchException;
import org.insa.graph.io.Openfile; 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 { public class MainWindow extends JFrame {

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import java.awt.BasicStroke; import java.awt.BasicStroke;
import java.awt.Color; import java.awt.Color;

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import java.awt.Color; import java.awt.Color;

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import java.awt.Color; import java.awt.Color;

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import java.awt.Color; import java.awt.Color;

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import org.insa.graph.Point; import org.insa.graph.Point;

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import java.awt.Color; import java.awt.Color;

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import java.awt.Color; import java.awt.Color;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -12,11 +12,11 @@ import java.util.UUID;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileNameExtensionFilter;
import org.insa.drawing.utils.MarkerUtils;
import org.insa.graph.Arc; import org.insa.graph.Arc;
import org.insa.graph.Graph; import org.insa.graph.Graph;
import org.insa.graph.Path; import org.insa.graph.Path;
import org.insa.graph.Point; import org.insa.graph.Point;
import org.insa.graphics.drawing.utils.MarkerUtils;
import org.mapsforge.core.graphics.Bitmap; import org.mapsforge.core.graphics.Bitmap;
import org.mapsforge.core.graphics.GraphicFactory; import org.mapsforge.core.graphics.GraphicFactory;
import org.mapsforge.core.graphics.Paint; import org.mapsforge.core.graphics.Paint;

View File

@ -1,4 +1,4 @@
package org.insa.drawing; package org.insa.graphics.drawing;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;

View File

@ -1,18 +1,13 @@
package org.insa.drawing.utils; package org.insa.graphics.drawing.utils;
import java.awt.Color; import java.awt.Color;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Map;
import org.mapsforge.core.graphics.Bitmap; import org.mapsforge.core.graphics.Bitmap;
import org.mapsforge.map.awt.graphics.AwtBitmap; import org.mapsforge.map.awt.graphics.AwtBitmap;
public class MarkerUtils { public class MarkerUtils {
// Marker
private static Map<Color, Bitmap> MARKER_BITMAPS = new HashMap<Color, Bitmap>();
/** /**
* Return a color mapping with the given color as the main color. * Return a color mapping with the given color as the main color.
* *
@ -30,10 +25,6 @@ public class MarkerUtils {
* @return * @return
*/ */
public static Bitmap getMarkerForColor(Color color) { public static Bitmap getMarkerForColor(Color color) {
if (MARKER_BITMAPS.containsKey(color)) {
return MARKER_BITMAPS.get(color);
}
// create image // create image
BufferedImage image = new BufferedImage(MARKER_MASK[0].length, MARKER_MASK.length, BufferedImage.TYPE_INT_ARGB); 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. // Create Bitmap and return it.
Bitmap bitmap = new AwtBitmap(image); return new AwtBitmap(image);
MARKER_BITMAPS.put(color, bitmap);
return bitmap;
} }
// Mask // Mask