package b4j.ScrollPane;


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.ScrollPane", "b4j.ScrollPane.main", null);
		ba.loadHtSubs(main.class);
        if (ba.getClass().getName().endsWith("ShellBA")) {
			anywheresoftware.b4a.ShellBA.delegateBA = new anywheresoftware.b4j.objects.FxBA("b4j.ScrollPane", null, null);
			ba.raiseEvent2(null, true, "SHELL", false);
			ba.raiseEvent2(null, true, "CREATE", true, "b4j.ScrollPane.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 {
		        b4j.example.cssutils._process_globals();
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static class _rowcol{
public boolean IsInitialized;
public int row;
public int col;
public void Initialize() {
IsInitialized = true;
row = 0;
col = 0;
}
@Override
		public String toString() {
			return BA.TypeToString(this, false);
		}}
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.ScrollPaneWrapper _scrollpane1 = 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="ScrollPane1.LoadLayout(\"ScrollPane1\", 0, 0) 'need";
_scrollpane1.LoadLayout(ba,"ScrollPane1",0,0);
RDebugUtils.currentLine=65540;
 //BA.debugLineNum = 65540;BA.debugLine="FillScrollPane";
_fillscrollpane();
RDebugUtils.currentLine=65541;
 //BA.debugLineNum = 65541;BA.debugLine="MainForm.Show";
_mainform.Show();
RDebugUtils.currentLine=65542;
 //BA.debugLineNum = 65542;BA.debugLine="End Sub";
return "";
}
public static String  _fillscrollpane() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "fillscrollpane"))
	return (String) Debug.delegate(ba, "fillscrollpane", null);
int _col = 0;
int _row = 0;
double _w = 0;
double _h = 0;
anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper _innerpane = null;
b4j.ScrollPane.main._rowcol _rc = null;
anywheresoftware.b4j.objects.LabelWrapper _lbl = null;
RDebugUtils.currentLine=131072;
 //BA.debugLineNum = 131072;BA.debugLine="Private Sub FillScrollPane";
RDebugUtils.currentLine=131073;
 //BA.debugLineNum = 131073;BA.debugLine="Private col, row As Int";
_col = 0;
_row = 0;
RDebugUtils.currentLine=131074;
 //BA.debugLineNum = 131074;BA.debugLine="Private w = 150 As Double";
_w = 150;
RDebugUtils.currentLine=131075;
 //BA.debugLineNum = 131075;BA.debugLine="Private h = 50 As Double";
_h = 50;
RDebugUtils.currentLine=131076;
 //BA.debugLineNum = 131076;BA.debugLine="Private innerPane As Pane";
_innerpane = new anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper();
RDebugUtils.currentLine=131077;
 //BA.debugLineNum = 131077;BA.debugLine="innerPane = ScrollPane1.InnerNode	'gets the innet";
_innerpane.setObject((javafx.scene.layout.Pane)(_scrollpane1.getInnerNode().getObject()));
RDebugUtils.currentLine=131078;
 //BA.debugLineNum = 131078;BA.debugLine="ScrollPane1.SetVScrollVisibility(\"ALWAYS\")	'shows";
_scrollpane1.SetVScrollVisibility(BA.getEnumFromString(javafx.scene.control.ScrollPane.ScrollBarPolicy.class,"ALWAYS"));
RDebugUtils.currentLine=131079;
 //BA.debugLineNum = 131079;BA.debugLine="ScrollPane1.SetHScrollVisibility(\"ALWAYS\")	'shows";
_scrollpane1.SetHScrollVisibility(BA.getEnumFromString(javafx.scene.control.ScrollPane.ScrollBarPolicy.class,"ALWAYS"));
RDebugUtils.currentLine=131080;
 //BA.debugLineNum = 131080;BA.debugLine="ScrollPane1.Pannable = True	'allows moving with t";
