package b4a.bitmapdrawer2;


import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;

public class main extends Activity implements B4AActivity{
	public static main mostCurrent;
	static boolean afterFirstLayout;
	static boolean isFirst = true;
    private static boolean processGlobalsRun = false;
	BALayout layout;
	public static BA processBA;
	BA activityBA;
    ActivityWrapper _activity;
    java.util.ArrayList<B4AMenuItem> menuItems;
	public static final boolean fullScreen = false;
	public static final boolean includeTitle = true;
    public static WeakReference<Activity> previousOne;
    public static boolean dontPause;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        mostCurrent = this;
		if (processBA == null) {
			processBA = new BA(this.getApplicationContext(), null, null, "b4a.bitmapdrawer2", "b4a.bitmapdrawer2.main");
			processBA.loadHtSubs(this.getClass());
	        float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
	        BALayout.setDeviceScale(deviceScale);
            
		}
		else if (previousOne != null) {
			Activity p = previousOne.get();
			if (p != null && p != this) {
                BA.LogInfo("Killing previous instance (main).");
				p.finish();
			}
		}
        processBA.setActivityPaused(true);
        processBA.runHook("oncreate", this, null);
		if (!includeTitle) {
        	this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
        }
        if (fullScreen) {
        	getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,   
        			android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
		
        processBA.sharedProcessBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
        WaitForLayout wl = new WaitForLayout();
        if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(this, processBA, wl, false))
		    BA.handler.postDelayed(wl, 5);

	}
	static class WaitForLayout implements Runnable {
		public void run() {
			if (afterFirstLayout)
				return;
			if (mostCurrent == null)
				return;
            
			if (mostCurrent.layout.getWidth() == 0) {
				BA.handler.postDelayed(this, 5);
				return;
			}
			mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
			mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
			afterFirstLayout = true;
			mostCurrent.afterFirstLayout();
		}
	}
	private void afterFirstLayout() {
        if (this != mostCurrent)
			return;
		activityBA = new BA(this, layout, processBA, "b4a.bitmapdrawer2", "b4a.bitmapdrawer2.main");
        
        processBA.sharedProcessBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
        anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
        _activity = new ActivityWrapper(activityBA, "activity");
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (BA.isShellModeRuntimeCheck(processBA)) {
			if (isFirst)
				processBA.raiseEvent2(null, true, "SHELL", false);
			processBA.raiseEvent2(null, true, "CREATE", true, "b4a.bitmapdrawer2.main", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (main) Create, isFirst = " + isFirst + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (main) Resume **");
        processBA.raiseEvent(null, "activity_resume");
        if (android.os.Build.VERSION.SDK_INT >= 11) {
			try {
				android.app.Activity.class.getMethod("invalidateOptionsMenu").invoke(this,(Object[]) null);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}
	public void addMenuItem(B4AMenuItem item) {
		if (menuItems == null)
			menuItems = new java.util.ArrayList<B4AMenuItem>();
		menuItems.add(item);
	}
	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		super.onCreateOptionsMenu(menu);
        try {
            if (processBA.subExists("activity_actionbarhomeclick")) {
                Class.forName("android.app.ActionBar").getMethod("setHomeButtonEnabled", boolean.class).invoke(
                    getClass().getMethod("getActionBar").invoke(this), true);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (processBA.runHook("oncreateoptionsmenu", this, new Object[] {menu}))
            return true;
		if (menuItems == null)
			return false;
		for (B4AMenuItem bmi : menuItems) {
			android.view.MenuItem mi = menu.add(bmi.title);
			if (bmi.drawable != null)
				mi.setIcon(bmi.drawable);
            if (android.os.Build.VERSION.SDK_INT >= 11) {
				try {
                    if (bmi.addToBar) {
				        android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1);
                    }
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
		}
        
		return true;
	}   
 @Override
 public boolean onOptionsItemSelected(android.view.MenuItem item) {
    if (item.getItemId() == 16908332) {
        processBA.raiseEvent(null, "activity_actionbarhomeclick");
        return true;
    }
    else
        return super.onOptionsItemSelected(item); 
}
@Override
 public boolean onPrepareOptionsMenu(android.view.Menu menu) {
    super.onPrepareOptionsMenu(menu);
    processBA.runHook("onprepareoptionsmenu", this, new Object[] {menu});
    return true;
    
 }
 protected void onStart() {
    super.onStart();
    processBA.runHook("onstart", this, null);
}
 protected void onStop() {
    super.onStop();
    processBA.runHook("onstop", this, null);
}
    public void onWindowFocusChanged(boolean hasFocus) {
       super.onWindowFocusChanged(hasFocus);
       if (processBA.subExists("activity_windowfocuschanged"))
           processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
    }
	private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
		private final String eventName;
		public B4AMenuItemsClickListener(String eventName) {
			this.eventName = eventName;
		}
		public boolean onMenuItemClick(android.view.MenuItem item) {
			processBA.raiseEventFromUI(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return main.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeydown", this, new Object[] {keyCode, event}))
            return true;
		if (onKeySubExist == null)
			onKeySubExist = processBA.subExists("activity_keypress");
		if (onKeySubExist) {
			if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK &&
					android.os.Build.VERSION.SDK_INT >= 18) {
				HandleKeyDelayed hk = new HandleKeyDelayed();
				hk.kc = keyCode;
				BA.handler.post(hk);
				return true;
			}
			else {
				boolean res = new HandleKeyDelayed().runDirectly(keyCode);
				if (res)
					return true;
			}
		}
		return super.onKeyDown(keyCode, event);
	}
	private class HandleKeyDelayed implements Runnable {
		int kc;
		public void run() {
			runDirectly(kc);
		}
		public boolean runDirectly(int keyCode) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
			if (res == null || res == true) {
                return true;
            }
            else if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK) {
				finish();
				return true;
			}
            return false;
		}
		
	}
    @Override
	public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeyup", this, new Object[] {keyCode, event}))
            return true;
		if (onKeyUpSubExist == null)
			onKeyUpSubExist = processBA.subExists("activity_keyup");
		if (onKeyUpSubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyUp(keyCode, event);
	}
	@Override
	public void onNewIntent(android.content.Intent intent) {
        super.onNewIntent(intent);
		this.setIntent(intent);
        processBA.runHook("onnewintent", this, new Object[] {intent});
	}
    @Override 
	public void onPause() {
		super.onPause();
        if (_activity == null)
            return;
        if (this != mostCurrent)
			return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        if (!dontPause)
            BA.LogInfo("** Activity (main) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        else
            BA.LogInfo("** Activity (main) Pause event (activity is not paused). **");
        if (mostCurrent != null)
            processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        if (!dontPause) {
            processBA.setActivityPaused(true);
            mostCurrent = null;
        }

        if (!activityBA.activity.isFinishing())
			previousOne = new WeakReference<Activity>(this);
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        processBA.runHook("onpause", this, null);
	}

	@Override
	public void onDestroy() {
        super.onDestroy();
		previousOne = null;
        processBA.runHook("ondestroy", this, null);
	}
    @Override 
	public void onResume() {
		super.onResume();
        mostCurrent = this;
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
        	ResumeMessage rm = new ResumeMessage(mostCurrent);
        	BA.handler.post(rm);
        }
        processBA.runHook("onresume", this, null);
	}
    private static class ResumeMessage implements Runnable {
    	private final WeakReference<Activity> activity;
    	public ResumeMessage(Activity activity) {
    		this.activity = new WeakReference<Activity>(activity);
    	}
		public void run() {
            main mc = mostCurrent;
			if (mc == null || mc != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (main) Resume **");
            if (mc != mostCurrent)
                return;
		    processBA.raiseEvent(mc._activity, "activity_resume", (Object[])null);
		}
    }
	@Override
	protected void onActivityResult(int requestCode, int resultCode,
	      android.content.Intent data) {
		processBA.onActivityResult(requestCode, resultCode, data);
        processBA.runHook("onactivityresult", this, new Object[] {requestCode, resultCode});
	}
	private static void initializeGlobals() {
		processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
	}
    public void onRequestPermissionsResult(int requestCode,
        String permissions[], int[] grantResults) {
        for (int i = 0;i < permissions.length;i++) {
            Object[] o = new Object[] {permissions[i], grantResults[i] == 0};
            processBA.raiseEventFromDifferentThread(null,null, 0, "activity_permissionresult", true, o);
        }
            
    }

public anywheresoftware.b4a.keywords.Common __c = null;
public b4a.bitmapdrawer2.main._coordx _mapsize = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public static int _timerx = 0;
public anywheresoftware.b4a.objects.B4XCanvas.B4XRect _rectanglewholeb4x = null;
public anywheresoftware.b4a.objects.PanelWrapper _pnlgraph = null;
public anywheresoftware.b4a.objects.B4XCanvas _cvsgraph = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _imvgraph = null;
public b4a.example.bcpath _pthgraph = null;
public b4a.example.bitmapcreator _bmcgraph = null;
public b4a.example.bitmapcreator _bmc2ndgraph = null;
public static double[] _pointx = null;
public static double[] _pointy = null;
public anywheresoftware.b4a.objects.Timer _timeriterate = null;
public static float _xpos = 0f;
public static float _ypos = 0f;
public static float _xposnew = 0f;
public static float _yposnew = 0f;
public static float _xposleft = 0f;
public static float _yposleft = 0f;
public static float _xposright = 0f;
public static float _yposright = 0f;
public static float _widthsection = 0f;
public static float _velocity = 0f;
public static float _heading = 0f;
public static float _headingrate = 0f;
public b4a.bitmapdrawer2.main._coordx _tractor1 = null;
public b4a.bitmapdrawer2.main._coordx _trailer1 = null;
public b4a.bitmapdrawer2.main._coordx _tractor0 = null;
public b4a.bitmapdrawer2.main._coordx _trailer0 = null;
public b4a.bitmapdrawer2.main._coordx _hitch1 = null;
public static float _offset_hitch = 0f;
public static float _offset_trailertoboom = 0f;
public static float _offset_trailerlength = 0f;
public static float[] _boomsectionwidth = null;
public b4a.bitmapdrawer2.main._coordx _vector1 = null;
public static float _vectorlength1 = 0f;
public b4a.bitmapdrawer2.main._coordx _boompoint0 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint00 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint01 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint1 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint10 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint11 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint2 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint20 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint21 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint3 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint30 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint31 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint4 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint40 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint41 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint5 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint50 = null;
public b4a.bitmapdrawer2.main._coordx _boompoint51 = null;
public b4a.bitmapdrawer2.main._coordx _boomcenter1 = null;
public b4a.bitmapdrawer2.main._coordx _unitvector1 = null;
public static int[] _boomcolor = null;
public static int _x1 = 0;
public static int _x2 = 0;
public static int _y1 = 0;
public static int _y2 = 0;
public b4a.bitmapdrawer2.main._coordx _p1 = null;
public b4a.bitmapdrawer2.main._coordx _p2 = null;
public b4a.bitmapdrawer2.main._coordx _p3 = null;
public b4a.bitmapdrawer2.main._coordx _p4 = null;
public b4a.bitmapdrawer2.main._coordx _a0 = null;
public b4a.bitmapdrawer2.main._coordx _a1 = null;
public b4a.bitmapdrawer2.main._coordx _b0 = null;
public b4a.bitmapdrawer2.main._coordx _b1 = null;
public anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper _rectanglewhole = null;
public anywheresoftware.b4a.objects.drawable.CanvasWrapper _canvas1 = null;
public anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
public static boolean _displayoutlines = false;
public static boolean _displayfill = false;
public static boolean _boomon = false;
public anywheresoftware.b4a.objects.B4XViewWrapper _panel1 = null;
public b4a.bitmapdrawer2.main._coordxx _origin = null;
public static float _deltalat = 0f;
public static float _deltalong = 0f;
public static int _xposorigin = 0;
public static int _yposorigin = 0;
public anywheresoftware.b4a.objects.B4XCanvas.B4XRect _b4arect1 = null;
public anywheresoftware.b4a.objects.PanelWrapper _section1colour = null;
public anywheresoftware.b4a.objects.PanelWrapper _section2colour = null;
public anywheresoftware.b4a.objects.PanelWrapper _section3colour = null;
public anywheresoftware.b4a.objects.PanelWrapper _section4colour = null;
public anywheresoftware.b4a.objects.PanelWrapper _section5colour = null;
public b4a.bitmapdrawer2.starter _starter = null;
public static class _coordx{
public boolean IsInitialized;
public float y;
public float x;
public void Initialize() {
IsInitialized = true;
y = 0f;
x = 0f;
}
@Override
		public String toString() {
			return BA.TypeToString(this, false);
		}}
public static class _coordxx{
public boolean IsInitialized;
public float lat;
public float lng;
public void Initialize() {
IsInitialized = true;
lat = 0f;
lng = 0f;
}
@Override
		public String toString() {
			return BA.TypeToString(this, false);
		}}
public static class _coord{
public boolean IsInitialized;
public long lat;
public long lng;
public void Initialize() {
IsInitialized = true;
lat = 0L;
lng = 0L;
}
@Override
		public String toString() {
			return BA.TypeToString(this, false);
		}}

public static boolean isAnyActivityVisible() {
    boolean vis = false;
vis = vis | (main.mostCurrent != null);
return vis;}
public static void  _activity_create(boolean _firsttime) throws Exception{
ResumableSub_activity_create rsub = new ResumableSub_activity_create(null,_firsttime);
rsub.resume(processBA, null);
}
public static class ResumableSub_activity_create extends BA.ResumableSub {
public ResumableSub_activity_create(b4a.bitmapdrawer2.main parent,boolean _firsttime) {
this.parent = parent;
this._firsttime = _firsttime;
}
b4a.bitmapdrawer2.main parent;
boolean _firsttime;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 148;BA.debugLine="Activity.LoadLayout(\"bitmapdrawer.bal\")";
parent.mostCurrent._activity.LoadLayout("bitmapdrawer.bal",mostCurrent.activityBA);
 //BA.debugLineNum = 151;BA.debugLine="b4arect1.Initialize(0,0,imvGraph.Width,imvGraph.H";
parent.mostCurrent._b4arect1.Initialize((float) (0),(float) (0),(float) (parent.mostCurrent._imvgraph.getWidth()),(float) (parent.mostCurrent._imvgraph.getHeight()));
 //BA.debugLineNum = 152;BA.debugLine="mapsize.Initialize";
parent.mostCurrent._mapsize.Initialize();
 //BA.debugLineNum = 153;BA.debugLine="mapsize.x=1200";
parent.mostCurrent._mapsize.x /*float*/  = (float) (1200);
 //BA.debugLineNum = 154;BA.debugLine="mapsize.y=1200";
parent.mostCurrent._mapsize.y /*float*/  = (float) (1200);
 //BA.debugLineNum = 155;BA.debugLine="xposorigin=mapsize.x/2";
parent._xposorigin = (int) (parent.mostCurrent._mapsize.x /*float*/ /(double)2);
 //BA.debugLineNum = 156;BA.debugLine="yposorigin=mapsize.y/2";
parent._yposorigin = (int) (parent.mostCurrent._mapsize.y /*float*/ /(double)2);
 //BA.debugLineNum = 158;BA.debugLine="xpos = xposorigin";
parent._xpos = (float) (parent._xposorigin);
 //BA.debugLineNum = 159;BA.debugLine="ypos = yposorigin";
parent._ypos = (float) (parent._yposorigin);
 //BA.debugLineNum = 162;BA.debugLine="unitvector1.Initialize";
parent.mostCurrent._unitvector1.Initialize();
 //BA.debugLineNum = 163;BA.debugLine="Offset_hitch = 0";
parent._offset_hitch = (float) (0);
 //BA.debugLineNum = 164;BA.debugLine="offset_trailerlength = 1";
parent._offset_trailerlength = (float) (1);
 //BA.debugLineNum = 165;BA.debugLine="offset_trailertoboom = 1";
parent._offset_trailertoboom = (float) (1);
 //BA.debugLineNum = 166;BA.debugLine="boomsectionwidth(1) = 8";
parent._boomsectionwidth[(int) (1)] = (float) (8);
 //BA.debugLineNum = 167;BA.debugLine="boomsectionwidth(2) = 8";
parent._boomsectionwidth[(int) (2)] = (float) (8);
 //BA.debugLineNum = 168;BA.debugLine="boomsectionwidth(3) = 8";
parent._boomsectionwidth[(int) (3)] = (float) (8);
 //BA.debugLineNum = 170;BA.debugLine="rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCAT";
parent.mostCurrent._rp.CheckAndRequest(processBA,parent.mostCurrent._rp.PERMISSION_ACCESS_FINE_LOCATION);
 //BA.debugLineNum = 171;BA.debugLine="a0.Initialize";
parent.mostCurrent._a0.Initialize();
 //BA.debugLineNum = 172;BA.debugLine="a1.Initialize";
parent.mostCurrent._a1.Initialize();
 //BA.debugLineNum = 173;BA.debugLine="b0.Initialize";
parent.mostCurrent._b0.Initialize();
 //BA.debugLineNum = 174;BA.debugLine="b1.Initialize";
parent.mostCurrent._b1.Initialize();
 //BA.debugLineNum = 175;BA.debugLine="trailer0.x=xpos";
parent.mostCurrent._trailer0.x /*float*/  = parent._xpos;
 //BA.debugLineNum = 176;BA.debugLine="trailer0.y=ypos-Offset_hitch-offset_trailerlength";
parent.mostCurrent._trailer0.y /*float*/  = (float) (parent._ypos-parent._offset_hitch-parent._offset_trailerlength);
 //BA.debugLineNum = 177;BA.debugLine="velocity  = 10";
parent._velocity = (float) (10);
 //BA.debugLineNum = 178;BA.debugLine="heading = 180";
parent._heading = (float) (180);
 //BA.debugLineNum = 180;BA.debugLine="boompoint50.Initialize";
parent.mostCurrent._boompoint50.Initialize();
 //BA.debugLineNum = 181;BA.debugLine="boompoint5.Initialize";
parent.mostCurrent._boompoint5.Initialize();
 //BA.debugLineNum = 182;BA.debugLine="boompoint0.Initialize";
parent.mostCurrent._boompoint0.Initialize();
 //BA.debugLineNum = 183;BA.debugLine="boompoint00.Initialize";
parent.mostCurrent._boompoint00.Initialize();
 //BA.debugLineNum = 184;BA.debugLine="boompoint51.Initialize";
parent.mostCurrent._boompoint51.Initialize();
 //BA.debugLineNum = 185;BA.debugLine="boompoint01.Initialize";
parent.mostCurrent._boompoint01.Initialize();
 //BA.debugLineNum = 186;BA.debugLine="boompoint1.Initialize";
parent.mostCurrent._boompoint1.Initialize();
 //BA.debugLineNum = 187;BA.debugLine="boompoint10.Initialize";
parent.mostCurrent._boompoint10.Initialize();
 //BA.debugLineNum = 188;BA.debugLine="boompoint11.Initialize";
parent.mostCurrent._boompoint11.Initialize();
 //BA.debugLineNum = 189;BA.debugLine="boompoint2.Initialize";
parent.mostCurrent._boompoint2.Initialize();
 //BA.debugLineNum = 190;BA.debugLine="boompoint20.Initialize";
parent.mostCurrent._boompoint20.Initialize();
 //BA.debugLineNum = 191;BA.debugLine="boompoint21.Initialize";
parent.mostCurrent._boompoint21.Initialize();
 //BA.debugLineNum = 192;BA.debugLine="boompoint3.Initialize";
parent.mostCurrent._boompoint3.Initialize();
 //BA.debugLineNum = 193;BA.debugLine="boompoint30.Initialize";
parent.mostCurrent._boompoint30.Initialize();
 //BA.debugLineNum = 194;BA.debugLine="boompoint31.Initialize";
parent.mostCurrent._boompoint31.Initialize();
 //BA.debugLineNum = 195;BA.debugLine="boompoint4.Initialize";
parent.mostCurrent._boompoint4.Initialize();
 //BA.debugLineNum = 196;BA.debugLine="boompoint40.Initialize";
parent.mostCurrent._boompoint40.Initialize();
 //BA.debugLineNum = 197;BA.debugLine="boompoint41.Initialize";
parent.mostCurrent._boompoint41.Initialize();
 //BA.debugLineNum = 198;BA.debugLine="boompoint00.x=0";
parent.mostCurrent._boompoint00.x /*float*/  = (float) (0);
 //BA.debugLineNum = 199;BA.debugLine="boompoint50.x=0";
parent.mostCurrent._boompoint50.x /*float*/  = (float) (0);
 //BA.debugLineNum = 200;BA.debugLine="boompoint10.x=0";
parent.mostCurrent._boompoint10.x /*float*/  = (float) (0);
 //BA.debugLineNum = 201;BA.debugLine="boompoint20.x=0";
parent.mostCurrent._boompoint20.x /*float*/  = (float) (0);
 //BA.debugLineNum = 202;BA.debugLine="boompoint30.x=0";
parent.mostCurrent._boompoint30.x /*float*/  = (float) (0);
 //BA.debugLineNum = 203;BA.debugLine="boompoint40.x=0";
parent.mostCurrent._boompoint40.x /*float*/  = (float) (0);
 //BA.debugLineNum = 204;BA.debugLine="headingrate = 0";
parent._headingrate = (float) (0);
 //BA.debugLineNum = 205;BA.debugLine="widthsection = 100";
parent._widthsection = (float) (100);
 //BA.debugLineNum = 206;BA.debugLine="cvsGraph.Initialize(imvGraph)";
parent.mostCurrent._cvsgraph.Initialize((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(parent.mostCurrent._imvgraph.getObject())));
 //BA.debugLineNum = 207;BA.debugLine="boomon=True";
parent._boomon = anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 208;BA.debugLine="boomcolor(0)=xui.Color_Green";
parent._boomcolor[(int) (0)] = parent.mostCurrent._xui.Color_Green;
 //BA.debugLineNum = 209;BA.debugLine="boomcolor(1)=xui.Color_Green";
parent._boomcolor[(int) (1)] = parent.mostCurrent._xui.Color_Green;
 //BA.debugLineNum = 210;BA.debugLine="boomcolor(2)=xui.Color_Green";
parent._boomcolor[(int) (2)] = parent.mostCurrent._xui.Color_Green;
 //BA.debugLineNum = 211;BA.debugLine="boomcolor(3)=xui.Color_Green";
parent._boomcolor[(int) (3)] = parent.mostCurrent._xui.Color_Green;
 //BA.debugLineNum = 212;BA.debugLine="boomcolor(4)=xui.Color_Green";
parent._boomcolor[(int) (4)] = parent.mostCurrent._xui.Color_Green;
 //BA.debugLineNum = 213;BA.debugLine="Initialize(1)";
_initialize((int) (1));
 //BA.debugLineNum = 215;BA.debugLine="Do While Starter.ValidGPS = False";
if (true) break;

case 1:
//do while
this.state = 4;
while (parent.mostCurrent._starter._validgps /*boolean*/ ==anywheresoftware.b4a.keywords.Common.False) {
this.state = 3;
if (true) break;
}
if (true) break;

case 3:
//C
this.state = 1;
 //BA.debugLineNum = 216;BA.debugLine="Sleep (100)";
anywheresoftware.b4a.keywords.Common.Sleep(mostCurrent.activityBA,this,(int) (100));
this.state = 5;
return;
case 5:
//C
this.state = 1;
;
 if (true) break;

case 4:
//C
this.state = -1;
;
 //BA.debugLineNum = 220;BA.debugLine="location_center";
_location_center();
 //BA.debugLineNum = 222;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 922;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 923;BA.debugLine="CallSubDelayed(Starter, \"StopGPS\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed(processBA,(Object)(mostCurrent._starter.getObject()),"StopGPS");
 //BA.debugLineNum = 924;BA.debugLine="End Sub";
return "";
}
public static void  _activity_resume() throws Exception{
ResumableSub_Activity_Resume rsub = new ResumableSub_Activity_Resume(null);
rsub.resume(processBA, null);
}
public static class ResumableSub_Activity_Resume extends BA.ResumableSub {
public ResumableSub_Activity_Resume(b4a.bitmapdrawer2.main parent) {
this.parent = parent;
}
b4a.bitmapdrawer2.main parent;
String _permission = "";
boolean _result = false;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 912;BA.debugLine="If Starter.GPS1.GPSEnabled = False Then";
if (true) break;

case 1:
//if
this.state = 12;
if (parent.mostCurrent._starter._gps1 /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled()==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 12;
 //BA.debugLineNum = 913;BA.debugLine="ToastMessageShow(\"Please enable the GPS device.\"";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Please enable the GPS device."),anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 914;BA.debugLine="StartActivity(Starter.GPS1.LocationSettingsInten";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)(parent.mostCurrent._starter._gps1 /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 if (true) break;

case 5:
//C
this.state = 6;
 //BA.debugLineNum = 916;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION";
parent.mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(processBA,parent.mostCurrent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_ACCESS_FINE_LOCATION);
 //BA.debugLineNum = 917;BA.debugLine="Wait For Activity_PermissionResult (Permission A";
anywheresoftware.b4a.keywords.Common.WaitFor("activity_permissionresult", processBA, this, null);
this.state = 13;
return;
case 13:
//C
this.state = 6;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
 //BA.debugLineNum = 918;BA.debugLine="If Result Then CallSubDelayed(Starter, \"StartGPS";
if (true) break;

case 6:
//if
this.state = 11;
if (_result) { 
this.state = 8;
;}if (true) break;

case 8:
//C
this.state = 11;
anywheresoftware.b4a.keywords.Common.CallSubDelayed(processBA,(Object)(parent.mostCurrent._starter.getObject()),"StartGPS");
if (true) break;

case 11:
//C
this.state = 12;
;
 if (true) break;

case 12:
//C
this.state = -1;
;
 //BA.debugLineNum = 920;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static void  _activity_permissionresult(String _permission,boolean _result) throws Exception{
}
public static boolean  _application_error(anywheresoftware.b4a.objects.B4AException _error,String _stacktrace) throws Exception{
 //BA.debugLineNum = 622;BA.debugLine="Sub Application_Error (Error As Exception, StackTr";
 //BA.debugLineNum = 623;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 624;BA.debugLine="End Sub";
return false;
}
public static String  _btnclear_click() throws Exception{
 //BA.debugLineNum = 459;BA.debugLine="Sub BtnClear_Click";
 //BA.debugLineNum = 462;BA.debugLine="bmcGraph.Initialize(pnlGraph.Width*10, pnlGraph.H";
mostCurrent._bmcgraph._initialize(processBA,(int) (mostCurrent._pnlgraph.getWidth()*10),(int) (mostCurrent._pnlgraph.getHeight()*10));
 //BA.debugLineNum = 463;BA.debugLine="imvGraph.Bitmap=(bmcGraph.Bitmap)";
mostCurrent._imvgraph.setBitmap((android.graphics.Bitmap)((mostCurrent._bmcgraph._getbitmap()).getObject()));
 //BA.debugLineNum = 465;BA.debugLine="End Sub";
return "";
}
public static String  _btndraw_click() throws Exception{
int _intcolour = 0;
int _i = 0;
int _j = 0;
anywheresoftware.b4a.objects.B4XCanvas.B4XRect _r = null;
b4a.example.bitmapcreator._drawtask _dt = null;
 //BA.debugLineNum = 472;BA.debugLine="Sub BtnDraw_Click";
 //BA.debugLineNum = 473;BA.debugLine="Dim intcolour As Int";
_intcolour = 0;
 //BA.debugLineNum = 474;BA.debugLine="For i=0 To pnlGraph.Width-1";
{
final int step2 = 1;
final int limit2 = (int) (mostCurrent._pnlgraph.getWidth()-1);
_i = (int) (0) ;
for (;_i <= limit2 ;_i = _i + step2 ) {
 //BA.debugLineNum = 475;BA.debugLine="For j=0 To pnlGraph.Height-1";
{
final int step3 = 1;
final int limit3 = (int) (mostCurrent._pnlgraph.getHeight()-1);
_j = (int) (0) ;
for (;_j <= limit3 ;_j = _j + step3 ) {
 //BA.debugLineNum = 476;BA.debugLine="intcolour = bmcGraph.GetColor(i,j)";
_intcolour = mostCurrent._bmcgraph._getcolor(_i,_j);
 //BA.debugLineNum = 478;BA.debugLine="If bmcGraph.GetColor(i,j) <> 0 Then 'fx.Colors.";
if (mostCurrent._bmcgraph._getcolor(_i,_j)!=0) { 
 };
 }
};
 }
};
 //BA.debugLineNum = 484;BA.debugLine="bmcGraph.DrawLine(0,0,pnlGraph.Width, 0,xui.Color";
mostCurrent._bmcgraph._drawline((float) (0),(float) (0),(float) (mostCurrent._pnlgraph.getWidth()),(float) (0),mostCurrent._xui.Color_Magenta,(int) (100));
 //BA.debugLineNum = 485;BA.debugLine="Dim r As B4XRect";
_r = new anywheresoftware.b4a.objects.B4XCanvas.B4XRect();
 //BA.debugLineNum = 487;BA.debugLine="r.Initialize(bmcGraph.mWidth/4, bmcGraph.mHeight/";
_r.Initialize((float) (mostCurrent._bmcgraph._mwidth/(double)4),(float) (mostCurrent._bmcgraph._mheight/(double)4),(float) (mostCurrent._bmcgraph._mwidth*0.75),(float) (mostCurrent._bmcgraph._mheight*0.75));
 //BA.debugLineNum = 488;BA.debugLine="Dim dt As DrawTask = bmcGraph.CreateDrawTask(bmcG";
_dt = mostCurrent._bmcgraph._createdrawtask((Object)(mostCurrent._bmcgraph),_r,(int) (mostCurrent._pnlgraph.getWidth()/(double)2),(int) (mostCurrent._pnlgraph.getHeight()/(double)2),anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 489;BA.debugLine="dt.SrcScaleX = 1";
_dt.SrcScaleX = (float) (1);
 //BA.debugLineNum = 490;BA.debugLine="dt.SrcScaleY = 1";
_dt.SrcScaleY = (float) (1);
 //BA.debugLineNum = 491;BA.debugLine="dt.Degrees = 15";
_dt.Degrees = (int) (15);
 //BA.debugLineNum = 494;BA.debugLine="bmc2ndgraph.DrawBitmapCreatorTransformed(dt)";
mostCurrent._bmc2ndgraph._drawbitmapcreatortransformed(_dt);
 //BA.debugLineNum = 496;BA.debugLine="imvGraph.Bitmap=(bmc2ndgraph.Bitmap)";
mostCurrent._imvgraph.setBitmap((android.graphics.Bitmap)((mostCurrent._bmc2ndgraph._getbitmap()).getObject()));
 //BA.debugLineNum = 499;BA.debugLine="End Sub";
return "";
}
public static String  _btnfast_click() throws Exception{
 //BA.debugLineNum = 434;BA.debugLine="Sub BtnFast_Click";
 //BA.debugLineNum = 435;BA.debugLine="velocity  = velocity + 1";
_velocity = (float) (_velocity+1);
 //BA.debugLineNum = 437;BA.debugLine="End Sub";
return "";
}
public static String  _btnleft_click() throws Exception{
 //BA.debugLineNum = 448;BA.debugLine="Sub BtnLeft_Click";
 //BA.debugLineNum = 450;BA.debugLine="headingrate = headingrate -1";
_headingrate = (float) (_headingrate-1);
 //BA.debugLineNum = 452;BA.debugLine="End Sub";
return "";
}
public static String  _btnright_click() throws Exception{
 //BA.debugLineNum = 454;BA.debugLine="Sub BtnRight_Click";
 //BA.debugLineNum = 455;BA.debugLine="headingrate = headingrate +1";
_headingrate = (float) (_headingrate+1);
 //BA.debugLineNum = 457;BA.debugLine="End Sub";
return "";
}
public static String  _btnslow_click() throws Exception{
 //BA.debugLineNum = 444;BA.debugLine="Sub BtnSlow_Click";
 //BA.debugLineNum = 445;BA.debugLine="velocity = velocity - 1";
_velocity = (float) (_velocity-1);
 //BA.debugLineNum = 446;BA.debugLine="End Sub";
return "";
}
public static String  _btnstop_click() throws Exception{
 //BA.debugLineNum = 439;BA.debugLine="Sub BtnStop_Click";
 //BA.debugLineNum = 440;BA.debugLine="velocity  = 0";
_velocity = (float) (0);
 //BA.debugLineNum = 442;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _calcline(int _tx1,int _ty1,int _tx2,int _ty2,anywheresoftware.b4a.objects.collections.List _linenumber,anywheresoftware.b4a.objects.collections.List _lineynumber) throws Exception{
ResumableSub_calcline rsub = new ResumableSub_calcline(null,_tx1,_ty1,_tx2,_ty2,_linenumber,_lineynumber);
rsub.resume(processBA, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_calcline extends BA.ResumableSub {
public ResumableSub_calcline(b4a.bitmapdrawer2.main parent,int _tx1,int _ty1,int _tx2,int _ty2,anywheresoftware.b4a.objects.collections.List _linenumber,anywheresoftware.b4a.objects.collections.List _lineynumber) {
this.parent = parent;
this._tx1 = _tx1;
this._ty1 = _ty1;
this._tx2 = _tx2;
this._ty2 = _ty2;
this._linenumber = _linenumber;
this._lineynumber = _lineynumber;
}
b4a.bitmapdrawer2.main parent;
int _tx1;
int _ty1;
int _tx2;
int _ty2;
anywheresoftware.b4a.objects.collections.List _linenumber;
anywheresoftware.b4a.objects.collections.List _lineynumber;
int _x = 0;
int _y = 0;
int _dx = 0;
int _dy = 0;
int _signx = 0;
int _signy = 0;
boolean _changed = false;
float _e = 0f;
int _i = 0;
int step15;
int limit15;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 800;BA.debugLine="Dim x As Int = tx1";
_x = _tx1;
 //BA.debugLineNum = 801;BA.debugLine="Dim y As Int = ty1";
_y = _ty1;
 //BA.debugLineNum = 803;BA.debugLine="Dim dx As Int = Abs(tx2 - tx1)";
_dx = (int) (anywheresoftware.b4a.keywords.Common.Abs(_tx2-_tx1));
 //BA.debugLineNum = 804;BA.debugLine="Dim dy As Int = Abs(ty2 - ty1)";
_dy = (int) (anywheresoftware.b4a.keywords.Common.Abs(_ty2-_ty1));
 //BA.debugLineNum = 806;BA.debugLine="Dim signx As Int = (tx2-tx1)/dx";
_signx = (int) ((_tx2-_tx1)/(double)_dx);
 //BA.debugLineNum = 807;BA.debugLine="Dim signy As Int = (ty2-ty1)/dy";
_signy = (int) ((_ty2-_ty1)/(double)_dy);
 //BA.debugLineNum = 809;BA.debugLine="Dim changed As Boolean = False";
_changed = anywheresoftware.b4a.keywords.Common.False;
 //BA.debugLineNum = 812;BA.debugLine="If (dy>=dx) Then";
if (true) break;

case 1:
//if
this.state = 6;
if ((_dy>=_dx)) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 6;
 //BA.debugLineNum = 813;BA.debugLine="Dim dy As Int = Abs(tx2 - tx1) 'swap";
_dy = (int) (anywheresoftware.b4a.keywords.Common.Abs(_tx2-_tx1));
 //BA.debugLineNum = 814;BA.debugLine="Dim dx As Int = Abs(ty2 - ty1)";
_dx = (int) (anywheresoftware.b4a.keywords.Common.Abs(_ty2-_ty1));
 //BA.debugLineNum = 815;BA.debugLine="changed = True";
_changed = anywheresoftware.b4a.keywords.Common.True;
 if (true) break;

case 5:
//C
this.state = 6;
 if (true) break;

case 6:
//C
this.state = 7;
;
 //BA.debugLineNum = 826;BA.debugLine="Dim e As Float = (2*dy)-dx";
_e = (float) ((2*_dy)-_dx);
 //BA.debugLineNum = 827;BA.debugLine="For i=1 To dx";
if (true) break;

case 7:
//for
this.state = 28;
step15 = 1;
limit15 = _dx;
_i = (int) (1) ;
this.state = 29;
if (true) break;

case 29:
//C
this.state = 28;
if ((step15 > 0 && _i <= limit15) || (step15 < 0 && _i >= limit15)) this.state = 9;
if (true) break;

case 30:
//C
this.state = 29;
_i = ((int)(0 + _i + step15)) ;
if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 829;BA.debugLine="If lineynumber.Get(lineynumber.size-1)<>y Then";
if (true) break;

case 10:
//if
this.state = 13;
if ((_lineynumber.Get((int) (_lineynumber.getSize()-1))).equals((Object)(_y)) == false) { 
this.state = 12;
}if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 830;BA.debugLine="linenumber.add(x)";
_linenumber.Add((Object)(_x));
 //BA.debugLineNum = 831;BA.debugLine="lineynumber.add(y)";
_lineynumber.Add((Object)(_y));
 if (true) break;
;
 //BA.debugLineNum = 833;BA.debugLine="Do While e>=0";

case 13:
//do while
this.state = 22;
while (_e>=0) {
this.state = 15;
if (true) break;
}
if (true) break;

case 15:
//C
this.state = 16;
 //BA.debugLineNum = 834;BA.debugLine="If changed=True Then";
if (true) break;

case 16:
//if
this.state = 21;
if (_changed==anywheresoftware.b4a.keywords.Common.True) { 
this.state = 18;
}else {
this.state = 20;
}if (true) break;

case 18:
//C
this.state = 21;
 //BA.debugLineNum = 836;BA.debugLine="x=x+signx";
_x = (int) (_x+_signx);
 if (true) break;

case 20:
//C
this.state = 21;
 //BA.debugLineNum = 842;BA.debugLine="y=y+signy";
_y = (int) (_y+_signy);
 if (true) break;

case 21:
//C
this.state = 13;
;
 //BA.debugLineNum = 847;BA.debugLine="e=e-2*dx";
_e = (float) (_e-2*_dx);
 if (true) break;
;
 //BA.debugLineNum = 849;BA.debugLine="If changed=True Then";

case 22:
//if
this.state = 27;
if (_changed==anywheresoftware.b4a.keywords.Common.True) { 
this.state = 24;
}else {
this.state = 26;
}if (true) break;

case 24:
//C
this.state = 27;
 //BA.debugLineNum = 850;BA.debugLine="y =y+signy";
_y = (int) (_y+_signy);
 if (true) break;

case 26:
//C
this.state = 27;
 //BA.debugLineNum = 852;BA.debugLine="x =x+signx";
_x = (int) (_x+_signx);
 if (true) break;

case 27:
//C
this.state = 30;
;
 //BA.debugLineNum = 854;BA.debugLine="e=e+(2*dy)";
_e = (float) (_e+(2*_dy));
 if (true) break;
if (true) break;

case 28:
//C
this.state = -1;
;
 //BA.debugLineNum = 860;BA.debugLine="Return Null";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,anywheresoftware.b4a.keywords.Common.Null);return;};
 //BA.debugLineNum = 862;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _globals() throws Exception{
 //BA.debugLineNum = 28;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 29;BA.debugLine="Type coordX (y As Float,x As Float)";
;
 //BA.debugLineNum = 30;BA.debugLine="Type coordxx (lat As Float,lng As Float)";
;
 //BA.debugLineNum = 31;BA.debugLine="Private mapsize As coordX";
mostCurrent._mapsize = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 34;BA.debugLine="Private xui As XUI";
mostCurrent._xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 35;BA.debugLine="Private timerx As Int";
_timerx = 0;
 //BA.debugLineNum = 36;BA.debugLine="Private rectanglewholeb4x As B4XRect";
mostCurrent._rectanglewholeb4x = new anywheresoftware.b4a.objects.B4XCanvas.B4XRect();
 //BA.debugLineNum = 38;BA.debugLine="Private pnlGraph As Panel";
mostCurrent._pnlgraph = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 39;BA.debugLine="Private cvsGraph As B4XCanvas";
mostCurrent._cvsgraph = new anywheresoftware.b4a.objects.B4XCanvas();
 //BA.debugLineNum = 40;BA.debugLine="Private imvGraph As ImageView";
mostCurrent._imvgraph = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 41;BA.debugLine="Private pthGraph As BCPath";
mostCurrent._pthgraph = new b4a.example.bcpath();
 //BA.debugLineNum = 42;BA.debugLine="Private bmcGraph As BitmapCreator";
mostCurrent._bmcgraph = new b4a.example.bitmapcreator();
 //BA.debugLineNum = 43;BA.debugLine="Private bmc2ndgraph As BitmapCreator";
mostCurrent._bmc2ndgraph = new b4a.example.bitmapcreator();
 //BA.debugLineNum = 45;BA.debugLine="Private PointX(6), PointY(6) As Double";
_pointx = new double[(int) (6)];
;
_pointy = new double[(int) (6)];
;
 //BA.debugLineNum = 54;BA.debugLine="Private timeriterate As Timer";
mostCurrent._timeriterate = new anywheresoftware.b4a.objects.Timer();
 //BA.debugLineNum = 55;BA.debugLine="Private xpos, ypos, xposnew, yposnew As Float";
_xpos = 0f;
_ypos = 0f;
_xposnew = 0f;
_yposnew = 0f;
 //BA.debugLineNum = 57;BA.debugLine="Private xposleft, yposleft, xposright, yposright,";
_xposleft = 0f;
_yposleft = 0f;
_xposright = 0f;
_yposright = 0f;
_widthsection = 0f;
 //BA.debugLineNum = 58;BA.debugLine="Private  velocity, heading, headingrate As Float";
_velocity = 0f;
_heading = 0f;
_headingrate = 0f;
 //BA.debugLineNum = 62;BA.debugLine="Private tractor1 As coordX	'location of tractor";
mostCurrent._tractor1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 63;BA.debugLine="Private trailer1 As coordX	'location of center of";
mostCurrent._trailer1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 64;BA.debugLine="Private tractor0 As coordX	'location of tractor";
mostCurrent._tractor0 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 65;BA.debugLine="Private trailer0 As coordX	'location of center of";
mostCurrent._trailer0 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 66;BA.debugLine="Private hitch1 As coordX	'location of tractor hit";
mostCurrent._hitch1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 67;BA.debugLine="Private Offset_hitch As Float";
_offset_hitch = 0f;
 //BA.debugLineNum = 68;BA.debugLine="Private offset_trailertoboom As Float";
_offset_trailertoboom = 0f;
 //BA.debugLineNum = 69;BA.debugLine="Private offset_trailerlength As Float";
_offset_trailerlength = 0f;
 //BA.debugLineNum = 70;BA.debugLine="Private boomsectionwidth(4) As Float 'center is 1";
_boomsectionwidth = new float[(int) (4)];
;
 //BA.debugLineNum = 71;BA.debugLine="Private vector1 As coordX";
mostCurrent._vector1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 72;BA.debugLine="Private vectorlength1 As Float";
_vectorlength1 = 0f;
 //BA.debugLineNum = 73;BA.debugLine="Private boompoint0 As coordX";
mostCurrent._boompoint0 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 74;BA.debugLine="Private boompoint00 As coordX";
mostCurrent._boompoint00 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 75;BA.debugLine="Private boompoint01 As coordX 'leading point";
mostCurrent._boompoint01 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 76;BA.debugLine="Private boompoint1 As coordX";
mostCurrent._boompoint1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 77;BA.debugLine="Private boompoint10 As coordX";
mostCurrent._boompoint10 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 78;BA.debugLine="Private boompoint11 As coordX";
mostCurrent._boompoint11 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 79;BA.debugLine="Private boompoint2 As coordX";
mostCurrent._boompoint2 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 80;BA.debugLine="Private boompoint20 As coordX";
mostCurrent._boompoint20 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 81;BA.debugLine="Private boompoint21 As coordX";
mostCurrent._boompoint21 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 82;BA.debugLine="Private boompoint3 As coordX";
mostCurrent._boompoint3 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 83;BA.debugLine="Private boompoint30 As coordX";
mostCurrent._boompoint30 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 84;BA.debugLine="Private boompoint31 As coordX";
mostCurrent._boompoint31 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 85;BA.debugLine="Private boompoint4 As coordX";
mostCurrent._boompoint4 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 86;BA.debugLine="Private boompoint40 As coordX";
mostCurrent._boompoint40 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 87;BA.debugLine="Private boompoint41 As coordX";
mostCurrent._boompoint41 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 88;BA.debugLine="Private boompoint5 As coordX";
mostCurrent._boompoint5 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 89;BA.debugLine="Private boompoint50 As coordX";
mostCurrent._boompoint50 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 90;BA.debugLine="Private boompoint51 As coordX 'leading point";
mostCurrent._boompoint51 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 91;BA.debugLine="Private boomcenter1 As coordX";
mostCurrent._boomcenter1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 92;BA.debugLine="Private unitvector1 As coordX";
mostCurrent._unitvector1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 93;BA.debugLine="Private boomcolor(5) As Int";
_boomcolor = new int[(int) (5)];
;
 //BA.debugLineNum = 102;BA.debugLine="Public x1 As Int";
_x1 = 0;
 //BA.debugLineNum = 103;BA.debugLine="Public x2 As Int";
_x2 = 0;
 //BA.debugLineNum = 104;BA.debugLine="Public y1 As Int";
_y1 = 0;
 //BA.debugLineNum = 105;BA.debugLine="Public y2 As Int";
_y2 = 0;
 //BA.debugLineNum = 107;BA.debugLine="Public P1 As coordX";
mostCurrent._p1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 108;BA.debugLine="Public P2 As coordX";
mostCurrent._p2 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 109;BA.debugLine="Public P3 As coordX";
mostCurrent._p3 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 110;BA.debugLine="Public P4 As coordX";
mostCurrent._p4 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 112;BA.debugLine="Public a0 As coordX";
mostCurrent._a0 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 113;BA.debugLine="Public a1 As coordX";
mostCurrent._a1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 114;BA.debugLine="Public b0 As coordX";
mostCurrent._b0 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 115;BA.debugLine="Public b1 As coordX";
mostCurrent._b1 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 117;BA.debugLine="Public rectanglewhole As Rect";
mostCurrent._rectanglewhole = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper();
 //BA.debugLineNum = 118;BA.debugLine="Public canvas1 As Canvas";
mostCurrent._canvas1 = new anywheresoftware.b4a.objects.drawable.CanvasWrapper();
 //BA.debugLineNum = 119;BA.debugLine="Private rp As RuntimePermissions";
mostCurrent._rp = new anywheresoftware.b4a.objects.RuntimePermissions();
 //BA.debugLineNum = 121;BA.debugLine="Dim displayoutlines As Boolean";
_displayoutlines = false;
 //BA.debugLineNum = 122;BA.debugLine="Dim displayfill As Boolean";
_displayfill = false;
 //BA.debugLineNum = 125;BA.debugLine="Public boomon As Boolean";
_boomon = false;
 //BA.debugLineNum = 126;BA.debugLine="Private Panel1 As B4XView";
mostCurrent._panel1 = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 128;BA.debugLine="Type coord (lat As Long,lng As Long)";
;
 //BA.debugLineNum = 131;BA.debugLine="Public origin As coordxx";
mostCurrent._origin = new b4a.bitmapdrawer2.main._coordxx();
 //BA.debugLineNum = 132;BA.debugLine="Private deltalat As Float";
_deltalat = 0f;
 //BA.debugLineNum = 133;BA.debugLine="Private deltalong As Float";
_deltalong = 0f;
 //BA.debugLineNum = 134;BA.debugLine="Private xposorigin As Int";
_xposorigin = 0;
 //BA.debugLineNum = 135;BA.debugLine="Private yposorigin As Int";
_yposorigin = 0;
 //BA.debugLineNum = 136;BA.debugLine="Private b4arect1 As B4XRect";
mostCurrent._b4arect1 = new anywheresoftware.b4a.objects.B4XCanvas.B4XRect();
 //BA.debugLineNum = 137;BA.debugLine="Private section1colour As Panel";
mostCurrent._section1colour = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 138;BA.debugLine="Private section2colour As Panel";
mostCurrent._section2colour = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 139;BA.debugLine="Private section3colour As Panel";
mostCurrent._section3colour = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 140;BA.debugLine="Private section4colour As Panel";
mostCurrent._section4colour = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 141;BA.debugLine="Private section5colour As Panel";
mostCurrent._section5colour = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 142;BA.debugLine="End Sub";
return "";
}
public static String  _initialize(int _index) throws Exception{
 //BA.debugLineNum = 627;BA.debugLine="Private Sub Initialize(Index As Int)";
 //BA.debugLineNum = 629;BA.debugLine="bmcGraph.Initialize(1000,1000)";
mostCurrent._bmcgraph._initialize(processBA,(int) (1000),(int) (1000));
 //BA.debugLineNum = 636;BA.debugLine="bmc2ndgraph.Initialize(mapsize.x, mapsize.y)";
mostCurrent._bmc2ndgraph._initialize(processBA,(int) (mostCurrent._mapsize.x /*float*/ ),(int) (mostCurrent._mapsize.y /*float*/ ));
 //BA.debugLineNum = 637;BA.debugLine="rectanglewhole.Initialize(0,0,mapsize.x,mapsize.y";
mostCurrent._rectanglewhole.Initialize((int) (0),(int) (0),(int) (mostCurrent._mapsize.x /*float*/ ),(int) (mostCurrent._mapsize.y /*float*/ ));
 //BA.debugLineNum = 638;BA.debugLine="rectanglewholeb4x.Initialize(0,0,1000,1000)";
mostCurrent._rectanglewholeb4x.Initialize((float) (0),(float) (0),(float) (1000),(float) (1000));
 //BA.debugLineNum = 639;BA.debugLine="bmcGraph.DrawRect(rectanglewholeb4x,xui.Color_whi";
mostCurrent._bmcgraph._drawrect(mostCurrent._rectanglewholeb4x,mostCurrent._xui.Color_White,anywheresoftware.b4a.keywords.Common.True,(int) (1));
 //BA.debugLineNum = 640;BA.debugLine="bmcGraph.DrawLine(5,900,900,5,xui.Color_green,60)";
mostCurrent._bmcgraph._drawline((float) (5),(float) (900),(float) (900),(float) (5),mostCurrent._xui.Color_Green,(int) (60));
 //BA.debugLineNum = 641;BA.debugLine="bmcGraph.DrawLine(5,300,300,5,xui.Color_green,40)";
mostCurrent._bmcgraph._drawline((float) (5),(float) (300),(float) (300),(float) (5),mostCurrent._xui.Color_Green,(int) (40));
 //BA.debugLineNum = 645;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _lineintersect(b4a.bitmapdrawer2.main._coordx _point1p,b4a.bitmapdrawer2.main._coordx _point1c,b4a.bitmapdrawer2.main._coordx _point1f,b4a.bitmapdrawer2.main._coordx _point2p,b4a.bitmapdrawer2.main._coordx _point2c,b4a.bitmapdrawer2.main._coordx _point2f,int _k) throws Exception{
ResumableSub_lineintersect rsub = new ResumableSub_lineintersect(null,_point1p,_point1c,_point1f,_point2p,_point2c,_point2f,_k);
rsub.resume(processBA, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_lineintersect extends BA.ResumableSub {
public ResumableSub_lineintersect(b4a.bitmapdrawer2.main parent,b4a.bitmapdrawer2.main._coordx _point1p,b4a.bitmapdrawer2.main._coordx _point1c,b4a.bitmapdrawer2.main._coordx _point1f,b4a.bitmapdrawer2.main._coordx _point2p,b4a.bitmapdrawer2.main._coordx _point2c,b4a.bitmapdrawer2.main._coordx _point2f,int _k) {
this.parent = parent;
this._point1p = _point1p;
this._point1c = _point1c;
this._point1f = _point1f;
this._point2p = _point2p;
this._point2c = _point2c;
this._point2f = _point2f;
this._k = _k;
}
b4a.bitmapdrawer2.main parent;
b4a.bitmapdrawer2.main._coordx _point1p;
b4a.bitmapdrawer2.main._coordx _point1c;
b4a.bitmapdrawer2.main._coordx _point1f;
b4a.bitmapdrawer2.main._coordx _point2p;
b4a.bitmapdrawer2.main._coordx _point2c;
b4a.bitmapdrawer2.main._coordx _point2f;
int _k;
float _u = 0f;
float _v = 0f;
float _denominat = 0f;
b4a.bitmapdrawer2.main._coordx _intersectpoint = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 933;BA.debugLine="Dim U As Float";
_u = 0f;
 //BA.debugLineNum = 934;BA.debugLine="Dim V As Float";
_v = 0f;
 //BA.debugLineNum = 935;BA.debugLine="Dim denominat As Float";
_denominat = 0f;
 //BA.debugLineNum = 936;BA.debugLine="Dim intersectpoint As coordX";
_intersectpoint = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 937;BA.debugLine="intersectpoint.Initialize";
_intersectpoint.Initialize();
 //BA.debugLineNum = 940;BA.debugLine="denominat=(point2c.x-point1c.x)*(point2f.y-point1";
_denominat = (float) ((_point2c.x /*float*/ -_point1c.x /*float*/ )*(_point2f.y /*float*/ -_point1f.y /*float*/ )-(_point2c.y /*float*/ -_point1c.y /*float*/ )*(_point2f.x /*float*/ -_point1f.x /*float*/ ));
 //BA.debugLineNum = 941;BA.debugLine="If denominat=0 Then";
if (true) break;

case 1:
//if
this.state = 4;
if (_denominat==0) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 943;BA.debugLine="rectanglefiller(point1c,point1p,point2p,point2c,";
_rectanglefiller(_point1c,_point1p,_point2p,_point2c,_k);
 //BA.debugLineNum = 944;BA.debugLine="rectanglechecker(point1f,point1c,point2c,point2f";
_rectanglechecker(_point1f,_point1c,_point2c,_point2f,_k);
 //BA.debugLineNum = 945;BA.debugLine="Return";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;};
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 947;BA.debugLine="U=((point1c.y-point1f.y)*(point2f.x-point1f.x)-(p";
_u = (float) (((_point1c.y /*float*/ -_point1f.y /*float*/ )*(_point2f.x /*float*/ -_point1f.x /*float*/ )-(_point2f.y /*float*/ -_point1f.y /*float*/ )*(_point1c.x /*float*/ -_point1f.x /*float*/ ))/(double)_denominat);
 //BA.debugLineNum = 948;BA.debugLine="v=((point1c.y-point1f.y)*(point2c.x-point1c.x)-(p";
_v = (float) (((_point1c.y /*float*/ -_point1f.y /*float*/ )*(_point2c.x /*float*/ -_point1c.x /*float*/ )-(_point2c.y /*float*/ -_point1c.y /*float*/ )*(_point1c.x /*float*/ -_point1f.x /*float*/ ))/(double)_denominat);
 //BA.debugLineNum = 949;BA.debugLine="If (U>0 And U<1 And v<1 And v>0) Then";
if (true) break;

case 5:
//if
this.state = 14;
if ((_u>0 && _u<1 && _v<1 && _v>0)) { 
this.state = 7;
}else {
this.state = 13;
}if (true) break;

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 951;BA.debugLine="intersectpoint.x=point1c.x+(point2c.x-point1c.x)";
_intersectpoint.x /*float*/  = (float) (_point1c.x /*float*/ +(_point2c.x /*float*/ -_point1c.x /*float*/ )*_u);
 //BA.debugLineNum = 952;BA.debugLine="intersectpoint.y=point1c.y+(point2c.y-point1c.x)";
_intersectpoint.y /*float*/  = (float) (_point1c.y /*float*/ +(_point2c.y /*float*/ -_point1c.x /*float*/ )*_v);
 //BA.debugLineNum = 953;BA.debugLine="trianglefiller(point1c,point1p,intersectpoint,k)";
_trianglefiller(_point1c,_point1p,_intersectpoint,_k);
 //BA.debugLineNum = 954;BA.debugLine="trianglefiller(point2c,point2p,intersectpoint,k)";
_trianglefiller(_point2c,_point2p,_intersectpoint,_k);
 //BA.debugLineNum = 956;BA.debugLine="boomcolor(k)=Colors.yellow";
parent._boomcolor[_k] = anywheresoftware.b4a.keywords.Common.Colors.Yellow;
 //BA.debugLineNum = 957;BA.debugLine="wait for (trianglechecker(point1f,point1p,inters";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _trianglechecker(_point1f,_point1p,_intersectpoint,_k));
this.state = 15;
return;
case 15:
//C
this.state = 8;
;
 //BA.debugLineNum = 958;BA.debugLine="If boomcolor(k)=Colors.Yellow Then";
if (true) break;

case 8:
//if
this.state = 11;
if (parent._boomcolor[_k]==anywheresoftware.b4a.keywords.Common.Colors.Yellow) { 
this.state = 10;
}if (true) break;

case 10:
//C
this.state = 11;
 //BA.debugLineNum = 959;BA.debugLine="wait for (trianglechecker(point2f,point2p,inters";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _trianglechecker(_point2f,_point2p,_intersectpoint,_k));
this.state = 16;
return;
case 16:
//C
this.state = 11;
;
 if (true) break;

case 11:
//C
this.state = 14;
;
 //BA.debugLineNum = 961;BA.debugLine="Return";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;};
 if (true) break;

case 13:
//C
this.state = 14;
 //BA.debugLineNum = 964;BA.debugLine="wait for (rectanglefiller(point1c,point1p,point2";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _rectanglefiller(_point1c,_point1p,_point2p,_point2c,_k));
this.state = 17;
return;
case 17:
//C
this.state = 14;
;
 //BA.debugLineNum = 965;BA.debugLine="wait for (rectanglechecker(point1f,point1c,point";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _rectanglechecker(_point1f,_point1c,_point2c,_point2f,_k));
this.state = 18;
return;
case 18:
//C
this.state = 14;
;
 //BA.debugLineNum = 966;BA.debugLine="Return";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;};
 if (true) break;

case 14:
//C
this.state = -1;
;
 //BA.debugLineNum = 968;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static void  _complete() throws Exception{
}
public static String  _location_center() throws Exception{
float _distance = 0f;
float _radius = 0f;
float _h1 = 0f;
float _o1 = 0f;
float _h2 = 0f;
float _o2 = 0f;
anywheresoftware.b4a.gps.LocationWrapper _location6 = null;
anywheresoftware.b4a.gps.LocationWrapper _location7 = null;
 //BA.debugLineNum = 864;BA.debugLine="Sub location_center 'to convert lat and long into";
 //BA.debugLineNum = 867;BA.debugLine="Private distance As Float";
_distance = 0f;
 //BA.debugLineNum = 868;BA.debugLine="Private radius As Float";
_radius = 0f;
 //BA.debugLineNum = 869;BA.debugLine="Private H1 As Float 'long";
_h1 = 0f;
 //BA.debugLineNum = 870;BA.debugLine="Private O1 As Float 'lat";
_o1 = 0f;
 //BA.debugLineNum = 871;BA.debugLine="Private H2 As Float 'long";
_h2 = 0f;
 //BA.debugLineNum = 872;BA.debugLine="Private O2 As Float 'lat";
_o2 = 0f;
 //BA.debugLineNum = 873;BA.debugLine="Dim location6 As Location";
_location6 = new anywheresoftware.b4a.gps.LocationWrapper();
 //BA.debugLineNum = 875;BA.debugLine="location6.Initialize";
_location6.Initialize();
 //BA.debugLineNum = 878;BA.debugLine="Dim location7 As Location";
_location7 = new anywheresoftware.b4a.gps.LocationWrapper();
 //BA.debugLineNum = 879;BA.debugLine="location7.Initialize";
_location7.Initialize();
 //BA.debugLineNum = 882;BA.debugLine="origin.Initialize";
mostCurrent._origin.Initialize();
 //BA.debugLineNum = 883;BA.debugLine="radius =6372300";
_radius = (float) (6372300);
 //BA.debugLineNum = 884;BA.debugLine="origin.lat =Starter.location2.Latitude";
mostCurrent._origin.lat /*float*/  = (float) (mostCurrent._starter._location2 /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude());
 //BA.debugLineNum = 886;BA.debugLine="origin.lng =Starter.location2.Longitude";
mostCurrent._origin.lng /*float*/  = (float) (mostCurrent._starter._location2 /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude());
 //BA.debugLineNum = 888;BA.debugLine="H1=(origin.lng)/360*2*cPI";
_h1 = (float) ((mostCurrent._origin.lng /*float*/ )/(double)360*2*anywheresoftware.b4a.keywords.Common.cPI);
 //BA.debugLineNum = 889;BA.debugLine="H2=(origin.lng+.01)/360*2*cPI";
_h2 = (float) ((mostCurrent._origin.lng /*float*/ +.01)/(double)360*2*anywheresoftware.b4a.keywords.Common.cPI);
 //BA.debugLineNum = 891;BA.debugLine="O1=(origin.lat)/360*2*cPI";
_o1 = (float) ((mostCurrent._origin.lat /*float*/ )/(double)360*2*anywheresoftware.b4a.keywords.Common.cPI);
 //BA.debugLineNum = 892;BA.debugLine="O2=(origin.lat+.01)/360*2*cPI";
_o2 = (float) ((mostCurrent._origin.lat /*float*/ +.01)/(double)360*2*anywheresoftware.b4a.keywords.Common.cPI);
 //BA.debugLineNum = 894;BA.debugLine="location6.Latitude=O1";
_location6.setLatitude(_o1);
 //BA.debugLineNum = 895;BA.debugLine="location6.Longitude=H1";
_location6.setLongitude(_h1);
 //BA.debugLineNum = 896;BA.debugLine="location7.Latitude=O1";
_location7.setLatitude(_o1);
 //BA.debugLineNum = 897;BA.debugLine="location7.Longitude=H2";
_location7.setLongitude(_h2);
 //BA.debugLineNum = 898;BA.debugLine="deltalat=-2*radius*ASin(Power(Power(Sin((O2-O1)/2";
_deltalat = (float) (-2*_radius*anywheresoftware.b4a.keywords.Common.ASin(anywheresoftware.b4a.keywords.Common.Power(anywheresoftware.b4a.keywords.Common.Power(anywheresoftware.b4a.keywords.Common.Sin((_o2-_o1)/(double)2),2)+anywheresoftware.b4a.keywords.Common.Cos(_o1)*anywheresoftware.b4a.keywords.Common.Cos(_o2)*anywheresoftware.b4a.keywords.Common.Power(anywheresoftware.b4a.keywords.Common.Sin((0)/(double)2),2),.5))/(double).01*30);
 //BA.debugLineNum = 899;BA.debugLine="deltalong=2*radius*ASin(Power(Cos(O1)*Cos(O1)*Pow";
_deltalong = (float) (2*_radius*anywheresoftware.b4a.keywords.Common.ASin(anywheresoftware.b4a.keywords.Common.Power(anywheresoftware.b4a.keywords.Common.Cos(_o1)*anywheresoftware.b4a.keywords.Common.Cos(_o1)*anywheresoftware.b4a.keywords.Common.Power(anywheresoftware.b4a.keywords.Common.Sin((_h2-_h1)/(double)2),2),.5))/(double).01*30);
 //BA.debugLineNum = 909;BA.debugLine="End Sub";
return "";
}
public static void  _locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
ResumableSub_LocationChanged rsub = new ResumableSub_LocationChanged(null,_location1);
rsub.resume(processBA, null);
}
public static class ResumableSub_LocationChanged extends BA.ResumableSub {
public ResumableSub_LocationChanged(b4a.bitmapdrawer2.main parent,anywheresoftware.b4a.gps.LocationWrapper _location1) {
this.parent = parent;
this._location1 = _location1;
}
b4a.bitmapdrawer2.main parent;
anywheresoftware.b4a.gps.LocationWrapper _location1;
anywheresoftware.b4a.objects.B4XCanvas.B4XRect _r = null;
b4a.example.bitmapcreator._drawtask _dt = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 225;BA.debugLine="If Starter.Location2.BearingValid = True Then";
if (true) break;

case 1:
//if
this.state = 4;
if (parent.mostCurrent._starter._location2 /*anywheresoftware.b4a.gps.LocationWrapper*/ .getBearingValid()==anywheresoftware.b4a.keywords.Common.True) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 226;BA.debugLine="heading=Starter.Location2.Bearing";
parent._heading = parent.mostCurrent._starter._location2 /*anywheresoftware.b4a.gps.LocationWrapper*/ .getBearing();
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 235;BA.debugLine="timerx=DateTime.now";
parent._timerx = (int) (anywheresoftware.b4a.keywords.Common.DateTime.getNow());
 //BA.debugLineNum = 237;BA.debugLine="xposnew=xposorigin+deltalong*(Starter.Location2.Lo";
parent._xposnew = (float) (parent._xposorigin+parent._deltalong*(parent.mostCurrent._starter._location2 /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude()-parent.mostCurrent._origin.lng /*float*/ )/(double)2);
 //BA.debugLineNum = 238;BA.debugLine="yposnew=yposorigin+deltalat*(Starter.Location2.la";
parent._yposnew = (float) (parent._yposorigin+parent._deltalat*(parent.mostCurrent._starter._location2 /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()-parent.mostCurrent._origin.lat /*float*/ )/(double)2);
 //BA.debugLineNum = 241;BA.debugLine="Log(\"xposnew: \" & NumberFormat(xposnew,0,0) & \" y";
anywheresoftware.b4a.keywords.Common.LogImpl("7196625","xposnew: "+anywheresoftware.b4a.keywords.Common.NumberFormat(parent._xposnew,(int) (0),(int) (0))+" yposnew: "+anywheresoftware.b4a.keywords.Common.NumberFormat(parent._yposnew,(int) (0),(int) (0))+" heading: "+anywheresoftware.b4a.keywords.Common.NumberFormat(parent._heading,(int) (0),(int) (0)),0);
 //BA.debugLineNum = 248;BA.debugLine="bmcGraph.DrawCircle(xposnew,yposnew,4,xui.Color_r";
parent.mostCurrent._bmcgraph._drawcircle(parent._xposnew,parent._yposnew,(float) (4),parent.mostCurrent._xui.Color_Red,anywheresoftware.b4a.keywords.Common.True,(int) (1));
 //BA.debugLineNum = 256;BA.debugLine="tractor0.x=xpos";
parent.mostCurrent._tractor0.x /*float*/  = parent._xpos;
 //BA.debugLineNum = 257;BA.debugLine="tractor0.y=ypos";
parent.mostCurrent._tractor0.y /*float*/  = parent._ypos;
 //BA.debugLineNum = 259;BA.debugLine="tractor1.x=xposnew";
parent.mostCurrent._tractor1.x /*float*/  = parent._xposnew;
 //BA.debugLineNum = 260;BA.debugLine="tractor1.y=yposnew";
parent.mostCurrent._tractor1.y /*float*/  = parent._yposnew;
 //BA.debugLineNum = 262;BA.debugLine="hitch1.x=tractor1.x-Offset_hitch*CosD(heading+90)";
parent.mostCurrent._hitch1.x /*float*/  = (float) (parent.mostCurrent._tractor1.x /*float*/ -parent._offset_hitch*anywheresoftware.b4a.keywords.Common.CosD(parent._heading+90));
 //BA.debugLineNum = 263;BA.debugLine="hitch1.y=tractor1.y-Offset_hitch*SinD(heading+90)";
parent.mostCurrent._hitch1.y /*float*/  = (float) (parent.mostCurrent._tractor1.y /*float*/ -parent._offset_hitch*anywheresoftware.b4a.keywords.Common.SinD(parent._heading+90));
 //BA.debugLineNum = 267;BA.debugLine="vector1.x = hitch1.x-trailer0.x";
parent.mostCurrent._vector1.x /*float*/  = (float) (parent.mostCurrent._hitch1.x /*float*/ -parent.mostCurrent._trailer0.x /*float*/ );
 //BA.debugLineNum = 268;BA.debugLine="vector1.y = hitch1.y-trailer0.y";
parent.mostCurrent._vector1.y /*float*/  = (float) (parent.mostCurrent._hitch1.y /*float*/ -parent.mostCurrent._trailer0.y /*float*/ );
 //BA.debugLineNum = 269;BA.debugLine="vectorlength1=Power(Power(vector1.x,2)+Power(vect";
parent._vectorlength1 = (float) (anywheresoftware.b4a.keywords.Common.Power(anywheresoftware.b4a.keywords.Common.Power(parent.mostCurrent._vector1.x /*float*/ ,2)+anywheresoftware.b4a.keywords.Common.Power(parent.mostCurrent._vector1.y /*float*/ ,2),.5));
 //BA.debugLineNum = 270;BA.debugLine="unitvector1.x=vector1.x/vectorlength1";
parent.mostCurrent._unitvector1.x /*float*/  = (float) (parent.mostCurrent._vector1.x /*float*/ /(double)parent._vectorlength1);
 //BA.debugLineNum = 271;BA.debugLine="unitvector1.y=vector1.y/vectorlength1";
parent.mostCurrent._unitvector1.y /*float*/  = (float) (parent.mostCurrent._vector1.y /*float*/ /(double)parent._vectorlength1);
 //BA.debugLineNum = 272;BA.debugLine="trailer1.x=hitch1.x-vector1.x*offset_trailerlengt";
parent.mostCurrent._trailer1.x /*float*/  = (float) (parent.mostCurrent._hitch1.x /*float*/ -parent.mostCurrent._vector1.x /*float*/ *parent._offset_trailerlength/(double)parent._vectorlength1);
 //BA.debugLineNum = 273;BA.debugLine="trailer1.y=hitch1.y-vector1.y*offset_trailerlengt";
parent.mostCurrent._trailer1.y /*float*/  = (float) (parent.mostCurrent._hitch1.y /*float*/ -parent.mostCurrent._vector1.y /*float*/ *parent._offset_trailerlength/(double)parent._vectorlength1);
 //BA.debugLineNum = 274;BA.debugLine="boomcenter1.x=-unitvector1.x*offset_trailertoboom";
parent.mostCurrent._boomcenter1.x /*float*/  = (float) (-parent.mostCurrent._unitvector1.x /*float*/ *parent._offset_trailertoboom+parent.mostCurrent._trailer1.x /*float*/ );
 //BA.debugLineNum = 275;BA.debugLine="boomcenter1.y=-unitvector1.y*offset_trailertoboom";
parent.mostCurrent._boomcenter1.y /*float*/  = (float) (-parent.mostCurrent._unitvector1.y /*float*/ *parent._offset_trailertoboom+parent.mostCurrent._trailer1.y /*float*/ );
 //BA.debugLineNum = 280;BA.debugLine="boompoint0.x=-(boomsectionwidth(1)/2+boomsectionw";
parent.mostCurrent._boompoint0.x /*float*/  = (float) (-(parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)]+parent._boomsectionwidth[(int) (3)])*parent.mostCurrent._unitvector1.y /*float*/ +parent.mostCurrent._boomcenter1.x /*float*/ );
 //BA.debugLineNum = 281;BA.debugLine="boompoint0.y=-(boomsectionwidth(1)/2+boomsectionw";
parent.mostCurrent._boompoint0.y /*float*/  = (float) (-(parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)]+parent._boomsectionwidth[(int) (3)])*-parent.mostCurrent._unitvector1.x /*float*/ +parent.mostCurrent._boomcenter1.y /*float*/ );
 //BA.debugLineNum = 282;BA.debugLine="boompoint01.x=boompoint0.x+ boompoint0.x-boompoin";
parent.mostCurrent._boompoint01.x /*float*/  = (float) (parent.mostCurrent._boompoint0.x /*float*/ +parent.mostCurrent._boompoint0.x /*float*/ -parent.mostCurrent._boompoint00.x /*float*/ );
 //BA.debugLineNum = 283;BA.debugLine="boompoint01.y=boompoint0.y+ boompoint0.y-boompoin";
parent.mostCurrent._boompoint01.y /*float*/  = (float) (parent.mostCurrent._boompoint0.y /*float*/ +parent.mostCurrent._boompoint0.y /*float*/ -parent.mostCurrent._boompoint00.y /*float*/ );
 //BA.debugLineNum = 284;BA.debugLine="boompoint1.x=-(boomsectionwidth(1)/2+boomsectionw";
parent.mostCurrent._boompoint1.x /*float*/  = (float) (-(parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)])*parent.mostCurrent._unitvector1.y /*float*/ +parent.mostCurrent._boomcenter1.x /*float*/ );
 //BA.debugLineNum = 285;BA.debugLine="boompoint1.y=-(boomsectionwidth(1)/2+boomsectionw";
parent.mostCurrent._boompoint1.y /*float*/  = (float) (-(parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)])*-parent.mostCurrent._unitvector1.x /*float*/ +parent.mostCurrent._boomcenter1.y /*float*/ );
 //BA.debugLineNum = 286;BA.debugLine="boompoint11.x=boompoint1.x+ boompoint1.x-boompoin";
parent.mostCurrent._boompoint11.x /*float*/  = (float) (parent.mostCurrent._boompoint1.x /*float*/ +parent.mostCurrent._boompoint1.x /*float*/ -parent.mostCurrent._boompoint10.x /*float*/ );
 //BA.debugLineNum = 287;BA.debugLine="boompoint11.y=boompoint1.y+ boompoint1.y-boompoin";
parent.mostCurrent._boompoint11.y /*float*/  = (float) (parent.mostCurrent._boompoint1.y /*float*/ +parent.mostCurrent._boompoint1.y /*float*/ -parent.mostCurrent._boompoint10.y /*float*/ );
 //BA.debugLineNum = 288;BA.debugLine="boompoint2.x=-(boomsectionwidth(1)/2)*unitvector1";
parent.mostCurrent._boompoint2.x /*float*/  = (float) (-(parent._boomsectionwidth[(int) (1)]/(double)2)*parent.mostCurrent._unitvector1.y /*float*/ +parent.mostCurrent._boomcenter1.x /*float*/ );
 //BA.debugLineNum = 289;BA.debugLine="boompoint2.y=-(boomsectionwidth(1)/2)*-unitvector";
parent.mostCurrent._boompoint2.y /*float*/  = (float) (-(parent._boomsectionwidth[(int) (1)]/(double)2)*-parent.mostCurrent._unitvector1.x /*float*/ +parent.mostCurrent._boomcenter1.y /*float*/ );
 //BA.debugLineNum = 290;BA.debugLine="boompoint21.x=boompoint2.x+ boompoint2.x-boompoin";
parent.mostCurrent._boompoint21.x /*float*/  = (float) (parent.mostCurrent._boompoint2.x /*float*/ +parent.mostCurrent._boompoint2.x /*float*/ -parent.mostCurrent._boompoint20.x /*float*/ );
 //BA.debugLineNum = 291;BA.debugLine="boompoint21.y=boompoint2.y+ boompoint2.y-boompoin";
parent.mostCurrent._boompoint21.y /*float*/  = (float) (parent.mostCurrent._boompoint2.y /*float*/ +parent.mostCurrent._boompoint2.y /*float*/ -parent.mostCurrent._boompoint20.y /*float*/ );
 //BA.debugLineNum = 292;BA.debugLine="boompoint3.x=(boomsectionwidth(1)/2)*unitvector1.";
parent.mostCurrent._boompoint3.x /*float*/  = (float) ((parent._boomsectionwidth[(int) (1)]/(double)2)*parent.mostCurrent._unitvector1.y /*float*/ +parent.mostCurrent._boomcenter1.x /*float*/ );
 //BA.debugLineNum = 293;BA.debugLine="boompoint3.y=(boomsectionwidth(1)/2)*-unitvector1";
parent.mostCurrent._boompoint3.y /*float*/  = (float) ((parent._boomsectionwidth[(int) (1)]/(double)2)*-parent.mostCurrent._unitvector1.x /*float*/ +parent.mostCurrent._boomcenter1.y /*float*/ );
 //BA.debugLineNum = 294;BA.debugLine="boompoint31.x=boompoint3.x+ boompoint3.x-boompoin";
parent.mostCurrent._boompoint31.x /*float*/  = (float) (parent.mostCurrent._boompoint3.x /*float*/ +parent.mostCurrent._boompoint3.x /*float*/ -parent.mostCurrent._boompoint30.x /*float*/ );
 //BA.debugLineNum = 295;BA.debugLine="boompoint31.y=boompoint3.y+ boompoint3.y-boompoin";
parent.mostCurrent._boompoint31.y /*float*/  = (float) (parent.mostCurrent._boompoint3.y /*float*/ +parent.mostCurrent._boompoint3.y /*float*/ -parent.mostCurrent._boompoint30.y /*float*/ );
 //BA.debugLineNum = 296;BA.debugLine="boompoint4.x=(boomsectionwidth(1)/2+boomsectionwi";
parent.mostCurrent._boompoint4.x /*float*/  = (float) ((parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)])*parent.mostCurrent._unitvector1.y /*float*/ +parent.mostCurrent._boomcenter1.x /*float*/ );
 //BA.debugLineNum = 297;BA.debugLine="boompoint4.y=(boomsectionwidth(1)/2+boomsectionwi";
parent.mostCurrent._boompoint4.y /*float*/  = (float) ((parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)])*-parent.mostCurrent._unitvector1.x /*float*/ +parent.mostCurrent._boomcenter1.y /*float*/ );
 //BA.debugLineNum = 298;BA.debugLine="boompoint41.x=boompoint4.x+ boompoint4.x-boompoin";
parent.mostCurrent._boompoint41.x /*float*/  = (float) (parent.mostCurrent._boompoint4.x /*float*/ +parent.mostCurrent._boompoint4.x /*float*/ -parent.mostCurrent._boompoint40.x /*float*/ );
 //BA.debugLineNum = 299;BA.debugLine="boompoint41.y=boompoint4.y+ boompoint4.y-boompoin";
parent.mostCurrent._boompoint41.y /*float*/  = (float) (parent.mostCurrent._boompoint4.y /*float*/ +parent.mostCurrent._boompoint4.y /*float*/ -parent.mostCurrent._boompoint40.y /*float*/ );
 //BA.debugLineNum = 300;BA.debugLine="boompoint5.x=(boomsectionwidth(1)/2+boomsectionwi";
parent.mostCurrent._boompoint5.x /*float*/  = (float) ((parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)]+parent._boomsectionwidth[(int) (3)])*parent.mostCurrent._unitvector1.y /*float*/ +parent.mostCurrent._boomcenter1.x /*float*/ );
 //BA.debugLineNum = 301;BA.debugLine="boompoint5.y=(boomsectionwidth(1)/2+boomsectionwi";
parent.mostCurrent._boompoint5.y /*float*/  = (float) ((parent._boomsectionwidth[(int) (1)]/(double)2+parent._boomsectionwidth[(int) (2)]+parent._boomsectionwidth[(int) (3)])*-parent.mostCurrent._unitvector1.x /*float*/ +parent.mostCurrent._boomcenter1.y /*float*/ );
 //BA.debugLineNum = 302;BA.debugLine="boompoint51.x=boompoint5.x+ boompoint5.x-boompoin";
parent.mostCurrent._boompoint51.x /*float*/  = (float) (parent.mostCurrent._boompoint5.x /*float*/ +parent.mostCurrent._boompoint5.x /*float*/ -parent.mostCurrent._boompoint50.x /*float*/ );
 //BA.debugLineNum = 303;BA.debugLine="boompoint51.y=boompoint5.y+ boompoint5.y-boompoin";
parent.mostCurrent._boompoint51.y /*float*/  = (float) (parent.mostCurrent._boompoint5.y /*float*/ +parent.mostCurrent._boompoint5.y /*float*/ -parent.mostCurrent._boompoint50.y /*float*/ );
 //BA.debugLineNum = 310;BA.debugLine="bmcGraph.DrawLine(boompoint0.x,boompoint0.y,boomp";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint0.x /*float*/ ,parent.mostCurrent._boompoint0.y /*float*/ ,parent.mostCurrent._boompoint1.x /*float*/ ,parent.mostCurrent._boompoint1.y /*float*/ ,parent.mostCurrent._xui.Color_Gray,(int) (1));
 //BA.debugLineNum = 311;BA.debugLine="bmcGraph.DrawLine(boompoint1.x,boompoint1.y,boomp";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint1.x /*float*/ ,parent.mostCurrent._boompoint1.y /*float*/ ,parent.mostCurrent._boompoint2.x /*float*/ ,parent.mostCurrent._boompoint2.y /*float*/ ,parent.mostCurrent._xui.Color_Cyan,(int) (1));
 //BA.debugLineNum = 312;BA.debugLine="bmcGraph.DrawLine(boompoint2.x,boompoint2.y,boomp";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint2.x /*float*/ ,parent.mostCurrent._boompoint2.y /*float*/ ,parent.mostCurrent._boompoint3.x /*float*/ ,parent.mostCurrent._boompoint3.y /*float*/ ,parent.mostCurrent._xui.Color_Green,(int) (1));
 //BA.debugLineNum = 313;BA.debugLine="bmcGraph.DrawLine(boompoint3.x,boompoint3.y,boomp";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint3.x /*float*/ ,parent.mostCurrent._boompoint3.y /*float*/ ,parent.mostCurrent._boompoint4.x /*float*/ ,parent.mostCurrent._boompoint4.y /*float*/ ,parent.mostCurrent._xui.Color_Magenta,(int) (1));
 //BA.debugLineNum = 314;BA.debugLine="bmcGraph.DrawLine(boompoint4.x,boompoint4.y,boomp";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint4.x /*float*/ ,parent.mostCurrent._boompoint4.y /*float*/ ,parent.mostCurrent._boompoint5.x /*float*/ ,parent.mostCurrent._boompoint5.y /*float*/ ,parent.mostCurrent._xui.Color_Black,(int) (1));
 //BA.debugLineNum = 316;BA.debugLine="bmcGraph.DrawCircle(hitch1.x,hitch1.y,2,xui.Color";
