Package com.lightcrafts.utils

Examples of com.lightcrafts.utils.ColorProfileInfo


        if ( temp == null )
            return null;
        final Collection<ColorProfileInfo> result =
            new ArrayList<ColorProfileInfo>();
        for ( int i = 0; i < temp.length - 1; i += 2 )
            result.add( new ColorProfileInfo( temp[i], temp[i+1] ) );
        return result;
    }
View Full Code Here


        for ( File file : files ) {
            final String path = file.getAbsolutePath();
            try {
                final ICC_Profile profile = ICC_Profile.getInstance( path );
                final String name = ColorProfileInfo.getNameOf( profile );
                m_profiles.add( new ColorProfileInfo( name, path ) );
            }
            catch ( IOException e ) {
                // Trouble reading the file
                System.err.println(
                    "Can't read a color profile from " + path + ": "
View Full Code Here

            // OK, color profile is optional.
        }
        if (profileNode != null) {
            String profileName = profileNode.getAttribute(ProfileNameTag);
            String profilePath = profileNode.getAttribute(ProfilePathTag);
            profile = new ColorProfileInfo(profileName, profilePath);
        }
        XmlNode pageNode = root.getChild(PageTag);
        restorePageFormat(pageNode);

        XmlNode imageRectNode = root.getChild(ImageRectTag);
View Full Code Here

        titlePanel.add(Box.createVerticalStrut(3));
        addRenderingIntent();

        // Initialize the color handling last, because changes here can trigger
        // updates in the other controls:
        ColorProfileInfo profile = model.getColorProfileInfo();
        Object selected =
            (profile != null) ? APPLICATION_COLORS : PRINTER_COLORS;
        colorHandling.setSelectedItem(selected);

        setLayout(new BorderLayout());
View Full Code Here

                        if (e.getItem() == APPLICATION_COLORS) {
                            renderingIntent.setEnabled(true);
                            printerProfile.setEnabled(true);
//                            blackPointCompensation.setEnabled(true);

                            ColorProfileInfo cpi = null;
                            Object stuff = printerProfile.getSelectedItem();
                            if (stuff instanceof ColorProfileInfo) {
                                cpi = (ColorProfileInfo) stuff;
                            }
                            model.setColorProfile(cpi);
View Full Code Here

            ColorProfileInfo.arrangeForMenu(PrinterProfiles);
        for (ColorProfileInfo profile : profiles) {
            printerProfile.addItem(profile);
        }
        // Initialize the printerProfile selection from the model:
        ColorProfileInfo initProfile = model.getColorProfileInfo();
        if (initProfile != null) {
            for (ColorProfileInfo profile : profiles) {
                if (profile != null) {
                    // Don't require strict equality for ColorProfileInfo's.
                    // Just ask that the names match:
                    if (profile.getName().equals(initProfile.getName())) {
                        printerProfile.setSelectedItem(profile);
                    }
                }
            }
        }
        // Avoid scroll bars in menus, even if some items may not be accessible:
        printerProfile.setMaximumRowCount(25);

        Box box = createLabelCombo(LOCALE.get("ProfileLabel"), printerProfile);
        titlePanel.add(box);

        printerProfile.addItemListener(
            new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        final ColorProfileInfo cpi =
                            (ColorProfileInfo)printerProfile.getSelectedItem();
                        model.setColorProfile(cpi);
                    }
                }
            }
View Full Code Here

        printerProfile.addItemListener(
            new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        ColorProfileInfo cpi =
                            (ColorProfileInfo) printerProfile.getSelectedItem();
                        ICC_Profile profile = cpi.getICCProfile();
                        settings.setColorProfile(profile);
                        engine.preview(settings);
                        Prefs.put(ProofProfileKey, cpi.getName());
                    }
                }
            }
        );
    }
View Full Code Here

            else if (file.isFile()) {
                String path = file.getAbsolutePath();
                try {
                    ICC_Profile profile = ICC_Profile.getInstance(path);
                    String name = ColorProfileInfo.getNameOf(profile);
                    ColorProfileInfo info = new ColorProfileInfo(name, path);
                    profiles.add(info);
                }
                catch (IOException e) {
                    // Trouble reading the file
                    String message = e.getMessage();
View Full Code Here

TOP

Related Classes of com.lightcrafts.utils.ColorProfileInfo

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.