_scrollpane1.setPannable(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=131081;
 //BA.debugLineNum = 131081;BA.debugLine="For row = 0 To 20";
{
final int step9 = 1;
final int limit9 = (int) (20);
for (_row = (int) (0) ; (step9 > 0 && _row <= limit9) || (step9 < 0 && _row >= limit9); _row = ((int)(0 + _row + step9)) ) {
RDebugUtils.currentLine=131082;
 //BA.debugLineNum = 131082;BA.debugLine="For col = 0 To 10";
{
final int step10 = 1;
final int limit10 = (int) (10);
for (_col = (int) (0) ; (step10 > 0 && _col <= limit10) || (step10 < 0 && _col >= limit10); _col = ((int)(0 + _col + step10)) ) {
RDebugUtils.currentLine=131083;
 //BA.debugLineNum = 131083;BA.debugLine="Private rc As RowCol";
_rc = new b4j.ScrollPane.main._rowcol();
RDebugUtils.currentLine=131084;
 //BA.debugLineNum = 131084;BA.debugLine="Private lbl As Label";
_lbl = new anywheresoftware.b4j.objects.LabelWrapper();
RDebugUtils.currentLine=131085;
 //BA.debugLineNum = 131085;BA.debugLine="lbl.Initialize(\"Cell\")";
_lbl.Initialize(ba,"Cell");
RDebugUtils.currentLine=131086;
 //BA.debugLineNum = 131086;BA.debugLine="CSSUtils.SetBorder(lbl, 1, fx.Colors.DarkGray,";
_cssutils._setborder((anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.NodeWrapper.ConcreteNodeWrapper(), (javafx.scene.Node)(_lbl.getObject())),1,(anywheresoftware.b4j.objects.JFX.PaintWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.objects.JFX.PaintWrapper(), (javafx.scene.paint.Paint)(_fx.Colors.DarkGray)),5);
RDebugUtils.currentLine=131087;
 //BA.debugLineNum = 131087;BA.debugLine="lbl.Alignment = \"CENTER\"";
_lbl.setAlignment("CENTER");
RDebugUtils.currentLine=131088;
 //BA.debugLineNum = 131088;BA.debugLine="innerPane.AddNode(lbl, col * w, row * h, w - 1,";
_innerpane.AddNode((javafx.scene.Node)(_lbl.getObject()),_col*_w,_row*_h,_w-1,_h-1);
RDebugUtils.currentLine=131089;
 //BA.debugLineNum = 131089;BA.debugLine="lbl.Text = \"Test_\" & row & \"_\" & col";
_lbl.setText("Test_"+BA.NumberToString(_row)+"_"+BA.NumberToString(_col));
RDebugUtils.currentLine=131090;
 //BA.debugLineNum = 131090;BA.debugLine="rc.row = row";
_rc.row = _row;
RDebugUtils.currentLine=131091;
 //BA.debugLineNum = 131091;BA.debugLine="rc.col = col";
_rc.col = _col;
RDebugUtils.currentLine=131092;
 //BA.debugLineNum = 131092;BA.debugLine="lbl.Tag = rc";
_lbl.setTag((Object)(_rc));
 }
};
 }
};
RDebugUtils.currentLine=131095;
 //BA.debugLineNum = 131095;BA.debugLine="innerPane.PrefWidth = col * w";
_innerpane.setPrefWidth(_col*_w);
RDebugUtils.currentLine=131096;
 //BA.debugLineNum = 131096;BA.debugLine="innerPane.PrefHeight = row * h";
_innerpane.setPrefHeight(_row*_h);
RDebugUtils.currentLine=131097;
 //BA.debugLineNum = 131097;BA.debugLine="End Sub";
return "";
}
public static String  _cell_mouseclicked(anywheresoftware.b4j.objects.NodeWrapper.MouseEventWrapper _eventdata) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "cell_mouseclicked"))
	return (String) Debug.delegate(ba, "cell_mouseclicked", new Object[] {_eventdata});
anywheresoftware.b4j.objects.LabelWrapper _lbl = null;
b4j.ScrollPane.main._rowcol _rc = null;
RDebugUtils.currentLine=196608;
 //BA.debugLineNum = 196608;BA.debugLine="Private Sub Cell_MouseClicked (EventData As MouseE";
RDebugUtils.currentLine=196609;
 //BA.debugLineNum = 196609;BA.debugLine="Private lbl As Label";
_lbl = new anywheresoftware.b4j.objects.LabelWrapper();
RDebugUtils.currentLine=196610;
 //BA.debugLineNum = 196610;BA.debugLine="Private rc As RowCol";
_rc = new b4j.ScrollPane.main._rowcol();
RDebugUtils.currentLine=196612;
 //BA.debugLineNum = 196612;BA.debugLine="lbl = Sender";
_lbl.setObject((javafx.scene.control.Label)(anywheresoftware.b4a.keywords.Common.Sender(ba)));
RDebugUtils.currentLine=196613;
 //BA.debugLineNum = 196613;BA.debugLine="rc = lbl.Tag";
_rc = (b4j.ScrollPane.main._rowcol)(_lbl.getTag());
RDebugUtils.currentLine=196614;
 //BA.debugLineNum = 196614;BA.debugLine="Log(rc.row)";
anywheresoftware.b4a.keywords.Common.Log(BA.NumberToString(_rc.row));
RDebugUtils.currentLine=196615;
 //BA.debugLineNum = 196615;BA.debugLine="Log(rc.col)";
anywheresoftware.b4a.keywords.Common.Log(BA.NumberToString(_rc.col));
RDebugUtils.currentLine=196616;
 //BA.debugLineNum = 196616;BA.debugLine="End Sub";
return "";
}
}