parent.mostCurrent._bmcgraph._drawcircle(parent.mostCurrent._hitch1.x /*float*/ ,parent.mostCurrent._hitch1.y /*float*/ ,(float) (2),parent.mostCurrent._xui.Color_Black,anywheresoftware.b4a.keywords.Common.True,(int) (1));
 //BA.debugLineNum = 317;BA.debugLine="trailer0.x=trailer1.x";
parent.mostCurrent._trailer0.x /*float*/  = parent.mostCurrent._trailer1.x /*float*/ ;
 //BA.debugLineNum = 318;BA.debugLine="trailer0.y=trailer1.y";
parent.mostCurrent._trailer0.y /*float*/  = parent.mostCurrent._trailer1.y /*float*/ ;
 //BA.debugLineNum = 319;BA.debugLine="If boompoint00.x <>0 Then";
if (true) break;

case 5:
//if
this.state = 8;
if (parent.mostCurrent._boompoint00.x /*float*/ !=0) { 
this.state = 7;
}if (true) break;

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 337;BA.debugLine="Wait For (lineintersect(boompoint00,boompoint0,b";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _lineintersect(parent.mostCurrent._boompoint00,parent.mostCurrent._boompoint0,parent.mostCurrent._boompoint01,parent.mostCurrent._boompoint10,parent.mostCurrent._boompoint1,parent.mostCurrent._boompoint11,(int) (0)));
this.state = 9;
return;
case 9:
//C
this.state = 8;
;
 //BA.debugLineNum = 338;BA.debugLine="Wait For (lineintersect(boompoint10,boompoint1,b";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _lineintersect(parent.mostCurrent._boompoint10,parent.mostCurrent._boompoint1,parent.mostCurrent._boompoint11,parent.mostCurrent._boompoint20,parent.mostCurrent._boompoint2,parent.mostCurrent._boompoint21,(int) (1)));
