001 package nl.cwi.sen1.gui.plugin;
002
003 import java.awt.Rectangle;
004 import java.awt.Shape;
005 import java.awt.geom.AffineTransform;
006 import java.awt.geom.PathIterator;
007 import java.awt.geom.Point2D;
008 import java.awt.geom.Rectangle2D;
009
010 public class GraphCompositeShape implements Shape {
011 private Shape outer;
012 private Shape inner;
013
014 public GraphCompositeShape(Shape inner, Shape outer) {
015 this.inner = inner;
016 this.outer = outer;
017 }
018
019 public Shape getInnerShape() {
020 return inner;
021 }
022
023 public Shape getOuterShape() {
024 return outer;
025 }
026
027 public boolean contains(double x, double y) {
028 return outer.contains(x,y);
029 }
030
031 public boolean contains(double x, double y, double w, double h) {
032 return outer.contains(x,y,w,h);
033 }
034
035 public boolean intersects(double x, double y, double w, double h) {
036 return outer.intersects(x,y,w,h);
037 }
038
039 public Rectangle getBounds() {
040 return outer.getBounds();
041 }
042
043 public boolean contains(Point2D p) {
044 return outer.contains(p);
045 }
046
047 public Rectangle2D getBounds2D() {
048 return outer.getBounds2D();
049 }
050
051 public boolean contains(Rectangle2D r) {
052 return outer.contains(r);
053 }
054
055 public boolean intersects(Rectangle2D r) {
056 return outer.intersects(r);
057 }
058
059 public PathIterator getPathIterator(AffineTransform at) {
060 return outer.getPathIterator(at);
061 }
062
063 public PathIterator getPathIterator(AffineTransform at, double flatness) {
064 return outer.getPathIterator(at, flatness);
065 }
066
067 }