Package simtools.shapes.undo

Examples of simtools.shapes.undo.PropertyChangeEdit


    if(props!=null){
      // Set local properties
      for(int j=0; j<props.length; j++) {
        String pname=props[j];
        Object value=properties.getPropertyValue(pname);
        ce.addEdit(new PropertyChangeEdit(this, pname, getPropertyValue(pname),value));
        setPropertyValue(pname, value);
        res=true;
      }
    }
   
View Full Code Here


            // Notify changes
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();
            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
            }
View Full Code Here

           
            // Notify changes
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();
            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
            }
            return true;
        }
        if (action.startsWith(resources.getString("Font"))) {
            // Save old params
            CompoundEdit ce = new CompoundEdit();
            HashMap oldValues = new HashMap();
            oldValues.put("FONT", currentFont);
            // Make changes
            fontName = action.substring(resources.getString("Font").length() + 1);
            updateFont();
            Rectangle bounds = getBounds();
            fitBounds();
            // Notify changes
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();
            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
            }
            // Repaint
            bounds.add(getBounds());
            notifyChange(bounds);
            return true;
        }
        if (action.startsWith(resources.getString("Body"))) {
            // Save old params
            CompoundEdit ce = new CompoundEdit();
            HashMap oldValues = new HashMap();
            oldValues.put("FONT", currentFont);
            // Make changes
            fontSize = new Integer(action.substring(resources.getString("Body").length() + 1)).intValue();
            updateFont();
            Rectangle bounds = getBounds();
            fitBounds();
            // Notify changes
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();
            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
            }
           
            // Repaint
            bounds.add(getBounds());
            notifyChange(bounds);
            return true;
        }
        if (action.equals(resources.getString("AdjustSize"))) {
            CompoundEdit ce = new CompoundEdit();
            HashMap oldValues = new HashMap();
            oldValues.put("WIDTH", getPropertyValue("WIDTH"));
            oldValues.put("HEIGHT", getPropertyValue("HEIGHT"));
            Rectangle bounds = getBounds();
            fitBounds();
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();
            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
            }
View Full Code Here

            // Notify changes
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();
            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
            }
View Full Code Here

            setPropertyValue("TRANSFORM", transform);
            // Notify changes
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();

            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
            }
        } else if (action.equals(resources.getString("rotation") + ";" + resources.getString("leftRotation"))) {
            // Save old params
            CompoundEdit ce = new CompoundEdit();
            HashMap oldValues = new HashMap();
            oldValues.put("TRANSFORM", getPropertyValue("TRANSFORM"));
            // Make changes
            if (transform == null) {
                transform = new AffineTransformData(this);
            }
            transform.rotEnabled = true;
            transform.rotValue = ((transform.rotValue * transform.angleUnitScale) - Math.PI / 2)
            / transform.angleUnitScale;
            setPropertyValue("TRANSFORM", transform);
            // Notify changes
            Iterator it = oldValues.keySet().iterator();
            while (it.hasNext()) {
                String n = (String) it.next();
                ce.addEdit(new PropertyChangeEdit(this, n, oldValues.get(n), getPropertyValue(n)));
            }
            ce.end();
           
            if (undoableEdit != null) {
                undoableEdit.addEdit(ce);
View Full Code Here

        public PlotCompoundEdit(HashMap oldValues){
            Iterator it=oldValues.keySet().iterator();
            while(it.hasNext()){
                String n=(String)it.next();
                addEdit(new PropertyChangeEdit(Plot.this, n, oldValues.get(n),getPropertyValue(n)));
            }
            end();
        }
View Full Code Here

TOP

Related Classes of simtools.shapes.undo.PropertyChangeEdit

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.