Fixed stuff

This commit is contained in:
2015-04-08 20:57:06 +02:00
parent d0baf5673f
commit c3973cc4e4
20 changed files with 519 additions and 189 deletions
+1
View File
@@ -256,6 +256,7 @@ public abstract class DrawObject implements Serializable
setPosition(position);
}
public double getRotation()
{
return rotation;
+19 -7
View File
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import javax.imageio.ImageIO;
import Applicatie.Panel;
import Applicatie.Waypoint;
/**
@@ -95,7 +96,7 @@ public class Path
}
return null;
}
/**
* Check if one of the lines contains the given point.
*
@@ -114,12 +115,13 @@ 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;
}
@@ -144,13 +146,23 @@ public class Path
lines.add(stroke.createStrokedShape(line));
}
return lines;
}
public void addWaypoint(Waypoint w)
public void addWaypoint(int i, Panel panel)
{
waypoints.add(w);
for (Waypoint w : panel.getWaypoints())
{
if (w.getSelf() == i)
{
waypoints.add(w);
return;
}
}
}
/**
* Add a point to the path.
*
+16 -1
View File
@@ -2,11 +2,16 @@ package Objects;
import java.awt.geom.Point2D;
import Agenda.AgendaStage;
public class Stage extends DrawObject
{
public Stage(Point2D position)
AgendaStage stage;
public Stage(Point2D position, AgendaStage st)
{
super("stage", position);
stage = st;
}
@Override
@@ -15,4 +20,14 @@ public class Stage extends DrawObject
return "Stage";
}
public AgendaStage getStage()
{
return stage;
}
public void setStage(AgendaStage stage)
{
this.stage = stage;
}
}