// Path: widget-core/src/main/java/org/ewidgetfx/core/Widget.java
// public interface Widget {
// 
//     public static enum DECORATION {
// 
//         STAGED_OS_TITLE_BAR,
//         STAGED_CLOSE,
//         STAGED_CONFIG_CLOSE,
//         STAGED_CONFIG,
//         STAGED_UNDECORATED,
//         NON_STAGED_CLOSE,
//         NON_STAGED_CONFIG_CLOSE,
//         NON_STAGED_CONFIG,
//         NON_STAGED_UNDECORATED
//     };
// 
//     DECORATION getDecoration();
// 
//     void setDecoration(DECORATION decoration);
// 
//     String getName();
// 
//     void setName(String name);
// 
//     StringProperty nameProperty();
// 
//     String getVersion();
// 
//     void setVersion(String version);
// 
//     StringProperty versionProperty();
// 
//     String getDescription();
// 
//     void setDescription(String descr);
// 
//     String getVendor();
// 
//     void setVendor(String vendor);
// 
//     String getVendorUrl();
// 
//     void setVendorUrl(String vendorUrl);
// 
//     String getVendorEmail();
// 
//     void setVendorEmail(String vendorEmail);
// 
//     LaunchInfo getLaunchInfo();
// 
//     void setLaunchInfo(LaunchInfo launchInfo);
// 
//     WidgetIcon getWidgetIcon();
// 
//     void setWidgetIcon(WidgetIcon widgetIcon);
// 
//     ObjectProperty<WidgetIcon> widgetIconProperty();
// 
//     Pane getAsNode();
// 
//     Stage getParentStage();
// 
//     void setParentStage(Stage stage);
// 
//     WidgetState getWidgetState();
// 
//     /**
//      * Returns a created WidgetIcon for the app container to use. Called 1st.
//      *
//      * @return WidgetIcon containing a raw node representing the icon. App containers can resize.
//      */
//     WidgetIcon buildWidgetIcon();
// 
//     /**
//      * Called after buildWidgetIcon() method to allow background processes to occur. Called 2nd. Typically to collect
//      * data to update WidgetIcon's Icon overlay. An example would be an email widget periodically checking email to
//      * update Icon overlay the number of emails received.
//      */
//     void startBackground();
// 
//     /**
//      * Initialize the widget. If the developer calls this method the framework will not call it. Called 3rd.
//      */
//     void init();
// 
//     /**
//      * Start is meant to be called when the user clicks to the icon to launch window. Called 4th. Typically to start
//      * animations. This should not be confused with backgroundStart()
//      */
//     void start();
// 
//     /**
//      * Pause is typically used to pause animations. Or other developer defined resources.
//      */
//     void pause();
// 
//     /**
//      * Resume is typically used to resume a animations. Or other developer defined resources.
//      */
//     void resume();
// 
//     /**
//      * Stop is called when the widget is closed and not visible. Typically this is to stop animations, and minor
//      * cleanup. The framework will call stop and stopBackground() method when exiting the app container.
//      */
//     void stop();
// 
//     /**
//      * Stops any background processes. Called when widget is being closed by the framework when exiting app contain.
//      * Called last.
//      *
//      */
//     void stopBackground();
// 
// }


import javafx.collections.FXCollections;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableMap;
import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import org.ewidgetfx.core.Widget;
import org.ewidgetfx.core.WidgetStage;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import org.apache.log4j.Logger;
/*
 * Copyright 2013 eWidgetFX.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ewidgetfx.util;



/**
 *
 * @author Carl Dea <carl.dea@gmail.com>
 * @since 1.0
 */
public class WidgetFactory {

    private static final Logger logger = Logger.getLogger(WidgetFactory.class);