this.state = 10;
return;
case 10:
//C
this.state = 8;
;
 //BA.debugLineNum = 339;BA.debugLine="Wait For (lineintersect(boompoint20,boompoint2,b";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _lineintersect(parent.mostCurrent._boompoint20,parent.mostCurrent._boompoint2,parent.mostCurrent._boompoint21,parent.mostCurrent._boompoint30,parent.mostCurrent._boompoint3,parent.mostCurrent._boompoint31,(int) (2)));
this.state = 11;
return;
case 11:
//C
this.state = 8;
;
 //BA.debugLineNum = 340;BA.debugLine="Wait For (lineintersect(boompoint30,boompoint3,b";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _lineintersect(parent.mostCurrent._boompoint30,parent.mostCurrent._boompoint3,parent.mostCurrent._boompoint31,parent.mostCurrent._boompoint40,parent.mostCurrent._boompoint4,parent.mostCurrent._boompoint41,(int) (3)));
this.state = 12;
return;
case 12:
//C
this.state = 8;
;
 //BA.debugLineNum = 341;BA.debugLine="Wait For (lineintersect(boompoint40,boompoint4,b";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _lineintersect(parent.mostCurrent._boompoint40,parent.mostCurrent._boompoint4,parent.mostCurrent._boompoint41,parent.mostCurrent._boompoint50,parent.mostCurrent._boompoint5,parent.mostCurrent._boompoint51,(int) (4)));
this.state = 13;
return;
case 13:
//C
this.state = 8;
;
 //BA.debugLineNum = 342;BA.debugLine="timerx=DateTime.Now-timerx";
parent._timerx = (int) (anywheresoftware.b4a.keywords.Common.DateTime.getNow()-parent._timerx);
 //BA.debugLineNum = 343;BA.debugLine="Log(\"timerx\"&timerx)";
anywheresoftware.b4a.keywords.Common.LogImpl("7196727","timerx"+BA.NumberToString(parent._timerx),0);
 //BA.debugLineNum = 344;BA.debugLine="bmcGraph.DrawLine(boompoint01.x,boompoint01.y,bo";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint01.x /*float*/ ,parent.mostCurrent._boompoint01.y /*float*/ ,parent.mostCurrent._boompoint51.x /*float*/ ,parent.mostCurrent._boompoint51.y /*float*/ ,parent.mostCurrent._xui.Color_Red,(int) (1));
 //BA.debugLineNum = 345;BA.debugLine="bmcGraph.DrawLine(boompoint01.x,boompoint01.y,bo";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint01.x /*float*/ ,parent.mostCurrent._boompoint01.y /*float*/ ,parent.mostCurrent._boompoint0.x /*float*/ ,parent.mostCurrent._boompoint0.y /*float*/ ,parent.mostCurrent._xui.Color_Magenta,(int) (1));
 //BA.debugLineNum = 347;BA.debugLine="bmcGraph.DrawLine(boompoint51.x,boompoint51.y,bo";
parent.mostCurrent._bmcgraph._drawline(parent.mostCurrent._boompoint51.x /*float*/ ,parent.mostCurrent._boompoint51.y /*float*/ ,parent.mostCurrent._boompoint5.x /*float*/ ,parent.mostCurrent._boompoint5.y /*float*/ ,parent.mostCurrent._xui.Color_Blue,(int) (1));
 if (true) break;

case 8:
//C
this.state = -1;
;
 //BA.debugLineNum = 354;BA.debugLine="boompoint00.x=boompoint0.x'custom type issue, equ";
parent.mostCurrent._boompoint00.x /*float*/  = parent.mostCurrent._boompoint0.x /*float*/ ;
 //BA.debugLineNum = 355;BA.debugLine="boompoint00.y=boompoint0.y";
parent.mostCurrent._boompoint00.y /*float*/  = parent.mostCurrent._boompoint0.y /*float*/ ;
 //BA.debugLineNum = 356;BA.debugLine="boompoint10.x=boompoint1.x";
parent.mostCurrent._boompoint10.x /*float*/  = parent.mostCurrent._boompoint1.x /*float*/ ;
 //BA.debugLineNum = 357;BA.debugLine="boompoint10.y=boompoint1.y";
parent.mostCurrent._boompoint10.y /*float*/  = parent.mostCurrent._boompoint1.y /*float*/ ;
 //BA.debugLineNum = 358;BA.debugLine="boompoint20.x=boompoint2.x";
parent.mostCurrent._boompoint20.x /*float*/  = parent.mostCurrent._boompoint2.x /*float*/ ;
 //BA.debugLineNum = 359;BA.debugLine="boompoint20.y=boompoint2.y";
parent.mostCurrent._boompoint20.y /*float*/  = parent.mostCurrent._boompoint2.y /*float*/ ;
 //BA.debugLineNum = 360;BA.debugLine="boompoint30.x=boompoint3.x";
parent.mostCurrent._boompoint30.x /*float*/  = parent.mostCurrent._boompoint3.x /*float*/ ;
 //BA.debugLineNum = 361;BA.debugLine="boompoint30.y=boompoint3.y";
parent.mostCurrent._boompoint30.y /*float*/  = parent.mostCurrent._boompoint3.y /*float*/ ;
 //BA.debugLineNum = 362;BA.debugLine="boompoint40.x=boompoint4.x";
parent.mostCurrent._boompoint40.x /*float*/  = parent.mostCurrent._boompoint4.x /*float*/ ;
 //BA.debugLineNum = 363;BA.debugLine="boompoint40.y=boompoint4.y";
parent.mostCurrent._boompoint40.y /*float*/  = parent.mostCurrent._boompoint4.y /*float*/ ;
 //BA.debugLineNum = 365;BA.debugLine="boompoint50.x=boompoint5.x";
parent.mostCurrent._boompoint50.x /*float*/  = parent.mostCurrent._boompoint5.x /*float*/ ;
 //BA.debugLineNum = 366;BA.debugLine="boompoint50.y=boompoint5.y";
parent.mostCurrent._boompoint50.y /*float*/  = parent.mostCurrent._boompoint5.y /*float*/ ;
 //BA.debugLineNum = 372;BA.debugLine="Dim r As B4XRect";
