Package com.lightcrafts.image.export

Examples of com.lightcrafts.image.export.ImageExportOptions


        final OtherApplication app = (OtherApplication) doc.getSource();
        final ImageInfo info = getImageInfo(doc);
        final Engine engine = doc.getEngine();
        final Dimension size = engine.getNaturalSize();
        try {
            final ImageExportOptions export =
                app.createExportOptions(info, size);
            if (export != null) {
                final SaveOptions options = getSaveOptions(export);
                options.setShouldSaveDirectly( true );
                return options;
View Full Code Here


        setLayout(new BorderLayout());

        // Initialize all the image type filters:
        for (ExportComboItem filter : filters) {
            ImageExportOptions filterOptions = filter.getExportOptions();
            ImageType filterType = filterOptions.getImageType();
            if (defaultType.equals(filterType)) {
                // For the default filter, use the default options:
                filter = new ExportComboItem(options);
                defaultItem = filter;
            }
        }
        // Add the default filter first, so that other filters will inherit
        // its settings according to ExportLogic.mergeExportOptions().
        if (defaultItem != null) {
            combo.addItem(defaultItem);
        }
        for (ExportComboItem filter : filters) {
            ImageExportOptions filterOptions = filter.getExportOptions();
            ImageType filterType = filterOptions.getImageType();
            if (! defaultType.equals(filterType)) {
                combo.addItem(filter);
            }
        }
        if (defaultItem != null) {
View Full Code Here

        combo.setMaximumSize(combo.getPreferredSize());
    }

    public ImageExportOptions getSelectedExportOptions() {
        ExportComboItem filter = (ExportComboItem) combo.getSelectedItem();
        ImageExportOptions options = filter.getExportOptions();
        return options;
    }
View Full Code Here

        if (event.getStateChange() == ItemEvent.SELECTED) {
            ExportComboItem newFilter =
                (ExportComboItem) combo.getSelectedItem();

            // The oldFilter may be null, first time an ExportComboItem is set.
            ImageExportOptions newOptions = newFilter.getExportOptions();
            if (oldFilter != null) {
                ImageExportOptions oldOptions = oldFilter.getExportOptions();
                ExportLogic.mergeExportOptions(oldOptions, newOptions);
            }
            ExportControls ctrls = new ExportControls(newOptions, textResize);
            toggle = new ExportCtrlToggle(ctrls, window);
View Full Code Here

    // Explanatory text
    private HelpArea help;

    SavePrefsPanel() {
        SaveOptions options = SaveOptions.getDefaultSaveOptions();
        ImageExportOptions export = SaveOptions.getExportOptions(options);

        List<ExportComboItem> filters = getExportAllComboItems();
        ImageType defaultType =
            SaveOptions.getExportOptions(options).getImageType();

        typeCombo = new JComboBox();
        ExportComboItem defaultItem = null;
        for (ExportComboItem filter : filters) {
            ImageExportOptions filterOptions = filter.getExportOptions();
            ImageType filterType = filterOptions.getImageType();
            if (defaultType.equals(filterType)) {
                // For the default filter, use the default options:
                filter = new ExportComboItem(export);
                defaultItem = filter;
            }
View Full Code Here

        add(help);
    }

    void commit() {
        ExportComboItem item = (ExportComboItem) typeCombo.getSelectedItem();
        ImageExportOptions export = item.exportOptions;
        SaveOptions options;
        if (export.getImageType() == TIFFImageType.INSTANCE) {
            options = SaveOptions.createSidecarTiff(export);
        }
        else {
            options = SaveOptions.createSidecarJpeg(export);
        }
View Full Code Here

        if (event.getStateChange() == ItemEvent.SELECTED) {
            ExportComboItem exportComboItem =
                (ExportComboItem) typeCombo.getSelectedItem();

            // The otherComboItem may be null, the first time this is called.
            ImageExportOptions newOptions = exportComboItem.getExportOptions();
            if (otherComboItem != null) {
                ImageExportOptions oldOptions = otherComboItem.getExportOptions();
                ExportLogic.mergeExportOptions(oldOptions, newOptions);
            }
            removeAll();

            ctrls = new ExportControls(newOptions, false);
View Full Code Here

    public boolean shouldSaveDirectly() {
        return options.m_shouldSaveDirectly;
    }

    public void updateSize(Dimension size) {
        ImageExportOptions export = getExportOptions(this);
        if (export != null) {
            ExportLogic.maybeUpdateSize(export, size);
        }
    }
View Full Code Here

            saveMarker(node);
            export.write(node);
        }

        static SidecarTiff restore(XmlNode node) throws XMLException {
            ImageExportOptions export = ImageExportOptions.read(node);
            SidecarTiff tiff = new SidecarTiff(export);
            tiff.verifyMarker(node);
            return tiff;
        }
View Full Code Here

TOP

Related Classes of com.lightcrafts.image.export.ImageExportOptions

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.