<commit_before>/* Copyright (C) 2005-2011 <NAME> */

package com.lightcrafts.platform.macosx;

import java.awt.color.ICC_Profile;
import java.io.File;
import java.io.InputStream;
import java.io.IOException;
import java.util.*;
import javax.swing.filechooser.FileSystemView;
import javax.swing.*;

import ch.randelshofer.quaqua.panther.filechooser.PantherFileSystemView;
import ch.randelshofer.quaqua.QuaquaLookAndFeel;

import com.lightcrafts.platform.*;
import com.lightcrafts.utils.ColorProfileInfo;
import com.lightcrafts.utils.file.FileUtil;
import com.lightcrafts.utils.Version;

import static com.lightcrafts.platform.macosx.MacOSXColorProfileManager.*;
import com.lightcrafts.ui.LightZoneSkin;

/**
 * <code>MacOSXPlatform</code> is-a {@link Platform} for Mac&nbsp;OS;&nbsp;X.
 */
public final class MacOSXPlatform extends Platform {

    public void bringAppToFront( String appName ) {
        AppleScript.bringAppToFront( appName );
    }

    public AlertDialog getAlertDialog() {
        return DefaultAlertDialog.INSTANCE; // new MacOSXAlertDialog();
    }

    public ICC_Profile getDisplayProfile() {
        try {
            final String path =
                MacOSXColorProfileManager.getSystemDisplayProfilePath();
            final InputStream in = new File( path ).toURL().openStream();
            return ICC_Profile.getInstance( in );
        }
        catch ( IOException e ) {
            return null;
        }
    }

    public File getDefaultImageDirectory() {
        final String home = System.getProperty( "user.home" );
        return new File( home, "Pictures" );
    }

    public synchronized Collection<ColorProfileInfo> getExportProfiles() {
        if ( m_exportProfiles == null ) {
            final Collection<ColorProfileInfo> colorspaceProfiles =
                MacOSXColorProfileManager.getProfilesFor( CM_COLORSPACE_CLASS );
            final Collection<ColorProfileInfo> displayProfiles =
                MacOSXColorProfileManager.getProfilesFor( CM_DISPLAY_CLASS );
            final Collection<ColorProfileInfo> outputProfiles =
                MacOSXColorProfileManager.getProfilesFor( CM_OUTPUT_CLASS );

            m_exportProfiles = new ArrayList<ColorProfileInfo>();

            if ( colorspaceProfiles != null )
                m_exportProfiles.addAll( colorspaceProfiles );
            if ( displayProfiles != null )
                m_exportProfiles.addAll( displayProfiles );
            if ( outputProfiles != null )
                m_exportProfiles.addAll( outputProfiles );

            if ( m_exportProfiles.isEmpty() )
                m_exportProfiles = null;
            else
                m_exportProfiles =
                    Collections.unmodifiableCollection( m_exportProfiles );
        }
        return m_exportProfiles;
    }

    public FileChooser getFileChooser() {
        return MacOSXFileChooser.getFileChooser();
    }

    public FileSystemView getFileSystemView() {
        return PantherFileSystemView.getQuaquaFileSystemView();
    }

    public File getLightZoneDocumentsDirectory() {<commit_msg>MacOSX - Changed a class name for newer Quaqua<commit_after>/* Copyright (C) 2005-2011 <NAME> */

package com.lightcrafts.platform.macosx;

import java.awt.color.ICC_Profile;
import java.io.File;
import java.io.InputStream;
import java.io.IOException;
import java.util.*;
import javax.swing.filechooser.FileSystemView;
import javax.swing.*;

import ch.randelshofer.quaqua.panther.filechooser.OSXPantherFileSystemView;
import ch.randelshofer.quaqua.QuaquaLookAndFeel;

import com.lightcrafts.platform.*;
import com.lightcrafts.utils.ColorProfileInfo;
import com.lightcrafts.utils.file.FileUtil;
import com.lightcrafts.utils.Version;

import static com.lightcrafts.platform.macosx.MacOSXColorProfileManager.*;
import com.lightcrafts.ui.LightZoneSkin;

/**
 * <code>MacOSXPlatform</code> is-a {@link Platform} for Mac&nbsp;OS;&nbsp;X.
 */
public final class MacOSXPlatform extends Platform {

    public void bringAppToFront( String appName ) {
        AppleScript.bringAppToFront( appName );
    }

    public AlertDialog getAlertDialog() {
        return DefaultAlertDialog.INSTANCE; // new MacOSXAlertDialog();
    }

    public ICC_Profile getDisplayProfile() {
        try {
            final String path =
                MacOSXColorProfileManager.getSystemDisplayProfilePath();
            final InputStream in = new File( path ).toURL().openStream();
            return ICC_Profile.getInstance( in );
        }
        catch ( IOException e ) {
            return null;
        }
    }

    public File getDefaultImageDirectory() {
        final String home = System.getProperty( "user.home" );
        return new File( home, "Pictures" );
    }

    public synchronized Collection<ColorProfileInfo> getExportProfiles() {
        if ( m_exportProfiles == null ) {
            final Collection<ColorProfileInfo> colorspaceProfiles =
                MacOSXColorProfileManager.getProfilesFor( CM_COLORSPACE_CLASS );
            final Collection<ColorProfileInfo> displayProfiles =
                MacOSXColorProfileManager.getProfilesFor( CM_DISPLAY_CLASS );
            final Collection<ColorProfileInfo> outputProfiles =
                MacOSXColorProfileManager.getProfilesFor( CM_OUTPUT_CLASS );

            m_exportProfiles = new ArrayList<ColorProfileInfo>();

            if ( colorspaceProfiles != null )
                m_exportProfiles.addAll( colorspaceProfiles );
            if ( displayProfiles != null )
                m_exportProfiles.addAll( displayProfiles );
            if ( outputProfiles != null )
                m_exportProfiles.addAll( outputProfiles );

            if ( m_exportProfiles.isEmpty() )
                m_exportProfiles = null;
            else
                m_exportProfiles =
                    Collections.unmodifiableCollection( m_exportProfiles );
        }
        return m_exportProfiles;
    }

    public FileChooser getFileChooser() {
        return MacOSXFileChooser.getFileChooser();
    }

    public FileSystemView getFileSystemView() {
        return OSXPantherFileSystemView.getQuaquaFileSystemView();
    }

    public File getLightZoneDocumentsDirectory() {
{'fraction_non_alphanumeric': 0.08528131549250363, 'fraction_numerical': 0.0025793970659358373, 'mean_word_length': 2.8296296296296295, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2891053', 'n_tokens_mistral': 1762, 'n_tokens_neox': 1692, 'n_words': 333}