Move resources to class.
This commit is contained in:
@@ -13,7 +13,6 @@ import java.awt.event.ActionListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -65,10 +64,10 @@ public class MapZoomControls {
|
||||
public MapZoomControls(Component component, final int defaultZoom, final int minZoom,
|
||||
final int maxZoom) throws IOException {
|
||||
|
||||
zoomIn = ImageIO.read(new File("res/zoomIn.png")).getScaledInstance(DEFAULT_HEIGHT,
|
||||
DEFAULT_HEIGHT, Image.SCALE_SMOOTH);
|
||||
zoomOut = ImageIO.read(new File("res/zoomOut.png")).getScaledInstance(DEFAULT_HEIGHT,
|
||||
DEFAULT_HEIGHT, Image.SCALE_SMOOTH);
|
||||
zoomIn = ImageIO.read(getClass().getResourceAsStream("/zoomIn.png"))
|
||||
.getScaledInstance(DEFAULT_HEIGHT, DEFAULT_HEIGHT, Image.SCALE_SMOOTH);
|
||||
zoomOut = ImageIO.read(getClass().getResourceAsStream("/zoomOut.png"))
|
||||
.getScaledInstance(DEFAULT_HEIGHT, DEFAULT_HEIGHT, Image.SCALE_SMOOTH);
|
||||
|
||||
this.currentLevel = defaultZoom;
|
||||
this.minLevel = minZoom;
|
||||
|
||||
@@ -4,12 +4,9 @@ import java.awt.Color;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
public class MarkerUtils {
|
||||
|
||||
private static final String MARKER_MASK_FILE = "res/marker_mask.bin";
|
||||
|
||||
/**
|
||||
* Create an Image representing a marker of the given color.
|
||||
*
|
||||
@@ -44,7 +41,8 @@ public class MarkerUtils {
|
||||
private static int[][] readMarkerMask() {
|
||||
if (MASK_CACHE == null) {
|
||||
try {
|
||||
DataInputStream dis = new DataInputStream(new FileInputStream(MARKER_MASK_FILE));
|
||||
DataInputStream dis = new DataInputStream(
|
||||
MarkerUtils.class.getResourceAsStream("/marker_mask.bin"));
|
||||
|
||||
int nrows = dis.readInt();
|
||||
int ncols = dis.readInt();
|
||||
|
||||
Reference in New Issue
Block a user