This commit is contained in:
Yorick
2015-03-17 13:28:01 +01:00
11 changed files with 27 additions and 7 deletions
+3 -1
View File
@@ -114,9 +114,11 @@ public abstract class DrawObject
{
shape = new Rectangle2D.Double(0, 0, image.getWidth(null), image.getHeight(null));
return getTransform().createTransformedShape(shape).contains(clickPoint);
} else
{
shape = new Rectangle2D.Double(-7, -7, image.getWidth(null) + 7, image.getHeight(null) + 7);
shape = new Rectangle2D.Double(-9, -9, image.getWidth(null) + 13, image.getHeight(null) + 13);
return getTransformSelection().createTransformedShape(shape).contains(clickPoint);
}
+6 -5
View File
@@ -1,15 +1,12 @@
package Applicatie;
import java.awt.BasicStroke;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.TexturePaint;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
@@ -26,9 +23,9 @@ import Listeners.Mouse;
import Listeners.MouseMotion;
import Listeners.MouseWheel;
import Objects.Entrance;
import Objects.Food;
import Objects.Path;
import Objects.Stage;
import Objects.Toilet;
import Objects.Wall;
@@ -37,7 +34,7 @@ public class Panel extends JPanel
{
BufferedImage background;
BufferedImage podiumImage, toiletImage, entranceImage, pathImage, wallImage;
BufferedImage podiumImage, toiletImage, entranceImage, pathImage, wallImage, foodImage;
private int panelInfox, panelInfoy, scrollfactor;
@@ -75,6 +72,7 @@ public class Panel extends JPanel
entranceImage = ImageIO.read(new File("images/entranceIcon.png"));
pathImage = ImageIO.read(new File("images/pathIcon.png"));
wallImage = ImageIO.read(new File("images/wallIcon.png"));
foodImage = ImageIO.read(new File("images/foodIcon.png"));
} catch (IOException e)
{
e.printStackTrace();
@@ -84,6 +82,7 @@ public class Panel extends JPanel
panelInfo.add(entranceImage);
panelInfo.add(pathImage);
panelInfo.add(wallImage);
panelInfo.add(foodImage);
panelInfox = 0;
panelInfoy = 0;
@@ -125,6 +124,8 @@ public class Panel extends JPanel
return new Path(null);
case 4:
return new Wall(null);
case 5:
return new Food(null);
default:
return null;
}
+17
View File
@@ -0,0 +1,17 @@
package Objects;
import java.awt.geom.Point2D;
import Applicatie.DrawObject;
public class Food extends DrawObject {
public Food(Point2D position) {
super("images/food.png", position);
}
public String getName() {
return "Food";
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ import Applicatie.DrawObject;
public class Stage extends DrawObject {
public Stage(Point2D position) {
super("images/stage3.png", position);
super("images/stage4.png", position);
}
@Override
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB