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.b4a.ShellBA("b4j.example", "b4j.example.main", null);
		ba.loadHtSubs(main.class);
        if (ba.getClass().getName().endsWith("ShellBA")) {
			anywheresoftware.b4a.ShellBA.delegateBA = new anywheresoftware.b4j.objects.FxBA("b4j.example", null, null);
			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, 400);
            ba.raiseEvent(null, "appstart", frm, (String[])getParameters().getRaw().toArray(new String[0]));
        } catch (Throwable t) {
            BA.printException(t, true);
            System.exit(1);
        }
    }


private static boolean processGlobalsRun;
public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}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.CanvasWrapper _cvsgraph = null;
public static String  _appstart(anywheresoftware.b4j.objects.Form _form1,String[] _args) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "appstart"))
	return (String) Debug.delegate(ba, "appstart", new Object[] {_form1,_args});
RDebugUtils.currentLine=65536;
 //BA.debugLineNum = 65536;BA.debugLine="Sub AppStart (Form1 As Form, Args() As String)";
RDebugUtils.currentLine=65537;
 //BA.debugLineNum = 65537;BA.debugLine="MainForm = Form1";
_mainform = _form1;
RDebugUtils.currentLine=65538;
 //BA.debugLineNum = 65538;BA.debugLine="MainForm.RootPane.LoadLayout(\"Main\") 'Load the la";
_mainform.getRootPane().LoadLayout(ba,"Main");
RDebugUtils.currentLine=65539;
 //BA.debugLineNum = 65539;BA.debugLine="MainForm.Show";
_mainform.Show();
RDebugUtils.currentLine=65541;
 //BA.debugLineNum = 65541;BA.debugLine="Drawing";
_drawing();
RDebugUtils.currentLine=65542;
 //BA.debugLineNum = 65542;BA.debugLine="End Sub";
return "";
}
public static String  _drawing() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "drawing"))
	return (String) Debug.delegate(ba, "drawing", null);
double _centerx = 0;
double _centery = 0;
double _radius = 0;
double _refx = 0;
double _refy = 0;
double _hl = 0;
anywheresoftware.b4j.objects.JFX.FontWrapper _font1 = null;
RDebugUtils.currentLine=655360;
 //BA.debugLineNum = 655360;BA.debugLine="Private Sub Drawing";
RDebugUtils.currentLine=655362;
 //BA.debugLineNum = 655362;BA.debugLine="cvsGraph.DrawLine(20, 20, 150, 20, fx.Colors.Red,";
_cvsgraph.DrawLine(20,20,150,20,_fx.Colors.Red,3);
RDebugUtils.currentLine=655365;
 //BA.debugLineNum = 655365;BA.debugLine="cvsGraph.DrawRect(20, 80, 100, 60, fx.Colors.Blue";
_cvsgraph.DrawRect(20,80,100,60,_fx.Colors.Blue,anywheresoftware.b4a.keywords.Common.False,3);
RDebugUtils.currentLine=655368;
 //BA.debugLineNum = 655368;BA.debugLine="cvsGraph.DrawRect(150, 80, 100, 60, fx.Colors.Blu";
_cvsgraph.DrawRect(150,80,100,60,_fx.Colors.Blue,anywheresoftware.b4a.keywords.Common.True,3);
RDebugUtils.currentLine=655371;
 //BA.debugLineNum = 655371;BA.debugLine="cvsGraph.DrawCircle(330, 110, 30, fx.Colors.Green";
_cvsgraph.DrawCircle(330,110,30,_fx.Colors.Green,anywheresoftware.b4a.keywords.Common.False,3);
RDebugUtils.currentLine=655374;
 //BA.debugLineNum = 655374;BA.debugLine="Private centerX, centerY, radius As Double";
_centerx = 0;
_centery = 0;
_radius = 0;
RDebugUtils.currentLine=655375;
 //BA.debugLineNum = 655375;BA.debugLine="centerX = 450";
