rendered paste bodyimport java.util.ArrayList;
import javax.imageio.*;
import javax.swing.*;
import java.awt.*;
import java.io.*;
public class Data {
int clickCount = 0;
ArrayList list = new ArrayList(0);
int color = 0; //0=red,1=blue,2=green
String filename="", newfilename="",routename="Not Implemented";
Image map;
int width, height, fullwidth, fullheight, wwidth, wheight; //pic variables
public void openMap() {
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fc.showOpenDialog(null);
File inFile = fc.getSelectedFile();
filename = inFile.getAbsolutePath();
try {
map = ImageIO.read (inFile);
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "ERROR:\n Could not load map image");
map = null;
return;
}
fullwidth = width = map.getWidth(null);
fullheight = height = map.getHeight(null);
clickCount = 0;
list.clear();
}
}