package b4j.example;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.debug.*;

public class main extends javafx.application.Application{
public static main mostCurrent = new main();

public static BA ba;
static {
		ba = new  anywheresoftware.b4j.objects.FxBA("b4j.example", "b4j.example.main", null);
		ba.loadHtSubs(main.class);
        if (ba.getClass().getName().endsWith("ShellBA")) {
			
			ba.raiseEvent2(null, true, "SHELL", false);
			ba.raiseEvent2(null, true, "CREATE", true, "b4j.example.main", ba);
		}
	}
    public static Class<?> getObject() {
		return main.class;
	}

 
    public static void main(String[] args) {
    	launch(args);
    }
    public void start (javafx.stage.Stage stage) {
        try {
            if (!false)
                System.setProperty("prism.lcdtext", "false");
            anywheresoftware.b4j.objects.FxBA.application = this;
		    anywheresoftware.b4a.keywords.Common.setDensity(javafx.stage.Screen.getPrimary().getDpi());
            anywheresoftware.b4a.keywords.Common.LogDebug("Program started.");
            initializeProcessGlobals();
            anywheresoftware.b4j.objects.Form frm = new anywheresoftware.b4j.objects.Form();
            frm.initWithStage(ba, stage, 600, 600);
            ba.raiseEvent(null, "appstart", frm, (String[])getParameters().getRaw().toArray(new String[0]));
        } catch (Throwable t) {
            BA.printException(t, true);
            System.exit(1);
        }
    }
public static anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4j.objects.JFX _fx = null;
public static anywheresoftware.b4j.objects.Form _mainform = null;
public static anywheresoftware.b4j.objects.LabelWrapper _mylabel = null;
public static anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper _mypane = null;
public static anywheresoftware.b4j.objects.ButtonWrapper _btnchangeimage = null;
public static String _imagefilename = "";
public static b4j.example.cssutils _cssutils = null;
public static String  _appstart(anywheresoftware.b4j.objects.Form _form1,String[] _args) throws Exception{
 //BA.debugLineNum = 17;BA.debugLine="Sub AppStart (Form1 As Form, Args() As String)";
 //BA.debugLineNum = 18;BA.debugLine="MainForm = Form1";
_mainform = _form1;
 //BA.debugLineNum = 19;BA.debugLine="MainForm.RootPane.LoadLayout(\"Main\") 'Load the la";
_mainform.getRootPane().LoadLayout(ba,"Main");
 //BA.debugLineNum = 20;BA.debugLine="MainForm.Show";
_mainform.Show();
 //BA.debugLineNum = 22;BA.debugLine="CSSUtils.SetBackgroundImage(MyPane, File.DirAsset";
_cssutils._setbackgroundimage((anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper(), (javafx.scene.Node)(_mypane.getObject())),anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_imagefilename);
 //BA.debugLineNum = 24;BA.debugLine="CSSUtils.SetBorder(MyLabel, 2, fx.Colors.Blue, 5)";
_cssutils._setborder((anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper(), (javafx.scene.Node)(_mylabel.getObject())),2,(anywheresoftware.b4j.objects.JFX.PaintWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.JFX.PaintWrapper(), (javafx.scene.paint.Paint)(_fx.Colors.Blue)),5);
 //BA.debugLineNum = 25;BA.debugLine="CSSUtils.SetStyleProperty(MyLabel, \"-fx-backgroun";
_cssutils._setstyleproperty((anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper(), (javafx.scene.Node)(_mylabel.getObject())),"-fx-background-color","blanchedalmond");
 //BA.debugLineNum = 26;BA.debugLine="End Sub";
return "";
}
public static String  _btnchangeimage_action() throws Exception{
 //BA.debugLineNum = 28;BA.debugLine="Private Sub btnChangeImage_Action";
 //BA.debugLineNum = 29;BA.debugLine="If ImageFileName = \"rose1.jpg\" Then";
if ((_imagefilename).equals("rose1.jpg")) { 
 //BA.debugLineNum = 30;BA.debugLine="ImageFileName = \"rose2.jpg\"";
_imagefilename = "rose2.jpg";
 }else {
 //BA.debugLineNum = 32;BA.debugLine="ImageFileName = \"rose1.jpg\"";
_imagefilename = "rose1.jpg";
 };
 //BA.debugLineNum = 34;BA.debugLine="CSSUtils.SetBackgroundImage(MyPane, File.DirAsset";
_cssutils._setbackgroundimage((anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper(), (javafx.scene.Node)(_mypane.getObject())),anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_imagefilename);
 //BA.debugLineNum = 35;BA.debugLine="End Sub";
return "";
}

private static boolean processGlobalsRun;
public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        b4j.example.cssutils._process_globals();
main._process_globals();
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 7;BA.debugLine="Private fx As JFX";
_fx = new anywheresoftware.b4j.objects.JFX();
 //BA.debugLineNum = 8;BA.debugLine="Private MainForm As Form";
_mainform = new anywheresoftware.b4j.objects.Form();
 //BA.debugLineNum = 10;BA.debugLine="Private MyLabel As Label";
_mylabel = new anywheresoftware.b4j.objects.LabelWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Private MyPane As Pane";
_mypane = new anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Private btnChangeImage As Button";
_btnchangeimage = new anywheresoftware.b4j.objects.ButtonWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Private ImageFileName = \"rose1.jpg\" As String";
_imagefilename = "rose1.jpg";
 //BA.debugLineNum = 15;BA.debugLine="End Sub";
return "";
}
}
