Exemplo n.º 1
0
 public void invokeStep(int x, int y, int anchorX, int anchorY, DrawingView view) {
   int dx = x - anchorX;
   int dy = y - anchorY;
   RoundRectangleFigure owner = (RoundRectangleFigure) owner();
   Rectangle r = owner.displayBox();
   Point originalRadius = ((RadiusHandle.UndoActivity) getUndoActivity()).getOldRadius();
   int rx = Geom.range(0, r.width, 2 * (originalRadius.x / 2 + dx));
   int ry = Geom.range(0, r.height, 2 * (originalRadius.y / 2 + dy));
   owner.setArc(rx, ry);
 }
Exemplo n.º 2
0
 protected boolean resetRadius() {
   FigureEnumeration fe = getAffectedFigures();
   if (!fe.hasMoreElements()) {
     return false;
   }
   RoundRectangleFigure currentFigure = (RoundRectangleFigure) fe.nextFigure();
   Point figureRadius = currentFigure.getArc();
   currentFigure.setArc(getOldRadius().x, getOldRadius().y);
   setOldRadius(figureRadius);
   return true;
 }
Exemplo n.º 3
0
 public Point locate() {
   RoundRectangleFigure owner = (RoundRectangleFigure) owner();
   Point radius = owner.getArc();
   Rectangle r = owner.displayBox();
   return new Point(r.x + radius.x / 2 + OFFSET, r.y + radius.y / 2 + OFFSET);
 }