package b4j.Draw;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class main_subs_0 {


public static RemoteObject  _appstart(RemoteObject _form1,RemoteObject _args) throws Exception{
try {
		Debug.PushSubsStack("AppStart (main) ","main",0,main.ba,main.mostCurrent,15);
if (RapidSub.canDelegate("appstart")) return main.remoteMe.runUserSub(false, "main","appstart", _form1, _args);
Debug.locals.put("Form1", _form1);
Debug.locals.put("Args", _args);
 BA.debugLineNum = 15;BA.debugLine="Sub AppStart (Form1 As Form, Args() As String)";
Debug.ShouldStop(16384);
 BA.debugLineNum = 16;BA.debugLine="MainForm = Form1";
Debug.ShouldStop(32768);
main._mainform = _form1;
 BA.debugLineNum = 17;BA.debugLine="MainForm.Show";
Debug.ShouldStop(65536);
main._mainform.runVoidMethodAndSync ("Show");
 BA.debugLineNum = 19;BA.debugLine="cvsMain.Initialize(\"\")";
Debug.ShouldStop(262144);
main._cvsmain.runVoidMethod ("Initialize",main.ba,(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 20;BA.debugLine="Shapes.Initialize";
Debug.ShouldStop(524288);
main._shapes.runVoidMethod ("Initialize");
 BA.debugLineNum = 21;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _drawallshapes() throws Exception{
try {
		Debug.PushSubsStack("DrawAllShapes (main) ","main",0,main.ba,main.mostCurrent,35);
if (RapidSub.canDelegate("drawallshapes")) return main.remoteMe.runUserSub(false, "main","drawallshapes");
RemoteObject _i = RemoteObject.createImmutable(0);
 BA.debugLineNum = 35;BA.debugLine="Private Sub DrawAllShapes";
Debug.ShouldStop(4);
 BA.debugLineNum = 36;BA.debugLine="Private i As Int";
Debug.ShouldStop(8);
_i = RemoteObject.createImmutable(0);Debug.locals.put("i", _i);
 BA.debugLineNum = 38;BA.debugLine="For i = 0 To Shapes.Size - 1";
Debug.ShouldStop(32);
{
final int step2 = 1;
final int limit2 = RemoteObject.solve(new RemoteObject[] {main._shapes.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
for (_i = BA.numberCast(int.class, 0) ; (step2 > 0 && _i.<Integer>get().intValue() <= limit2) || (step2 < 0 && _i.<Integer>get().intValue() >= limit2); _i = RemoteObject.createImmutable((int)(0 + _i.<Integer>get().intValue() + step2)) ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 39;BA.debugLine="CallSub2(Shapes.Get(i), \"Draw\", cvsMain)";
Debug.ShouldStop(64);
main.__c.runMethodAndSync(false,"CallSubNew2",main.ba,(Object)(main._shapes.runMethod(false,"Get",(Object)(_i))),(Object)(BA.ObjectToString("Draw")),(Object)((main._cvsmain)));
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 41;BA.debugLine="End Sub";
Debug.ShouldStop(256);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _mainform_resize(RemoteObject _width,RemoteObject _height) throws Exception{
try {
		Debug.PushSubsStack("MainForm_Resize (main) ","main",0,main.ba,main.mostCurrent,23);
if (RapidSub.canDelegate("mainform_resize")) return main.remoteMe.runUserSub(false, "main","mainform_resize", _width, _height);
RemoteObject _square1 = RemoteObject.declareNull("b4j.Draw.square");
RemoteObject _square2 = RemoteObject.declareNull("b4j.Draw.square");
RemoteObject _circle1 = RemoteObject.declareNull("b4j.Draw.circle");
Debug.locals.put("Width", _width);
Debug.locals.put("Height", _height);
 BA.debugLineNum = 23;BA.debugLine="Private Sub MainForm_Resize (Width As Double, Heig";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 24;BA.debugLine="MainForm.RootPane.AddNode(cvsMain, 0, 0, Width, H";
Debug.ShouldStop(8388608);
main._mainform.runMethod(false,"getRootPane").runVoidMethod ("AddNode",(Object)((main._cvsmain.getObject())),(Object)(BA.numberCast(double.class, 0)),(Object)(BA.numberCast(double.class, 0)),(Object)(_width),(Object)(_height));
 BA.debugLineNum = 25;BA.debugLine="Private Square1, Square2 As Square";
Debug.ShouldStop(16777216);
_square1 = RemoteObject.createNew ("b4j.Draw.square");Debug.locals.put("Square1", _square1);
_square2 = RemoteObject.createNew ("b4j.Draw.square");Debug.locals.put("Square2", _square2);
 BA.debugLineNum = 26;BA.debugLine="Private Circle1 As Circle";
Debug.ShouldStop(33554432);
_circle1 = RemoteObject.createNew ("b4j.Draw.circle");Debug.locals.put("Circle1", _circle1);
 BA.debugLineNum = 27;BA.debugLine="Shapes.Initialize";
Debug.ShouldStop(67108864);
main._shapes.runVoidMethod ("Initialize");
 BA.debugLineNum = 28;BA.debugLine="Square1.Initialize(Shapes, 110, 110, 50)";
Debug.ShouldStop(134217728);
_square1.runClassMethod (b4j.Draw.square.class, "_initialize",main.ba,(Object)(main._shapes),(Object)(BA.numberCast(int.class, 110)),(Object)(BA.numberCast(int.class, 110)),(Object)(BA.numberCast(int.class, 50)));
 BA.debugLineNum = 29;BA.debugLine="Square2.Initialize(Shapes, 10, 10, 100)";
Debug.ShouldStop(268435456);
_square2.runClassMethod (b4j.Draw.square.class, "_initialize",main.ba,(Object)(main._shapes),(Object)(BA.numberCast(int.class, 10)),(Object)(BA.numberCast(int.class, 10)),(Object)(BA.numberCast(int.class, 100)));
 BA.debugLineNum = 30;BA.debugLine="Circle1.Initialize(Shapes, 0.5 * Width, 0.5 * Hei";
Debug.ShouldStop(536870912);
_circle1.runClassMethod (b4j.Draw.circle.class, "_initialize",main.ba,(Object)(main._shapes),(Object)(BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {RemoteObject.createImmutable(0.5),_width}, "*",0, 0))),(Object)(BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {RemoteObject.createImmutable(0.5),_height}, "*",0, 0))),(Object)(BA.numberCast(int.class, 100)));
 BA.debugLineNum = 32;BA.debugLine="DrawAllShapes";
Debug.ShouldStop(-2147483648);
_drawallshapes();
 BA.debugLineNum = 33;BA.debugLine="End Sub";
Debug.ShouldStop(1);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}

private static boolean processGlobalsRun;
public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        main_subs_0._process_globals();
main.myClass = BA.getDeviceClass ("b4j.Draw.main");
square.myClass = BA.getDeviceClass ("b4j.Draw.square");
circle.myClass = BA.getDeviceClass ("b4j.Draw.circle");
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 7;BA.debugLine="Private fx As JFX";
main._fx = RemoteObject.createNew ("anywheresoftware.b4j.objects.JFX");
 //BA.debugLineNum = 8;BA.debugLine="Private MainForm As Form";
main._mainform = RemoteObject.createNew ("anywheresoftware.b4j.objects.Form");
 //BA.debugLineNum = 10;BA.debugLine="Public Shapes As List";
main._shapes = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
 //BA.debugLineNum = 11;BA.debugLine="Private cvsMain As Canvas";
main._cvsmain = RemoteObject.createNew ("anywheresoftware.b4j.objects.CanvasWrapper");
 //BA.debugLineNum = 13;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
}