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 anywheresoftware.b4j.objects.LabelWrapper _lbltest1 = null;
public static anywheresoftware.b4j.objects.LabelWrapper _lbltest2 = null;
public static anywheresoftware.b4j.objects.LabelWrapper _lbltest3 = null;
public static anywheresoftware.b4j.objects.CanvasWrapper _cvstest = null;
public static anywheresoftware.b4j.objects.ImageViewWrapper _imvsmall = null;
public static anywheresoftware.b4j.objects.ImageViewWrapper.ImageWrapper _imgsmall = null;
public static b4j.example.cssutils _cssutils = null;
public static b4j.example.fx2 _fx2 = 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});
anywheresoftware.b4j.objects.JFX.FontWrapper _fontarial = null;
anywheresoftware.b4j.objects.JFX.FontWrapper _fontlucidahandwriting = null;
anywheresoftware.b4j.objects.JFX.FontWrapper _myfont = null;
anywheresoftware.b4j.objects.JFX.FontWrapper _myfont1 = null;
anywheresoftware.b4j.objects.JFX.PaintWrapper _colline = null;
anywheresoftware.b4j.objects.ImageViewWrapper.ImageWrapper _imgtest = null;
int _answer = 0;
anywheresoftware.b4a.objects.collections.List _lstfruits = null;
String _fruit = "";
anywheresoftware.b4a.objects.collections.List _lstscreens = null;
anywheresoftware.b4j.objects.JFX.ScreenWrapper _scrtest = null;
anywheresoftware.b4j.objects.JFX.ScreenWrapper _scrprimary = null;
String _dir = "";
String _txt = "";
anywheresoftware.b4a.objects.streams.File.TextWriterWrapper _tw = null;
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="fx2.Initialize";
_fx2._initialize();
RDebugUtils.currentLine=65543;
 //BA.debugLineNum = 65543;BA.debugLine="Private FontArial, FontLucidaHandwriting As Font";
_fontarial = new anywheresoftware.b4j.objects.JFX.FontWrapper();
_fontlucidahandwriting = new anywheresoftware.b4j.objects.JFX.FontWrapper();
RDebugUtils.currentLine=65544;
 //BA.debugLineNum = 65544;BA.debugLine="FontArial = fx.CreateFont(\"Arial\", 20, True, Fals";
