Advertisement
AishaAli

Untitled

Nov 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1.  
  2. /*
  3. @(#)ChopEllipseConnector.java 5.2
  4. */
  5.  
  6. package CH.ifa.draw.figures;
  7.  
  8. import java.awt.*;
  9. import CH.ifa.draw.framework.*;
  10. import CH.ifa.draw.standard.*;
  11. import CH.ifa.draw.util.Geom;
  12.  
  13. public class ChopEllipseConnector extends ChopBoxConnector {
  14.  
  15. private static final long serialVersionUID = -3165091511154766610L;
  16.  
  17. public ChopEllipseConnector() {
  18. }
  19.  
  20. public ChopEllipseConnector(Figure owner) {
  21. super(owner);
  22. }
  23.  
  24. protected Point chop(Figure target, Point from) {
  25. Rectangle r = target.displayBox();
  26. double angle = Geom.pointToAngle(r, from);
  27. return Geom.ovalAngleToPoint(r, angle);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement