本文整理汇总了Java中com.beyondar.android.world.BeyondarObject类的典型用法代码示例。如果您正苦于以下问题:Java BeyondarObject类的具体用法?Java BeyondarObject怎么用?Java BeyondarObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BeyondarObject类属于com.beyondar.android.world包,在下文中一共展示了BeyondarObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replaceImagesByStaticViews
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
private void replaceImagesByStaticViews(World world) {
String path = getTmpPath();
for (BeyondarObjectList beyondarList : world.getBeyondarObjectLists()) {
for (BeyondarObject beyondarObject : beyondarList) {
// First let's get the view, inflate it and change some stuff
View view = getLayoutInflater().inflate(R.layout.static_beyondar_object_view, null);
TextView textView = (TextView) view.findViewById(R.id.geoObjectName);
textView.setText(beyondarObject.getName());
try {
// Now that we have it we need to store this view in the
// storage in order to allow the framework to load it when
// it will be need it
String imageName = TMP_IMAGE_PREFIX + beyondarObject.getName() + ".png";
ImageUtils.storeView(view, path, imageName);
// If there are no errors we can tell the object to use the
// view that we just stored
beyondarObject.setImageUri(path + imageName);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
示例2: getView
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
@Override
public View getView(BeyondarObject beyondarObject, View recycledView, ViewGroup parent) {
if (!showViewOn.contains(beyondarObject)) {
return null;
}
if (recycledView == null) {
recycledView = inflater.inflate(R.layout.beyondar_object_view, null);
}
TextView textView = (TextView) recycledView.findViewById(R.id.titleTextView);
textView.setText(beyondarObject.getName());
Button button = (Button) recycledView.findViewById(R.id.button);
button.setOnClickListener(AttachViewToGeoObjectActivity.this);
// Once the view is ready we specify the position
setPosition(beyondarObject.getScreenPositionTopRight());
return recycledView;
}
示例3: renderList
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
/**
* Render a specific list.
*
* @param gl
* @param list
* List to render.
* @param time
* Time mark to be used for drawing the frame.
*/
protected void renderList(GL10 gl, BeyondarObjectList list, long time) {
Texture listTexture = list.getDefaultTexture();
if (!listTexture.isLoaded()) {
Texture defaultTexture = sTextureHolder.get(list.getDefaultImageUri());
if (defaultTexture == null || !defaultTexture.isLoaded()) {
Logger.w("Warning!! The default texture for the list \"" + list.getType()
+ "\" has not been loaded. Trying to load it now...");
Bitmap defaultBtm = mWorld.getBitmapCache().getBitmap(list.getDefaultImageUri());
defaultTexture = load2DTexture(gl, defaultBtm);
}
list.setDefaultTexture(defaultTexture == null ? null : defaultTexture.clone());
}
for (int j = 0; j < list.size(); j++) {
BeyondarObject beyondarObject = list.get(j);
if (beyondarObject == null) {
continue;
}
renderBeyondarObject(gl, beyondarObject, listTexture, time);
}
}
示例4: loadBeyondarObjectTexture
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
/**
* Load the textures of the specified geoObject.
*
* @param gl
* @param geoObject
* The object to load the textures.
*/
public void loadBeyondarObjectTexture(GL10 gl, BeyondarObject geoObject) {
Texture texture = getTexture(geoObject.getImageUri());
if (texture == null) {
Bitmap btm = mWorld.getBitmapCache().getBitmap(geoObject.getImageUri());
texture = loadBitmapTexture(gl, btm, geoObject.getImageUri());
if (texture == null || !texture.isLoaded()) {
sPendingTextureObjects.addObject(geoObject.getImageUri(), geoObject);
}
if (btm == null) {
if (Logger.DEBUG_OPENGL) {
Logger.e(TAG, "ERROR: the resource " + geoObject.getImageUri()
+ " has not been loaded. Object Name: " + geoObject.getName());
}
}
}
geoObject.setTexture(texture);
}
示例5: setAllTextures
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
private synchronized void setAllTextures(GL10 gl, String uri, Bitmap btm,
PendingBitmapsToBeLoaded<BeyondarObject> pendingList) {
if (uri == null) {
return;
}
ArrayList<BeyondarObject> list = pendingList.getPendingList(uri);
if (list == null) {
return;
}
Texture texture = loadBitmapTexture(gl, btm, uri);
for (int i = 0; i < list.size() && texture.isLoaded(); i++) {
BeyondarObject object = list.get(i);
object.setTexture(texture);
}
pendingList.removePendingList(uri);
}
示例6: onClick
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
@Override
public void onClick(View v) {
if (v == mMainLayout) {
if (mClickListener == null) {
return;
}
final float lastX = mLastScreenTouchX;
final float lastY = mLastScreenTouchY;
mThreadPool.execute(new Runnable() {
@Override
public void run() {
final ArrayList<BeyondarObject> beyondarObjects = new ArrayList<BeyondarObject>();
mBeyondarGLSurface.getBeyondarObjectsOnScreenCoordinates(lastX, lastY, beyondarObjects);
if (beyondarObjects.size() == 0)
return;
mBeyondarGLSurface.post(new Runnable() {
@Override
public void run() {
OnClickBeyondarObjectListener listener = mClickListener;
if (listener != null) {
Log.d("ArFragment", "run: ListenerSet");
listener.onClickBeyondarObject(beyondarObjects);
}
}
});
}
});
}
}
示例7: onBeyondarObjectsRendered
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
@Override
public void onBeyondarObjectsRendered(List<BeyondarObject> renderedBeyondarObjects) {
BeyondarViewAdapter tmpView = mViewAdapter;
if (tmpView != null) {
List<BeyondarObject> elements = World
.sortGeoObjectByDistanceFromCenter(new ArrayList<BeyondarObject>(renderedBeyondarObjects));
tmpView.processList(elements, mParent, this);
}
}
示例8: onTouchBeyondarView
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
@Override
public void onTouchBeyondarView(MotionEvent event, ArBeyondarGLSurfaceView var2) {
float x = event.getX();
float y = event.getY();
ArrayList<BeyondarObject> geoObjects = new ArrayList<BeyondarObject>();
// This method call is better to don't do it in the UI thread!
// This method is also available in the BeyondarFragment
var2.getBeyondarObjectsOnScreenCoordinates(x, y, geoObjects);
String textEvent = "";
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
textEvent = "Event type ACTION_DOWN: ";
break;
case MotionEvent.ACTION_UP:
textEvent = "Event type ACTION_UP: ";
break;
case MotionEvent.ACTION_MOVE:
textEvent = "Event type ACTION_MOVE: ";
break;
default:
break;
}
Iterator<BeyondarObject> iterator = geoObjects.iterator();
while (iterator.hasNext()) {
BeyondarObject geoObject = iterator.next();
textEvent = textEvent + " " + geoObject.getName();
Log.d(TAG, "onTouchBeyondarView: ATTENTION !!! "+textEvent);
// ...
// Do something
// ...
}
}
示例9: onCreate
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
showViewOn = Collections.synchronizedList(new ArrayList<BeyondarObject>());
// Hide the window title.
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.simple_camera);
mBeyondarFragment = (BeyondarFragmentSupport) getSupportFragmentManager().findFragmentById(
R.id.beyondarFragment);
// We create the world and fill it ...
mWorld = CustomWorldHelper.generateObjects(this);
// .. and send it to the fragment
mBeyondarFragment.setWorld(mWorld);
// We also can see the Frames per seconds
mBeyondarFragment.showFPS(true);
mBeyondarFragment.setOnClickBeyondarObjectListener(this);
CustomBeyondarViewAdapter customBeyondarViewAdapter = new CustomBeyondarViewAdapter(this);
mBeyondarFragment.setBeyondarViewAdapter(customBeyondarViewAdapter);
Toast.makeText(this, "Click on any object to attach it a view", Toast.LENGTH_LONG).show();
}
示例10: onClickBeyondarObject
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
@Override
public void onClickBeyondarObject(ArrayList<BeyondarObject> beyondarObjects) {
if (beyondarObjects.size() == 0) {
return;
}
BeyondarObject beyondarObject = beyondarObjects.get(0);
if (showViewOn.contains(beyondarObject)) {
showViewOn.remove(beyondarObject);
} else {
showViewOn.add(beyondarObject);
}
}
示例11: onTouchBeyondarView
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
@Override
public void onTouchBeyondarView(MotionEvent event, BeyondarGLSurfaceView beyondarView) {
float x = event.getX();
float y = event.getY();
ArrayList<BeyondarObject> geoObjects = new ArrayList<BeyondarObject>();
// This method call is better to don't do it in the UI thread!
beyondarView.getBeyondarObjectsOnScreenCoordinates(x, y, geoObjects);
String textEvent = "";
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
textEvent = "Event type ACTION_DOWN: ";
break;
case MotionEvent.ACTION_UP:
textEvent = "Event type ACTION_UP: ";
break;
case MotionEvent.ACTION_MOVE:
textEvent = "Event type ACTION_MOVE: ";
break;
default:
break;
}
Iterator<BeyondarObject> iterator = geoObjects.iterator();
while (iterator.hasNext()) {
BeyondarObject geoObject = iterator.next();
textEvent = textEvent + " " + geoObject.getName();
}
mLabelText.setText("Event: " + textEvent);
}
示例12: onClickBeyondarObject
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
@Override
public void onClickBeyondarObject(ArrayList<BeyondarObject> beyondarObjects) {
if (beyondarObjects.size() > 0) {
Toast.makeText(this, "Clicked on: " + beyondarObjects.get(0).getName(),
Toast.LENGTH_LONG).show();
}
}
示例13: GoogleMapGeoObjectPlugin
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
public GoogleMapGeoObjectPlugin(GoogleMapWorldPlugin worldGoogleMapPlugin, BeyondarObject beyondarObject) {
mAttached = false;
mWorldGoogleMapPlugin = worldGoogleMapPlugin;
if (mWorldGoogleMapPlugin == null) {
throw new NullPointerException("The WorldGoogleMapPlugin must not be null");
}
setBeyondarObject(beyondarObject);
}
示例14: setBeyondarObject
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
/**
* Setup the plugin according to the BeyondarObject
*
* @param BeyondarObject
*/
private void setBeyondarObject(BeyondarObject beyondarObject) {
if (beyondarObject instanceof GeoObject) {
mGeoObject = (GeoObject) beyondarObject;
} else {
// throw new
// IllegalArgumentException("beyondarObject must be a GeoObject");
}
if (mGeoObject == null) {
throw new NullPointerException("The BeyondarObject must not be null");
}
mAttached = true;
}
示例15: addGooGleMapPlugin
import com.beyondar.android.world.BeyondarObject; //导入依赖的package包/类
/**
* This method adds the {@link GoogleMapGeoObjectPlugin} to the
* {@link com.beyondar.android.world.GeoObject GeoObject}
*
* @param beyondarObject
*/
protected void addGooGleMapPlugin(BeyondarObject beyondarObject) {
if (beyondarObject instanceof GeoObject) {
if (!beyondarObject.containsAnyPlugin(GoogleMapGeoObjectPlugin.class)) {
GoogleMapGeoObjectPlugin plugin = new GoogleMapGeoObjectPlugin(this, beyondarObject);
beyondarObject.addPlugin(plugin);
createMarker((GeoObject) beyondarObject, plugin);
}
}
}