// Path: src/main/java/de/robertschuette/octochat/util/Util.java
// public class Util {
//     private static String resourcesPath;
// 
//     /**
//      * This function returns the absolute path to the
//      * resources directory as String.
//      *
//      * @return resources dir path
//      */
//     public static String getResourcesPath() {
//         if(resourcesPath != null) {
//             return  resourcesPath;
//         }
// 
//         String jarDir = ".";
// 
//         // get the path of the .jar
//         try {
//             CodeSource codeSource = Util.class.getProtectionDomain().getCodeSource();
//             File jarFile = new File(codeSource.getLocation().toURI().getPath());
//             jarDir = jarFile.getParentFile().getPath();
//         } catch (URISyntaxException e) {
//             e.printStackTrace();
//         }
// 
//         File f = new File(jarDir+"/data");
//         if(f.exists() && f.isDirectory()) {
//             resourcesPath = jarDir+"/data/";
//         }
//         else {
//             resourcesPath = jarDir+"/";
//         }
// 
//         return resourcesPath;
//     }
// 
// 
//     /**
//      * Function to get the whole dom tree as String
//      * ONLY FOR DEV-ANALYSE!!!
//      *
//      * @param doc dom to parse
//      * @return dom as string
//      */
//     public static String getStringFromDoc(Document doc) {
//         try {
//             DOMSource domSource = new DOMSource(doc);
//             StringWriter writer = new StringWriter();
//             StreamResult result = new StreamResult(writer);
//             TransformerFactory tf = TransformerFactory.newInstance();
//             Transformer transformer = tf.newTransformer();
//             transformer.transform(domSource, result);
//             writer.flush();
//             return writer.toString();
//         } catch (TransformerException ex) {
//             ex.printStackTrace();
//             return null;
//         }
//     }
// }


import com.apple.eawt.Application;
import com.aquafx_project.AquaFx;
import de.robertschuette.octochat.util.Util;
import javafx.stage.Stage;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
package de.robertschuette.octochat.os;



/**
 * Class for Mac OS X specific operations.
 */
public class MacSpecific extends OsSpecific {

    /**
     * This functions styles the whole gui
     * in a mac os x specific view and set
     * the menu bar in the top menu.
     */
    @Override
    public void setSpecificStyle(Stage stage) {
        // style the whole application
        AquaFx.style();

        // set the mac os x dock icon
// Path: src/main/java/de/robertschuette/octochat/util/Util.java
// public class Util {
//     private static String resourcesPath;
// 
//     /**
//      * This function returns the absolute path to the
//      * resources directory as String.
//      *
//      * @return resources dir path
//      */
//     public static String getResourcesPath() {
//         if(resourcesPath != null) {
//             return  resourcesPath;
//         }
// 
//         String jarDir = ".";
// 
//         // get the path of the .jar
//         try {
//             CodeSource codeSource = Util.class.getProtectionDomain().getCodeSource();
//             File jarFile = new File(codeSource.getLocation().toURI().getPath());
//             jarDir = jarFile.getParentFile().getPath();
//         } catch (URISyntaxException e) {
//             e.printStackTrace();
//         }
// 
//         File f = new File(jarDir+"/data");
//         if(f.exists() && f.isDirectory()) {
//             resourcesPath = jarDir+"/data/";
//         }
//         else {
//             resourcesPath = jarDir+"/";
//         }
// 
//         return resourcesPath;
//     }
// 
// 
//     /**
//      * Function to get the whole dom tree as String
//      * ONLY FOR DEV-ANALYSE!!!
//      *
//      * @param doc dom to parse
//      * @return dom as string
//      */
//     public static String getStringFromDoc(Document doc) {
//         try {
//             DOMSource domSource = new DOMSource(doc);
//             StringWriter writer = new StringWriter();
//             StreamResult result = new StreamResult(writer);
//             TransformerFactory tf = TransformerFactory.newInstance();
//             Transformer transformer = tf.newTransformer();
//             transformer.transform(domSource, result);
//             writer.flush();
//             return writer.toString();
//         } catch (TransformerException ex) {
//             ex.printStackTrace();
//             return null;
//         }
//     }
// }


// Path: src/main/java/de/robertschuette/octochat/os/MacSpecific.java
import com.apple.eawt.Application;
import com.aquafx_project.AquaFx;
import de.robertschuette.octochat.util.Util;
import javafx.stage.Stage;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

package de.robertschuette.octochat.os;



/**
 * Class for Mac OS X specific operations.
 */
public class MacSpecific extends OsSpecific {

    /**
     * This functions styles the whole gui
     * in a mac os x specific view and set
     * the menu bar in the top menu.
     */
    @Override
    public void setSpecificStyle(Stage stage) {
        // style the whole application
        AquaFx.style();

        // set the mac os x dock icon
        Image image = new ImageIcon(Util.getResourcesPath()+"/img/octo.png").getImage();