1 19 package org.openharmonise.workfloweditor.flowchart.shapes; 20 21 import java.awt.*; 22 import java.awt.geom.*; 23 24 31 public class LineSelectionPoint extends AbstractWorkflowShape { 32 33 34 39 public LineSelectionPoint(Point2D.Double control) { 40 super(new Double (control.x).floatValue(), new Double (control.y).floatValue()); 41 } 42 43 46 public void drawSelf(Graphics2D g) { 47 g.setPaint(Color.GRAY); 48 g.setStroke(new BasicStroke(2)); 49 50 Rectangle2D.Float rect = new Rectangle2D.Float(this.getX()-6, this.getY()-6, 12, 12); 51 g.setPaint(Color.LIGHT_GRAY); 52 g.fill(rect); 53 g.setPaint(Color.BLACK); 54 g.draw(rect); 55 56 Line2D.Float line = new Line2D.Float(this.getX()-2, this.getY()-2, this.getX()+2, this.getY()+2); 57 g.draw(line); 58 59 line = new Line2D.Float(this.getX()-2, this.getY()+2, this.getX()+2, this.getY()-2); 60 g.draw(line); 61 } 62 63 68 public Point2D.Double getControl() { 69 return new Point2D.Double(this.getX(), this.getY()); 70 } 71 72 79 public boolean contains(double x, double y) { 80 return new Rectangle2D.Float(this.getX()-6, this.getY()-6, 12, 12).contains(x, y); 81 } 82 83 86 public void setX(float x) { 87 super.setX(x); 88 } 89 90 93 public void setY(float y) { 94 super.setY(y); 95 } 96 97 } 98 | Popular Tags |