Package com.lightcrafts.ui.editor

Examples of com.lightcrafts.ui.editor.Document$MissingImageFileException


        add(emptyItem);
    }

    void update() {
        ComboFrame frame = getComboFrame();
        Document newDoc = (frame != null) ? frame.getDocument() : null;
        Document oldDoc = docRef.get();

        if (newDoc != oldDoc) {
            removeAll();

            JMenuItem proofItem = (JMenuItem) get("proof");
View Full Code Here


    RotateRightMenuItem(ComboFrame frame) {
        super(frame, "Right");
    }

    Action getDocumentAction() {
        Document doc = getDocument();
        if (doc != null) {
            return doc.getRotateRightAction();
        }
        else {
            return null;
        }
    }
View Full Code Here

    ShowInMenuItem(ComboFrame frame) {
        super(frame, "ShowIn");
    }

    public void actionPerformed(ActionEvent event) {
        Document doc = getDocument();
        File file = doc.getFile();
        if (file == null) {
            file = doc.getMetadata().getFile();
        }
        Platform platform = Platform.getPlatform();
        String path = file.getAbsolutePath();
        platform.showFileInFolder(path);
    }
View Full Code Here

    UndoMenuItem(ComboFrame frame) {
        super(frame, "Undo");
    }

    Action getDocumentAction() {
        Document doc = getDocument();
        if (doc != null) {
            return doc.getUndoAction();
        }
        else {
            return null;
        }
    }
View Full Code Here

        // The frame may be null on the Mac, when there is no active window.
        if (frame != null) {
            // Hold a hard reference to the current Document, so all the weak
            // references in UpdatableMenuItems will be valid until this reference
            // is nulled.
            Document doc = frame.getDocument();
            put("document", doc);
        }
    }
View Full Code Here

        }
        // Now that the UpdatableMenuItems have updated, it's OK for the
        // last Document to get GC'd.
        ComboFrame frame = getComboFrame();
        if (frame != null) {
            Document doc = frame.getDocument();
            put("document", doc);
        }
        else {
            put("document", null);
        }
View Full Code Here

    ShowHideRegionsMenuItem(ComboFrame frame) {
        super(frame, "ShowHideRegions");
    }

    Action getDocumentAction() {
        final Document doc = getDocument();
        if (doc != null) {
            Action action = new ToggleAction(HideRegionsText, ShowRegionsText) {
                protected void onActionPerformed(ActionEvent event) {
                    EditorMode mode = doc.getEditor().getMode();
                    if (mode != EditorMode.REGION) {
                        doc.getEditor().setMode(EditorMode.REGION);
                    }
                    else {
                        // We're out of phase with the ModeManager--
                        // toggle the mode anyway, but leave properties fixed.
                        doc.getEditor().setMode(EditorMode.ARROW);
                        EventQueue.invokeLater(
                            new Runnable() {
                                public void run() {
                                    setState(false);
                                }
                            }
                        );
                    }
                }
                protected void offActionPerformed(ActionEvent event) {
                    EditorMode mode = doc.getEditor().getMode();
                    if (mode == EditorMode.REGION) {
                        doc.getEditor().setMode(EditorMode.ARROW);
                    }
                    else {
                        // We're out of phase with the ModeManager--
                        // toggle the mode anyway, but leave properties fixed.
                        doc.getEditor().setMode(EditorMode.REGION);
                        EventQueue.invokeLater(
                            new Runnable() {
                                public void run() {
                                    setState(true);
                                }
View Full Code Here

        );
    }

    void updateButton() {
        ComboFrame frame = getComboFrame();
        Document newDoc = frame.getDocument();
        if (newDoc == doc) {
            return;
        }
        if (doc != null) {
            Action action = doc.getRedoAction();
View Full Code Here

        super(frame, "ZoomOut");
        setEnabled(false);
    }

    void update() {
        Document newDoc = getDocument();
        Document oldDoc = docRef.get();
        if (newDoc != oldDoc) {
            if (oldDoc != null) {
                ScaleModel model = oldDoc.getScaleModel();
                model.removeScaleListener(this);
            }
            if (newDoc != null) {
                ScaleModel model = newDoc.getScaleModel();
                model.addScaleListener(this);
View Full Code Here

                File file = files[n];

                Image.setCachedFile(file);

                logStart(file);
                Document doc = Application.createDocumentHeadless(file);
                File outFile;
                String outName;

                // Enforce the original requested output dimensions, since
                // the ImageExportOptions may have been mutated on a previous
                // iteration.
                export.resizeWidth.setValue(exportWidth);
                export.resizeHeight.setValue(exportHeight);

                if (template != null) {
                    XmlNode root = template.getRoot();

                    doc.applyTemplate(root);

                    SaveOptions save = doc.getSaveOptions();
                    if (save == null) {
                        save = createTemplateSaveOptions(doc, export, ignoreResize);
                    }
                    doc.setSaveOptions(save);

                    ComboFrame frame = (ComboFrame) Dialog.getOwner();
                    DocumentWriter.save(doc, frame, false, Progress);
                    outFile = save.getFile();
                    outName = outFile.getName();
                    DocumentDatabase.addDocumentFile(outFile);
                } else {
                    conformExportOptions(doc, conf, ignoreResize);

                    Engine engine = doc.getEngine();
                    DocumentWriter.export(engine, export, Progress);
                    outFile = export.getExportFile();
                    outName = outFile.getName();
                }

                doc.dispose();

                logEnd(LOCALE.get("BatchLogSavedMessage", outName));

                Image.setFile(outFile);
View Full Code Here

TOP

Related Classes of com.lightcrafts.ui.editor.Document$MissingImageFileException

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.