Back to index

moin  1.9.0~rc2
ChopEllipseConnector.java
Go to the documentation of this file.
00001 /*
00002  * @(#)ChopEllipseConnector.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.figures;
00007 
00008 import java.awt.*;
00009 import CH.ifa.draw.framework.*;
00010 import CH.ifa.draw.standard.*;
00011 import CH.ifa.draw.util.Geom;
00012 
00018 public class ChopEllipseConnector extends ChopBoxConnector {
00019 
00020     /*
00021      * Serialization support.
00022      */
00023     private static final long serialVersionUID = -3165091511154766610L;
00024 
00025     public ChopEllipseConnector() {
00026     }
00027 
00028     public ChopEllipseConnector(Figure owner) {
00029         super(owner);
00030     }
00031 
00032     protected Point chop(Figure target, Point from) {
00033         Rectangle r = target.displayBox();
00034         double angle = Geom.pointToAngle(r, from);
00035            return Geom.ovalAngleToPoint(r, angle);
00036     }
00037 }
00038