1 19 package org.openharmonise.workfloweditor.flowchart.shapes; 20 21 import java.awt.Graphics2D ; 22 import java.awt.geom.Point2D ; 23 24 32 public abstract class AbstractMoveableShape extends AbstractWorkflowShape { 33 34 37 private ControlPoint m_control = null; 38 39 45 public AbstractMoveableShape(float x, float y) { 46 super(x, y); 47 } 48 49 57 protected void setMoveControl(Point2D.Double control, int nWidth, int nHeight) { 58 m_control = new ControlPoint(control, nWidth, nHeight); 59 } 60 61 64 public void draw(Graphics2D g) { 65 super.draw(g); 66 if(this.m_control!=null) { 67 this.m_control.draw(g); 68 } 69 } 70 71 79 public boolean controlPointContains(double x, double y) { 80 return this.m_control.contains(x, y); 81 } 82 83 86 public void setX(float x) { 87 super.setX(x); 88 this.m_control.setX(x); 89 } 90 91 94 public void setY(float y) { 95 super.setY(y); 96 this.m_control.setY(y); 97 } 98 99 } 100 | Popular Tags |