Heirs of ImagePanel now throw IOException.
This commit is contained in:
parent
17d7f46d78
commit
573518d14b
@ -1,10 +1,12 @@
|
|||||||
package cicaprojekt;
|
package cicaprojekt;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class FieldDrawer extends ImagePanel implements Drawer {
|
public class FieldDrawer extends ImagePanel implements Drawer {
|
||||||
|
|
||||||
Field field;
|
Field field;
|
||||||
|
|
||||||
public FieldDrawer(Field f) {
|
public FieldDrawer(Field f) throws IOException {
|
||||||
super("Field.png");
|
super("Field.png");
|
||||||
field = f;
|
field = f;
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package cicaprojekt;
|
package cicaprojekt;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class GapDrawer extends ImagePanel implements Drawer{
|
public class GapDrawer extends ImagePanel implements Drawer{
|
||||||
|
|
||||||
private Gap gap;
|
private Gap gap;
|
||||||
|
|
||||||
public GapDrawer(Gap g) {
|
public GapDrawer(Gap g) throws IOException {
|
||||||
super("Gap.png");
|
super("Gap.png");
|
||||||
gap = g;
|
gap = g;
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
@ -12,11 +12,8 @@ public class ImagePanel extends JPanel{
|
|||||||
|
|
||||||
private BufferedImage image;
|
private BufferedImage image;
|
||||||
|
|
||||||
public ImagePanel(String path) {
|
public ImagePanel(String path) throws IOException {
|
||||||
try {
|
|
||||||
image = ImageIO.read(new File(path));
|
image = ImageIO.read(new File(path));
|
||||||
} catch (IOException ex) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package cicaprojekt;
|
package cicaprojekt;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class WallDrawer extends ImagePanel implements Drawer {
|
public class WallDrawer extends ImagePanel implements Drawer {
|
||||||
|
|
||||||
Wall wall;
|
Wall wall;
|
||||||
|
|
||||||
public WallDrawer(Wall w) {
|
public WallDrawer(Wall w) throws IOException {
|
||||||
super("Wall.png");
|
super("Wall.png");
|
||||||
wall = w;
|
wall = w;
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user