fix warnings, cleanups

This commit is contained in:
Hannes Janetzek 2013-09-17 22:43:53 +02:00
parent 1421a1f6b6
commit e5761ef601
10 changed files with 51 additions and 57 deletions

View File

@ -17,7 +17,6 @@
package org.oscim.awt; package org.oscim.awt;
import java.awt.AlphaComposite; import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.awt.font.TextLayout; import java.awt.font.TextLayout;

View File

@ -60,7 +60,7 @@ public class AwtPaint implements Paint {
private int cap; private int cap;
private float strokeWidth; private float strokeWidth;
private Align mAlign; //private Align mAlign;
@Override @Override
public int getColor() { public int getColor() {
@ -121,7 +121,7 @@ public class AwtPaint implements Paint {
@Override @Override
public void setTextAlign(Align align) { public void setTextAlign(Align align) {
mAlign = align; //mAlign = align;
} }
@Override @Override

View File

@ -16,7 +16,7 @@ public class GwtPaint implements Paint {
float fontSize = 12; float fontSize = 12;
private FontStyle fontStyle = FontStyle.NORMAL; private FontStyle fontStyle = FontStyle.NORMAL;
private FontFamily fontFamily = FontFamily.DEFAULT; //private FontFamily fontFamily = FontFamily.DEFAULT;
//String font = "12px sans-serif"; //String font = "12px sans-serif";
String font = "13px Helvetica"; String font = "13px Helvetica";
@ -85,7 +85,7 @@ public class GwtPaint implements Paint {
@Override @Override
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) { public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
this.fontStyle = fontStyle; this.fontStyle = fontStyle;
this.fontFamily = fontFamily; //this.fontFamily = fontFamily;
buildFont(); buildFont();
} }

View File

@ -25,7 +25,6 @@ import java.nio.ShortBuffer;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Pixmap;

View File

@ -2,7 +2,6 @@ package org.oscim.utils.async;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.utils.Timer;
/** /**
* GWT emulation of AsynchExecutor, will call tasks immediately :D * GWT emulation of AsynchExecutor, will call tasks immediately :D
@ -26,7 +25,7 @@ public class AsyncExecutor implements Disposable {
* will be queued. * will be queued.
* @param task the task to execute asynchronously * @param task the task to execute asynchronously
*/ */
@SuppressWarnings("rawtypes") @SuppressWarnings({ "unchecked", "rawtypes" })
public <T> AsyncResult<T> submit(final AsyncTask<T> task) { public <T> AsyncResult<T> submit(final AsyncTask<T> task) {
T result = null; T result = null;
@ -37,6 +36,9 @@ public class AsyncExecutor implements Disposable {
} catch(Throwable t) { } catch(Throwable t) {
error = true; error = true;
} }
if (error)
return null;
return new AsyncResult(result); return new AsyncResult(result);
} }

View File

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright 2011 See AUTHORS file. * Copyright 2011 See libgdx AUTHORS file.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -15,7 +15,6 @@
package org.oscim.layers.tile.vector; package org.oscim.layers.tile.vector;
import org.oscim.core.MapPosition; import org.oscim.core.MapPosition;
import org.oscim.event.MotionEvent;
import org.oscim.layers.Layer; import org.oscim.layers.Layer;
import org.oscim.map.Map; import org.oscim.map.Map;
import org.oscim.renderer.ExtrusionRenderer; import org.oscim.renderer.ExtrusionRenderer;

View File

@ -16,10 +16,6 @@ package org.oscim.utils;
import org.oscim.core.Point; import org.oscim.core.Point;
/**
* @author Hannes Janetzek
*/
public final class GeometryUtils { public final class GeometryUtils {
/** /**
* Calculates the center of the minimum bounding rectangle for the given * Calculates the center of the minimum bounding rectangle for the given

View File

@ -21,7 +21,6 @@ import java.nio.FloatBuffer;
import org.oscim.backend.GL20; import org.oscim.backend.GL20;
import org.oscim.backend.GLAdapter; import org.oscim.backend.GLAdapter;
public class Matrix4 { public class Matrix4 {
private static final GL20 GL = GLAdapter.get(); private static final GL20 GL = GLAdapter.get();
@ -29,46 +28,6 @@ public class Matrix4 {
private final static String TAG = Matrix4.class.getName(); private final static String TAG = Matrix4.class.getName();
private final static boolean dbg = false; private final static boolean dbg = false;
private native static long alloc();
private native static void delete(long self);
private native static void set(long self, float[] m);
private native static void copy(long self, long other);
private native static void identity(long self);
private native static void get(long self, float[] m);
private native static void mul(long self, long lhs_ptr);
private native static void smul(long self, long rhs_ptr, long lhs_ptr);
private native static void smulrhs(long self, long rhs_ptr);
private native static void smullhs(long self, long lhs_ptr);
private native static void strans(long self, long rhs_ptr);
private native static void prj(long self, float[] vec3);
private native static void setRotation(long self, float a, float x, float y, float z);
private native static void setScale(long self, float x, float y, float z);
private native static void setTranslation(long self, float x, float y, float z);
private native static void setTransScale(long self, float tx, float ty, float scale);
//private native static void setAsUniform(long self, int handle);
private native static void setValueAt(long self, int pos, float value);
private native static void addDepthOffset(long self, int delta);
private native static ByteBuffer getBuffer(long self);
private final long pointer; private final long pointer;
private final FloatBuffer buffer; private final FloatBuffer buffer;
@ -247,6 +206,9 @@ public class Matrix4 {
identity(pointer); identity(pointer);
} }
/**
* Free native object
* */
@Override @Override
public void finalize() { public void finalize() {
if (pointer != 0) if (pointer != 0)
@ -452,4 +414,43 @@ public class Matrix4 {
return true; return true;
} }
private native static long alloc();
private native static void delete(long self);
private native static void set(long self, float[] m);
private native static void copy(long self, long other);
private native static void identity(long self);
private native static void get(long self, float[] m);
private native static void mul(long self, long lhs_ptr);
private native static void smul(long self, long rhs_ptr, long lhs_ptr);
private native static void smulrhs(long self, long rhs_ptr);
private native static void smullhs(long self, long lhs_ptr);
private native static void strans(long self, long rhs_ptr);
private native static void prj(long self, float[] vec3);
private native static void setRotation(long self, float a, float x, float y, float z);
private native static void setScale(long self, float x, float y, float z);
private native static void setTranslation(long self, float x, float y, float z);
private native static void setTransScale(long self, float tx, float ty, float scale);
//private native static void setAsUniform(long self, int handle);
private native static void setValueAt(long self, int pos, float value);
private native static void addDepthOffset(long self, int delta);
private native static ByteBuffer getBuffer(long self);
} }

View File

@ -22,7 +22,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
* Allows asnynchronous execution of {@link AsyncTask} instances on a separate thread. * Allows asnynchronous execution of {@link AsyncTask} instances on a separate thread.
* Needs to be disposed via a call to {@link #dispose()} when no longer used, in which * Needs to be disposed via a call to {@link #dispose()} when no longer used, in which
@ -82,7 +81,6 @@ public class AsyncExecutor {
* then destroys any resources like threads. Can not be used * then destroys any resources like threads. Can not be used
* after this method is called. * after this method is called.
*/ */
//@Override
public void dispose () { public void dispose () {
executor.shutdown(); executor.shutdown();
try { try {