package org.agmip.ui.quadui;

import org.apache.pivot.beans.BXMLSerializer;
import org.apache.pivot.collections.Map;
import org.apache.pivot.wtk.Application;
import org.apache.pivot.wtk.DesktopApplicationContext;
import org.apache.pivot.wtk.Display;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class QuadUIApp extends Application.Adapter {
    private QuadUIWindow window = null;
    private static Logger LOG = LoggerFactory.getLogger(QuadCmdLine.class);

    @Override
    public void startup(Display display, Map<String, String> props) throws Exception {
        LOG.info("GUI start");
        BXMLSerializer bxml = new BXMLSerializer();
        window = (QuadUIWindow) bxml.readObject(getClass().getResource("/quadui.bxml"));
        window.open(display);
    }

    @Override
    public boolean shutdown(boolean opt) {
        if (window != null) {
            window.close();
            LOG.info("GUI end");
        }
        return false;
    }

    public static void main(String[] args) {
        boolean cmdFlg = false;
        for (int i = 0; i < args.length; i++) {
            if (args[i].equalsIgnoreCase("-cli")) {
                cmdFlg = true;
                break;
            }
        }
        if (cmdFlg) {
            LOG.info("CLI Mode");
            QuadCmdLine cmd = new QuadCmdLine();
            cmd.run(args);
            
        } else {
            LOG.info("GUI Mode");
            DesktopApplicationContext.main(QuadUIApp.class, args);
        }
    }
}

@@ -246,65 +246,8 @@
 lay;
-%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0Apu
@@ -340,84 +340,8 @@
 ull;
-%0A    private static Logger LOG = LoggerFactory.getLogger(QuadCmdLine.class);
 %0A%0A  
@@ -443,39 +443,8 @@
 n %7B%0A
-        LOG.info(%22GUI start%22);%0A
     
@@ -736,41 +736,8 @@
 ();%0A
-            LOG.info(%22GUI end%22);%0A
     
@@ -1052,42 +1052,8 @@
 ) %7B%0A
-            LOG.info(%22CLI Mode%22);%0A
     
@@ -1137,16 +1137,16 @@
        %0A
+
         
@@ -1158,42 +1158,8 @@
 e %7B%0A
-            LOG.info(%22GUI Mode%22);%0A
     

remove log info