_r = new anywheresoftware.b4a.objects.B4XCanvas.B4XRect();
 //BA.debugLineNum = 373;BA.debugLine="r.Initialize(xposnew-400,yposnew-400,xposnew+400,";
_r.Initialize((float) (parent._xposnew-400),(float) (parent._yposnew-400),(float) (parent._xposnew+400),(float) (parent._yposnew+400));
 //BA.debugLineNum = 374;BA.debugLine="bmc2ndgraph.Initialize(imvGraph.Width, imvGraph.H";
parent.mostCurrent._bmc2ndgraph._initialize(processBA,parent.mostCurrent._imvgraph.getWidth(),parent.mostCurrent._imvgraph.getHeight());
 //BA.debugLineNum = 375;BA.debugLine="Dim dt As DrawTask = bmcGraph.CreateDrawTask(bmcG";
_dt = parent.mostCurrent._bmcgraph._createdrawtask((Object)(parent.mostCurrent._bmcgraph),_r,(int) (parent.mostCurrent._imvgraph.getWidth()/(double)2),(int) (parent.mostCurrent._imvgraph.getHeight()/(double)2),anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 376;BA.debugLine="dt.SrcScaleX=4";
_dt.SrcScaleX = (float) (4);
 //BA.debugLineNum = 377;BA.debugLine="dt.SrcScaleY=4";
_dt.SrcScaleY = (float) (4);
 //BA.debugLineNum = 378;BA.debugLine="dt.Degrees=-Starter.Location2.Bearing";
_dt.Degrees = (int) (-parent.mostCurrent._starter._location2 /*anywheresoftware.b4a.gps.LocationWrapper*/ .getBearing());
 //BA.debugLineNum = 382;BA.debugLine="bmc2ndgraph.DrawBitmapCreatorTransformed(dt)";
parent.mostCurrent._bmc2ndgraph._drawbitmapcreatortransformed(_dt);
 //BA.debugLineNum = 383;BA.debugLine="cvsGraph.DrawBitmap(bmc2ndgraph.Bitmap,b4arect1)";
parent.mostCurrent._cvsgraph.DrawBitmap((android.graphics.Bitmap)(parent.mostCurrent._bmc2ndgraph._getbitmap().getObject()),parent.mostCurrent._b4arect1);
 //BA.debugLineNum = 384;BA.debugLine="imvGraph.Invalidate";
parent.mostCurrent._imvgraph.Invalidate();
 //BA.debugLineNum = 385;BA.debugLine="section1colour.Color=boomcolor(0)";
parent.mostCurrent._section1colour.setColor(parent._boomcolor[(int) (0)]);
 //BA.debugLineNum = 386;BA.debugLine="section2colour.Color=boomcolor(1)";
parent.mostCurrent._section2colour.setColor(parent._boomcolor[(int) (1)]);
 //BA.debugLineNum = 387;BA.debugLine="section3colour.Color=boomcolor(2)";
parent.mostCurrent._section3colour.setColor(parent._boomcolor[(int) (2)]);
 //BA.debugLineNum = 388;BA.debugLine="section4colour.Color=boomcolor(3)";
parent.mostCurrent._section4colour.setColor(parent._boomcolor[(int) (3)]);
 //BA.debugLineNum = 389;BA.debugLine="section5colour.Color=boomcolor(4)";
parent.mostCurrent._section5colour.setColor(parent._boomcolor[(int) (4)]);
 //BA.debugLineNum = 430;BA.debugLine="xpos = xposnew";
parent._xpos = parent._xposnew;
 //BA.debugLineNum = 431;BA.debugLine="ypos = yposnew";
parent._ypos = parent._yposnew;
 //BA.debugLineNum = 432;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}

public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        main._process_globals();
starter._process_globals();
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 24;BA.debugLine="Sub Process_globals";
 //BA.debugLineNum = 26;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _rectanglechecker(b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,b4a.bitmapdrawer2.main._coordx _point4,int _k) throws Exception{
ResumableSub_rectanglechecker rsub = new ResumableSub_rectanglechecker(null,_point1,_point2,_point3,_point4,_k);
rsub.resume(processBA, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_rectanglechecker extends BA.ResumableSub {
public ResumableSub_rectanglechecker(b4a.bitmapdrawer2.main parent,b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,b4a.bitmapdrawer2.main._coordx _point4,int _k) {
this.parent = parent;
this._point1 = _point1;
this._point2 = _point2;
this._point3 = _point3;
this._point4 = _point4;
this._k = _k;
}
b4a.bitmapdrawer2.main parent;
b4a.bitmapdrawer2.main._coordx _point1;
b4a.bitmapdrawer2.main._coordx _point2;
b4a.bitmapdrawer2.main._coordx _point3;
b4a.bitmapdrawer2.main._coordx _point4;
int _k;
anywheresoftware.b4a.objects.collections.Map _rc_acwmap = null;
anywheresoftware.b4a.objects.collections.Map _rc_cwmap = null;
anywheresoftware.b4a.objects.collections.List _rc_line1xvalues = null;
anywheresoftware.b4a.objects.collections.List _rc_line2xvalues = null;
anywheresoftware.b4a.objects.collections.List _rc_line2yvalues = null;
anywheresoftware.b4a.objects.collections.List _rc_line1yvalues = null;
b4a.bitmapdrawer2.main._coordx _pmax = null;
b4a.bitmapdrawer2.main._coordx _pmin = null;
b4a.bitmapdrawer2.main._coordx _temp = null;
anywheresoftware.b4a.objects.collections.Map _pmap = null;
float _temp3 = 0f;
float _temp4 = 0f;
b4a.bitmapdrawer2.main._coordx _temp2 = null;
int _ytemp = 0;
int _pixelchecked = 0;
int _i = 0;
int _j = 0;
int step63;
int limit63;
int step64;
int limit64;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 503;BA.debugLine="Dim RC_ACWmap As Map";
_rc_acwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 504;BA.debugLine="Dim RC_CWmap As Map";
_rc_cwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 505;BA.debugLine="Dim RC_line1xvalues As List";
_rc_line1xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 506;BA.debugLine="Dim RC_line2xvalues As List";
_rc_line2xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 507;BA.debugLine="Dim RC_line2yvalues As List";
_rc_line2yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 508;BA.debugLine="Dim RC_line1yvalues As List";
_rc_line1yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 511;BA.debugLine="RC_ACWmap.Initialize		'used to progress clockwise";
_rc_acwmap.Initialize();
 //BA.debugLineNum = 512;BA.debugLine="RC_ACWmap.Put(point1,point2)";
_rc_acwmap.Put((Object)(_point1),(Object)(_point2));
 //BA.debugLineNum = 513;BA.debugLine="RC_ACWmap.Put(point2,point3)";
_rc_acwmap.Put((Object)(_point2),(Object)(_point3));
 //BA.debugLineNum = 514;BA.debugLine="RC_ACWmap.Put(point4,point1)";
_rc_acwmap.Put((Object)(_point4),(Object)(_point1));
 //BA.debugLineNum = 515;BA.debugLine="RC_ACWmap.Put(point3,point4)";
_rc_acwmap.Put((Object)(_point3),(Object)(_point4));
 //BA.debugLineNum = 517;BA.debugLine="RC_CWmap.Initialize";
_rc_cwmap.Initialize();
 //BA.debugLineNum = 518;BA.debugLine="RC_CWmap.Put(point1,point4)";
_rc_cwmap.Put((Object)(_point1),(Object)(_point4));
 //BA.debugLineNum = 519;BA.debugLine="RC_CWmap.Put(point2,point1)";
_rc_cwmap.Put((Object)(_point2),(Object)(_point1));
 //BA.debugLineNum = 520;BA.debugLine="RC_CWmap.Put(point4,point3)";
_rc_cwmap.Put((Object)(_point4),(Object)(_point3));
 //BA.debugLineNum = 521;BA.debugLine="RC_CWmap.Put(point3,point2)";
_rc_cwmap.Put((Object)(_point3),(Object)(_point2));
 //BA.debugLineNum = 523;BA.debugLine="RC_line1xvalues.Initialize";
_rc_line1xvalues.Initialize();
 //BA.debugLineNum = 524;BA.debugLine="RC_line2xvalues.Initialize";
_rc_line2xvalues.Initialize();
 //BA.debugLineNum = 525;BA.debugLine="RC_line1yvalues.initialize";
_rc_line1yvalues.Initialize();
 //BA.debugLineNum = 526;BA.debugLine="RC_line2yvalues.Initialize";
_rc_line2yvalues.Initialize();
 //BA.debugLineNum = 529;BA.debugLine="Dim pmax As coordX";
_pmax = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 530;BA.debugLine="Dim pmin As coordX";
_pmin = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 531;BA.debugLine="Dim temp As coordX";
_temp = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 532;BA.debugLine="Dim Pmap As Map		'lets us grab the maxY and minY";
_pmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 533;BA.debugLine="Pmap.Initialize";
_pmap.Initialize();
 //BA.debugLineNum = 534;BA.debugLine="Pmap.Put(point1.y,point1)";
_pmap.Put((Object)(_point1.y /*float*/ ),(Object)(_point1));
 //BA.debugLineNum = 535;BA.debugLine="Pmap.Put(point2.y,point2)";
_pmap.Put((Object)(_point2.y /*float*/ ),(Object)(_point2));
 //BA.debugLineNum = 536;BA.debugLine="Pmap.Put(point4.y,point4)";
_pmap.Put((Object)(_point4.y /*float*/ ),(Object)(_point4));
 //BA.debugLineNum = 537;BA.debugLine="Pmap.Put(point3.y,point3)";
_pmap.Put((Object)(_point3.y /*float*/ ),(Object)(_point3));
 //BA.debugLineNum = 539;BA.debugLine="pmax.Initialize";
_pmax.Initialize();
 //BA.debugLineNum = 540;BA.debugLine="pmin.Initialize";
_pmin.Initialize();
 //BA.debugLineNum = 542;BA.debugLine="Dim temp3 As Float";
_temp3 = 0f;
 //BA.debugLineNum = 543;BA.debugLine="temp3 = Max(point1.y,Max(point2.y,Max(point4.y,po";
_temp3 = (float) (anywheresoftware.b4a.keywords.Common.Max(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Max(_point2.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Max(_point4.y /*float*/ ,_point3.y /*float*/ ))));
 //BA.debugLineNum = 544;BA.debugLine="Dim temp4 As Float";
_temp4 = 0f;
 //BA.debugLineNum = 545;BA.debugLine="temp4 = Min(point1.y,Min(point2.y,Min(point4.y,po";
_temp4 = (float) (anywheresoftware.b4a.keywords.Common.Min(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Min(_point2.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Min(_point4.y /*float*/ ,_point3.y /*float*/ ))));
 //BA.debugLineNum = 546;BA.debugLine="pmax=Pmap.Get(temp3) 'temp variable required, oth";
_pmax = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp3)));
 //BA.debugLineNum = 547;BA.debugLine="pmin=Pmap.Get(temp4)";
_pmin = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp4)));
 //BA.debugLineNum = 548;BA.debugLine="Dim temp2 As coordX";
_temp2 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 549;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 550;BA.debugLine="RC_line1xvalues.add(pmax.x)'initial point to both";
_rc_line1xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 551;BA.debugLine="RC_line1yvalues.add(pmax.y)";
_rc_line1yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 552;BA.debugLine="RC_line2xvalues.add(pmax.x)";
_rc_line2xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 553;BA.debugLine="RC_line2yvalues.add(pmax.y)";
_rc_line2yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 555;BA.debugLine="Do While temp <> pmin	'cwloop";
if (true) break;

case 1:
//do while
this.state = 4;
while ((_temp).equals(_pmin) == false) {
this.state = 3;
if (true) break;
}
if (true) break;

case 3:
//C
this.state = 1;
 //BA.debugLineNum = 556;BA.debugLine="temp2=RC_CWmap.Get(temp)'gets second point for l";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_rc_cwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 557;BA.debugLine="Wait For(calcline(temp.x,temp.y, temp2.x,temp2.y";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_rc_line1xvalues,_rc_line1yvalues));
this.state = 21;
return;
case 21:
//C
this.state = 1;
;
 //BA.debugLineNum = 558;BA.debugLine="temp = RC_CWmap.Get(temp) 'changes the first lin";
_temp = (b4a.bitmapdrawer2.main._coordx)(_rc_cwmap.Get((Object)(_temp)));
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 560;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 564;BA.debugLine="Do While temp <> pmin 'acwloop";
if (true) break;

case 5:
//do while
this.state = 8;
while ((_temp).equals(_pmin) == false) {
this.state = 7;
if (true) break;
}
if (true) break;

case 7:
//C
this.state = 5;
 //BA.debugLineNum = 565;BA.debugLine="temp2=RC_ACWmap.Get(temp)'gets second point for";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_rc_acwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 566;BA.debugLine="wait for (calcline(temp.x,temp.y, temp2.x,temp2.";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_rc_line2xvalues,_rc_line2yvalues));
this.state = 22;
return;
case 22:
//C
this.state = 5;
;
 //BA.debugLineNum = 567;BA.debugLine="temp = RC_ACWmap.Get(temp) 'changes the first li";
_temp = (b4a.bitmapdrawer2.main._coordx)(_rc_acwmap.Get((Object)(_temp)));
 if (true) break;

case 8:
//C
this.state = 9;
;
 //BA.debugLineNum = 569;BA.debugLine="RC_line1xvalues.add(pmin.x)'adds final point to b";
_rc_line1xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 570;BA.debugLine="RC_line1yvalues.add(pmin.y)";
_rc_line1yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 571;BA.debugLine="RC_line2xvalues.add(pmin.x)";
_rc_line2xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 572;BA.debugLine="RC_line2yvalues.add(pmin.y)";
_rc_line2yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 573;BA.debugLine="Dim ytemp As Int";
_ytemp = 0;
 //BA.debugLineNum = 574;BA.debugLine="Dim pixelchecked As Int";
_pixelchecked = 0;
 //BA.debugLineNum = 575;BA.debugLine="pixelchecked=0";
_pixelchecked = (int) (0);
 //BA.debugLineNum = 583;BA.debugLine="ytemp=pmax.y		'could choose to save both x and y";
_ytemp = (int) (_pmax.y /*float*/ );
 //BA.debugLineNum = 584;BA.debugLine="For i=0 To (Min(RC_line1xvalues.Size,RC_line2xval";
if (true) break;

case 9:
//for
this.state = 20;
step63 = 1;
limit63 = (int) ((anywheresoftware.b4a.keywords.Common.Min(_rc_line1xvalues.getSize(),_rc_line2xvalues.getSize())-1));
_i = (int) (0) ;
this.state = 23;
if (true) break;

case 23:
//C
this.state = 20;
if ((step63 > 0 && _i <= limit63) || (step63 < 0 && _i >= limit63)) this.state = 11;
if (true) break;

case 24:
//C
this.state = 23;
_i = ((int)(0 + _i + step63)) ;
if (true) break;

case 11:
//C
this.state = 12;
 //BA.debugLineNum = 585;BA.debugLine="For j=RC_line2xvalues.Get(i) To RC_line1xvalues.";
if (true) break;

case 12:
//for
this.state = 19;
step64 = 1;
limit64 = (int)(BA.ObjectToNumber(_rc_line1xvalues.Get(_i)));
_j = (int)(BA.ObjectToNumber(_rc_line2xvalues.Get(_i))) ;
this.state = 25;
if (true) break;

case 25:
//C
this.state = 19;
if ((step64 > 0 && _j <= limit64) || (step64 < 0 && _j >= limit64)) this.state = 14;
if (true) break;

case 26:
//C
this.state = 25;
_j = ((int)(0 + _j + step64)) ;
if (true) break;

case 14:
//C
this.state = 15;
 //BA.debugLineNum = 587;BA.debugLine="pixelchecked=pixelchecked+1";
_pixelchecked = (int) (_pixelchecked+1);
 //BA.debugLineNum = 594;BA.debugLine="If bmcGraph.GetColor(j,ytemp)=-1 Then";
if (true) break;

case 15:
//if
this.state = 18;
if (parent.mostCurrent._bmcgraph._getcolor(_j,_ytemp)==-1) { 
this.state = 17;
}if (true) break;

case 17:
//C
this.state = 18;
 //BA.debugLineNum = 595;BA.debugLine="boomon=True";
parent._boomon = anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 596;BA.debugLine="boomcolor(k)=xui.Color_Green";
parent._boomcolor[_k] = parent.mostCurrent._xui.Color_Green;
 //BA.debugLineNum = 597;BA.debugLine="Log(\"pixelchecked\"&pixelchecked)";
anywheresoftware.b4a.keywords.Common.LogImpl("7720991","pixelchecked"+BA.NumberToString(_pixelchecked),0);
 //BA.debugLineNum = 600;BA.debugLine="Return boomcolor(k)";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(parent._boomcolor[_k]));return;};
 if (true) break;

case 18:
//C
this.state = 26;
;
 if (true) break;
if (true) break;

case 19:
//C
this.state = 24;
;
 //BA.debugLineNum = 607;BA.debugLine="ytemp=ytemp-1";
_ytemp = (int) (_ytemp-1);
 if (true) break;
if (true) break;

case 20:
//C
this.state = -1;
;
 //BA.debugLineNum = 609;BA.debugLine="Log(\"pixelchecked\"&pixelchecked)";
anywheresoftware.b4a.keywords.Common.LogImpl("7721003","pixelchecked"+BA.NumberToString(_pixelchecked),0);
 //BA.debugLineNum = 610;BA.debugLine="boomcolor(k)=xui.Color_yellow";
parent._boomcolor[_k] = parent.mostCurrent._xui.Color_Yellow;
 //BA.debugLineNum = 615;BA.debugLine="boomon=False";
parent._boomon = anywheresoftware.b4a.keywords.Common.False;
 //BA.debugLineNum = 616;BA.debugLine="Log(\"boomon\"&boomon)";
anywheresoftware.b4a.keywords.Common.LogImpl("7721010","boomon"+BA.ObjectToString(parent._boomon),0);
 //BA.debugLineNum = 618;BA.debugLine="Return boomcolor(k)";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(parent._boomcolor[_k]));return;};
 //BA.debugLineNum = 619;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _rectanglefiller(b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,b4a.bitmapdrawer2.main._coordx _point4,int _k) throws Exception{
