Examples of CanvasModel


Examples of com.cburch.draw.model.CanvasModel

            Bounds bds = computeBounds(canvas, e.getX(), e.getY(), e.getModifiersEx());
            currentBounds = Bounds.EMPTY_BOUNDS;
            active = false;
            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));
            }
View Full Code Here

Examples of com.cburch.draw.model.CanvasModel

        for (Map.Entry<AttributeSet, CanvasObject> ent : attrs.entries()) {
            AttributeMapKey key = new AttributeMapKey(attr, ent.getValue());
            oldVals.put(key, ent.getKey().getValue(attr));
            newVals.put(key, value);
        }
        CanvasModel model = canvas.getModel();
        canvas.doAction(new ModelChangeAttributeAction(model, oldVals, newVals));
    }
View Full Code Here

Examples of com.cburch.draw.model.CanvasModel

        this.listener = new Listener();
        this.oldPreferredSize = null;
        setSelection(new AppearanceSelection());
        setTool(selectTool);

        CanvasModel model = super.getModel();
        if (model != null) {
            model.addCanvasModelListener(listener);
        }

        grid.addPropertyChangeListener(GridPainter.ZOOM_PROPERTY, listener);
    }
View Full Code Here

Examples of com.cburch.draw.model.CanvasModel

        }
    }

    @Override
    public void setModel(CanvasModel value, ActionDispatcher dispatcher) {
        CanvasModel oldModel = super.getModel();
        if (oldModel != null) {
            oldModel.removeCanvasModelListener(listener);
        }
        super.setModel(value, dispatcher);
        if (value != null) {
            value.addCanvasModelListener(listener);
        }
View Full Code Here

Examples of com.cburch.draw.model.CanvasModel

    private AppearanceCanvas canvas;

    AppearanceEditHandler(AppearanceCanvas canvas) {
        this.canvas = canvas;
        canvas.getSelection().addSelectionListener(this);
        CanvasModel model = canvas.getModel();
        if (model != null) {
            model.addCanvasModelListener(this);
        }

        canvas.addPropertyChangeListener(Canvas.MODEL_PROPERTY, this);
    }
View Full Code Here

Examples of com.cburch.draw.model.CanvasModel

    @Override
    public void propertyChange(PropertyChangeEvent e) {
        String prop = e.getPropertyName();
        if (prop.equals(Canvas.MODEL_PROPERTY)) {
            CanvasModel oldModel = (CanvasModel) e.getOldValue();
            if (oldModel != null) {
                oldModel.removeCanvasModelListener(this);
            }
            CanvasModel newModel = (CanvasModel) e.getNewValue();
            if (newModel != null) {
                newModel.addCanvasModelListener(this);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.