本文整理汇总了Java中anywheresoftware.b4a.BA类的典型用法代码示例。如果您正苦于以下问题:Java BA类的具体用法?Java BA怎么用?Java BA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BA类属于anywheresoftware.b4a包,在下文中一共展示了BA类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onWebSocketConnect
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Override
public void onWebSocketConnect(Session sess) {
super.onWebSocketConnect(sess);
((WebSocketRemoteEndpoint)sess.getRemote()).setBatchMode(BatchMode.ON);
handler = new ThreadHandler();
if (parentServlet.singleThread) {
BA.firstInstance.postRunnable(handler);
}
else {
Servlet.pool.submit(handler);
}
}
开发者ID:AnywhereSoftware,项目名称:B4J_Server,代码行数:13,代码来源:WebSocketModule.java
示例2: DesignerCreateView
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Override
public void DesignerCreateView(PanelWrapper base, LabelWrapper lw, Map props) {
CustomViewWrapper.replaceBaseWithView2(base, getObject());
EditTextWrapper et = getEditText();
et.setText(lw.getText());
et.setTextSize(lw.getTextSize());
et.setTypeface(lw.getTypeface());
int hintColor = BA.gm(props.getObject(), "HintColor", ViewWrapper.defaultColor);
if (hintColor != ViewWrapper.defaultColor) {
et.setHintColor(hintColor);
getObject().mHintTextView.setTextColor(hintColor);
}
int textColor = BA.gm(props.getObject(), "TextColor", ViewWrapper.defaultColor);
if (textColor != ViewWrapper.defaultColor) {
et.setTextColor(textColor);
}
getObject().setHint((String)props.Get("Hint"));
}
开发者ID:AnywhereSoftware,项目名称:B4A_ViewsEx,代码行数:19,代码来源:FloatLabeledEditTextWrapper.java
示例3: _initialize
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Hide
@Override
public void _initialize(final BA ba, Object activityClass, String EventName) {
final FloatLabeledEditText fle = new FloatLabeledEditText(ba.context, null);
final String eventName = EventName.toLowerCase(BA.cul);
EditTextWrapper etw = new EditTextWrapper();
etw.Initialize(ba, EventName);
etw.setSingleLine(true);
fle.addView(etw.getObject(), new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
setObject(fle);
innerInitialize(ba, eventName, true);
if (ba.subExists(eventName + "_focuschanged")) {
getObject().MyFocusListener = (new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
ba.raiseEventFromUI(getObject(), eventName + "_focuschanged", hasFocus);
}
});
}
}
开发者ID:AnywhereSoftware,项目名称:B4A_ViewsEx,代码行数:23,代码来源:FloatLabeledEditTextWrapper.java
示例4: _initialize
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Hide
@Override
public void _initialize(final BA ba, Object activityClass, String EventName) {
final RatingBar rb = new RatingBar(ba.context);
final String eventName = EventName.toLowerCase(BA.cul);
setObject(rb);
innerInitialize(ba, eventName, true);
if (ba.subExists(eventName + "_valuechanged")) {
getObject().setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
@Override
public void onRatingChanged(RatingBar ratingBar, float rating,
boolean fromUser) {
ba.raiseEventFromUI(rb, eventName + "_valuechanged", rating, fromUser);
}
});
}
}
开发者ID:AnywhereSoftware,项目名称:B4A_ViewsEx,代码行数:19,代码来源:RatingBarWrapper.java
示例5: _initialize
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Hide
@Override
public void _initialize(final BA ba, Object activityClass, String EventName) {
final Switch _switch = new Switch(ba.context);
final String eventName = EventName.toLowerCase(BA.cul);
setObject(_switch);
innerInitialize(ba, eventName, true);
if (ba.subExists(eventName + "_checkedchange")) {
getObject().setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
ba.raiseEventFromUI(_switch,eventName + "_checkedchange", isChecked);
}
});
}
}
开发者ID:AnywhereSoftware,项目名称:B4A_ViewsEx,代码行数:19,代码来源:SwitchWrapper.java
示例6: Handle
import anywheresoftware.b4a.BA; //导入依赖的package包/类
private void Handle(HttpServletRequest request, HttpServletResponse response, FilterChain chain) {
Handle h = new Handle(request, response, chain);
if (singleThread &&
(BA.firstInstance.getOwnerThread() != Thread.currentThread())) {
h.cdl = new CountDownLatch(1);
synchronized (BA.firstInstance) {
BA.firstInstance.postRunnable(h);
try {
h.cdl.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
else {
h.run();
}
}
开发者ID:AnywhereSoftware,项目名称:B4J_Server,代码行数:19,代码来源:JServlet.java
示例7: onKeyDown
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Override
public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
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);
}
开发者ID:so27,项目名称:Material-Actionbar-Color,代码行数:21,代码来源:main.java
示例8: onStartCommand
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Override
public int onStartCommand(final android.content.Intent intent, int flags, int startId) {
if (ServiceHelper.StarterHelper.onStartCommand(processBA))
handleStart(intent);
else {
ServiceHelper.StarterHelper.waitForLayout = new Runnable() {
public void run() {
BA.LogInfo("** Service (starter) Create **");
processBA.raiseEvent(null, "service_create");
handleStart(intent);
}
};
}
processBA.runHook("onstartcommand", this, new Object[] {intent, flags, startId});
return android.app.Service.START_NOT_STICKY;
}
开发者ID:so27,项目名称:Material-Actionbar-Color,代码行数:17,代码来源:starter.java
示例9: handleStart
import anywheresoftware.b4a.BA; //导入依赖的package包/类
private void handleStart(android.content.Intent intent) {
BA.LogInfo("** Service (starter) Start **");
java.lang.reflect.Method startEvent = processBA.htSubs.get("service_start");
if (startEvent != null) {
if (startEvent.getParameterTypes().length > 0) {
anywheresoftware.b4a.objects.IntentWrapper iw = new anywheresoftware.b4a.objects.IntentWrapper();
if (intent != null) {
if (intent.hasExtra("b4a_internal_intent"))
iw.setObject((android.content.Intent) intent.getParcelableExtra("b4a_internal_intent"));
else
iw.setObject(intent);
}
processBA.raiseEvent(null, "service_start", iw);
}
else {
processBA.raiseEvent(null, "service_start");
}
}
}
开发者ID:so27,项目名称:Material-Actionbar-Color,代码行数:20,代码来源:starter.java
示例10: onDestroy
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Override
public void onDestroy() {
BA.LogInfo("** Service (starter) Destroy **");
processBA.raiseEvent(null, "service_destroy");
processBA.service = null;
mostCurrent = null;
processBA.setActivityPaused(true);
processBA.runHook("ondestroy", this, null);
}
开发者ID:so27,项目名称:Material-Actionbar-Color,代码行数:10,代码来源:starter.java
示例11: onCreateOptionsMenu
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(android.view.Menu menu) {
super.onCreateOptionsMenu(menu);
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;
}
开发者ID:gearit,项目名称:RadaeePDF-B4A,代码行数:23,代码来源:main.java
示例12: _checkresult
import anywheresoftware.b4a.BA; //导入依赖的package包/类
public static boolean _checkresult(int _presult) throws Exception{
//BA.debugLineNum = 80;BA.debugLine="Sub CheckResult (pResult As Int) As Boolean";
//BA.debugLineNum = 82;BA.debugLine="Select pResult";
switch (BA.switchObjectToInt(_presult,(int) (0),(int) (-1),(int) (-2),(int) (-3),(int) (-10))) {
case 0:
//BA.debugLineNum = 84;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
}
;
//BA.debugLineNum = 92;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
//BA.debugLineNum = 93;BA.debugLine="End Sub";
return false;
}
开发者ID:gearit,项目名称:RadaeePDF-B4A,代码行数:24,代码来源:main.java
示例13: CreateFileSource
import anywheresoftware.b4a.BA; //导入依赖的package包/类
/**
* Creates a local file source.
*/
public Object CreateFileSource (String Dir, String FileName) throws IOException {
String path;
if (Dir.equals(File.getDirAssets())) {
if (File.virtualAssetsFolder != null) {
path = "file://" + File.Combine(File.virtualAssetsFolder, File.getUnpackedVirtualAssetFile(FileName));
} else {
path = "asset:///" + FileName.toLowerCase(BA.cul);
}
}
else {
path = "file://" + File.Combine(Dir, FileName);
}
return CreateUriSource(path);
}
开发者ID:AnywhereSoftware,项目名称:B4A_ExoPlayer,代码行数:18,代码来源:SimpleExoPlayerWrapper.java
示例14: createDefaultDataFactory
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Hide
public DefaultDataSourceFactory createDefaultDataFactory() {
try {
return new DefaultDataSourceFactory(BA.applicationContext, Util.getUserAgent(BA.applicationContext, B4AApplication.getLabelName()));
} catch (NameNotFoundException e) {
throw new RuntimeException(e);
}
}
开发者ID:AnywhereSoftware,项目名称:B4A_ExoPlayer,代码行数:9,代码来源:SimpleExoPlayerWrapper.java
示例15: _initialize
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Hide
@Override
public void _initialize(final BA ba, Object activityClass, String EventName) {
final SimpleExoPlayerView view = new SimpleExoPlayerView(ba.context);
final String eventName = EventName.toLowerCase(BA.cul);
setObject(view);
innerInitialize(ba, eventName, true);
}
开发者ID:AnywhereSoftware,项目名称:B4A_ExoPlayer,代码行数:9,代码来源:SimpleExoPlayerViewWrapper.java
示例16: Initialize2
import anywheresoftware.b4a.BA; //导入依赖的package包/类
/**
* Initializes the AdView.
*EventName - Name of Subs that will handle the events.
*AdUnitId - The Ad unit id received from AdMob.
*Size - One of the SIZE constants.
*/
public void Initialize2(final BA ba, String EventName, String AdUnitId, Object Size) {
AdView ad = new AdView(ba.activity);
ad.setAdSize((com.google.android.gms.ads.AdSize)Size);
ad.setAdUnitId(AdUnitId);
setObject(ad);
super.Initialize(ba, EventName);
final String eventName = EventName.toLowerCase(BA.cul);
getObject().setAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int e){
ba.raiseEvent(getObject(), eventName + "_failedtoreceivead", String.valueOf(e));
}
@Override
public void onAdLoaded() {
ba.raiseEvent(getObject(), eventName + "_receivead");
}
@Override
public void onAdClosed() {
ba.raiseEventFromDifferentThread(getObject(), null, 0, eventName + "_adscreendismissed", false, null);
}
@Override
public void onAdLeftApplication() {
//
}
@Override
public void onAdOpened() {
ba.raiseEventFromDifferentThread(getObject(), null, 0, eventName + "_presentscreen", false, null);
}
});
}
开发者ID:AnywhereSoftware,项目名称:B4A_FirebaseAdMob,代码行数:39,代码来源:AdViewWrapper.java
示例17: Initialize
import anywheresoftware.b4a.BA; //导入依赖的package包/类
/**
* Initializes the ad view.
*EventName - Sets the subs that will handle the events.
*AdUnitId - Ad unit ID of a native ad.
*Width - Requested ad width.
*Height - Requested ad height.
*/
public void Initialize(final BA ba, String EventName, String AdUnitId, float Width, float Height) {
NativeExpressAdView ad = new NativeExpressAdView(ba.activity);
ad.setAdSize(new AdSize((int)Math.round(Width / Common.Density), (int)Math.round(Height / Common.Density)));
ad.setAdUnitId(AdUnitId);
setObject(ad);
super.Initialize(ba, EventName);
final String eventName = EventName.toLowerCase(BA.cul);
getObject().setAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int e){
ba.raiseEvent(getObject(), eventName + "_failedtoreceivead", String.valueOf(e));
}
@Override
public void onAdLoaded() {
ba.raiseEvent(getObject(), eventName + "_receivead");
}
@Override
public void onAdClosed() {
ba.raiseEventFromDifferentThread(getObject(), null, 0, eventName + "_adscreendismissed", false, null);
}
@Override
public void onAdLeftApplication() {
//
}
@Override
public void onAdOpened() {
ba.raiseEventFromDifferentThread(getObject(), null, 0, eventName + "_presentscreen", false, null);
}
});
}
开发者ID:AnywhereSoftware,项目名称:B4A_FirebaseAdMob,代码行数:40,代码来源:AdViewWrapper.java
示例18: getInitializeMethod
import anywheresoftware.b4a.BA; //导入依赖的package包/类
public static Method getInitializeMethod(Class<?> c) throws NoSuchMethodException, SecurityException {
Method m = null;
try {
m = c.getDeclaredMethod("_initialize", BA.class);
} catch (NoSuchMethodException e) {
m = c.getDeclaredMethod("innerInitializeHelper", BA.class);
}
return m;
}
开发者ID:AnywhereSoftware,项目名称:B4J_Server,代码行数:10,代码来源:JServlet.java
示例19: createInstance
import anywheresoftware.b4a.BA; //导入依赖的package包/类
public static B4AClass createInstance(Class<?> handlerClass, Method initializeMethod) throws Exception {
B4AClass handler = (B4AClass)handlerClass.newInstance();
initializeMethod.invoke(handler, (Object)null);
BA ba = handler.getBA();
if (BA.isShellModeRuntimeCheck(ba)) {
ba.raiseEvent(null, "initialize", (Object)null);
}
return handler;
}
开发者ID:AnywhereSoftware,项目名称:B4J_Server,代码行数:10,代码来源:JServlet.java
示例20: run
import anywheresoftware.b4a.BA; //导入依赖的package包/类
@Override
public void run() {
try {
try {
B4AClass b4aclass = createInstance(handlerClass, initializeMethod);
BA ba = b4aclass.getBA();
Object o = ba.raiseEvent(null, chain == null ? "handle" : "filter" ,
AbsObjectWrapper.ConvertToWrapper(new ServletRequestWrapper(),request),
AbsObjectWrapper.ConvertToWrapper(new ServletResponseWrapper(), response));
if (chain != null) {
if (Boolean.TRUE.equals(o))
chain.doFilter(request, response);
}
} finally {
if (cdl != null)
cdl.countDown();
}
} catch (Exception e) {
try {
response.sendError(500, e.toString());
} catch (Exception e1) {
e1.printStackTrace();
}
e.printStackTrace();
}
}
开发者ID:AnywhereSoftware,项目名称:B4J_Server,代码行数:28,代码来源:JServlet.java
注:本文中的anywheresoftware.b4a.BA类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论