Merge remote-tracking branch 'origin/kenneth' into develop

This commit is contained in:
Yorick
2015-04-08 12:43:11 +02:00
4 changed files with 37 additions and 3 deletions
+2 -1
View File
@@ -26,10 +26,11 @@ public class ControlPanel extends JPanel
super();
BoxLayout box = new BoxLayout(this, BoxLayout.X_AXIS);
setLayout(box);
setPreferredSize(new Dimension(0,50));
setBorder(BorderFactory.createLineBorder(new Color(180, 180, 180)));
setBackground(new Color(220, 220, 220));
setFocusable(false);
JPanel simulatorPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
simulatorPanel.setPreferredSize(new Dimension(350,50));
+9 -2
View File
@@ -28,6 +28,7 @@ import javax.swing.JPanel;
import javax.swing.Timer;
import Agenda.Agenda;
import Listeners.WindowFocusListener;
import Listeners.Mouse;
import Listeners.MouseMotion;
import Listeners.MouseWheel;
@@ -113,7 +114,7 @@ public class Panel extends JPanel implements ActionListener
entranceImage = ImageIO.read(new File("images/entranceIcon.png"));
wallImage = ImageIO.read(new File("images/wallIcon.png"));
foodImage = ImageIO.read(new File("images/foodIcon.png"));
waypointImage = ImageIO.read(new File("images/waypointIcon.png"));
waypointImage = ImageIO.read(new File("images/waypoint.png"));
background = grass;
}
catch (IOException e)
@@ -142,6 +143,9 @@ public class Panel extends JPanel implements ActionListener
addMouseMotionListener(new MouseMotion(this));
addMouseWheelListener(new MouseWheel(this));
addFocusListener(new WindowFocusListener(this));
t = new Timer(1000 / 10, this);
}
@@ -209,7 +213,7 @@ public class Panel extends JPanel implements ActionListener
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setClip(new Rectangle2D.Double(0, 0, getWidth(), 300));
g2.setClip(new Rectangle2D.Double(0, 0, getWidth(), 150));
Stroke old = g2.getStroke();
g2.setStroke(new BasicStroke(10));
g2.drawLine(0, 150, getWidth(), 150);
@@ -469,6 +473,9 @@ public class Panel extends JPanel implements ActionListener
*/
public void startPath()
{
pp.clearSelected();
setSelectedObject(null);
clearObjectSelection();
setClickedOption("Path");
currentPath = new Path();
paths.add(currentPath);
+1
View File
@@ -56,6 +56,7 @@ public class PropertiesPanel extends JPanel
setPreferredSize(new Dimension(200, 0));
setBorder(BorderFactory.createLineBorder(new Color(180, 180, 180)));
setBackground(new Color(220, 220, 220));
setFocusable(false);
// NAME "PROPERTIES"
JPanel propPanel = new JPanel();
+25
View File
@@ -0,0 +1,25 @@
package Listeners;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import Applicatie.Panel;
public class WindowFocusListener implements FocusListener
{
Panel p;
public WindowFocusListener(Panel p)
{
this.p = p;
}
@Override
public void focusGained(FocusEvent e){}
@Override
public void focusLost(FocusEvent e)
{
p.requestFocus();
}
}