AishaAli

Untitled

Nov 19th, 2019
94
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. @(#)ChopEllipseConnector.java 5.2
  3. */
  4.  
  5. package CH.ifa.draw.figures;
  6.  
  7. import java.awt.*;
  8. import CH.ifa.draw.framework.*;
  9. import CH.ifa.draw.standard.*;
  10. import CH.ifa.draw.util.Geom;
  11.  
  12. public class ChopEllipseConnector extends ChopBoxConnector {
  13.  
  14. private static final long serialVersionUID = -3165091511154766610L;
  15.  
  16. public ChopEllipseConnector() {
  17. }
  18.  
  19. public ChopEllipseConnector(Figure owner) {
  20. super(owner);
  21. }
  22.  
  23. protected Point chop(Figure target, Point from) {
  24. Rectangle r = target.displayBox();
  25. double angle = Geom.pointToAngle(r, from);
  26. return Geom.ovalAngleToPoint(r, angle);
  27. }
  28.  
  29.  
  30. public void action(Figure figure, BorderTool B_T) {
  31. B_T.drawing().replace(figure, new BorderDecorator(figure));
  32. }
  33.  
  34. }
RAW Paste Data