_centerx = 450;
RDebugUtils.currentLine=655376;
 //BA.debugLineNum = 655376;BA.debugLine="centerY = 110";
_centery = 110;
RDebugUtils.currentLine=655377;
 //BA.debugLineNum = 655377;BA.debugLine="radius = 30";
_radius = 30;
RDebugUtils.currentLine=655378;
 //BA.debugLineNum = 655378;BA.debugLine="cvsGraph.DrawCircle(centerX, centerY, radius, fx.";
_cvsgraph.DrawCircle(_centerx,_centery,_radius,_fx.Colors.Green,anywheresoftware.b4a.keywords.Common.True,3);
RDebugUtils.currentLine=655379;
 //BA.debugLineNum = 655379;BA.debugLine="cvsGraph.DrawCircle(centerX, centerY, radius, fx.";
_cvsgraph.DrawCircle(_centerx,_centery,_radius,_fx.Colors.Red,anywheresoftware.b4a.keywords.Common.False,3);
RDebugUtils.currentLine=655381;
 //BA.debugLineNum = 655381;BA.debugLine="Private refX, refY, hl As Double";
_refx = 0;
_refy = 0;
_hl = 0;
RDebugUtils.currentLine=655382;
 //BA.debugLineNum = 655382;BA.debugLine="refX = 150";
_refx = 150;
RDebugUtils.currentLine=655383;
 //BA.debugLineNum = 655383;BA.debugLine="refY = 190";
_refy = 190;
RDebugUtils.currentLine=655384;
 //BA.debugLineNum = 655384;BA.debugLine="hl = 5";
_hl = 5;
RDebugUtils.currentLine=655386;
 //BA.debugLineNum = 655386;BA.debugLine="Private Font1 As Font";
_font1 = new anywheresoftware.b4j.objects.JFX.FontWrapper();
RDebugUtils.currentLine=655387;
 //BA.debugLineNum = 655387;BA.debugLine="Font1 = fx.CreateFont(\"Arial\", 20, False, False)";
