package b4j.jClsCustomButton;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.debug.*;

public class custombutton extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    public static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new  anywheresoftware.b4j.objects.FxBA("b4j.jClsCustomButton", "b4j.jClsCustomButton.custombutton", this);
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            ba.htSubs = htSubs;
             
        }
        if (BA.isShellModeRuntimeCheck(ba))
                this.getClass().getMethod("_class_globals", b4j.jClsCustomButton.custombutton.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4j.objects.JFX _fx = null;
public String _meventname = "";
public Object _mcallback = null;
public anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper _mbase = null;
public int _mleft = 0;
public int _mtop = 0;
public int _mwidth = 0;
public int _mheight = 0;
public String _mtext = "";
public String _micon = "";
public anywheresoftware.b4j.objects.JFX.FontWrapper _miconfont = null;
public anywheresoftware.b4j.objects.JFX.PaintWrapper _mtextcolor = null;
public float _micontextsize = 0f;
public float _mtextsize = 0f;
public Object _mtag = null;
public anywheresoftware.b4j.objects.LabelWrapper _mlabel = null;
public anywheresoftware.b4j.objects.LabelWrapper _miconlabel = null;
public anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper _mparent = null;
public long _mclicktime = 0L;
public String  _addtoparent(anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper _parent,int _left,int _top,int _width,int _height,anywheresoftware.b4j.objects.JFX.PaintWrapper _textcolor,String _icon,String _text) throws Exception{
 //BA.debugLineNum = 68;BA.debugLine="Public Sub AddToParent(Parent As Pane, Left As Int";
 //BA.debugLineNum = 69;BA.debugLine="mLeft = Left";
_mleft = _left;
 //BA.debugLineNum = 70;BA.debugLine="mTop = Top";
_mtop = _top;
 //BA.debugLineNum = 71;BA.debugLine="mWidth = Width";
_mwidth = _width;
 //BA.debugLineNum = 72;BA.debugLine="mHeight = Height";
_mheight = _height;
 //BA.debugLineNum = 74;BA.debugLine="mBase.Initialize(\"mBase\")";
_mbase.Initialize(ba,"mBase");
 //BA.debugLineNum = 75;BA.debugLine="Parent.AddNode(mBase, mLeft, mTop, mWidth, mHeigh";
_parent.AddNode((javafx.scene.Node)(_mbase.getObject()),_mleft,_mtop,_mwidth,_mheight);
 //BA.debugLineNum = 77;BA.debugLine="mIcon = Icon";
_micon = _icon;
 //BA.debugLineNum = 78;BA.debugLine="mText = Text";
_mtext = _text;
 //BA.debugLineNum = 79;BA.debugLine="mTextColor = TextColor";
_mtextcolor = _textcolor;
 //BA.debugLineNum = 81;BA.debugLine="InitClass";
_initclass();
 //BA.debugLineNum = 82;BA.debugLine="End Sub";
return "";
}
public String  _base_resize(double _width,double _height) throws Exception{
 //BA.debugLineNum = 55;BA.debugLine="Private Sub Base_Resize (Width As Double, Height A";
 //BA.debugLineNum = 56;BA.debugLine="mWidth = Width";
_mwidth = (int) (_width);
 //BA.debugLineNum = 57;BA.debugLine="mHeight = Height";
_mheight = (int) (_height);
 //BA.debugLineNum = 58;BA.debugLine="mBase.PrefWidth = mWidth";
_mbase.setPrefWidth(_mwidth);
 //BA.debugLineNum = 59;BA.debugLine="mBase.PrefHeight = mHeight";
_mbase.setPrefHeight(_mheight);
 //BA.debugLineNum = 61;BA.debugLine="InitClass";
_initclass();
 //BA.debugLineNum = 62;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 12;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 13;BA.debugLine="Private fx As JFX";
_fx = new anywheresoftware.b4j.objects.JFX();
 //BA.debugLineNum = 15;BA.debugLine="Private mEventName As String";
_meventname = "";
 //BA.debugLineNum = 16;BA.debugLine="Private mCallBack As Object";
_mcallback = new Object();
 //BA.debugLineNum = 17;BA.debugLine="Private mBase As Pane";
_mbase = new anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper();
 //BA.debugLineNum = 19;BA.debugLine="Private mLeft, mTop, mWidth, mHeight As Int";
_mleft = 0;
_mtop = 0;
_mwidth = 0;
_mheight = 0;
 //BA.debugLineNum = 20;BA.debugLine="Private mText, mIcon As String";
_mtext = "";
_micon = "";
 //BA.debugLineNum = 21;BA.debugLine="Private mIconFont As Font";
_miconfont = new anywheresoftware.b4j.objects.JFX.FontWrapper();
 //BA.debugLineNum = 22;BA.debugLine="Private mTextColor As Paint";
_mtextcolor = new anywheresoftware.b4j.objects.JFX.PaintWrapper();
 //BA.debugLineNum = 23;BA.debugLine="Private mIconTextSize, mTextSize As Float";
_micontextsize = 0f;
_mtextsize = 0f;
 //BA.debugLineNum = 24;BA.debugLine="Private mTag As Object";
_mtag = new Object();
 //BA.debugLineNum = 26;BA.debugLine="Private mLabel, mIconLabel As Label";
_mlabel = new anywheresoftware.b4j.objects.LabelWrapper();
_miconlabel = new anywheresoftware.b4j.objects.LabelWrapper();
 //BA.debugLineNum = 27;BA.debugLine="Private mParent As Pane";
_mparent = new anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper();
 //BA.debugLineNum = 29;BA.debugLine="Private mClickTime As Long	'used to distingish Cl";
_mclicktime = 0L;
 //BA.debugLineNum = 30;BA.debugLine="End Sub";
return "";
}
public String  _designercreateview(anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper _base,anywheresoftware.b4j.objects.LabelWrapper _lbl,anywheresoftware.b4a.objects.collections.Map _props) throws Exception{
 //BA.debugLineNum = 41;BA.debugLine="Public Sub DesignerCreateView (Base As Pane, Lbl A";
 //BA.debugLineNum = 42;BA.debugLine="mLeft = Base.Left";
_mleft = (int) (_base.getLeft());
 //BA.debugLineNum = 43;BA.debugLine="mTop = Base.Top";
_mtop = (int) (_base.getTop());
 //BA.debugLineNum = 44;BA.debugLine="mIcon = Lbl.Text";
_micon = _lbl.getText();
 //BA.debugLineNum = 45;BA.debugLine="mText = Props.Get(\"Text\")";
_mtext = BA.ObjectToString(_props.Get((Object)("Text")));
 //BA.debugLineNum = 46;BA.debugLine="mBase.Initialize(\"mBase\")";
_mbase.Initialize(ba,"mBase");
 //BA.debugLineNum = 47;BA.debugLine="mParent = Base.Parent";
_mparent.setObject((javafx.scene.layout.Pane)(_base.getParent().getObject()));
 //BA.debugLineNum = 48;BA.debugLine="mParent.AddNode(mBase, mLeft, mTop, Base.Width, B";
_mparent.AddNode((javafx.scene.Node)(_mbase.getObject()),_mleft,_mtop,_base.getWidth(),_base.getHeight());
 //BA.debugLineNum = 50;BA.debugLine="mTextColor = Lbl.TextColor";
_mtextcolor.setObject((javafx.scene.paint.Paint)(_lbl.getTextColor()));
 //BA.debugLineNum = 51;BA.debugLine="mIconFont = Lbl.Font";
_miconfont = _lbl.getFont();
 //BA.debugLineNum = 52;BA.debugLine="mTag = Base.Tag";
_mtag = _base.getTag();
 //BA.debugLineNum = 53;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper  _getbase() throws Exception{
 //BA.debugLineNum = 64;BA.debugLine="Public Sub GetBase As Pane";
 //BA.debugLineNum = 65;BA.debugLine="Return mBase";
if (true) return _mbase;
 //BA.debugLineNum = 66;BA.debugLine="End Sub";
return null;
}
public Object  _gettag() throws Exception{
 //BA.debugLineNum = 138;BA.debugLine="Public Sub getTag As Object";
 //BA.debugLineNum = 139;BA.debugLine="Return mTag";
if (true) return _mtag;
 //BA.debugLineNum = 140;BA.debugLine="End Sub";
return null;
}
public String  _initclass() throws Exception{
int _lblleft = 0;
int _lblwidth = 0;
 //BA.debugLineNum = 84;BA.debugLine="Private Sub InitClass";
 //BA.debugLineNum = 86;BA.debugLine="Private lblLeft, lblWidth  As Int";
_lblleft = 0;
_lblwidth = 0;
 //BA.debugLineNum = 87;BA.debugLine="lblWidth = 2 * mHeight / 3		'icon Label width and";
_lblwidth = (int) (2*_mheight/(double)3);
 //BA.debugLineNum = 88;BA.debugLine="lblLeft = (mWidth - lblWidth) / 2";
_lblleft = (int) ((_mwidth-_lblwidth)/(double)2);
 //BA.debugLineNum = 91;BA.debugLine="mIconLabel.Initialize(\"\")";
_miconlabel.Initialize(ba,"");
 //BA.debugLineNum = 92;BA.debugLine="mIconTextSize = mHeight / 2";
_micontextsize = (float) (_mheight/(double)2);
 //BA.debugLineNum = 93;BA.debugLine="mIconLabel.Font = mIconFont";
_miconlabel.setFont(_miconfont);
 //BA.debugLineNum = 94;BA.debugLine="mIconLabel.TextSize = mIconTextSize";
_miconlabel.setTextSize(_micontextsize);
 //BA.debugLineNum = 95;BA.debugLine="mIconLabel.Alignment = \"CENTER\"";
_miconlabel.setAlignment("CENTER");
 //BA.debugLineNum = 96;BA.debugLine="mIconLabel.TextColor = mTextColor";
_miconlabel.setTextColor((javafx.scene.paint.Paint)(_mtextcolor.getObject()));
 //BA.debugLineNum = 97;BA.debugLine="mBase.AddNode(mIconLabel, lblLeft, 0, lblWidth, l";
_mbase.AddNode((javafx.scene.Node)(_miconlabel.getObject()),_lblleft,0,_lblwidth,_lblwidth);
 //BA.debugLineNum = 98;BA.debugLine="mIconLabel.Text = mIcon";
_miconlabel.setText(_micon);
 //BA.debugLineNum = 101;BA.debugLine="mLabel.Initialize(\"\")";
_mlabel.Initialize(ba,"");
 //BA.debugLineNum = 102;BA.debugLine="mBase.AddNode(mLabel, 0, 2 * mHeight / 3, mWidth,";
_mbase.AddNode((javafx.scene.Node)(_mlabel.getObject()),0,2*_mheight/(double)3,_mwidth,_mheight/(double)3);
 //BA.debugLineNum = 103;BA.debugLine="mTextSize = lblWidth / 3";
_mtextsize = (float) (_lblwidth/(double)3);
 //BA.debugLineNum = 104;BA.debugLine="mLabel.TextSize = mTextSize";
_mlabel.setTextSize(_mtextsize);
 //BA.debugLineNum = 105;BA.debugLine="mLabel.TextColor = mTextColor";
_mlabel.setTextColor((javafx.scene.paint.Paint)(_mtextcolor.getObject()));
 //BA.debugLineNum = 106;BA.debugLine="mLabel.Alignment = \"TOP_CENTER\"";
_mlabel.setAlignment("TOP_CENTER");
 //BA.debugLineNum = 107;BA.debugLine="mLabel.Text = mText";
_mlabel.setText(_mtext);
 //BA.debugLineNum = 108;BA.debugLine="End Sub";
return "";
}
public String  _initialize(anywheresoftware.b4a.BA _ba,Object _callback,String _eventname) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 32;BA.debugLine="Public Sub Initialize (Callback As Object, EventNa";
 //BA.debugLineNum = 33;BA.debugLine="mEventName = EventName";
_meventname = _eventname;
 //BA.debugLineNum = 34;BA.debugLine="mCallBack = Callback";
_mcallback = _callback;
 //BA.debugLineNum = 36;BA.debugLine="mIcon = Chr(0xE859)";
_micon = BA.ObjectToString(__c.Chr((int) (0xe859)));
 //BA.debugLineNum = 37;BA.debugLine="mText = \"Test\"";
_mtext = "Test";
 //BA.debugLineNum = 38;BA.debugLine="mTextColor = fx.Colors.Black";
_mtextcolor.setObject((javafx.scene.paint.Paint)(_fx.Colors.Black));
 //BA.debugLineNum = 39;BA.debugLine="End Sub";
return "";
}
public String  _mbase_mousepressed(anywheresoftware.b4j.objects.NodeWrapper.MouseEventWrapper _eventdata) throws Exception{
 //BA.debugLineNum = 110;BA.debugLine="Private Sub mBase_MousePressed (EventData As Mouse";
 //BA.debugLineNum = 111;BA.debugLine="mClickTime = DateTime.Now";
_mclicktime = __c.DateTime.getNow();
 //BA.debugLineNum = 112;BA.debugLine="End Sub";
return "";
}
public String  _mbase_mousereleased(anywheresoftware.b4j.objects.NodeWrapper.MouseEventWrapper _eventdata) throws Exception{
 //BA.debugLineNum = 114;BA.debugLine="Private Sub mBase_MouseReleased (EventData As Mous";
 //BA.debugLineNum = 115;BA.debugLine="If DateTime.Now - mClickTime < 500 Then";
if (__c.DateTime.getNow()-_mclicktime<500) { 
 //BA.debugLineNum = 116;BA.debugLine="If SubExists(mCallBack, mEventName & \"_Click\") =";
if (__c.SubExists(ba,_mcallback,_meventname+"_Click")==__c.True) { 
 //BA.debugLineNum = 117;BA.debugLine="CallSub(mCallBack,  mEventName & \"_Click\")";
__c.CallSubNew(ba,_mcallback,_meventname+"_Click");
 };
 }else {
 //BA.debugLineNum = 120;BA.debugLine="If SubExists(mCallBack, mEventName & \"_LongClick";
if (__c.SubExists(ba,_mcallback,_meventname+"_LongClick")==__c.True) { 
 //BA.debugLineNum = 121;BA.debugLine="CallSub(mCallBack,  mEventName & \"_LongClick\")";
__c.CallSubNew(ba,_mcallback,_meventname+"_LongClick");
 };
 };
 //BA.debugLineNum = 124;BA.debugLine="End Sub";
return "";
}
public String  _seticonfont(anywheresoftware.b4j.objects.JFX.FontWrapper _iconfont) throws Exception{
 //BA.debugLineNum = 128;BA.debugLine="Public Sub setIconFont(IconFont As Font)";
 //BA.debugLineNum = 129;BA.debugLine="mIconFont = IconFont";
_miconfont = _iconfont;
 //BA.debugLineNum = 130;BA.debugLine="End Sub";
return "";
}
public String  _settag(Object _tag) throws Exception{
 //BA.debugLineNum = 133;BA.debugLine="Public Sub setTag(Tag As Object)";
 //BA.debugLineNum = 134;BA.debugLine="mTag = Tag";
_mtag = _tag;
 //BA.debugLineNum = 135;BA.debugLine="mBase.Tag = Tag";
_mbase.setTag(_tag);
 //BA.debugLineNum = 136;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
return BA.SubDelegator.SubNotFound;
}
}
