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, 600);
            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 {
		        b4j.example.cssutils._process_globals();
		
        } 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 b4j.example.limitbar _ltbtest = null;
public static b4j.example.limitbar _ltbtest1 = null;
public static anywheresoftware.b4j.objects.LabelWrapper _lbllimitleft = null;
public static anywheresoftware.b4j.objects.LabelWrapper _lbllimitright = null;
public static anywheresoftware.b4j.objects.ButtonWrapper _btnchangeproperties = null;
public static b4j.example.cssutils _cssutils = 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=65540;
 //BA.debugLineNum = 65540;BA.debugLine="MainForm.SetWindowSizeLimits(370, 320, 1200, 1000";
_mainform.SetWindowSizeLimits(370,320,1200,1000);
RDebugUtils.currentLine=65542;
 //BA.debugLineNum = 65542;BA.debugLine="ltbTest1.Initialize(Me, \"ltbTest1\")";
_ltbtest1._initialize(ba,main.getObject(),"ltbTest1");
RDebugUtils.currentLine=65543;
 //BA.debugLineNum = 65543;BA.debugLine="ltbTest1.AddToParent(MainForm.RootPane, 40, 120,";
_ltbtest1._addtoparent((anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper(), (javafx.scene.layout.Pane)(_mainform.getRootPane().getObject())),(int) (40),(int) (120),(int) (_mainform.getRootPane().getWidth()-80),(int) (40),(anywheresoftware.b4j.objects.JFX.PaintWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.JFX.PaintWrapper(), (javafx.scene.paint.Paint)(_fx.Colors.Red)),(int) (5));
RDebugUtils.currentLine=65544;
 //BA.debugLineNum = 65544;BA.debugLine="lblLimitLeft.Text = ltbTest.LimitLeft";
_lbllimitleft.setText(BA.NumberToString(_ltbtest._getlimitleft()));
RDebugUtils.currentLine=65545;
 //BA.debugLineNum = 65545;BA.debugLine="lblLimitRight.Text = ltbTest.LimitRight";
_lbllimitright.setText(BA.NumberToString(_ltbtest._getlimitright()));
RDebugUtils.currentLine=65546;
 //BA.debugLineNum = 65546;BA.debugLine="End Sub";
return "";
}
public static String  _btnchangeproperties_action() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "btnchangeproperties_action"))
	return (String) Debug.delegate(ba, "btnchangeproperties_action", null);
RDebugUtils.currentLine=262144;
 //BA.debugLineNum = 262144;BA.debugLine="Private Sub btnChangeProperties_Action";
RDebugUtils.currentLine=262145;
 //BA.debugLineNum = 262145;BA.debugLine="ltbTest1.Left = 200";
_ltbtest1._setleft((int) (200));
RDebugUtils.currentLine=262146;
 //BA.debugLineNum = 262146;BA.debugLine="ltbTest1.Width = 300";
_ltbtest1._setwidth((int) (300));
RDebugUtils.currentLine=262147;
 //BA.debugLineNum = 262147;BA.debugLine="ltbTest1.Height = 70";
_ltbtest1._setheight((int) (70));
RDebugUtils.currentLine=262148;
 //BA.debugLineNum = 262148;BA.debugLine="ltbTest1.BackLineColor = fx.Colors.Blue";
_ltbtest1._setbacklinecolor((anywheresoftware.b4j.objects.JFX.PaintWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.JFX.PaintWrapper(), (javafx.scene.paint.Paint)(_fx.Colors.Blue)));
RDebugUtils.currentLine=262149;
 //BA.debugLineNum = 262149;BA.debugLine="ltbTest1.FrontLineColor = fx.Colors.Green";
_ltbtest1._setfrontlinecolor((anywheresoftware.b4j.objects.JFX.PaintWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.JFX.PaintWrapper(), (javafx.scene.paint.Paint)(_fx.Colors.Green)));
RDebugUtils.currentLine=262150;
 //BA.debugLineNum = 262150;BA.debugLine="ltbTest1.Max = 150";
_ltbtest1._setmax((int) (150));
RDebugUtils.currentLine=262151;
 //BA.debugLineNum = 262151;BA.debugLine="ltbTest1.LimitLeft = 20";
_ltbtest1._setlimitleft((int) (20));
RDebugUtils.currentLine=262152;
 //BA.debugLineNum = 262152;BA.debugLine="ltbTest1.LimitRight = 120";
_ltbtest1._setlimitright((int) (120));
RDebugUtils.currentLine=262153;
 //BA.debugLineNum = 262153;BA.debugLine="End Sub";
return "";
}
public static String  _ltbtest_valueschanged(int _limitleft,int _limitright) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "ltbtest_valueschanged"))
	return (String) Debug.delegate(ba, "ltbtest_valueschanged", new Object[] {_limitleft,_limitright});
RDebugUtils.currentLine=196608;
 //BA.debugLineNum = 196608;BA.debugLine="Private Sub ltbTest_ValuesChanged(LimitLeft As Int";
RDebugUtils.currentLine=196609;
 //BA.debugLineNum = 196609;BA.debugLine="lblLimitLeft.Text = LimitLeft";
_lbllimitleft.setText(BA.NumberToString(_limitleft));
RDebugUtils.currentLine=196610;
 //BA.debugLineNum = 196610;BA.debugLine="lblLimitRight.Text = LimitRight";
_lbllimitright.setText(BA.NumberToString(_limitright));
RDebugUtils.currentLine=196611;
 //BA.debugLineNum = 196611;BA.debugLine="End Sub";
return "";
}
public static String  _mainform_resize(double _width,double _height) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "mainform_resize"))
	return (String) Debug.delegate(ba, "mainform_resize", new Object[] {_width,_height});
RDebugUtils.currentLine=131072;
 //BA.debugLineNum = 131072;BA.debugLine="Private Sub MainForm_Resize (Width As Double, Heig";
RDebugUtils.currentLine=131075;
 //BA.debugLineNum = 131075;BA.debugLine="ltbTest1.Width = Width - 80";
_ltbtest1._setwidth((int) (_width-80));
RDebugUtils.currentLine=131076;
 //BA.debugLineNum = 131076;BA.debugLine="End Sub";
return "";
}
}