Package com.cburch.draw.actions

Examples of com.cburch.draw.actions.ModelAddAction


        CanvasModel model = canvas.getModel();
        Location[] ends = { start, end };
        List<Location> locs = UnmodifiableList.create(ends);
        add = attrs.applyTo(new Poly(false, locs));
        add.setValue(DrawAttr.PAINT_TYPE, DrawAttr.PAINT_STROKE);
        canvas.doAction(new ModelAddAction(model, add));
        repaintArea(canvas);
      }
      canvas.toolGestureComplete(this, add);
    }
  }
View Full Code Here


    mouseDown = false;
    if (state == CONTROL_DRAG) {
      if (c != null) {
        attrs.applyTo(c);
        CanvasModel model = canvas.getModel();
        canvas.doAction(new ModelAddAction(model, c));
        canvas.toolGestureComplete(this, c);
      }
      state = BEFORE_CREATION;
    }
    repaintArea(canvas);
View Full Code Here

        canvasAction = new ModelReorderAction(getModel(), mod);
      }
    }
   
    if (canvasAction instanceof ModelAddAction) {
      ModelAddAction addAction = (ModelAddAction) canvasAction;
      int cur = addAction.getDestinationIndex();
      int max = getMaxIndex(getModel());
      if (cur > max) {
        canvasAction = new ModelAddAction(getModel(),
            addAction.getObjects(), max + 1);
      }
    }
     
    proj.doAction(new CanvasActionAdapter(circuit, canvasAction));
  }
View Full Code Here

      if (locs.get(i).equals(locs.get(i + 1))) locs.remove(i);
    }
    if (locs.size() > 1) {
      CanvasModel model = canvas.getModel();
      add = new Poly(closed, locs);
      canvas.doAction(new ModelAddAction(model, add));
      repaintArea(canvas);
    }
    locs.clear();
    return add;
  }
View Full Code Here

      CanvasObject add = null;
      if (bds.getWidth() != 0 && bds.getHeight() != 0) {
        CanvasModel model = canvas.getModel();
        add = createShape(bds.getX(), bds.getY(),
            bds.getWidth(), bds.getHeight());
        canvas.doAction(new ModelAddAction(model, add));
        repaintArea(canvas, oldBounds.add(bds));
      }
      canvas.toolGestureComplete(this, add);
    }
  }
View Full Code Here

    cancelText(canvas);

    if (isNew) {
      if (!newText.equals("")) {
        cur.setText(newText);
        canvas.doAction(new ModelAddAction(canvas.getModel(), cur));
      }
    } else {
      String oldText = cur.getText();
      if (newText.equals("")) {
        canvas.doAction(new ModelRemoveAction(canvas.getModel(), cur));
View Full Code Here

        cancelText(canvas);

        if (isNew) {
            if (!newText.equals("")) {
                cur.setText(newText);
                canvas.doAction(new ModelAddAction(canvas.getModel(), cur));
            }
        } else {
            String oldText = cur.getText();
            if (newText.equals("")) {
                canvas.doAction(new ModelRemoveAction(canvas.getModel(), cur));
View Full Code Here

                CanvasModel model = canvas.getModel();
                Location[] ends = { start, end };
                List<Location> locs = UnmodifiableList.decorate(Arrays.asList(ends));
                add = attrs.applyTo(new Poly(false, locs));
                add.setValue(DrawAttr.PAINT_TYPE, DrawAttr.PAINT_STROKE);
                canvas.doAction(new ModelAddAction(model, add));
                repaintArea(canvas);
            }
            canvas.toolGestureComplete(this, add);
        }
    }
View Full Code Here

        mouseDown = false;
        if (state == CONTROL_DRAG) {
            if (c != null) {
                attrs.applyTo(c);
                CanvasModel model = canvas.getModel();
                canvas.doAction(new ModelAddAction(model, c));
                canvas.toolGestureComplete(this, c);
            }
            state = BEFORE_CREATION;
        }
        repaintArea(canvas);
View Full Code Here

        }
        if (locs.size() > 1) {
            CanvasModel model = canvas.getModel();
            add = new Poly(closed, locs);
            canvas.doAction(new ModelAddAction(model, add));
            repaintArea(canvas);
        }
        locs.clear();
        return add;
    }
View Full Code Here

TOP

Related Classes of com.cburch.draw.actions.ModelAddAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.