_fontarial = _fx.CreateFont("Arial",20,anywheresoftware.b4a.keywords.Common.True,anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=65545;
 //BA.debugLineNum = 65545;BA.debugLine="lblTest1.Font = FontArial";
_lbltest1.setFont(_fontarial);
RDebugUtils.currentLine=65546;
 //BA.debugLineNum = 65546;BA.debugLine="FontLucidaHandwriting = fx.CreateFont(\"Lucida Han";
_fontlucidahandwriting = _fx.CreateFont("Lucida Handwriting",20,anywheresoftware.b4a.keywords.Common.False,anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=65547;
 //BA.debugLineNum = 65547;BA.debugLine="lblTest2.Font = FontLucidaHandwriting";
_lbltest2.setFont(_fontlucidahandwriting);
RDebugUtils.currentLine=65549;
 //BA.debugLineNum = 65549;BA.debugLine="Private MyFont, MyFont1 As Font";
_myfont = new anywheresoftware.b4j.objects.JFX.FontWrapper();
_myfont1 = new anywheresoftware.b4j.objects.JFX.FontWrapper();
RDebugUtils.currentLine=65550;
 //BA.debugLineNum = 65550;BA.debugLine="MyFont = fx.LoadFont(File.DirAssets, \"OLDENGL.TTF";
_myfont = _fx.LoadFont(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"OLDENGL.TTF",30);
RDebugUtils.currentLine=65551;
 //BA.debugLineNum = 65551;BA.debugLine="lblTest2.Font = MyFont";
_lbltest2.setFont(_myfont);
RDebugUtils.currentLine=65552;
 //BA.debugLineNum = 65552;BA.debugLine="MyFont1 = fx.CreateFont(MyFont.FamilyName, 30, Fa";
_myfont1 = _fx.CreateFont(_myfont.getFamilyName(),30,anywheresoftware.b4a.keywords.Common.False,anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=65553;
 //BA.debugLineNum = 65553;BA.debugLine="lblTest3.Font = MyFont1";
_lbltest3.setFont(_myfont1);
RDebugUtils.currentLine=65555;
 //BA.debugLineNum = 65555;BA.debugLine="cvsTest.DrawRect(0, 0, cvsTest.Width, cvsTest.Hei";
_cvstest.DrawRect(0,0,_cvstest.getWidth(),_cvstest.getHeight(),(javafx.scene.paint.Paint)(_fx.Colors.RGB((int) (245),(int) (245),(int) (220))),anywheresoftware.b4a.keywords.Common.True,1);
RDebugUtils.currentLine=65556;
 //BA.debugLineNum = 65556;BA.debugLine="cvsTest.MouseCursor = fx2.Cursors.E_RESIZE";
_cvstest.setMouseCursor((javafx.scene.Cursor)(_fx2._cursors.E_RESIZE));
RDebugUtils.currentLine=65558;
 //BA.debugLineNum = 65558;BA.debugLine="cvsTest.MouseCursor = fx2.ImageCursor(fx.LoadImag";
_cvstest.setMouseCursor((javafx.scene.Cursor)(_fx2._imagecursor(_fx.LoadImage(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"RedArrow.png"))));
RDebugUtils.currentLine=65560;
 //BA.debugLineNum = 65560;BA.debugLine="cvsTest.DrawCircle(160, 120, 40, fx.Colors.Red, T";
_cvstest.DrawCircle(160,120,40,_fx.Colors.Red,anywheresoftware.b4a.keywords.Common.True,5);
RDebugUtils.currentLine=65562;
 //BA.debugLineNum = 65562;BA.debugLine="Private colLine As Paint";
_colline = new anywheresoftware.b4j.objects.JFX.PaintWrapper();
RDebugUtils.currentLine=65563;
 //BA.debugLineNum = 65563;BA.debugLine="colLine = fx.Colors.Blue";
_colline.setObject((javafx.scene.paint.Paint)(_fx.Colors.Blue));
RDebugUtils.currentLine=65564;
 //BA.debugLineNum = 65564;BA.debugLine="cvsTest.DrawCircle(160, 120, 80, colLine, False,";
_cvstest.DrawCircle(160,120,80,(javafx.scene.paint.Paint)(_colline.getObject()),anywheresoftware.b4a.keywords.Common.False,5);
RDebugUtils.currentLine=65567;
 //BA.debugLineNum = 65567;BA.debugLine="Private imgTest As Image";
_imgtest = new anywheresoftware.b4j.objects.ImageViewWrapper.ImageWrapper();
RDebugUtils.currentLine=65568;
 //BA.debugLineNum = 65568;BA.debugLine="imgTest = fx.LoadImage(File.DirAssets, \"rose.jpg\"";
_imgtest = _fx.LoadImage(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"rose.jpg");
RDebugUtils.currentLine=65569;
 //BA.debugLineNum = 65569;BA.debugLine="cvsTest.DrawImage(imgTest, 0, 0, cvsTest.Width, c";
_cvstest.DrawImage((javafx.scene.image.Image)(_imgtest.getObject()),0,0,_cvstest.getWidth(),_cvstest.getHeight());
RDebugUtils.currentLine=65576;
 //BA.debugLineNum = 65576;BA.debugLine="fx.Msgbox(MainForm, \"This is a test message\", \"TE";
_fx.Msgbox(_mainform,"This is a test message","TEST");
RDebugUtils.currentLine=65579;
 //BA.debugLineNum = 65579;BA.debugLine="Private Answer As Int";
_answer = 0;
RDebugUtils.currentLine=65580;
 //BA.debugLineNum = 65580;BA.debugLine="Answer = fx.Msgbox2(MainForm, \"Do you want to sav";
_answer = _fx.Msgbox2(_mainform,"Do you want to save the file with the same name?","TEST","Yes","Cancel","Change name",_fx.MSGBOX_CONFIRMATION);
RDebugUtils.currentLine=65581;
 //BA.debugLineNum = 65581;BA.debugLine="If Answer = fx.DialogResponse.POSITIVE Then";
if (_answer==_fx.DialogResponse.POSITIVE) { 
 }else 
{RDebugUtils.currentLine=65583;
 //BA.debugLineNum = 65583;BA.debugLine="Else If Answer = fx.DialogResponse.NEGATIVE Then";
if (_answer==_fx.DialogResponse.NEGATIVE) { 
 }};
RDebugUtils.currentLine=65589;
 //BA.debugLineNum = 65589;BA.debugLine="Private lstFruits As List";
_lstfruits = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=65590;
 //BA.debugLineNum = 65590;BA.debugLine="Private Fruit As String";
_fruit = "";
RDebugUtils.currentLine=65591;
 //BA.debugLineNum = 65591;BA.debugLine="Private Answer As Int";
_answer = 0;
RDebugUtils.currentLine=65592;
 //BA.debugLineNum = 65592;BA.debugLine="lstFruits.Initialize";
_lstfruits.Initialize();
RDebugUtils.currentLine=65593;
 //BA.debugLineNum = 65593;BA.debugLine="lstFruits.AddAll(Array As String(\"Apple\", \"Orange";
_lstfruits.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Apple","Orange","Strawberry","Peach","Pear","Banana"}));
RDebugUtils.currentLine=65594;
 //BA.debugLineNum = 65594;BA.debugLine="Answer = fx.InputList(MainForm, lstFruits, \"Selec";
_answer = _fx.InputList(_mainform,_lstfruits,"Select a fruit","Fruits",(int) (2));
RDebugUtils.currentLine=65595;
 //BA.debugLineNum = 65595;BA.debugLine="If Answer >= 0 Then  'checks if an item was selec";
if (_answer>=0) { 
RDebugUtils.currentLine=65596;
 //BA.debugLineNum = 65596;BA.debugLine="Fruit = lstFruits.Get(Answer)";
_fruit = BA.ObjectToString(_lstfruits.Get(_answer));
 };
RDebugUtils.currentLine=65599;
 //BA.debugLineNum = 65599;BA.debugLine="Private lstScreens As List";
_lstscreens = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=65600;
 //BA.debugLineNum = 65600;BA.debugLine="lstScreens.Initialize";
_lstscreens.Initialize();
RDebugUtils.currentLine=65601;
 //BA.debugLineNum = 65601;BA.debugLine="lstScreens = fx.Screens";
_lstscreens = _fx.getScreens();
RDebugUtils.currentLine=65602;
 //BA.debugLineNum = 65602;BA.debugLine="Private scrTest As Screen";
_scrtest = new anywheresoftware.b4j.objects.JFX.ScreenWrapper();
RDebugUtils.currentLine=65603;
 //BA.debugLineNum = 65603;BA.debugLine="scrTest = lstScreens.Get(0)";
_scrtest.setObject((javafx.stage.Screen)(_lstscreens.Get((int) (0))));
RDebugUtils.currentLine=65604;
 //BA.debugLineNum = 65604;BA.debugLine="Log(scrTest.MaxX)";
anywheresoftware.b4a.keywords.Common.Log(BA.NumberToString(_scrtest.getMaxX()));
RDebugUtils.currentLine=65606;
 //BA.debugLineNum = 65606;BA.debugLine="Private scrPrimary As Screen";
_scrprimary = new anywheresoftware.b4j.objects.JFX.ScreenWrapper();
RDebugUtils.currentLine=65607;
 //BA.debugLineNum = 65607;BA.debugLine="scrPrimary = fx.PrimaryScreen";
_scrprimary = _fx.getPrimaryScreen();
RDebugUtils.currentLine=65608;
 //BA.debugLineNum = 65608;BA.debugLine="Log(scrTest.MaxX)";
anywheresoftware.b4a.keywords.Common.Log(BA.NumberToString(_scrtest.getMaxX()));
RDebugUtils.currentLine=65610;
 //BA.debugLineNum = 65610;BA.debugLine="Private Dir As String";
_dir = "";
RDebugUtils.currentLine=65611;
 //BA.debugLineNum = 65611;BA.debugLine="Dir = \"D:\\B4J\\BeginnersGuide\\V1_0\\\"";
_dir = "D:\\B4J\\BeginnersGuide\\V1_0\\";
RDebugUtils.currentLine=65612;
 //BA.debugLineNum = 65612;BA.debugLine="Private txt As String";
_txt = "";
RDebugUtils.currentLine=65613;
 //BA.debugLineNum = 65613;BA.debugLine="txt = \"Ceçi est un échantillon de texte\" & CRLF &";
_txt = "Ceçi est un échantillon de texte"+anywheresoftware.b4a.keywords.Common.CRLF+"avec des carartères accentués.";
RDebugUtils.currentLine=65614;
 //BA.debugLineNum = 65614;BA.debugLine="Private tw As TextWriter";
_tw = new anywheresoftware.b4a.objects.streams.File.TextWriterWrapper();
RDebugUtils.currentLine=65615;
 //BA.debugLineNum = 65615;BA.debugLine="tw.Initialize(File.OpenOutput(Dir, \"TestUTF8.txt\"";
_tw.Initialize((java.io.OutputStream)(anywheresoftware.b4a.keywords.Common.File.OpenOutput(_dir,"TestUTF8.txt",anywheresoftware.b4a.keywords.Common.False).getObject()));
RDebugUtils.currentLine=65616;
 //BA.debugLineNum = 65616;BA.debugLine="tw.Write(txt)";
_tw.Write(_txt);
RDebugUtils.currentLine=65617;
 //BA.debugLineNum = 65617;BA.debugLine="tw.Close";
_tw.Close();
RDebugUtils.currentLine=65618;
 //BA.debugLineNum = 65618;BA.debugLine="tw.Initialize2(File.OpenOutput(Dir, \"TestWindows.";
_tw.Initialize2((java.io.OutputStream)(anywheresoftware.b4a.keywords.Common.File.OpenOutput(_dir,"TestWindows.txt",anywheresoftware.b4a.keywords.Common.False).getObject()),"Windows-1252");
RDebugUtils.currentLine=65619;
 //BA.debugLineNum = 65619;BA.debugLine="tw.Write(txt)";
_tw.Write(_txt);
RDebugUtils.currentLine=65620;
 //BA.debugLineNum = 65620;BA.debugLine="tw.Close";
_tw.Close();
RDebugUtils.currentLine=65621;
 //BA.debugLineNum = 65621;BA.debugLine="End Sub";
return "";
}
public static String  _btnexcel_action() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "btnexcel_action"))
	return (String) Debug.delegate(ba, "btnexcel_action", null);
