1 19 package org.openharmonise.workfloweditor.flowchart.shapes; 20 21 import java.awt.BasicStroke ; 22 import java.awt.Color ; 23 import java.awt.Graphics2D ; 24 import java.awt.geom.Rectangle2D ; 25 26 34 public class ConnectionPoint extends AbstractWorkflowShape { 35 36 42 public ConnectionPoint(float x, float y) { 43 super(x, y); 44 } 45 46 49 public void drawSelf(Graphics2D g) { 50 g.setStroke(new BasicStroke (2)); 51 g.setPaint(new Color (181,12,0)); 52 g.draw( this.getRect() ); 53 } 54 55 60 private Rectangle2D.Float getRect() { 61 return new Rectangle2D.Float (this.getX()-5, this.getY()-5, 10, 10); 62 } 63 64 71 public boolean contains(double x, double y) { 72 return this.getRect().contains(x, y); 73 } 74 75 } 76 | Popular Tags |