cicaprojekt/cicaprojekt/AbstractDrawer.java

32 lines
683 B
Java

package cicaprojekt;
import java.awt.image.BufferedImage;
import java.io.IOException;
public abstract class AbstractDrawer implements Drawer {
private static ImageStorage storage;
static {
try {
storage = new ImageStorage();
}
catch (IOException e) { /* TODO kitalálni, hogy itt mit kéne csinálni */ }
}
private String filename;
public AbstractDrawer(String path) throws IOException {
filename = path;
}
public void changeImage(String path) throws IOException {
filename = path;
}
@Override
public BufferedImage getImage() {
return storage.getImage(filename);
}
}