Package com.lightcrafts.ui.mode

Examples of com.lightcrafts.ui.mode.Mode


        ModeOverlay overlay = new ModeOverlay(panel);

        CenteringScrollPane scroll = new CenteringScrollPane(overlay);

        Mode mode = new ScrollMode(scroll);

        overlay.pushMode(mode);

        overlay.addMouseWheelListener(
            new MouseWheelListener() {
View Full Code Here


        while (isControlModeActive() || isTransientPanModeActive()) {
            overlay.popMode();
            controlMode = null;
        }
        // See if that did the trick, to avoid duplicate pushes.
        Mode oldMode = overlay.peekMode();
        if (oldMode == newMode) {
            return;
        }
        // If the current Mode is one of ours, pop it before pushing the next:
        if (oldMode == regionMode ||
            oldMode == cropMode ||
            oldMode == rotateMode) {
            // If we are in region mode make sure we exit edit mode
            if (oldMode == regionMode && regionMode instanceof RegionOverlay)
                ((RegionOverlay) regionMode).finishEditingCurve();

            overlay.popMode();

            // The CropModes need setup and teardown:
            if ((oldMode == cropMode) || (oldMode == rotateMode)) {
                CropMode crop = (CropMode) oldMode;
                crop.doCrop();
            }
            oldMode.exit();
        }
        if (newMode != null) {
            overlay.pushMode(newMode);
            newMode.enter();
        }
View Full Code Here

TOP

Related Classes of com.lightcrafts.ui.mode.Mode

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.