    static WidgetLoader widgetLoader = new WidgetLoaderImpl(new File(new File(".").getAbsoluteFile().getParentFile() + File.separator + "jabs"));

// Path: widget-core/src/main/java/org/ewidgetfx/core/Widget.java
// public interface Widget {
// 
//     public static enum DECORATION {
// 
//         STAGED_OS_TITLE_BAR,
//         STAGED_CLOSE,
//         STAGED_CONFIG_CLOSE,
//         STAGED_CONFIG,
//         STAGED_UNDECORATED,
//         NON_STAGED_CLOSE,
//         NON_STAGED_CONFIG_CLOSE,
//         NON_STAGED_CONFIG,
//         NON_STAGED_UNDECORATED
//     };
// 
//     DECORATION getDecoration();
// 
//     void setDecoration(DECORATION decoration);
// 
//     String getName();
// 
//     void setName(String name);
// 
//     StringProperty nameProperty();
// 
//     String getVersion();
// 
//     void setVersion(String version);
// 
//     StringProperty versionProperty();
// 
//     String getDescription();
// 
//     void setDescription(String descr);
// 
//     String getVendor();
// 
//     void setVendor(String vendor);
// 
//     String getVendorUrl();
// 
//     void setVendorUrl(String vendorUrl);
// 
//     String getVendorEmail();
// 
//     void setVendorEmail(String vendorEmail);
// 
//     LaunchInfo getLaunchInfo();
// 
//     void setLaunchInfo(LaunchInfo launchInfo);
// 
//     WidgetIcon getWidgetIcon();
// 
//     void setWidgetIcon(WidgetIcon widgetIcon);
// 
//     ObjectProperty<WidgetIcon> widgetIconProperty();
// 
//     Pane getAsNode();
// 
//     Stage getParentStage();
// 
//     void setParentStage(Stage stage);
// 
//     WidgetState getWidgetState();
// 
//     /**
//      * Returns a created WidgetIcon for the app container to use. Called 1st.
//      *
//      * @return WidgetIcon containing a raw node representing the icon. App containers can resize.
//      */
//     WidgetIcon buildWidgetIcon();
// 
//     /**
//      * Called after buildWidgetIcon() method to allow background processes to occur. Called 2nd. Typically to collect
//      * data to update WidgetIcon's Icon overlay. An example would be an email widget periodically checking email to
//      * update Icon overlay the number of emails received.
//      */
//     void startBackground();
// 
//     /**
//      * Initialize the widget. If the developer calls this method the framework will not call it. Called 3rd.
//      */
//     void init();
// 
//     /**
//      * Start is meant to be called when the user clicks to the icon to launch window. Called 4th. Typically to start
//      * animations. This should not be confused with backgroundStart()
//      */
//     void start();
// 
//     /**
//      * Pause is typically used to pause animations. Or other developer defined resources.
//      */
//     void pause();
// 
//     /**
//      * Resume is typically used to resume a animations. Or other developer defined resources.
//      */
//     void resume();
// 
//     /**
//      * Stop is called when the widget is closed and not visible. Typically this is to stop animations, and minor
//      * cleanup. The framework will call stop and stopBackground() method when exiting the app container.
//      */
//     void stop();
// 
//     /**
//      * Stops any background processes. Called when widget is being closed by the framework when exiting app contain.
//      * Called last.
//      *
//      */
//     void stopBackground();
// 
// }


// Path: widget-core/src/main/java/org/ewidgetfx/util/WidgetFactory.java
import javafx.collections.FXCollections;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableMap;
import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import org.ewidgetfx.core.Widget;
import org.ewidgetfx.core.WidgetStage;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import org.apache.log4j.Logger;

/*
 * Copyright 2013 eWidgetFX.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ewidgetfx.util;



/**
 *
 * @author Carl Dea <carl.dea@gmail.com>
 * @since 1.0
 */
public class WidgetFactory {

    private static final Logger logger = Logger.getLogger(WidgetFactory.class);

    static WidgetLoader widgetLoader = new WidgetLoaderImpl(new File(new File(".").getAbsoluteFile().getParentFile() + File.separator + "jabs"));

    static ObservableMap<String, Widget> widgetMap = FXCollections.observableMap(new HashMap<String, Widget>());