Added some icons and implemented them
@@ -3,10 +3,7 @@ import java.awt.Graphics;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.TexturePaint;
|
import java.awt.TexturePaint;
|
||||||
import java.awt.event.MouseWheelEvent;
|
|
||||||
import java.awt.event.MouseWheelListener;
|
|
||||||
import java.awt.geom.AffineTransform;
|
import java.awt.geom.AffineTransform;
|
||||||
import java.awt.geom.Ellipse2D;
|
|
||||||
import java.awt.geom.NoninvertibleTransformException;
|
import java.awt.geom.NoninvertibleTransformException;
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
@@ -14,7 +11,6 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
@@ -22,18 +18,21 @@ import javax.swing.JPanel;
|
|||||||
import Listeners.Mouse;
|
import Listeners.Mouse;
|
||||||
import Listeners.MouseMotion;
|
import Listeners.MouseMotion;
|
||||||
import Listeners.MouseWheel;
|
import Listeners.MouseWheel;
|
||||||
|
import Objects.Entrance;
|
||||||
|
import Objects.Path;
|
||||||
import Objects.Podium;
|
import Objects.Podium;
|
||||||
import Objects.Toilet;
|
import Objects.Toilet;
|
||||||
|
import Objects.Wall;
|
||||||
|
|
||||||
public class Panel extends JPanel {
|
public class Panel extends JPanel {
|
||||||
|
|
||||||
BufferedImage background;
|
BufferedImage background;
|
||||||
BufferedImage podiumImage, toiletImage;
|
BufferedImage podiumImage, toiletImage, entranceImage, pathImage,wallImage;
|
||||||
|
|
||||||
private int panelInfox, panelInfoy,scrollfactor;
|
private int panelInfox, panelInfoy,scrollfactor;
|
||||||
|
|
||||||
private ArrayList<BufferedImage> panelInfo = new ArrayList<BufferedImage>();
|
private ArrayList<BufferedImage> panelInfo = new ArrayList<BufferedImage>();
|
||||||
private ArrayList<Object> panelTypes = new ArrayList<Object>();
|
// private ArrayList<Object> panelTypes = new ArrayList<Object>();
|
||||||
|
|
||||||
ArrayList<DrawObject> objects = new ArrayList<>();
|
ArrayList<DrawObject> objects = new ArrayList<>();
|
||||||
DrawObject dragObject = null;
|
DrawObject dragObject = null;
|
||||||
@@ -54,16 +53,18 @@ public class Panel extends JPanel {
|
|||||||
try {
|
try {
|
||||||
background = ImageIO.read(new File("images/grass.jpg"));
|
background = ImageIO.read(new File("images/grass.jpg"));
|
||||||
podiumImage = ImageIO.read(new File("images/stageIcon.png"));
|
podiumImage = ImageIO.read(new File("images/stageIcon.png"));
|
||||||
toiletImage = ImageIO.read(new File("images/toilet.png"));
|
toiletImage = ImageIO.read(new File("images/wcIcon.png"));
|
||||||
|
entranceImage = ImageIO.read(new File("images/entranceIcon.png"));
|
||||||
|
pathImage = ImageIO.read(new File("images/pathIcon.png"));
|
||||||
|
wallImage = ImageIO.read(new File("images/wallIcon.png"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
panelInfo.add(podiumImage);
|
panelInfo.add(podiumImage);
|
||||||
panelInfo.add(toiletImage);
|
panelInfo.add(toiletImage);
|
||||||
panelTypes.add(new Podium(null));
|
panelInfo.add(entranceImage);
|
||||||
panelTypes.add(new Toilet(null));
|
panelInfo.add(pathImage);
|
||||||
panelInfo.add(toiletImage);
|
panelInfo.add(wallImage);
|
||||||
panelTypes.add(new Toilet(null));
|
|
||||||
|
|
||||||
panelInfox = 0;
|
panelInfox = 0;
|
||||||
panelInfoy = 0;
|
panelInfoy = 0;
|
||||||
@@ -101,7 +102,11 @@ public class Panel extends JPanel {
|
|||||||
case 1:
|
case 1:
|
||||||
return new Toilet(null);
|
return new Toilet(null);
|
||||||
case 2:
|
case 2:
|
||||||
return new Podium(null);
|
return new Entrance(null);
|
||||||
|
case 3:
|
||||||
|
return new Path(null);
|
||||||
|
case 4:
|
||||||
|
return new Wall(null);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -251,15 +256,6 @@ public class Panel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<Object> getPanelTypes() {
|
|
||||||
return panelTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setPanelTypes(ArrayList<Object> panelTypes) {
|
|
||||||
this.panelTypes = panelTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getScrollfactor() {
|
public int getScrollfactor() {
|
||||||
return scrollfactor;
|
return scrollfactor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package Objects;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import Applicatie.DrawObject;
|
||||||
|
|
||||||
|
|
||||||
|
public class Entrance extends DrawObject {
|
||||||
|
|
||||||
|
public Entrance(Point2D position) {
|
||||||
|
super("images/entrance.png", position);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package Objects;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import Applicatie.DrawObject;
|
||||||
|
|
||||||
|
|
||||||
|
public class Path extends DrawObject {
|
||||||
|
|
||||||
|
public Path(Point2D position) {
|
||||||
|
super("images/path.jpg", position);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import Applicatie.DrawObject;
|
|||||||
public class Toilet extends DrawObject {
|
public class Toilet extends DrawObject {
|
||||||
|
|
||||||
public Toilet(Point2D position) {
|
public Toilet(Point2D position) {
|
||||||
super("images/toilet.png", position);
|
super("images/wc.png", position);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package Objects;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import Applicatie.DrawObject;
|
||||||
|
|
||||||
|
|
||||||
|
public class Wall extends DrawObject {
|
||||||
|
|
||||||
|
public Wall(Point2D position) {
|
||||||
|
super("images/wall.png", position);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 972 B |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 972 B |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 494 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 737 B |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 737 B |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 4.0 KiB |