String _foldername = "";
RDebugUtils.currentLine=131072;
 //BA.debugLineNum = 131072;BA.debugLine="Private Sub btnExcel_Action";
RDebugUtils.currentLine=131073;
 //BA.debugLineNum = 131073;BA.debugLine="Private FolderName As String";
_foldername = "";
RDebugUtils.currentLine=131076;
 //BA.debugLineNum = 131076;BA.debugLine="FolderName = File.DirAssets";
_foldername = anywheresoftware.b4a.keywords.Common.File.getDirAssets();
RDebugUtils.currentLine=131077;
 //BA.debugLineNum = 131077;BA.debugLine="fx.ShowExternalDocument(File.GetUri(FolderName, \"";
_fx.ShowExternalDocument(anywheresoftware.b4a.keywords.Common.File.GetUri(_foldername,"Test.xls"));
RDebugUtils.currentLine=131078;
 //BA.debugLineNum = 131078;BA.debugLine="End Sub";
return "";
}
public static String  _btninternet_action() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "btninternet_action"))
	return (String) Debug.delegate(ba, "btninternet_action", null);
RDebugUtils.currentLine=262144;
 //BA.debugLineNum = 262144;BA.debugLine="Private Sub btnInternet_Action";
RDebugUtils.currentLine=262145;
 //BA.debugLineNum = 262145;BA.debugLine="fx.ShowExternalDocument(\"http://www.basic4ppc.com";