ResumableSub_rectanglefiller rsub = new ResumableSub_rectanglefiller(null,_point1,_point2,_point3,_point4,_k);
rsub.resume(processBA, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_rectanglefiller extends BA.ResumableSub {
public ResumableSub_rectanglefiller(b4a.bitmapdrawer2.main parent,b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,b4a.bitmapdrawer2.main._coordx _point4,int _k) {
this.parent = parent;
this._point1 = _point1;
this._point2 = _point2;
this._point3 = _point3;
this._point4 = _point4;
this._k = _k;
}
b4a.bitmapdrawer2.main parent;
b4a.bitmapdrawer2.main._coordx _point1;
b4a.bitmapdrawer2.main._coordx _point2;
b4a.bitmapdrawer2.main._coordx _point3;
b4a.bitmapdrawer2.main._coordx _point4;
int _k;
long _timer = 0L;
anywheresoftware.b4a.objects.collections.List _line1xvalues = null;
anywheresoftware.b4a.objects.collections.List _line2xvalues = null;
anywheresoftware.b4a.objects.collections.List _line1yvalues = null;
anywheresoftware.b4a.objects.collections.List _line2yvalues = null;
anywheresoftware.b4a.objects.collections.Map _cwmap = null;
anywheresoftware.b4a.objects.collections.Map _acwmap = null;
b4a.bitmapdrawer2.main._coordx _pmax = null;
b4a.bitmapdrawer2.main._coordx _pmin = null;
b4a.bitmapdrawer2.main._coordx _temp = null;
anywheresoftware.b4a.objects.collections.Map _pmap = null;
float _temp3 = 0f;
float _temp4 = 0f;
b4a.bitmapdrawer2.main._coordx _temp2 = null;
int _ytemp = 0;
int _i = 0;
int step63;
int limit63;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 652;BA.debugLine="Dim timer As Long";
_timer = 0L;
 //BA.debugLineNum = 653;BA.debugLine="timer=DateTime.Now";
_timer = anywheresoftware.b4a.keywords.Common.DateTime.getNow();
 //BA.debugLineNum = 662;BA.debugLine="Dim line1xvalues As List";
_line1xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 663;BA.debugLine="Dim line2xvalues As List";
_line2xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 664;BA.debugLine="Dim line1yvalues As List";
_line1yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 665;BA.debugLine="Dim line2yvalues As List";
_line2yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 666;BA.debugLine="Dim CWmap As Map";
_cwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 667;BA.debugLine="Dim ACWmap As Map";
_acwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 669;BA.debugLine="ACWmap.Initialize		'used to progress clockwise an";
_acwmap.Initialize();
 //BA.debugLineNum = 670;BA.debugLine="ACWmap.Put(point1,point2)";
_acwmap.Put((Object)(_point1),(Object)(_point2));
 //BA.debugLineNum = 671;BA.debugLine="ACWmap.Put(point2,point3)";
_acwmap.Put((Object)(_point2),(Object)(_point3));
 //BA.debugLineNum = 672;BA.debugLine="ACWmap.Put(point4,point1)";
_acwmap.Put((Object)(_point4),(Object)(_point1));
 //BA.debugLineNum = 673;BA.debugLine="ACWmap.Put(point3,point4)";
_acwmap.Put((Object)(_point3),(Object)(_point4));
 //BA.debugLineNum = 675;BA.debugLine="CWmap.Initialize";
_cwmap.Initialize();
 //BA.debugLineNum = 676;BA.debugLine="CWmap.Put(point1,point4)";
_cwmap.Put((Object)(_point1),(Object)(_point4));
 //BA.debugLineNum = 677;BA.debugLine="CWmap.Put(point2,point1)";
_cwmap.Put((Object)(_point2),(Object)(_point1));
 //BA.debugLineNum = 678;BA.debugLine="CWmap.Put(point4,point3)";
_cwmap.Put((Object)(_point4),(Object)(_point3));
 //BA.debugLineNum = 679;BA.debugLine="CWmap.Put(point3,point2)";
_cwmap.Put((Object)(_point3),(Object)(_point2));
 //BA.debugLineNum = 680;BA.debugLine="line1xvalues.Initialize";
_line1xvalues.Initialize();
 //BA.debugLineNum = 681;BA.debugLine="line2xvalues.Initialize";
_line2xvalues.Initialize();
 //BA.debugLineNum = 682;BA.debugLine="line1yvalues.initialize";
_line1yvalues.Initialize();
 //BA.debugLineNum = 683;BA.debugLine="line2yvalues.Initialize";
_line2yvalues.Initialize();
 //BA.debugLineNum = 686;BA.debugLine="Dim pmax As coordX";
_pmax = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 687;BA.debugLine="Dim pmin As coordX";
_pmin = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 688;BA.debugLine="Dim temp As coordX";
_temp = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 689;BA.debugLine="Dim Pmap As Map		'lets us grab the maxY and minY";
_pmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 690;BA.debugLine="Pmap.Initialize";
_pmap.Initialize();
 //BA.debugLineNum = 691;BA.debugLine="Pmap.Put(point1.y,point1)";
_pmap.Put((Object)(_point1.y /*float*/ ),(Object)(_point1));
 //BA.debugLineNum = 692;BA.debugLine="Pmap.Put(point2.y,point2)";
_pmap.Put((Object)(_point2.y /*float*/ ),(Object)(_point2));
 //BA.debugLineNum = 693;BA.debugLine="Pmap.Put(point4.y,point4)";
_pmap.Put((Object)(_point4.y /*float*/ ),(Object)(_point4));
 //BA.debugLineNum = 694;BA.debugLine="Pmap.Put(point3.y,point3)";
_pmap.Put((Object)(_point3.y /*float*/ ),(Object)(_point3));
 //BA.debugLineNum = 723;BA.debugLine="pmax.Initialize";
_pmax.Initialize();
 //BA.debugLineNum = 724;BA.debugLine="pmin.Initialize";
_pmin.Initialize();
 //BA.debugLineNum = 726;BA.debugLine="Dim temp3 As Float";
_temp3 = 0f;
 //BA.debugLineNum = 727;BA.debugLine="temp3 = Max(point1.y,Max(point2.y,Max(point4.y,po";
_temp3 = (float) (anywheresoftware.b4a.keywords.Common.Max(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Max(_point2.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Max(_point4.y /*float*/ ,_point3.y /*float*/ ))));
 //BA.debugLineNum = 728;BA.debugLine="Dim temp4 As Float";
_temp4 = 0f;
 //BA.debugLineNum = 729;BA.debugLine="temp4 = Min(point1.y,Min(point2.y,Min(point4.y,po";
_temp4 = (float) (anywheresoftware.b4a.keywords.Common.Min(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Min(_point2.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Min(_point4.y /*float*/ ,_point3.y /*float*/ ))));
 //BA.debugLineNum = 731;BA.debugLine="pmax=Pmap.Get(temp3) 'temp variable required, oth";
_pmax = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp3)));
 //BA.debugLineNum = 732;BA.debugLine="pmin=Pmap.Get(temp4)";
_pmin = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp4)));
 //BA.debugLineNum = 733;BA.debugLine="Dim temp2 As coordX";
_temp2 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 734;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 735;BA.debugLine="line1xvalues.add(pmax.x)'initial point to both li";
_line1xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 736;BA.debugLine="line1yvalues.add(pmax.y)";
_line1yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 737;BA.debugLine="line2xvalues.add(pmax.x)";
_line2xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 738;BA.debugLine="line2yvalues.add(pmax.y)";
_line2yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 740;BA.debugLine="Do While temp <> pmin	'cwloop";
if (true) break;

case 1:
//do while
this.state = 4;
while ((_temp).equals(_pmin) == false) {
this.state = 3;
if (true) break;
}
if (true) break;

case 3:
//C
this.state = 1;
 //BA.debugLineNum = 741;BA.debugLine="temp2=CWmap.Get(temp)'gets second point for line";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_cwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 742;BA.debugLine="Wait For(calcline(temp.x,temp.y, temp2.x,temp2.y";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_line1xvalues,_line1yvalues));
this.state = 13;
return;
case 13:
//C
this.state = 1;
;
 //BA.debugLineNum = 743;BA.debugLine="temp = CWmap.Get(temp) 'changes the first line p";
_temp = (b4a.bitmapdrawer2.main._coordx)(_cwmap.Get((Object)(_temp)));
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 746;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 750;BA.debugLine="Do While temp <> pmin 'acwloop";
if (true) break;

case 5:
//do while
this.state = 8;
while ((_temp).equals(_pmin) == false) {
this.state = 7;
if (true) break;
}
if (true) break;

case 7:
//C
this.state = 5;
 //BA.debugLineNum = 751;BA.debugLine="temp2=ACWmap.Get(temp)'gets second point for lin";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_acwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 752;BA.debugLine="wait for (calcline(temp.x,temp.y, temp2.x,temp2.";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_line2xvalues,_line2yvalues));
this.state = 14;
return;
case 14:
//C
this.state = 5;
;
 //BA.debugLineNum = 753;BA.debugLine="temp = ACWmap.Get(temp) 'changes the first line";
_temp = (b4a.bitmapdrawer2.main._coordx)(_acwmap.Get((Object)(_temp)));
 if (true) break;

case 8:
//C
this.state = 9;
;
 //BA.debugLineNum = 756;BA.debugLine="line1xvalues.add(pmin.x)'final point to both line";
_line1xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 757;BA.debugLine="line1yvalues.add(pmin.y)";
_line1yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 758;BA.debugLine="line2xvalues.add(pmin.x)";
_line2xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 759;BA.debugLine="line2yvalues.add(pmin.y)";
_line2yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 760;BA.debugLine="Dim ytemp As Int";
_ytemp = 0;
 //BA.debugLineNum = 763;BA.debugLine="ytemp=pmax.y		'could choose to save both x and y";
_ytemp = (int) (_pmax.y /*float*/ );
 //BA.debugLineNum = 764;BA.debugLine="For i=0 To Min(line1xvalues.Size,line2xvalues.Siz";
if (true) break;

case 9:
//for
this.state = 12;
step63 = 1;
limit63 = (int) (anywheresoftware.b4a.keywords.Common.Min(_line1xvalues.getSize(),_line2xvalues.getSize())-1);
_i = (int) (0) ;
this.state = 15;
if (true) break;

case 15:
//C
this.state = 12;
if ((step63 > 0 && _i <= limit63) || (step63 < 0 && _i >= limit63)) this.state = 11;
if (true) break;

case 16:
//C
this.state = 15;
_i = ((int)(0 + _i + step63)) ;
if (true) break;

case 11:
//C
this.state = 16;
 //BA.debugLineNum = 765;BA.debugLine="bmcGraph.DrawLine(line1xvalues.Get(i),ytemp,line";
parent.mostCurrent._bmcgraph._drawline((float)(BA.ObjectToNumber(_line1xvalues.Get(_i))),(float) (_ytemp),(float)(BA.ObjectToNumber(_line2xvalues.Get(_i))),(float) (_ytemp),parent._boomcolor[_k],(int) (1));
 //BA.debugLineNum = 766;BA.debugLine="ytemp=ytemp-1";
_ytemp = (int) (_ytemp-1);
 if (true) break;
if (true) break;

case 12:
//C
this.state = -1;
;
 //BA.debugLineNum = 795;BA.debugLine="Return 2";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(2));return;};
 //BA.debugLineNum = 796;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _trianglechecker(b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,int _k) throws Exception{
ResumableSub_trianglechecker rsub = new ResumableSub_trianglechecker(null,_point1,_point2,_point3,_k);
rsub.resume(processBA, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_trianglechecker extends BA.ResumableSub {
public ResumableSub_trianglechecker(b4a.bitmapdrawer2.main parent,b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,int _k) {
this.parent = parent;
this._point1 = _point1;
this._point2 = _point2;
this._point3 = _point3;
this._k = _k;
}
b4a.bitmapdrawer2.main parent;
b4a.bitmapdrawer2.main._coordx _point1;
b4a.bitmapdrawer2.main._coordx _point2;
b4a.bitmapdrawer2.main._coordx _point3;
int _k;
anywheresoftware.b4a.objects.collections.Map _acwmap = null;
anywheresoftware.b4a.objects.collections.Map _cwmap = null;
anywheresoftware.b4a.objects.collections.List _line1xvalues = null;
anywheresoftware.b4a.objects.collections.List _line2xvalues = null;
anywheresoftware.b4a.objects.collections.List _line2yvalues = null;
anywheresoftware.b4a.objects.collections.List _line1yvalues = null;
b4a.bitmapdrawer2.main._coordx _pmax = null;
b4a.bitmapdrawer2.main._coordx _pmin = null;
b4a.bitmapdrawer2.main._coordx _temp = null;
anywheresoftware.b4a.objects.collections.Map _pmap = null;
float _temp3 = 0f;
float _temp4 = 0f;
b4a.bitmapdrawer2.main._coordx _temp2 = null;
int _ytemp = 0;
int _pixelchecked = 0;
int _i = 0;
int _j = 0;
int step60;
int limit60;
int step61;
int limit61;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 1058;BA.debugLine="Dim ACWmap As Map";
_acwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 1059;BA.debugLine="Dim CWmap As Map";
_cwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 1060;BA.debugLine="Dim line1xvalues As List";
_line1xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 1061;BA.debugLine="Dim line2xvalues As List";
_line2xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 1062;BA.debugLine="Dim line2yvalues As List";
_line2yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 1063;BA.debugLine="Dim line1yvalues As List";
_line1yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 1066;BA.debugLine="ACWmap.Initialize		'used to progress clockwise an";
_acwmap.Initialize();
 //BA.debugLineNum = 1067;BA.debugLine="ACWmap.Put(point1,point2)";
_acwmap.Put((Object)(_point1),(Object)(_point2));
 //BA.debugLineNum = 1068;BA.debugLine="ACWmap.Put(point2,point3)";
_acwmap.Put((Object)(_point2),(Object)(_point3));
 //BA.debugLineNum = 1069;BA.debugLine="ACWmap.Put(point3,point1)";
_acwmap.Put((Object)(_point3),(Object)(_point1));
 //BA.debugLineNum = 1072;BA.debugLine="CWmap.Initialize";
_cwmap.Initialize();
 //BA.debugLineNum = 1073;BA.debugLine="CWmap.Put(point1,point3)";
_cwmap.Put((Object)(_point1),(Object)(_point3));
 //BA.debugLineNum = 1074;BA.debugLine="CWmap.Put(point2,point1)";
_cwmap.Put((Object)(_point2),(Object)(_point1));
 //BA.debugLineNum = 1075;BA.debugLine="CWmap.Put(point3,point2)";
_cwmap.Put((Object)(_point3),(Object)(_point2));
 //BA.debugLineNum = 1077;BA.debugLine="line1xvalues.Initialize";
_line1xvalues.Initialize();
 //BA.debugLineNum = 1078;BA.debugLine="line2xvalues.Initialize";
_line2xvalues.Initialize();
 //BA.debugLineNum = 1079;BA.debugLine="line1yvalues.initialize";
_line1yvalues.Initialize();
 //BA.debugLineNum = 1080;BA.debugLine="line2yvalues.Initialize";
_line2yvalues.Initialize();
 //BA.debugLineNum = 1083;BA.debugLine="Dim pmax As coordX";
_pmax = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1084;BA.debugLine="Dim pmin As coordX";
_pmin = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1085;BA.debugLine="Dim temp As coordX";
_temp = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1086;BA.debugLine="Dim Pmap As Map		'lets us grab the maxY and minY";
_pmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 1087;BA.debugLine="Pmap.Initialize";
_pmap.Initialize();
 //BA.debugLineNum = 1088;BA.debugLine="Pmap.Put(point1.y,point1)";
_pmap.Put((Object)(_point1.y /*float*/ ),(Object)(_point1));
 //BA.debugLineNum = 1089;BA.debugLine="Pmap.Put(point2.y,point2)";
_pmap.Put((Object)(_point2.y /*float*/ ),(Object)(_point2));
 //BA.debugLineNum = 1090;BA.debugLine="Pmap.Put(point3.y,point3)";
_pmap.Put((Object)(_point3.y /*float*/ ),(Object)(_point3));
 //BA.debugLineNum = 1092;BA.debugLine="pmax.Initialize";
_pmax.Initialize();
 //BA.debugLineNum = 1093;BA.debugLine="pmin.Initialize";
_pmin.Initialize();
 //BA.debugLineNum = 1095;BA.debugLine="Dim temp3 As Float";
_temp3 = 0f;
 //BA.debugLineNum = 1096;BA.debugLine="temp3 = Max(point1.y,Max(point2.y,point3.y))";
_temp3 = (float) (anywheresoftware.b4a.keywords.Common.Max(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Max(_point2.y /*float*/ ,_point3.y /*float*/ )));
 //BA.debugLineNum = 1097;BA.debugLine="Dim temp4 As Float";
_temp4 = 0f;
 //BA.debugLineNum = 1098;BA.debugLine="temp4 = Min(point1.y,Min(point2.y,point3.y))";
_temp4 = (float) (anywheresoftware.b4a.keywords.Common.Min(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Min(_point2.y /*float*/ ,_point3.y /*float*/ )));
 //BA.debugLineNum = 1099;BA.debugLine="pmax=Pmap.Get(temp3) 'temp variable required, oth";
_pmax = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp3)));
 //BA.debugLineNum = 1100;BA.debugLine="pmin=Pmap.Get(temp4)";
_pmin = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp4)));
 //BA.debugLineNum = 1101;BA.debugLine="Dim temp2 As coordX";
_temp2 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1102;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 1103;BA.debugLine="line1xvalues.add(pmax.x)'initial point to both li";
_line1xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 1104;BA.debugLine="line1yvalues.add(pmax.y)";
_line1yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 1105;BA.debugLine="line2xvalues.add(pmax.x)";
_line2xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 1106;BA.debugLine="line2yvalues.add(pmax.y)";
_line2yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 1108;BA.debugLine="Do While temp <> pmin	'cwloop";
if (true) break;