_font1 = _fx.CreateFont("Arial",20,anywheresoftware.b4a.keywords.Common.False,anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=655388;
 //BA.debugLineNum = 655388;BA.debugLine="cvsGraph.DrawText(\"Test text\", refX, refY, Font1,";
_cvsgraph.DrawText("Test text",_refx,_refy,(javafx.scene.text.Font)(_font1.getObject()),_fx.Colors.Black,BA.getEnumFromString(javafx.scene.text.TextAlignment.class,"LEFT"));
RDebugUtils.currentLine=655389;
 //BA.debugLineNum = 655389;BA.debugLine="DrawCross(refX, refY, hl)";
_drawcross(_refx,_refy,_hl);
RDebugUtils.currentLine=655391;
 //BA.debugLineNum = 655391;BA.debugLine="refY = 240";
_refy = 240;
RDebugUtils.currentLine=655392;
 //BA.debugLineNum = 655392;BA.debugLine="cvsGraph.DrawText(\"Test text\", refX, refY, Font1,";
_cvsgraph.DrawText("Test text",_refx,_refy,(javafx.scene.text.Font)(_font1.getObject()),_fx.Colors.Black,BA.getEnumFromString(javafx.scene.text.TextAlignment.class,"CENTER"));
RDebugUtils.currentLine=655393;
 //BA.debugLineNum = 655393;BA.debugLine="DrawCross(refX, refY, hl)";
_drawcross(_refx,_refy,_hl);
RDebugUtils.currentLine=655395;
 //BA.debugLineNum = 655395;BA.debugLine="refY = 290";
_refy = 290;
RDebugUtils.currentLine=655396;
 //BA.debugLineNum = 655396;BA.debugLine="cvsGraph.DrawText(\"Test text\", refX, refY, Font1,";
_cvsgraph.DrawText("Test text",_refx,_refy,(javafx.scene.text.Font)(_font1.getObject()),_fx.Colors.Black,BA.getEnumFromString(javafx.scene.text.TextAlignment.class,"RIGHT"));
RDebugUtils.currentLine=655397;
 //BA.debugLineNum = 655397;BA.debugLine="DrawCross(refX, refY, hl)";
_drawcross(_refx,_refy,_hl);
RDebugUtils.currentLine=655399;
 //BA.debugLineNum = 655399;BA.debugLine="refX = 350";
_refx = 350;
RDebugUtils.currentLine=655400;
 //BA.debugLineNum = 655400;BA.debugLine="refY = 190";
_refy = 190;
RDebugUtils.currentLine=655402;
 //BA.debugLineNum = 655402;BA.debugLine="cvsGraph.DrawTextRotated(\"Test text\", refX, refY,";
_cvsgraph.DrawTextRotated("Test text",_refx,_refy,(javafx.scene.text.Font)(_font1.getObject()),_fx.Colors.Black,BA.getEnumFromString(javafx.scene.text.TextAlignment.class,"LEFT"),45);
RDebugUtils.currentLine=655404;
 //BA.debugLineNum = 655404;BA.debugLine="DrawCross(refX, refY, hl)";
_drawcross(_refx,_refy,_hl);
RDebugUtils.currentLine=655406;
 //BA.debugLineNum = 655406;BA.debugLine="refY = 240";
_refy = 240;
RDebugUtils.currentLine=655408;
 //BA.debugLineNum = 655408;BA.debugLine="cvsGraph.DrawTextRotated(\"Test text\", refX, refY,";
_cvsgraph.DrawTextRotated("Test text",_refx,_refy,(javafx.scene.text.Font)(_font1.getObject()),_fx.Colors.Black,BA.getEnumFromString(javafx.scene.text.TextAlignment.class,"CENTER"),45);
RDebugUtils.currentLine=655410;
 //BA.debugLineNum = 655410;BA.debugLine="DrawCross(refX, refY, hl)";
_drawcross(_refx,_refy,_hl);
RDebugUtils.currentLine=655412;
 //BA.debugLineNum = 655412;BA.debugLine="refY = 290";
_refy = 290;
RDebugUtils.currentLine=655414;
 //BA.debugLineNum = 655414;BA.debugLine="cvsGraph.DrawTextRotated(\"Test text\", refX, refY,";
_cvsgraph.DrawTextRotated("Test text",_refx,_refy,(javafx.scene.text.Font)(_font1.getObject()),_fx.Colors.Black,BA.getEnumFromString(javafx.scene.text.TextAlignment.class,"RIGHT"),45);
RDebugUtils.currentLine=655416;
 //BA.debugLineNum = 655416;BA.debugLine="DrawCross(refX, refY, hl)";
_drawcross(_refx,_refy,_hl);
RDebugUtils.currentLine=655417;
 //BA.debugLineNum = 655417;BA.debugLine="End Sub";
return "";
}
public static String  _drawcross(double _x,double _y,double _l) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "drawcross"))
	return (String) Debug.delegate(ba, "drawcross", new Object[] {_x,_y,_l});
RDebugUtils.currentLine=983040;
 //BA.debugLineNum = 983040;BA.debugLine="Private Sub DrawCross(x As Double, y As Double, l";
RDebugUtils.currentLine=983042;
 //BA.debugLineNum = 983042;BA.debugLine="cvsGraph.DrawLine(x - l, y, x + l, y, fx.Colors.R";
_cvsgraph.DrawLine(_x-_l,_y,_x+_l,_y,_fx.Colors.Red,1);
RDebugUtils.currentLine=983043;
 //BA.debugLineNum = 983043;BA.debugLine="cvsGraph.DrawLine(x, y - l, x, y +l, fx.Colors.Re";
_cvsgraph.DrawLine(_x,_y-_l,_x,_y+_l,_fx.Colors.Red,1);
RDebugUtils.currentLine=983044;
 //BA.debugLineNum = 983044;BA.debugLine="End Sub";
return "";
}
}