Package com.lightcrafts.model

Examples of com.lightcrafts.model.Scale


            x.getValue(), y.getValue(), width.getValue(), height.getValue()
        );
        double radians = angle.getValue() * Math.PI / 180;
        CropBounds bounds = new CropBounds(rect, radians);

        Scale scale = new Scale(zoom.getValue() / 10f);

        for (Iterator i=listeners.iterator(); i.hasNext(); ) {
            Listener listener = (Listener) i.next();
            listener.cropBoundsChanged(bounds, scale, isChanging);
        }
View Full Code Here


    private LinkedList<ScaleListener> listeners;

    /** Construct a ScaleModel with the Scale set to 1:1.
     */
    ScaleModel(Engine engine) {
        this(engine, new Scale(1, 1));
    }
View Full Code Here

    public void removeScaleListener(ScaleListener listener) {
        listeners.remove(listener);
    }

    private void notifyListeners() {
        Scale scale = getCurrentScale();
        for (ScaleListener listener : listeners) {
            listener.scaleChanged(scale);
        }
    }
View Full Code Here

            listener.scaleChanged(scale);
        }
    }

    public boolean scaleUp() {
        Scale scale = getNextScaleUp();
        return setScale(scale);
    }
View Full Code Here

        Scale scale = getNextScaleUp();
        return setScale(scale);
    }

    public boolean scaleDown() {
        Scale scale = getNextScaleDown();
        return setScale(scale);
    }
View Full Code Here

        Scale scale = getNextScaleDown();
        return setScale(scale);
    }

    boolean scaleBy(float percent) {
        Scale scale = getCurrentScale();
        float factor = scale.getFactor();
        factor *= percent;
        scale = new Scale(factor);
        return setScale(scale);
    }
View Full Code Here

        scale = new Scale(factor);
        return setScale(scale);
    }

    private Scale getNextScaleUp() {
        Scale current = getCurrentScale();
        for (Scale next : scales) {
            if (next.compareTo(current) > 0) {
                return next;
            }
        }
View Full Code Here

        }
        return null;
    }

    private Scale getNextScaleDown() {
        Scale current = getCurrentScale();
        for (int n=scales.size()-1; n>= 0; n--) {
            Scale next = scales.get(n);
            if (next.compareTo(current) < 0) {
                return next;
            }
        }
        return null;
    }
View Full Code Here

        return getNextScaleDown() != null;
    }

    private int getIndexOf(Scale scale) {
        for (int n=0; n<scales.size(); n++) {
            Scale s = scales.get(n);
            if (s.equals(scale)) {
                return n;
            }
        }
        return -1;
    }
View Full Code Here

        regions = new RegionManager();
        crop = new CropRotateManager(engine, xform);

        scale = new ScaleModel(engine);
        XmlNode scaleNode = root.getChild(ScaleTag);
        Scale s = new Scale(scaleNode);
        scale.setScale(s);

        editor = new Editor(engine, scale, xform, regions, crop, this);
        editor.showWait(LOCALE.get("EditorWaitText"));
        crop.setEditor( editor );
View Full Code Here

TOP

Related Classes of com.lightcrafts.model.Scale

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.