case 1:
//do while
this.state = 4;
while ((_temp).equals(_pmin) == false) {
this.state = 3;
if (true) break;
}
if (true) break;

case 3:
//C
this.state = 1;
 //BA.debugLineNum = 1109;BA.debugLine="temp2=CWmap.Get(temp)'gets second point for line";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_cwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 1110;BA.debugLine="Wait For(calcline(temp.x,temp.y, temp2.x,temp2.y";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_line1xvalues,_line1yvalues));
this.state = 21;
return;
case 21:
//C
this.state = 1;
;
 //BA.debugLineNum = 1111;BA.debugLine="temp = CWmap.Get(temp) 'changes the first line p";
_temp = (b4a.bitmapdrawer2.main._coordx)(_cwmap.Get((Object)(_temp)));
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 1113;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 1117;BA.debugLine="Do While temp <> pmin 'acwloop";
if (true) break;

case 5:
//do while
this.state = 8;
while ((_temp).equals(_pmin) == false) {
this.state = 7;
if (true) break;
}
if (true) break;

case 7:
//C
this.state = 5;
 //BA.debugLineNum = 1118;BA.debugLine="temp2=ACWmap.Get(temp)'gets second point for lin";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_acwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 1119;BA.debugLine="wait for (calcline(temp.x,temp.y, temp2.x,temp2.";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_line2xvalues,_line2yvalues));
this.state = 22;
return;
case 22:
//C
this.state = 5;
;
 //BA.debugLineNum = 1120;BA.debugLine="temp = ACWmap.Get(temp) 'changes the first line";
_temp = (b4a.bitmapdrawer2.main._coordx)(_acwmap.Get((Object)(_temp)));
 if (true) break;

case 8:
//C
this.state = 9;
;
 //BA.debugLineNum = 1122;BA.debugLine="line1xvalues.add(pmin.x)'adds final point to both";
_line1xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 1123;BA.debugLine="line1yvalues.add(pmin.y)";
_line1yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 1124;BA.debugLine="line2xvalues.add(pmin.x)";
_line2xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 1125;BA.debugLine="line2yvalues.add(pmin.y)";
_line2yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 1126;BA.debugLine="Dim ytemp As Int";
_ytemp = 0;
 //BA.debugLineNum = 1127;BA.debugLine="Dim pixelchecked As Int";
_pixelchecked = 0;
 //BA.debugLineNum = 1128;BA.debugLine="pixelchecked=0";
_pixelchecked = (int) (0);
 //BA.debugLineNum = 1131;BA.debugLine="ytemp=pmax.y		'could choose to save both x and y";
_ytemp = (int) (_pmax.y /*float*/ );
 //BA.debugLineNum = 1132;BA.debugLine="For i=0 To (Min(line1xvalues.Size,line2xvalues.Si";
if (true) break;

case 9:
//for
this.state = 20;
step60 = 1;
limit60 = (int) ((anywheresoftware.b4a.keywords.Common.Min(_line1xvalues.getSize(),_line2xvalues.getSize())-1));
_i = (int) (0) ;
this.state = 23;
if (true) break;

case 23:
//C
this.state = 20;
if ((step60 > 0 && _i <= limit60) || (step60 < 0 && _i >= limit60)) this.state = 11;
if (true) break;

case 24:
//C
this.state = 23;
_i = ((int)(0 + _i + step60)) ;
if (true) break;

case 11:
//C
this.state = 12;
 //BA.debugLineNum = 1133;BA.debugLine="For j=line2xvalues.Get(i) To line1xvalues.Get(i)";
if (true) break;

case 12:
//for
this.state = 19;
step61 = 1;
limit61 = (int)(BA.ObjectToNumber(_line1xvalues.Get(_i)));
_j = (int)(BA.ObjectToNumber(_line2xvalues.Get(_i))) ;
this.state = 25;
if (true) break;

case 25:
//C
this.state = 19;
if ((step61 > 0 && _j <= limit61) || (step61 < 0 && _j >= limit61)) this.state = 14;
if (true) break;

case 26:
//C
this.state = 25;
_j = ((int)(0 + _j + step61)) ;
if (true) break;

case 14:
//C
this.state = 15;
 //BA.debugLineNum = 1134;BA.debugLine="pixelchecked=pixelchecked+1";
_pixelchecked = (int) (_pixelchecked+1);
 //BA.debugLineNum = 1135;BA.debugLine="If bmcGraph.GetColor(j,ytemp)=-1 Then";
if (true) break;

case 15:
//if
this.state = 18;
if (parent.mostCurrent._bmcgraph._getcolor(_j,_ytemp)==-1) { 
this.state = 17;
}if (true) break;

case 17:
//C
this.state = 18;
 //BA.debugLineNum = 1136;BA.debugLine="boomon=True";
parent._boomon = anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 1137;BA.debugLine="boomcolor(k)=xui.Color_Green";
parent._boomcolor[_k] = parent.mostCurrent._xui.Color_Green;
 //BA.debugLineNum = 1138;BA.debugLine="Return boomcolor(k)";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(parent._boomcolor[_k]));return;};
 if (true) break;

case 18:
//C
this.state = 26;
;
 if (true) break;
if (true) break;

case 19:
//C
this.state = 24;
;
 //BA.debugLineNum = 1142;BA.debugLine="ytemp=ytemp-1";
_ytemp = (int) (_ytemp-1);
 if (true) break;
if (true) break;

case 20:
//C
this.state = -1;
;
 //BA.debugLineNum = 1144;BA.debugLine="boomcolor(k)=xui.Color_yellow";
parent._boomcolor[_k] = parent.mostCurrent._xui.Color_Yellow;
 //BA.debugLineNum = 1145;BA.debugLine="boomon=False";
parent._boomon = anywheresoftware.b4a.keywords.Common.False;
 //BA.debugLineNum = 1146;BA.debugLine="Log(\"boomon\"&boomon)";
anywheresoftware.b4a.keywords.Common.LogImpl("71966169","boomon"+BA.ObjectToString(parent._boomon),0);
 //BA.debugLineNum = 1147;BA.debugLine="Return boomcolor(k)";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(parent._boomcolor[_k]));return;};
 //BA.debugLineNum = 1148;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _trianglefiller(b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,int _k) throws Exception{
ResumableSub_trianglefiller rsub = new ResumableSub_trianglefiller(null,_point1,_point2,_point3,_k);
rsub.resume(processBA, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_trianglefiller extends BA.ResumableSub {
public ResumableSub_trianglefiller(b4a.bitmapdrawer2.main parent,b4a.bitmapdrawer2.main._coordx _point1,b4a.bitmapdrawer2.main._coordx _point2,b4a.bitmapdrawer2.main._coordx _point3,int _k) {
this.parent = parent;
this._point1 = _point1;
this._point2 = _point2;
this._point3 = _point3;
this._k = _k;
}
b4a.bitmapdrawer2.main parent;
b4a.bitmapdrawer2.main._coordx _point1;
b4a.bitmapdrawer2.main._coordx _point2;
b4a.bitmapdrawer2.main._coordx _point3;
int _k;
long _timer = 0L;
anywheresoftware.b4a.objects.collections.List _line1xvalues = null;
anywheresoftware.b4a.objects.collections.List _line2xvalues = null;
anywheresoftware.b4a.objects.collections.List _line1yvalues = null;
anywheresoftware.b4a.objects.collections.List _line2yvalues = null;
anywheresoftware.b4a.objects.collections.Map _cwmap = null;
anywheresoftware.b4a.objects.collections.Map _acwmap = null;
b4a.bitmapdrawer2.main._coordx _pmax = null;
b4a.bitmapdrawer2.main._coordx _pmin = null;
b4a.bitmapdrawer2.main._coordx _temp = null;
anywheresoftware.b4a.objects.collections.Map _pmap = null;
float _temp3 = 0f;
float _temp4 = 0f;
b4a.bitmapdrawer2.main._coordx _temp2 = null;
int _ytemp = 0;
int _i = 0;
int step60;
int limit60;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 975;BA.debugLine="Dim timer As Long";
_timer = 0L;
 //BA.debugLineNum = 976;BA.debugLine="timer=DateTime.Now";
_timer = anywheresoftware.b4a.keywords.Common.DateTime.getNow();
 //BA.debugLineNum = 978;BA.debugLine="Dim line1xvalues As List";
_line1xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 979;BA.debugLine="Dim line2xvalues As List";
_line2xvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 980;BA.debugLine="Dim line1yvalues As List";
_line1yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 981;BA.debugLine="Dim line2yvalues As List";
_line2yvalues = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 982;BA.debugLine="Dim CWmap As Map";
_cwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 983;BA.debugLine="Dim ACWmap As Map";
_acwmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 985;BA.debugLine="ACWmap.Initialize		'used to progress clockwise an";
_acwmap.Initialize();
 //BA.debugLineNum = 986;BA.debugLine="ACWmap.Put(point1,point2)";
_acwmap.Put((Object)(_point1),(Object)(_point2));
 //BA.debugLineNum = 987;BA.debugLine="ACWmap.Put(point2,point3)";
_acwmap.Put((Object)(_point2),(Object)(_point3));
 //BA.debugLineNum = 988;BA.debugLine="ACWmap.Put(point3,point1)";
_acwmap.Put((Object)(_point3),(Object)(_point1));
 //BA.debugLineNum = 991;BA.debugLine="CWmap.Initialize";
_cwmap.Initialize();
 //BA.debugLineNum = 992;BA.debugLine="CWmap.Put(point1,point3)";
_cwmap.Put((Object)(_point1),(Object)(_point3));
 //BA.debugLineNum = 993;BA.debugLine="CWmap.Put(point2,point1)";
_cwmap.Put((Object)(_point2),(Object)(_point1));
 //BA.debugLineNum = 994;BA.debugLine="CWmap.Put(point3,point2)";
_cwmap.Put((Object)(_point3),(Object)(_point2));
 //BA.debugLineNum = 995;BA.debugLine="line1xvalues.Initialize";
_line1xvalues.Initialize();
 //BA.debugLineNum = 996;BA.debugLine="line2xvalues.Initialize";
_line2xvalues.Initialize();
 //BA.debugLineNum = 997;BA.debugLine="line1yvalues.initialize";
_line1yvalues.Initialize();
 //BA.debugLineNum = 998;BA.debugLine="line2yvalues.Initialize";
_line2yvalues.Initialize();
 //BA.debugLineNum = 1001;BA.debugLine="Dim pmax As coordX";
_pmax = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1002;BA.debugLine="Dim pmin As coordX";
_pmin = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1003;BA.debugLine="Dim temp As coordX";
_temp = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1004;BA.debugLine="Dim Pmap As Map		'lets us grab the maxY and minY";
_pmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 1005;BA.debugLine="Pmap.Initialize";
_pmap.Initialize();
 //BA.debugLineNum = 1006;BA.debugLine="Pmap.Put(point1.y,point1)";
_pmap.Put((Object)(_point1.y /*float*/ ),(Object)(_point1));
 //BA.debugLineNum = 1007;BA.debugLine="Pmap.Put(point2.y,point2)";
_pmap.Put((Object)(_point2.y /*float*/ ),(Object)(_point2));
 //BA.debugLineNum = 1008;BA.debugLine="Pmap.Put(point3.y,point3)";
_pmap.Put((Object)(_point3.y /*float*/ ),(Object)(_point3));
 //BA.debugLineNum = 1010;BA.debugLine="pmax.Initialize";
_pmax.Initialize();
 //BA.debugLineNum = 1011;BA.debugLine="pmin.Initialize";
_pmin.Initialize();
 //BA.debugLineNum = 1012;BA.debugLine="Dim temp3 As Float";
_temp3 = 0f;
 //BA.debugLineNum = 1013;BA.debugLine="temp3 = Max(point1.y,Max(point2.y,point3.y))";
_temp3 = (float) (anywheresoftware.b4a.keywords.Common.Max(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Max(_point2.y /*float*/ ,_point3.y /*float*/ )));
 //BA.debugLineNum = 1014;BA.debugLine="Dim temp4 As Float";
_temp4 = 0f;
 //BA.debugLineNum = 1015;BA.debugLine="temp4 = Min(point1.y,Min(point2.y,point3.y))";
_temp4 = (float) (anywheresoftware.b4a.keywords.Common.Min(_point1.y /*float*/ ,anywheresoftware.b4a.keywords.Common.Min(_point2.y /*float*/ ,_point3.y /*float*/ )));
 //BA.debugLineNum = 1016;BA.debugLine="pmax=Pmap.Get(temp3) 'temp variable required, oth";
_pmax = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp3)));
 //BA.debugLineNum = 1017;BA.debugLine="pmin=Pmap.Get(temp4)";
_pmin = (b4a.bitmapdrawer2.main._coordx)(_pmap.Get((Object)(_temp4)));
 //BA.debugLineNum = 1018;BA.debugLine="Dim temp2 As coordX";
_temp2 = new b4a.bitmapdrawer2.main._coordx();
 //BA.debugLineNum = 1019;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 1020;BA.debugLine="line1xvalues.add(pmax.x)'initial point to both li";
_line1xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 1021;BA.debugLine="line1yvalues.add(pmax.y)";
_line1yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 1022;BA.debugLine="line2xvalues.add(pmax.x)";
_line2xvalues.Add((Object)(_pmax.x /*float*/ ));
 //BA.debugLineNum = 1023;BA.debugLine="line2yvalues.add(pmax.y)";
_line2yvalues.Add((Object)(_pmax.y /*float*/ ));
 //BA.debugLineNum = 1025;BA.debugLine="Do While temp <> pmin	'cwloop";
if (true) break;

case 1:
//do while
this.state = 4;
while ((_temp).equals(_pmin) == false) {
this.state = 3;
if (true) break;
}
if (true) break;

case 3:
//C
this.state = 1;
 //BA.debugLineNum = 1026;BA.debugLine="temp2=CWmap.Get(temp)'gets second point for line";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_cwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 1027;BA.debugLine="Wait For(calcline(temp.x,temp.y, temp2.x,temp2.y";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_line1xvalues,_line1yvalues));
this.state = 13;
return;
case 13:
//C
this.state = 1;
;
 //BA.debugLineNum = 1028;BA.debugLine="temp = CWmap.Get(temp) 'changes the first line p";
_temp = (b4a.bitmapdrawer2.main._coordx)(_cwmap.Get((Object)(_temp)));
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 1031;BA.debugLine="temp = pmax";
_temp = _pmax;
 //BA.debugLineNum = 1035;BA.debugLine="Do While temp <> pmin 'acwloop";
if (true) break;

case 5:
//do while
this.state = 8;
while ((_temp).equals(_pmin) == false) {
this.state = 7;
if (true) break;
}
if (true) break;

case 7:
//C
this.state = 5;
 //BA.debugLineNum = 1036;BA.debugLine="temp2=ACWmap.Get(temp)'gets second point for lin";
_temp2 = (b4a.bitmapdrawer2.main._coordx)(_acwmap.Get((Object)(_temp)));
 //BA.debugLineNum = 1037;BA.debugLine="wait for (calcline(temp.x,temp.y, temp2.x,temp2.";
anywheresoftware.b4a.keywords.Common.WaitFor("complete", processBA, this, _calcline((int) (_temp.x /*float*/ ),(int) (_temp.y /*float*/ ),(int) (_temp2.x /*float*/ ),(int) (_temp2.y /*float*/ ),_line2xvalues,_line2yvalues));
this.state = 14;
return;
case 14:
//C
this.state = 5;
;
 //BA.debugLineNum = 1038;BA.debugLine="temp = ACWmap.Get(temp) 'changes the first line";
_temp = (b4a.bitmapdrawer2.main._coordx)(_acwmap.Get((Object)(_temp)));
 if (true) break;

case 8:
//C
this.state = 9;
;
 //BA.debugLineNum = 1041;BA.debugLine="line1xvalues.add(pmin.x)'final point to both line";
_line1xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 1042;BA.debugLine="line1yvalues.add(pmin.y)";
_line1yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 1043;BA.debugLine="line2xvalues.add(pmin.x)";
_line2xvalues.Add((Object)(_pmin.x /*float*/ ));
 //BA.debugLineNum = 1044;BA.debugLine="line2yvalues.add(pmin.y)";
_line2yvalues.Add((Object)(_pmin.y /*float*/ ));
 //BA.debugLineNum = 1045;BA.debugLine="Dim ytemp As Int";
_ytemp = 0;
 //BA.debugLineNum = 1046;BA.debugLine="ytemp=pmax.y		'could choose to save both x and y";
_ytemp = (int) (_pmax.y /*float*/ );
 //BA.debugLineNum = 1047;BA.debugLine="For i=0 To Min(line1xvalues.Size,line2xvalues.Siz";
if (true) break;

case 9:
//for
this.state = 12;
step60 = 1;
limit60 = (int) (anywheresoftware.b4a.keywords.Common.Min(_line1xvalues.getSize(),_line2xvalues.getSize())-1);
_i = (int) (0) ;
this.state = 15;
if (true) break;

case 15:
//C
this.state = 12;
if ((step60 > 0 && _i <= limit60) || (step60 < 0 && _i >= limit60)) this.state = 11;
if (true) break;

case 16:
//C
this.state = 15;
_i = ((int)(0 + _i + step60)) ;
if (true) break;

case 11:
//C
this.state = 16;
 //BA.debugLineNum = 1048;BA.debugLine="bmcGraph.DrawLine(line1xvalues.Get(i),ytemp,line";
parent.mostCurrent._bmcgraph._drawline((float)(BA.ObjectToNumber(_line1xvalues.Get(_i))),(float) (_ytemp),(float)(BA.ObjectToNumber(_line2xvalues.Get(_i))),(float) (_ytemp),parent._boomcolor[_k],(int) (1));
 //BA.debugLineNum = 1049;BA.debugLine="ytemp=ytemp-1";
_ytemp = (int) (_ytemp-1);
 if (true) break;
if (true) break;

case 12:
//C
this.state = -1;
;
 //BA.debugLineNum = 1053;BA.debugLine="Return 2";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(2));return;};
 //BA.debugLineNum = 1054;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
}
