text stringlengths 3 1.18M |
|---|
package tests;
import static org.junit.Assert.*;
import game.Shot;
import java.util.Random;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ShotTest {
Random random;
Shot shot;
@Before
public void do... |
package tests;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({ DiceTest.class, GameTest.class, PlayerTest.class,
ShotTest.class })
public class AllTests {
}
|
package roboguice;
import roboguice.config.RoboModule;
import roboguice.inject.*;
import android.app.Application;
import android.content.Context;
import com.google.inject.*;
import com.google.inject.spi.DefaultElementVisitor;
import com.google.inject.spi.Element;
import com.google.inject.spi.Elements;
import com.goo... |
package roboguice.config;
import roboguice.event.EventManager;
import roboguice.event.ObservesTypeListener;
import roboguice.event.eventListener.factory.EventListenerThreadingDecorator;
import roboguice.inject.*;
import roboguice.util.Ln;
import roboguice.util.RoboAsyncTask;
import roboguice.util.Strings;
i... |
/*
* Copyright 2009 Michael Burton Licensed under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
* or agreed to in writing, s... |
package roboguice.service.event;
import android.content.res.Configuration;
/**
* Class representing the event raised by RoboActivity.onConfigurationChanged()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnConfigurationChangedEvent {
protected Configuration oldConfig;
protected Configur... |
package roboguice.service.event;
/**
* Class representing the event raised by RoboService.onCreate()
*/
public class OnCreateEvent{}
|
package roboguice.service.event;
/**
* Class representing the event raised by RoboService.onDestroy()
*/
public class OnDestroyEvent {}
|
package roboguice.service.event;
/**
* Class representing the event raised by RoboService.onStart()
*/
public class OnStartEvent {}
|
package roboguice.service;
import roboguice.RoboGuice;
import roboguice.event.EventManager;
import roboguice.service.event.OnConfigurationChangedEvent;
import roboguice.service.event.OnCreateEvent;
import roboguice.service.event.OnDestroyEvent;
import roboguice.service.event.OnStartEvent;
import android.app.IntentSer... |
package roboguice.receiver;
import roboguice.RoboGuice;
import android.app.Application;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.google.inject.Injector;
/**
* To ensure proper ContextScope usage, override the handleReceive method
*/
public... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
package roboguice.inject;
import roboguice.inject.ViewListener.ViewMembersInjector;
import android.content.Context;
import android.view.View;
import com.google.inject.*;
import com.google.inject.spi.TypeConverterBinding;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Map;
import jav... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
package roboguice.inject;
import android.content.Context;
import android.content.res.AssetManager;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class AssetManagerProvider implements Provider<AssetManager> {
@Inject protected Context context;
public AssetManager get() {
... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
package roboguice.inject;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import com.google.inject.BindingAnnotation;
/**
*
* @author Pierre-Yves Ricau (py.ricau+roboguice@g... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2010 Rodrigo Damazio
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
package roboguice.inject;
import roboguice.util.Strings;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
public class Nullable {
public static boolean notNullable( Field field ) {
return !isNullable( field );
}
public static boolean isNullable(Field field) {
for( ... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
package roboguice.inject;
import com.google.inject.Injector;
public interface RoboInjector extends Injector {
void injectViewMembers(Object instance);
}
|
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
package roboguice.event;
import roboguice.event.javaassist.RuntimeSupport;
import roboguice.inject.ContextScoped;
import roboguice.util.Ln;
import com.google.inject.Inject;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.... |
package roboguice.event;
import roboguice.event.eventListener.ObserverMethodListener;
import roboguice.event.eventListener.factory.EventListenerThreadingDecorator;
import com.google.inject.Provider;
import com.google.inject.TypeLiteral;
import com.google.inject.spi.InjectionListener;
import com.google.inject.... |
package roboguice.event;
/**
* Interface for registering functionality with the EventManager.
*
* @author Mike Burton
*
* @param <T>
*/
public interface EventListener<T> {
/**
* Method called when event T is triggered.
*
* @param event fired
*/
public void onEvent(T event);
}
|
/*
* Javassist, a Java-bytecode translator toolkit.
* Copyright (C) 1999-2007 Shigeru Chiba. All Rights Reserved.
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. Alternatively, the contents o... |
package roboguice.event;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Parameter annotation to bind a given method and parameter to an event raised through the
* EventManager.fire... |
package roboguice.event;
/**
* Observes annotation parameter specifying which thread the annotated method will be called from. Use this
* parameter to ensure that event manager calls with special requirements are executed properly:
*
* Current:
* Default execution technique. The same thread that fires the even... |
package roboguice.event.eventListener;
import roboguice.event.EventListener;
/**
* Runnable implementation of the event listener on event call.
*
* @author John Ericksen
*/
public class EventListenerRunnable<T> implements Runnable {
protected T event;
protected EventListener<T> eventListener;
public E... |
package roboguice.event.eventListener.factory;
import roboguice.event.EventListener;
import roboguice.event.EventThread;
import roboguice.event.eventListener.AsynchronousEventListenerDecorator;
import roboguice.event.eventListener.UIThreadEventListenerDecorator;
import android.os.Handler;
import com.google.inject.In... |
/*
* Javassist, a Java-bytecode translator toolkit.
* Copyright (C) 1999-2007 Shigeru Chiba. All Rights Reserved.
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. Alternatively, the contents o... |
package roboguice.event.eventListener;
import roboguice.util.SafeAsyncTask;
import android.os.Handler;
/**
* Adaptor between the SafeAsyncTask class and provided Runnable.
*
* @author John Ericksen
*/
public class RunnableAsyncTaskAdaptor extends SafeAsyncTask<Void> {
protected Runnable runnable;
public ... |
package roboguice.event.eventListener;
import roboguice.event.EventListener;
import android.os.Handler;
/**
* EventListener Decorator which executes the given event listener on the ui thread, through the provided Handler.
*
* @author John Ericksen
*/
public class UIThreadEventListenerDecorator<T> implements Even... |
package roboguice.event.eventListener;
import roboguice.event.EventListener;
import android.os.Handler;
/**
* Event Listener Decorator class. This decorator executes the event listener through the SafeAsyncTask functionality.
*
* @author John Ericksen
*/
public class AsynchronousEventListenerDecorator<T> implem... |
package roboguice.event.eventListener;
import roboguice.event.EventListener;
import roboguice.event.eventListener.javaassist.RuntimeSupport;
import roboguice.util.Ln;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Observer Method Event ... |
package roboguice.adapter;
import android.content.Context;
import android.widget.ArrayAdapter;
import java.util.ArrayList;
import java.util.List;
public class IterableAdapter<T> extends ArrayAdapter<T> {
public IterableAdapter(Context context, int resource, int textViewResourceId) {
super(context, resou... |
package roboguice.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.util.Log;
import com.google.inject.Inject;
import java.text.SimpleDateFormat;
/**
* A more natural android logging facility.
*
* WARNING: CHECK OUT COMMON PITFALLS BELOW
*
* Unlike {@link android.u... |
package roboguice.util;
import roboguice.RoboGuice;
import android.content.Context;
import android.os.Handler;
import com.google.inject.Inject;
import com.google.inject.Provider;
import java.util.concurrent.Executor;
/**
* Allows injection to happen for tasks that execute in a background thread.
*
* @param <Re... |
package roboguice.util;
import java.io.*;
import java.security.InvalidParameterException;
import java.security.MessageDigest;
import java.util.*;
public class Strings {
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
/**
* Like join, but allows for a distinct final delimiter. For english sente... |
package roboguice.util;
import android.os.Handler;
import android.util.Log;
import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.*;
/**
* A class similar but unrelated to android's {@link android.os.AsyncTask}.
*
* Unlike AsyncTask, this class pro... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
package roboguice.activity;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
/**
* An activity that can be used to display a splash page while initializing the
* guice injector in the background.
*
* Use of this class is definitely not required in order to use RoboGuice, but... |
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
package roboguice.activity.event;
import android.content.Intent;
/**
* Class representing the event raised by RoboActivity.onActivityResult()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnActivityResultEvent {
protected int requestCode;
protected int resultCode;
pr... |
package roboguice.activity.event;
import android.content.res.Configuration;
/**
* Class representing the event raised by RoboActivity.onConfigurationChanged()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnConfigurationChangedEvent {
protected Configuration oldConfig;
protected Configu... |
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onStop()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnStopEvent {} |
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onResume()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnResumeEvent {} |
package roboguice.activity.event;
import android.os.Bundle;
/**
* Class representing the event raised by RoboActivity.onCreate()
*
* You may also be interested in roboguice.activity.event.OnContentViewAvailableEvent
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnCreateEvent{
protect... |
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onDestroy()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnDestroyEvent {} |
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onContentChanged()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnContentChangedEvent {} |
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onNewIntent()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnNewIntentEvent {} |
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onPause()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnPauseEvent {} |
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onRestart()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnRestartEvent {}
|
package roboguice.activity.event;
/**
* Class representing the event raised by RoboActivity.onStart()
*
* @author Adam Tybor
* @author John Ericksen
*/
public class OnStartEvent {}
|
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
package roboguice;
/**
* Used by robolectric
*/
public class R {
}
|
package roboguice.event;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Base ContextScoped Observer testing class exercising the various ... |
package roboguice.event;
/**
* Simple Test Event
*
* @author John Ericksen
*/
public class EventOne {
}
|
package roboguice.event;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* ContextScoped Observer testing class exercising the various implementation combinations.
*
* @author John Ericksen
*/
public class ContextObserverTesterImpl extends ContextObserverBase implements Con... |
package roboguice.event;
/**
* ContextScoped Observer testing interface
*
* @author John Ericksen
*/
public interface ContextObserverTester {
void observesImplementedEvent(@Observes EventOne event);
void observesImplementedEvent(@Observes EventTwo event);
}
|
package roboguice.event;
/**
* Simple Test Event
*
* @author John Ericksen
*/
public class EventTwo {
}
|
package org.roboguice.astroboy.controller;
import roboguice.inject.ContextScoped;
import roboguice.util.Ln;
import android.app.Activity;
import android.widget.Toast;
import com.google.inject.Inject;
/**
* A class to control Astroboy remotely.
*
* This class uses the current context, so we must make it @ContextSc... |
package org.roboguice.astroboy.controller;
import android.content.Context;
import android.os.Vibrator;
import android.widget.Toast;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import java.util.Random;
/**
* What you'll learn in this class:
* - What it... |
package org.roboguice.astroboy.activity;
import org.roboguice.astroboy.R;
import org.roboguice.astroboy.controller.AstroboyRemoteControl;
import roboguice.activity.RoboActivity;
import roboguice.inject.InjectView;
import android.content.Intent;
import android.os.Bundle;
import android.os.Vibrator;
import android.view... |
package org.roboguice.astroboy.activity;
import org.roboguice.astroboy.R;
import org.roboguice.astroboy.controller.Astroboy;
import roboguice.activity.RoboActivity;
import roboguice.inject.InjectResource;
import roboguice.inject.InjectView;
import roboguice.util.RoboAsyncTask;
import android.os.Bundle;
import android... |
package tyt.android.bigplanettracks;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.SAXParser;
import javax.xml... |
package tyt.android.bigplanettracks;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.hardware.GeomagneticField;
import android.hardware.Sensor;
... |
package tyt.android.bigplanettracks.maps.providers;
public abstract class Layer {
public abstract int getId();
public abstract String getDescription();
public abstract String getURLPattern();
}
|
package tyt.android.bigplanettracks.maps.providers;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
public class GoogleVectorMapStrategy extends MapStrategy {
private List<Layer> layers = new ArrayList<Layer>();
public GoogleVectorMapStrategy() {
layers.add(new Layer() {
... |
package tyt.android.bigplanettracks.maps.providers;
import java.util.HashMap;
import java.util.Map;
public class MapStrategyFactory {
public static final int GOOGLE_VECTOR = 0;
public static final int GOOGLE_SATELLITE = 1;
public static final int GOOGLE_TERRAIN = 2;
public static final int OPENSTREET_VECTOR ... |
package tyt.android.bigplanettracks.maps.providers;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
public class OpenStreetMapStrategy extends MapStrategy {
private List<Layer> layers = new ArrayList<Layer>();
public OpenStreetMapStrategy() {
layers.add(new Layer() {
priva... |
package tyt.android.bigplanettracks.maps.providers;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
public class GoogleSatelliteMapStrategy extends MapStrategy {
private List<Layer> layers = new ArrayList<Layer>();
public GoogleSatelliteMapStrategy() {
layers.add(new Layer() ... |
package tyt.android.bigplanettracks.maps.providers;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
public class GoogleTerrainMapStrategy extends MapStrategy {
private List<Layer> layers = new ArrayList<Layer>();
public GoogleTerrainMapStrategy() {
layers.add(new Layer() {
... |
package tyt.android.bigplanettracks.maps.providers;
public abstract class MapStrategy {
public abstract String getURL(int x, int y, int z, int layout);
public abstract String getDescription();
}
|
package tyt.android.bigplanettracks.maps;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SHA1Hash {
private static String convertToHex(byte[] data) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i <... |
package tyt.android.bigplanettracks.maps.storage;
import tyt.android.bigplanettracks.maps.Preferences;
import tyt.android.bigplanettracks.maps.RawTile;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
public class SQLLocalStorage implements ILocalSt... |
package tyt.android.bigplanettracks.maps.storage;
import tyt.android.bigplanettracks.maps.RawTile;
public interface ILocalStorage {
/**
* Очистка файлового кеша
*/
public abstract void clear();
public abstract boolean isExists(RawTile tile);
/**
* Сохраняет тайл в файловый кеш
*
* @param tile
* ... |
package tyt.android.bigplanettracks.maps.storage;
import java.util.LinkedHashMap;
import java.util.Collection;
import java.util.Map;
import java.util.ArrayList;
/**
* An LRU cache, based on <code>LinkedHashMap</code>.<br>
* This cache has a fixed maximum number of elements (<code>cacheSize</code>).
* If the... |
package tyt.android.bigplanettracks.maps.storage;
import tyt.android.bigplanettracks.maps.RawTile;
import android.graphics.Bitmap;
/**
* @author tytung
*/
public class BitmapCache {
private LRUCache<RawTile, Bitmap> cacheMap;
public BitmapCache(int size) {
cacheMap = new LRUCache<RawTile, Bitmap>(size);
}
... |
package tyt.android.bigplanettracks.maps.storage;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import tyt.android.bigplanettracks.BigPlanet;
import tyt.android.bigplanettracks.maps.Handler;
import tyt.android.bigplanettracks.maps.RawTile;
import android.graphics.Bitmap;
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.