_fx.ShowExternalDocument("http://www.basic4ppc.com");
RDebugUtils.currentLine=262146;
 //BA.debugLineNum = 262146;BA.debugLine="End Sub";
return "";
}
public static String  _btnpdf_action() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "btnpdf_action"))
	return (String) Debug.delegate(ba, "btnpdf_action", null);
String _foldername = "";
RDebugUtils.currentLine=196608;
 //BA.debugLineNum = 196608;BA.debugLine="Private Sub btnPdf_Action";
RDebugUtils.currentLine=196609;
 //BA.debugLineNum = 196609;BA.debugLine="Private FolderName As String";
_foldername = "";
RDebugUtils.currentLine=196612;
 //BA.debugLineNum = 196612;BA.debugLine="FolderName = File.DirAssets";
_foldername = anywheresoftware.b4a.keywords.Common.File.getDirAssets();
RDebugUtils.currentLine=196613;
 //BA.debugLineNum = 196613;BA.debugLine="fx.ShowExternalDocument(File.GetUri(FolderName, \"";
_fx.ShowExternalDocument(anywheresoftware.b4a.keywords.Common.File.GetUri(_foldername,"Test.pdf"));
RDebugUtils.currentLine=196614;
 //BA.debugLineNum = 196614;BA.debugLine="End Sub";
return "";
}
public static String  _btnpong_action() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "btnpong_action"))
	return (String) Debug.delegate(ba, "btnpong_action", null);
String _foldername = "";
RDebugUtils.currentLine=327680;
 //BA.debugLineNum = 327680;BA.debugLine="Private Sub btnPong_Action";
RDebugUtils.currentLine=327681;
 //BA.debugLineNum = 327681;BA.debugLine="Private FolderName As String";
_foldername = "";
RDebugUtils.currentLine=327684;
 //BA.debugLineNum = 327684;BA.debugLine="FolderName = File.DirAssets";
_foldername = anywheresoftware.b4a.keywords.Common.File.getDirAssets();
RDebugUtils.currentLine=327685;
 //BA.debugLineNum = 327685;BA.debugLine="fx.ShowExternalDocument(File.GetUri(FolderName, \"";
_fx.ShowExternalDocument(anywheresoftware.b4a.keywords.Common.File.GetUri(_foldername,"Pong.jar"));
RDebugUtils.currentLine=327686;
 //BA.debugLineNum = 327686;BA.debugLine="End Sub";
return "";
}
}