Combined Agenda

This commit is contained in:
2015-04-08 16:38:55 +02:00
parent ab91a7f1aa
commit 9d853babdc
20 changed files with 180 additions and 357 deletions
+18 -1
View File
@@ -15,6 +15,7 @@ import java.io.Serializable;
import javax.swing.ImageIcon;
import Applicatie.Images;
import Applicatie.Panel;
public abstract class DrawObject implements Serializable
{
@@ -232,11 +233,27 @@ public abstract class DrawObject implements Serializable
public void setPosition(Point2D position)
{
if(position.getX() < -Panel.getFieldWidth()/2)
{
position.setLocation(-Panel.getFieldWidth()/2, position.getY());
}
if(position.getY() < -Panel.getFieldHeight()/2)
{
position.setLocation(position.getX(), -Panel.getFieldHeight()/2);
}
if(position.getX() > Panel.getFieldWidth()/2 - width)
{
position.setLocation(Panel.getFieldWidth()/2-width, position.getY());
}
if(position.getY() > Panel.getFieldHeight()/2 - height)
{
position.setLocation(position.getX(), Panel.getFieldHeight()/2-height);
}
this.position = position;
}
public void setPosition(Point2D position, boolean b)
{
this.position = position;
setPosition(position);
}
public double getRotation()
+7 -19
View File
@@ -14,7 +14,6 @@ import java.util.ArrayList;
import javax.imageio.ImageIO;
import Applicatie.Panel;
import Applicatie.Waypoint;
/**
@@ -96,7 +95,7 @@ public class Path
}
return null;
}
/**
* Check if one of the lines contains the given point.
*
@@ -115,13 +114,12 @@ public class Path
}
return false;
}
public boolean intersectsRect(Rectangle2D rect)
{
for (Shape line : getPath())
for(Shape line : getPath())
{
if (line.intersects(rect))
if(line.intersects(rect))
{
return true;
}
@@ -146,23 +144,13 @@ public class Path
lines.add(stroke.createStrokedShape(line));
}
return lines;
}
public void addWaypoint(int i, Panel panel)
public void addWaypoint(Waypoint w)
{
for (Waypoint w : panel.getWaypoints())
{
if (w.getSelf() == i)
{
waypoints.add(w);
return;
}
}
waypoints.add(w);
}
/**
* Add a point to the path.
*
+1 -16
View File
@@ -2,16 +2,11 @@ package Objects;
import java.awt.geom.Point2D;
import Agenda.AgendaStage;
public class Stage extends DrawObject
{
AgendaStage stage;
public Stage(Point2D position, AgendaStage st)
public Stage(Point2D position)
{
super("stage", position);
stage = st;
}
@Override
@@ -20,14 +15,4 @@ public class Stage extends DrawObject
return "Stage";
}
public AgendaStage getStage()
{
return stage;
}
public void setStage(AgendaStage stage)
{
this.stage = stage;
}
}