Commit 39e79fcb authored by Nico Mack's avatar Nico Mack

Implemented clone interface for Marker

Added method to Bounds2D class
parent fc01bb9b
...@@ -23,7 +23,7 @@ import java.util.Objects; ...@@ -23,7 +23,7 @@ import java.util.Objects;
// * Class Definition and Members * // * Class Definition and Members *
// *************************************************************************** // ***************************************************************************
public abstract class Marker implements Positionable { public abstract class Marker implements Positionable, Cloneable {
/** The name given to this marker. */ /** The name given to this marker. */
protected String name; protected String name;
...@@ -345,4 +345,8 @@ public abstract class Marker implements Positionable { ...@@ -345,4 +345,8 @@ public abstract class Marker implements Positionable {
return comparison; return comparison;
} }
// ---------------------------------------------------------------------------
@Override
public abstract Marker clone();
} }
...@@ -281,6 +281,12 @@ public class ModalMarker extends TetherableMarker { ...@@ -281,6 +281,12 @@ public class ModalMarker extends TetherableMarker {
return coronaBundles.get(bundle); return coronaBundles.get(bundle);
} }
// ---------------------------------------------------------------------------
public ModalMarker clone() {
return new ModalMarker(this);
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// *************************************************************************** // ***************************************************************************
// * End of Class * // * End of Class *
......
...@@ -47,6 +47,10 @@ public class Bounds2D { ...@@ -47,6 +47,10 @@ public class Bounds2D {
} }
public boolean includes(Point candidate) {
return includes(candidate.x, candidate.y);
}
public Bounds2D translate(double x, double y) { public Bounds2D translate(double x, double y) {
double tx1 = x1 + x; double tx1 = x1 + x;
double tx2 = x2 + x; double tx2 = x2 + x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment