// Path: src/main/java/de/robertschuette/octochat/model/ChatSettings.java
// public class ChatSettings {
// 
//     private String name;
//     private boolean notifications;
// 
// 
//     /**
//      * Constructor to create a setting object.
//      *
//      * @param name unique name of the chat
//      */
//     public ChatSettings(String name) {
//         this.name = name;
//         notifications = true;
//     }
// 
// 
//     /******** Getter & Setter **************/
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public boolean isNotifications() {
//         return notifications;
//     }
// 
//     public void setNotifications(boolean notifications) {
//         this.notifications = notifications;
//     }
// }
// 
// 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 de.robertschuette.octochat.model.ChatSettings;
import de.robertschuette.octochat.util.Util;
import javafx.scene.layout.Region;
import java.io.File;
package de.robertschuette.octochat.chats;



/**
 * This class defines a Chat and every chat which should be
 * manageable over the chat handler must extend this class.
 *
 * @author Robert Schütte
 */
public abstract class Chat extends Region {
    /**
     * Returns a icon which indicates the chat.
     *
     * @return the icon path in a File object
     */
    public File getIcon() {
        return new File(Util.getResourcesPath()+"/img/octo.png");
    }

    /**
     * Returns the actual settings of the chat.
     *
     * @return the chat settings
     */
// Path: src/main/java/de/robertschuette/octochat/model/ChatSettings.java
// public class ChatSettings {
// 
//     private String name;
//     private boolean notifications;
// 
// 
//     /**
//      * Constructor to create a setting object.
//      *
//      * @param name unique name of the chat
//      */
//     public ChatSettings(String name) {
//         this.name = name;
//         notifications = true;
//     }
// 
// 
//     /******** Getter & Setter **************/
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public boolean isNotifications() {
//         return notifications;
//     }
// 
//     public void setNotifications(boolean notifications) {
//         this.notifications = notifications;
//     }
// }
// 
// 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/chats/Chat.java
import de.robertschuette.octochat.model.ChatSettings;
import de.robertschuette.octochat.util.Util;
import javafx.scene.layout.Region;
import java.io.File;

package de.robertschuette.octochat.chats;



/**
 * This class defines a Chat and every chat which should be
 * manageable over the chat handler must extend this class.
 *
 * @author Robert Schütte
 */
public abstract class Chat extends Region {
    /**
     * Returns a icon which indicates the chat.
     *
     * @return the icon path in a File object
     */
    public File getIcon() {
        return new File(Util.getResourcesPath()+"/img/octo.png");
    }

    /**
     * Returns the actual settings of the chat.
     *
     * @return the chat settings
     */
    abstract public ChatSettings getChatSettings();