formatting
This commit is contained in:
parent
df9d94ac51
commit
3608e49885
@ -11,10 +11,9 @@ public abstract class AssetAdapter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Open file as stream.
|
* Open file as stream.
|
||||||
*
|
*
|
||||||
* @param name the name
|
* @param name the name
|
||||||
* @return the input stream
|
* @return the input stream
|
||||||
*/
|
*/
|
||||||
public abstract InputStream openFileAsStream(String name);
|
public abstract InputStream openFileAsStream(String name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,6 @@ import org.oscim.backend.canvas.Bitmap;
|
|||||||
import org.oscim.backend.canvas.Canvas;
|
import org.oscim.backend.canvas.Canvas;
|
||||||
import org.oscim.backend.canvas.Paint;
|
import org.oscim.backend.canvas.Paint;
|
||||||
|
|
||||||
|
|
||||||
public abstract class CanvasAdapter {
|
public abstract class CanvasAdapter {
|
||||||
protected static final String TAG = CanvasAdapter.class.getName();
|
protected static final String TAG = CanvasAdapter.class.getName();
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ public abstract class CanvasAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
InputStream inputStream = AssetAdapter.g.openFileAsStream(src);
|
InputStream inputStream = AssetAdapter.g.openFileAsStream(src);
|
||||||
if (inputStream == null){
|
if (inputStream == null) {
|
||||||
Log.e(TAG, "invalid bitmap source: " + src);
|
Log.e(TAG, "invalid bitmap source: " + src);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.backend;
|
package org.oscim.backend;
|
||||||
|
|
||||||
|
|
||||||
public class GLAdapter {
|
public class GLAdapter {
|
||||||
|
|
||||||
public static GL20 g;
|
public static GL20 g;
|
||||||
@ -24,7 +23,7 @@ public class GLAdapter {
|
|||||||
|
|
||||||
public static boolean NON_PREMUL_CANVAS;
|
public static boolean NON_PREMUL_CANVAS;
|
||||||
|
|
||||||
public static GL20 get(){
|
public static GL20 get() {
|
||||||
if (g == null)
|
if (g == null)
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
|
||||||
|
|||||||
@ -17,23 +17,29 @@ package org.oscim.backend;
|
|||||||
public class Log {
|
public class Log {
|
||||||
public static Logger logger;
|
public static Logger logger;
|
||||||
|
|
||||||
public static void d(String tag, String msg){
|
public static void d(String tag, String msg) {
|
||||||
logger.d(tag, 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);
|
logger.w(tag, msg);
|
||||||
}
|
}
|
||||||
public static void e(String tag, String msg){
|
|
||||||
|
public static void e(String tag, String msg) {
|
||||||
logger.e(tag, 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);
|
logger.i(tag, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Logger{
|
public interface Logger {
|
||||||
void d(String tag, String msg);
|
void d(String tag, String msg);
|
||||||
|
|
||||||
void w(String tag, String msg);
|
void w(String tag, String msg);
|
||||||
|
|
||||||
void e(String tag, String msg);
|
void e(String tag, String msg);
|
||||||
|
|
||||||
void i(String tag, String msg);
|
void i(String tag, String msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import org.xml.sax.XMLReader;
|
|||||||
import org.xml.sax.helpers.DefaultHandler;
|
import org.xml.sax.helpers.DefaultHandler;
|
||||||
|
|
||||||
public class XMLReaderAdapter {
|
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();
|
SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||||
factory.setNamespaceAware(true);
|
factory.setNamespaceAware(true);
|
||||||
@ -23,9 +23,9 @@ public class XMLReaderAdapter {
|
|||||||
xmlReader.parse(new InputSource(is));
|
xmlReader.parse(new InputSource(is));
|
||||||
|
|
||||||
} catch (SAXException e) {
|
} catch (SAXException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (ParserConfigurationException e) {
|
} catch (ParserConfigurationException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,9 +17,14 @@ package org.oscim.backend.canvas;
|
|||||||
public interface Bitmap {
|
public interface Bitmap {
|
||||||
|
|
||||||
int getWidth();
|
int getWidth();
|
||||||
|
|
||||||
int getHeight();
|
int getHeight();
|
||||||
|
|
||||||
void recycle();
|
void recycle();
|
||||||
|
|
||||||
int[] getPixels();
|
int[] getPixels();
|
||||||
|
|
||||||
void eraseColor(int color);
|
void eraseColor(int color);
|
||||||
|
|
||||||
int uploadToTexture(boolean replace);
|
int uploadToTexture(boolean replace);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package org.oscim.backend.canvas;
|
package org.oscim.backend.canvas;
|
||||||
|
|
||||||
|
|
||||||
public interface Canvas {
|
public interface Canvas {
|
||||||
|
|
||||||
void setBitmap(Bitmap bitmap);
|
void setBitmap(Bitmap bitmap);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user