formatting

This commit is contained in:
Hannes Janetzek 2013-09-20 18:34:43 +02:00
parent df9d94ac51
commit 3608e49885
7 changed files with 24 additions and 17 deletions

View File

@ -11,10 +11,9 @@ public abstract class AssetAdapter {
/**
* Open file as stream.
*
*
* @param name the name
* @return the input stream
*/
public abstract InputStream openFileAsStream(String name);
}

View File

@ -22,7 +22,6 @@ import org.oscim.backend.canvas.Bitmap;
import org.oscim.backend.canvas.Canvas;
import org.oscim.backend.canvas.Paint;
public abstract class CanvasAdapter {
protected static final String TAG = CanvasAdapter.class.getName();
@ -56,7 +55,7 @@ public abstract class CanvasAdapter {
}
InputStream inputStream = AssetAdapter.g.openFileAsStream(src);
if (inputStream == null){
if (inputStream == null) {
Log.e(TAG, "invalid bitmap source: " + src);
return null;
}

View File

@ -14,7 +14,6 @@
*/
package org.oscim.backend;
public class GLAdapter {
public static GL20 g;
@ -24,7 +23,7 @@ public class GLAdapter {
public static boolean NON_PREMUL_CANVAS;
public static GL20 get(){
public static GL20 get() {
if (g == null)
throw new IllegalStateException();

View File

@ -17,23 +17,29 @@ package org.oscim.backend;
public class Log {
public static Logger logger;
public static void d(String tag, String msg){
public static void d(String tag, String msg) {
logger.d(tag, msg);
}
public static void w(String tag, String msg){
public static void w(String tag, String msg) {
logger.w(tag, msg);
}
public static void e(String tag, String msg){
public static void e(String tag, String msg) {
logger.e(tag, msg);
}
public static void i(String tag, String msg){
public static void i(String tag, String msg) {
logger.i(tag, msg);
}
public interface Logger{
public interface Logger {
void d(String tag, String msg);
void w(String tag, String msg);
void e(String tag, String msg);
void i(String tag, String msg);
}
}

View File

@ -12,7 +12,7 @@ import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
public class XMLReaderAdapter {
public void parse(DefaultHandler handler, InputStream is) throws IOException {
public void parse(DefaultHandler handler, InputStream is) throws IOException {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
@ -23,9 +23,9 @@ public class XMLReaderAdapter {
xmlReader.parse(new InputSource(is));
} catch (SAXException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
}
}

View File

@ -17,9 +17,14 @@ package org.oscim.backend.canvas;
public interface Bitmap {
int getWidth();
int getHeight();
void recycle();
int[] getPixels();
void eraseColor(int color);
int uploadToTexture(boolean replace);
}

View File

@ -1,6 +1,5 @@
package org.oscim.backend.canvas;
public interface Canvas {
void setBitmap(Bitmap bitmap);