Merge pull request #608 from Gustl22/static_final
Refactor 'final static' to 'static final' convention
This commit is contained in:
@@ -21,8 +21,8 @@ import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||
|
||||
public class GLAdapter {
|
||||
|
||||
public final static boolean debug = false;
|
||||
public final static boolean debugView = false;
|
||||
public static final boolean debug = false;
|
||||
public static final boolean debugView = false;
|
||||
|
||||
/**
|
||||
* The instance provided by backend
|
||||
|
||||
@@ -37,8 +37,8 @@ import java.util.Arrays;
|
||||
*/
|
||||
public class GeometryBuffer {
|
||||
|
||||
private final static int GROW_INDICES = 64;
|
||||
private final static int GROW_POINTS = 512;
|
||||
private static final int GROW_INDICES = 64;
|
||||
private static final int GROW_POINTS = 512;
|
||||
|
||||
/**
|
||||
* The Enum GeometryType.
|
||||
|
||||
@@ -256,7 +256,7 @@ public class PathLayer extends Layer implements GestureListener {
|
||||
}
|
||||
}
|
||||
|
||||
final static class Task {
|
||||
static final class Task {
|
||||
final RenderBuckets buckets = new RenderBuckets();
|
||||
final MapPosition position = new MapPosition();
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class MarkerRenderer extends BucketRenderer {
|
||||
ZSORT.doSort(a, zComparator, lo, hi);
|
||||
}
|
||||
|
||||
final static Comparator<InternalItem> zComparator = new Comparator<InternalItem>() {
|
||||
static final Comparator<InternalItem> zComparator = new Comparator<InternalItem>() {
|
||||
@Override
|
||||
public int compare(InternalItem a, InternalItem b) {
|
||||
if (a.visible && b.visible) {
|
||||
|
||||
@@ -49,45 +49,45 @@ public class MapTile extends Tile {
|
||||
}
|
||||
|
||||
public static final class State {
|
||||
public final static byte NONE = (1 << 0);
|
||||
public static final byte NONE = (1 << 0);
|
||||
|
||||
/**
|
||||
* STATE_LOADING means the tile is about to be loaded / loading.
|
||||
* Tile belongs to TileLoader thread.
|
||||
*/
|
||||
public final static byte LOADING = (1 << 1);
|
||||
public static final byte LOADING = (1 << 1);
|
||||
|
||||
/**
|
||||
* STATE_NEW_DATA: tile data is prepared for rendering.
|
||||
* While 'locked' it belongs to GL Thread.
|
||||
*/
|
||||
public final static byte NEW_DATA = (1 << 2);
|
||||
public static final byte NEW_DATA = (1 << 2);
|
||||
|
||||
/**
|
||||
* STATE_READY: tile data is uploaded to GL.
|
||||
* While 'locked' it belongs to GL Thread.
|
||||
*/
|
||||
public final static byte READY = (1 << 3);
|
||||
public static final byte READY = (1 << 3);
|
||||
|
||||
/**
|
||||
* STATE_CANCEL: tile is removed from TileManager,
|
||||
* but may still be processed by TileLoader.
|
||||
*/
|
||||
public final static byte CANCEL = (1 << 4);
|
||||
public static final byte CANCEL = (1 << 4);
|
||||
|
||||
/**
|
||||
* Dont touch if you find some.
|
||||
*/
|
||||
public final static byte DEADBEEF = (1 << 6);
|
||||
public static final byte DEADBEEF = (1 << 6);
|
||||
}
|
||||
|
||||
public final static int PROXY_CHILD00 = (1 << 0);
|
||||
public final static int PROXY_CHILD01 = (1 << 1);
|
||||
public final static int PROXY_CHILD10 = (1 << 2);
|
||||
public final static int PROXY_CHILD11 = (1 << 3);
|
||||
public final static int PROXY_PARENT = (1 << 4);
|
||||
public final static int PROXY_GRAMPA = (1 << 5);
|
||||
public final static int PROXY_HOLDER = (1 << 6);
|
||||
public static final int PROXY_CHILD00 = (1 << 0);
|
||||
public static final int PROXY_CHILD01 = (1 << 1);
|
||||
public static final int PROXY_CHILD10 = (1 << 2);
|
||||
public static final int PROXY_CHILD11 = (1 << 3);
|
||||
public static final int PROXY_PARENT = (1 << 4);
|
||||
public static final int PROXY_GRAMPA = (1 << 5);
|
||||
public static final int PROXY_HOLDER = (1 << 6);
|
||||
|
||||
/**
|
||||
* Tile state
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TileDistanceSort extends TimSort<MapTile> {
|
||||
}
|
||||
}
|
||||
|
||||
final static Comparator<MapTile> DistanceComparator = new Comparator<MapTile>() {
|
||||
static final Comparator<MapTile> DistanceComparator = new Comparator<MapTile>() {
|
||||
@Override
|
||||
public int compare(MapTile a, MapTile b) {
|
||||
if (a == null) {
|
||||
|
||||
@@ -50,8 +50,8 @@ public class TileManager {
|
||||
static final Logger log = LoggerFactory.getLogger(TileManager.class);
|
||||
static final boolean dbg = false;
|
||||
|
||||
public final static Event TILE_LOADED = new Event();
|
||||
public final static Event TILE_REMOVED = new Event();
|
||||
public static final Event TILE_LOADED = new Event();
|
||||
public static final Event TILE_REMOVED = new Event();
|
||||
|
||||
private final int mCacheLimit;
|
||||
private int mCacheReduce;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class BitmapTileLayer extends TileLayer {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(BitmapTileLayer.class);
|
||||
|
||||
private final static int CACHE_LIMIT = 40;
|
||||
private static final int CACHE_LIMIT = 40;
|
||||
|
||||
protected final TileSource mTileSource;
|
||||
private float mBitmapAlpha = 1.0f;
|
||||
@@ -144,7 +144,7 @@ public class BitmapTileLayer extends TileLayer {
|
||||
pool.clear();
|
||||
}
|
||||
|
||||
final static int POOL_FILL = 20;
|
||||
static final int POOL_FILL = 20;
|
||||
|
||||
/**
|
||||
* pool shared by TextLayers
|
||||
|
||||
@@ -43,9 +43,9 @@ import java.util.Set;
|
||||
|
||||
public class BuildingLayer extends Layer implements TileLoaderThemeHook, ZoomLimiter.IZoomLimiter {
|
||||
|
||||
protected final static int BUILDING_LEVEL_HEIGHT = 280; // cm
|
||||
protected static final int BUILDING_LEVEL_HEIGHT = 280; // cm
|
||||
|
||||
public final static int MIN_ZOOM = 17;
|
||||
public static final int MIN_ZOOM = 17;
|
||||
|
||||
/**
|
||||
* Use Fast Approximate Anti-Aliasing (FXAA) and Screen Space Ambient Occlusion (SSAO).
|
||||
|
||||
@@ -29,10 +29,10 @@ import org.oscim.tiling.TileSource;
|
||||
|
||||
public class S3DBTileLayer extends TileLayer {
|
||||
|
||||
private final static int MAX_CACHE = 32;
|
||||
private static final int MAX_CACHE = 32;
|
||||
|
||||
private final static int MIN_ZOOM = 16;
|
||||
private final static int MAX_ZOOM = 16;
|
||||
private static final int MIN_ZOOM = 16;
|
||||
private static final int MAX_ZOOM = 16;
|
||||
|
||||
private final TileSource mTileSource;
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ public final class S3DBUtils {
|
||||
private static final Logger log = LoggerFactory.getLogger(S3DBUtils.class);
|
||||
|
||||
/* TODO get from theme */
|
||||
private final static double HSV_S = 0.7;
|
||||
private final static double HSV_V = 1.2;
|
||||
private static final double HSV_S = 0.7;
|
||||
private static final double HSV_V = 1.2;
|
||||
|
||||
// Toggle this to debug and improve ridge calculation, you can see the faults in map then.
|
||||
private static final boolean IMPROVE_RIDGE_CALCULATION = false;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.oscim.theme.styles.LineStyle;
|
||||
|
||||
class Debug {
|
||||
|
||||
private final static float[] mDebugPoints = new float[8];
|
||||
private static final float[] mDebugPoints = new float[8];
|
||||
// TODO Auto-generated method stub
|
||||
static RenderBuckets dbg;
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ public class LabelPlacement {
|
||||
static final boolean dbg = false;
|
||||
static final Logger log = LoggerFactory.getLogger(LabelPlacement.class);
|
||||
|
||||
public final static LabelTileData getLabels(MapTile tile) {
|
||||
public static final LabelTileData getLabels(MapTile tile) {
|
||||
return (LabelTileData) tile.getData(LabelLayer.LABEL_DATA);
|
||||
}
|
||||
|
||||
private final static float MIN_CAPTION_DIST = 5;
|
||||
private final static float MIN_WAY_DIST = 3;
|
||||
private static final float MIN_CAPTION_DIST = 5;
|
||||
private static final float MIN_WAY_DIST = 3;
|
||||
|
||||
/**
|
||||
* thread local pool of for unused label items
|
||||
|
||||
@@ -39,7 +39,7 @@ import static org.oscim.layers.tile.vector.labeling.LabelLayer.LABEL_DATA;
|
||||
|
||||
public class LabelTileLoaderHook implements TileLoaderThemeHook {
|
||||
|
||||
//public final static LabelTileData EMPTY = new LabelTileData();
|
||||
//public static final LabelTileData EMPTY = new LabelTileData();
|
||||
|
||||
private LabelTileData get(MapTile tile) {
|
||||
// FIXME could be 'this'..
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
|
||||
public abstract class AbstractVectorLayer<T> extends Layer implements UpdateListener {
|
||||
public static final Logger log = LoggerFactory.getLogger(AbstractVectorLayer.class);
|
||||
|
||||
protected final static double UNSCALE_COORD = 4;
|
||||
protected static final double UNSCALE_COORD = 4;
|
||||
|
||||
// limit coords to maximum resolution of GL.Short
|
||||
private static final int MAX_CLIP = (int) (Short.MAX_VALUE / MapRenderer.COORD_SCALE);
|
||||
|
||||
@@ -41,12 +41,12 @@ import static org.oscim.utils.FastMath.clamp;
|
||||
public class Animator {
|
||||
static final Logger log = LoggerFactory.getLogger(Animator.class);
|
||||
|
||||
public final static int ANIM_NONE = 0;
|
||||
public final static int ANIM_MOVE = 1 << 0;
|
||||
public final static int ANIM_SCALE = 1 << 1;
|
||||
public final static int ANIM_ROTATE = 1 << 2;
|
||||
public final static int ANIM_TILT = 1 << 3;
|
||||
public final static int ANIM_FLING = 1 << 4;
|
||||
public static final int ANIM_NONE = 0;
|
||||
public static final int ANIM_MOVE = 1 << 0;
|
||||
public static final int ANIM_SCALE = 1 << 1;
|
||||
public static final int ANIM_ROTATE = 1 << 2;
|
||||
public static final int ANIM_TILT = 1 << 3;
|
||||
public static final int ANIM_FLING = 1 << 4;
|
||||
|
||||
final Map mMap;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import static org.oscim.utils.FastMath.clamp;
|
||||
public class Animator2 extends Animator {
|
||||
private static final Logger log = LoggerFactory.getLogger(Animator2.class);
|
||||
|
||||
private final static int ANIM_KINETIC = 1 << 5;
|
||||
private static final int ANIM_KINETIC = 1 << 5;
|
||||
|
||||
/**
|
||||
* The minimum changes that are pleasant for users.
|
||||
|
||||
@@ -39,12 +39,12 @@ import org.oscim.utils.FastMath;
|
||||
*/
|
||||
public class Viewport {
|
||||
|
||||
public final static int MAX_ZOOM_LEVEL = 20;
|
||||
public final static int MIN_ZOOM_LEVEL = 2;
|
||||
public final static float MIN_TILT = 0;
|
||||
public static final int MAX_ZOOM_LEVEL = 20;
|
||||
public static final int MIN_ZOOM_LEVEL = 2;
|
||||
public static final float MIN_TILT = 0;
|
||||
|
||||
/* Note: limited by numTiles in TileManager to ~80° */
|
||||
public final static float MAX_TILT = 65;
|
||||
public static final float MAX_TILT = 65;
|
||||
|
||||
protected double mMaxScale = (1 << MAX_ZOOM_LEVEL);
|
||||
protected double mMinScale = (1 << MIN_ZOOM_LEVEL);
|
||||
@@ -82,13 +82,13 @@ public class Viewport {
|
||||
|
||||
protected float mHeight, mWidth;
|
||||
|
||||
public final static float VIEW_DISTANCE = 3.0f;
|
||||
public final static float VIEW_NEAR = 1;
|
||||
public final static float VIEW_FAR = 8;
|
||||
public static final float VIEW_DISTANCE = 3.0f;
|
||||
public static final float VIEW_NEAR = 1;
|
||||
public static final float VIEW_FAR = 8;
|
||||
/**
|
||||
* scale map plane at VIEW_DISTANCE to near plane
|
||||
*/
|
||||
public final static float VIEW_SCALE = (VIEW_NEAR / VIEW_DISTANCE) * 0.5f;
|
||||
public static final float VIEW_SCALE = (VIEW_NEAR / VIEW_DISTANCE) * 0.5f;
|
||||
|
||||
public Viewport() {
|
||||
mPos.scale = mMinScale;
|
||||
|
||||
@@ -102,8 +102,8 @@ public final class BufferObject extends Inlist<BufferObject> {
|
||||
log.debug("now: " + mBufferMemoryUsage / MB + "MB");
|
||||
}
|
||||
|
||||
private final static BufferObject pool[] = new BufferObject[2];
|
||||
private final static int counter[] = new int[2];
|
||||
private static final BufferObject pool[] = new BufferObject[2];
|
||||
private static final int counter[] = new int[2];
|
||||
|
||||
/**
|
||||
* @param target can be GL20.ARRAY_BUFFER or GL20.ELEMENT_ARRAY_BUFFER
|
||||
|
||||
@@ -28,12 +28,12 @@ import static org.oscim.backend.GLAdapter.gl;
|
||||
public class GLMatrix {
|
||||
|
||||
static final Logger log = LoggerFactory.getLogger(GLMatrix.class);
|
||||
private final static boolean dbg = false;
|
||||
private static final boolean dbg = false;
|
||||
|
||||
private final long pointer;
|
||||
private final FloatBuffer buffer;
|
||||
|
||||
private final static String INVALID_INPUT = "Bad Array!";
|
||||
private static final String INVALID_INPUT = "Bad Array!";
|
||||
|
||||
public GLMatrix() {
|
||||
pointer = alloc();
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.nio.IntBuffer;
|
||||
import static org.oscim.backend.GLAdapter.gl;
|
||||
|
||||
public abstract class GLShader {
|
||||
final static Logger log = LoggerFactory.getLogger(GLShader.class);
|
||||
static final Logger log = LoggerFactory.getLogger(GLShader.class);
|
||||
|
||||
public int program;
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ import static org.oscim.backend.GLAdapter.gl;
|
||||
public class GLState {
|
||||
static final Logger log = LoggerFactory.getLogger(GLState.class);
|
||||
|
||||
public final static int DISABLED = -1;
|
||||
public final static int UNBIND = 0;
|
||||
public static final int DISABLED = -1;
|
||||
public static final int UNBIND = 0;
|
||||
|
||||
private final static boolean[] vertexArray = {false, false};
|
||||
private static final boolean[] vertexArray = {false, false};
|
||||
private static boolean blend = false;
|
||||
private static boolean depth = false;
|
||||
private static boolean stencil = false;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class LocationTextureRenderer extends BucketRenderer {
|
||||
private static final int SHOW_ACCURACY_ZOOM = 13;
|
||||
private static final boolean IS_MAC = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac");
|
||||
|
||||
private final static String V_SHADER = (""
|
||||
private static final String V_SHADER = (""
|
||||
+ "precision highp float;"
|
||||
+ "uniform mat4 u_mvp;"
|
||||
+ "uniform float u_phase;"
|
||||
|
||||
@@ -52,11 +52,11 @@ public class MapRenderer {
|
||||
/**
|
||||
* Number of Quads that can be rendered with bindQuadIndicesVBO()
|
||||
*/
|
||||
public final static int MAX_QUADS = 512;
|
||||
public static final int MAX_QUADS = 512;
|
||||
/**
|
||||
* Number of Indices that can be rendered with bindQuadIndicesVBO()
|
||||
*/
|
||||
public final static int MAX_INDICES = MAX_QUADS * 6;
|
||||
public static final int MAX_INDICES = MAX_QUADS * 6;
|
||||
|
||||
public static long frametime;
|
||||
private static boolean rerender;
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.nio.IntBuffer;
|
||||
import static org.oscim.backend.GLAdapter.gl;
|
||||
|
||||
public class OffscreenRenderer extends LayerRenderer {
|
||||
final static Logger log = LoggerFactory.getLogger(OffscreenRenderer.class);
|
||||
static final Logger log = LoggerFactory.getLogger(OffscreenRenderer.class);
|
||||
|
||||
public enum Mode {
|
||||
FXAA, // Fast Approximate Anti-Aliasing
|
||||
|
||||
@@ -187,9 +187,9 @@ public class BitmapBucket extends TextureBucket {
|
||||
|
||||
public static final class Renderer {
|
||||
|
||||
public final static int INDICES_PER_SPRITE = 6;
|
||||
final static int VERTICES_PER_SPRITE = 4;
|
||||
final static int SHORTS_PER_VERTICE = 6;
|
||||
public static final int INDICES_PER_SPRITE = 6;
|
||||
static final int VERTICES_PER_SPRITE = 4;
|
||||
static final int SHORTS_PER_VERTICE = 6;
|
||||
static Shader shader;
|
||||
|
||||
static void init() {
|
||||
|
||||
@@ -56,13 +56,13 @@ public class ExtrusionBucket extends RenderBucket {
|
||||
*/
|
||||
public int off[] = {0, 0, 0, 0, 0};
|
||||
|
||||
//private final static int IND_EVEN_SIDE = 0;
|
||||
//private final static int IND_ODD_SIDE = 1;
|
||||
private final static int IND_ROOF = 2;
|
||||
//private static final int IND_EVEN_SIDE = 0;
|
||||
//private static final int IND_ODD_SIDE = 1;
|
||||
private static final int IND_ROOF = 2;
|
||||
|
||||
// FIXME flip OUTLINE / MESH!
|
||||
private final static int IND_OUTLINE = 3;
|
||||
private final static int IND_MESH = 4;
|
||||
private static final int IND_OUTLINE = 3;
|
||||
private static final int IND_MESH = 4;
|
||||
|
||||
private final float mGroundResolution;
|
||||
|
||||
|
||||
@@ -535,15 +535,15 @@ public class LineBucket extends RenderBucket {
|
||||
* http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter22.html */
|
||||
|
||||
/* factor to normalize extrusion vector and scale to coord scale */
|
||||
private final static float COORD_SCALE_BY_DIR_SCALE =
|
||||
private static final float COORD_SCALE_BY_DIR_SCALE =
|
||||
COORD_SCALE / LineBucket.DIR_SCALE;
|
||||
|
||||
private final static int CAP_THIN = 0;
|
||||
private final static int CAP_BUTT = 1;
|
||||
private final static int CAP_ROUND = 2;
|
||||
private static final int CAP_THIN = 0;
|
||||
private static final int CAP_BUTT = 1;
|
||||
private static final int CAP_ROUND = 2;
|
||||
|
||||
private final static int SHADER_FLAT = 1;
|
||||
private final static int SHADER_PROJ = 0;
|
||||
private static final int SHADER_FLAT = 1;
|
||||
private static final int SHADER_PROJ = 0;
|
||||
|
||||
public static int mTexID;
|
||||
private static Shader[] shaders = {null, null};
|
||||
|
||||
@@ -264,11 +264,11 @@ public final class LineTexBucket extends LineBucket {
|
||||
}
|
||||
}
|
||||
|
||||
public final static class Renderer {
|
||||
public static final class Renderer {
|
||||
private static Shader shader;
|
||||
|
||||
/* factor to normalize extrusion vector and scale to coord scale */
|
||||
private final static float COORD_SCALE_BY_DIR_SCALE =
|
||||
private static final float COORD_SCALE_BY_DIR_SCALE =
|
||||
COORD_SCALE / LineBucket.DIR_SCALE;
|
||||
|
||||
private static int mVertexFlipID;
|
||||
@@ -342,10 +342,10 @@ public final class LineTexBucket extends LineBucket {
|
||||
}
|
||||
|
||||
/* posX, posY, extrX, extrY, length, unused */
|
||||
private final static int STRIDE = 6 * RenderBuckets.SHORT_BYTES;
|
||||
private static final int STRIDE = 6 * RenderBuckets.SHORT_BYTES;
|
||||
|
||||
/* offset for line length, unused; skip first 4 units */
|
||||
private final static int LEN_OFFSET = 4 * RenderBuckets.SHORT_BYTES;
|
||||
private static final int LEN_OFFSET = 4 * RenderBuckets.SHORT_BYTES;
|
||||
|
||||
public static RenderBucket draw(RenderBucket b, GLViewport v,
|
||||
float div, RenderBuckets buckets) {
|
||||
|
||||
@@ -48,9 +48,9 @@ public final class PolygonBucket extends RenderBucket {
|
||||
|
||||
static final Logger log = LoggerFactory.getLogger(PolygonBucket.class);
|
||||
|
||||
public final static int CLIP_STENCIL = 1;
|
||||
public final static int CLIP_DEPTH = 2;
|
||||
public final static int CLIP_TEST_DEPTH = 3;
|
||||
public static final int CLIP_STENCIL = 1;
|
||||
public static final int CLIP_DEPTH = 2;
|
||||
public static final int CLIP_TEST_DEPTH = 3;
|
||||
|
||||
public static boolean enableTexture = true;
|
||||
|
||||
@@ -157,7 +157,7 @@ public final class PolygonBucket extends RenderBucket {
|
||||
public static final class Renderer {
|
||||
|
||||
private static final int STENCIL_BITS = 8;
|
||||
public final static int CLIP_BIT = 0x80;
|
||||
public static final int CLIP_BIT = 0x80;
|
||||
|
||||
private static PolygonBucket[] mAreaLayer;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public abstract class RenderBucket extends Inlist<RenderBucket> {
|
||||
protected final VertexData vertexItems;
|
||||
protected final VertexData indiceItems;
|
||||
|
||||
final static VertexData EMPTY = new VertexData();
|
||||
static final VertexData EMPTY = new VertexData();
|
||||
final boolean quads;
|
||||
|
||||
protected RenderBucket(byte type, boolean indexed, boolean quads) {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class RenderBuckets extends TileData {
|
||||
static final Logger log = LoggerFactory.getLogger(RenderBuckets.class);
|
||||
|
||||
/* Count of units needed for one vertex */
|
||||
public final static int[] VERTEX_CNT = {
|
||||
public static final int[] VERTEX_CNT = {
|
||||
4, // LINE_VERTEX
|
||||
6, // TEXLINE_VERTEX
|
||||
2, // POLY_VERTEX
|
||||
@@ -59,8 +59,8 @@ public class RenderBuckets extends TileData {
|
||||
2, // CIRCLE
|
||||
};
|
||||
|
||||
public final static int SHORT_BYTES = 2;
|
||||
// public final static int INT_BYTES = 4;
|
||||
public static final int SHORT_BYTES = 2;
|
||||
// public static final int INT_BYTES = 4;
|
||||
|
||||
private RenderBucket buckets;
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ import static org.oscim.renderer.MapRenderer.COORD_SCALE;
|
||||
public final class SymbolBucket extends TextureBucket {
|
||||
static final Logger log = LoggerFactory.getLogger(SymbolBucket.class);
|
||||
|
||||
private final static int VERTICES_PER_SPRITE = 4;
|
||||
private final static int LBIT_MASK = 0xfffffffe;
|
||||
private static final int VERTICES_PER_SPRITE = 4;
|
||||
private static final int LBIT_MASK = 0xfffffffe;
|
||||
|
||||
private TextureItem prevTextures;
|
||||
private List<SymbolItem> mSymbols = new List<SymbolItem>();
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.oscim.utils.pool.SyncPool;
|
||||
|
||||
public class SymbolItem extends Inlist<SymbolItem> {
|
||||
|
||||
public final static SyncPool<SymbolItem> pool = new SyncPool<SymbolItem>(128) {
|
||||
public static final SyncPool<SymbolItem> pool = new SyncPool<SymbolItem>(128) {
|
||||
|
||||
@Override
|
||||
protected SymbolItem createItem() {
|
||||
|
||||
@@ -26,7 +26,7 @@ import static org.oscim.renderer.MapRenderer.COORD_SCALE;
|
||||
public class TextBucket extends TextureBucket {
|
||||
static final Logger log = LoggerFactory.getLogger(TextBucket.class);
|
||||
|
||||
protected final static int LBIT_MASK = 0xfffffffe;
|
||||
protected static final int LBIT_MASK = 0xfffffffe;
|
||||
|
||||
protected static int mFontPadX = 1;
|
||||
//private static int mFontPadY = 1;
|
||||
|
||||
@@ -23,9 +23,9 @@ import org.oscim.utils.pool.SyncPool;
|
||||
|
||||
public class TextItem extends Inlist<TextItem> {
|
||||
//static final Logger log = LoggerFactory.getLogger(TextItem.class);
|
||||
private final static int MAX_POOL = 250;
|
||||
private static final int MAX_POOL = 250;
|
||||
|
||||
public final static SyncPool<TextItem> pool = new SyncPool<TextItem>(MAX_POOL) {
|
||||
public static final SyncPool<TextItem> pool = new SyncPool<TextItem>(MAX_POOL) {
|
||||
|
||||
@Override
|
||||
protected TextItem createItem() {
|
||||
|
||||
@@ -36,18 +36,18 @@ public class TextureBucket extends RenderBucket {
|
||||
|
||||
static final Logger log = LoggerFactory.getLogger(TextureBucket.class);
|
||||
|
||||
public final static int INDICES_PER_SPRITE = 6;
|
||||
final static int VERTICES_PER_SPRITE = 4;
|
||||
final static int SHORTS_PER_VERTICE = 6;
|
||||
public static final int INDICES_PER_SPRITE = 6;
|
||||
static final int VERTICES_PER_SPRITE = 4;
|
||||
static final int SHORTS_PER_VERTICE = 6;
|
||||
|
||||
public final static int TEXTURE_HEIGHT = 256;
|
||||
public final static int TEXTURE_WIDTH = 1024;
|
||||
final static int POOL_FILL = 4;
|
||||
public static final int TEXTURE_HEIGHT = 256;
|
||||
public static final int TEXTURE_WIDTH = 1024;
|
||||
static final int POOL_FILL = 4;
|
||||
|
||||
/**
|
||||
* pool shared by TextLayers
|
||||
*/
|
||||
public final static TexturePool pool = new TexturePool(POOL_FILL,
|
||||
public static final TexturePool pool = new TexturePool(POOL_FILL,
|
||||
TEXTURE_WIDTH,
|
||||
TEXTURE_HEIGHT,
|
||||
false);
|
||||
|
||||
@@ -340,8 +340,8 @@ public class TextureItem extends Inlist<TextureItem> {
|
||||
|
||||
/* Pool for not-pooled textures. Disposed items will only be released
|
||||
* on the GL-Thread and will not be put back in any pool. */
|
||||
final static TexturePool NOPOOL = new TexturePool(0);
|
||||
final static ArrayList<Integer> disposedTextures = new ArrayList<Integer>();
|
||||
static final TexturePool NOPOOL = new TexturePool(0);
|
||||
static final ArrayList<Integer> disposedTextures = new ArrayList<Integer>();
|
||||
|
||||
/**
|
||||
* Disposed textures are released by MapRenderer after each frame
|
||||
|
||||
@@ -94,7 +94,7 @@ public class VertexData extends Inlist.List<Chunk> {
|
||||
return super.clear();
|
||||
}
|
||||
|
||||
private final static Pool pool = new Pool();
|
||||
private static final Pool pool = new Pool();
|
||||
|
||||
public void dispose() {
|
||||
pool.releaseAll(super.clear());
|
||||
|
||||
@@ -45,8 +45,8 @@ public class Rule {
|
||||
public static final int WHEN_MATCHED = 1 << 1;
|
||||
}
|
||||
|
||||
public final static RenderStyle[] EMPTY_STYLE = new RenderStyle[0];
|
||||
public final static Rule[] EMPTY_RULES = new Rule[0];
|
||||
public static final RenderStyle[] EMPTY_STYLE = new RenderStyle[0];
|
||||
public static final Rule[] EMPTY_RULES = new Rule[0];
|
||||
|
||||
public final Rule[] subRules;
|
||||
public final RenderStyle[] styles;
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.List;
|
||||
|
||||
public class RuleBuilder {
|
||||
|
||||
private final static String[] EMPTY_KV = {};
|
||||
private static final String[] EMPTY_KV = {};
|
||||
|
||||
public enum RuleType {
|
||||
POSITIVE,
|
||||
|
||||
@@ -42,18 +42,18 @@ public class LwHttp implements HttpEngine {
|
||||
static final Logger log = LoggerFactory.getLogger(LwHttp.class);
|
||||
static final boolean dbg = false;
|
||||
|
||||
private final static byte[] HEADER_HTTP_OK = "200 OK".getBytes();
|
||||
private final static byte[] HEADER_CONTENT_LENGTH = "Content-Length".getBytes();
|
||||
private final static byte[] HEADER_CONNECTION_CLOSE = "Connection: close".getBytes();
|
||||
private final static byte[] HEADER_ENCODING_GZIP = "Content-Encoding: gzip".getBytes();
|
||||
private static final byte[] HEADER_HTTP_OK = "200 OK".getBytes();
|
||||
private static final byte[] HEADER_CONTENT_LENGTH = "Content-Length".getBytes();
|
||||
private static final byte[] HEADER_CONNECTION_CLOSE = "Connection: close".getBytes();
|
||||
private static final byte[] HEADER_ENCODING_GZIP = "Content-Encoding: gzip".getBytes();
|
||||
|
||||
private final static int RESPONSE_EXPECTED_LIVES = 100;
|
||||
private final static long RESPONSE_TIMEOUT = (long) 10E9; // 10 second in nanosecond
|
||||
private static final int RESPONSE_EXPECTED_LIVES = 100;
|
||||
private static final long RESPONSE_TIMEOUT = (long) 10E9; // 10 second in nanosecond
|
||||
|
||||
private final static int CONNECT_TIMEOUT = 15000; // 15 seconds
|
||||
private final static int SOCKET_TIMEOUT = 8000; // 8 seconds
|
||||
private static final int CONNECT_TIMEOUT = 15000; // 15 seconds
|
||||
private static final int SOCKET_TIMEOUT = 8000; // 8 seconds
|
||||
|
||||
private final static int BUFFER_SIZE = 8192;
|
||||
private static final int BUFFER_SIZE = 8192;
|
||||
private final byte[] buffer = new byte[BUFFER_SIZE];
|
||||
|
||||
private final String mHost;
|
||||
|
||||
@@ -27,15 +27,15 @@ import java.io.InputStream;
|
||||
public abstract class PbfDecoder implements ITileDecoder {
|
||||
static final Logger log = LoggerFactory.getLogger(PbfDecoder.class);
|
||||
|
||||
private final static int S1 = 7;
|
||||
private final static int S2 = 14;
|
||||
private final static int S3 = 21;
|
||||
private final static int S4 = 28;
|
||||
private static final int S1 = 7;
|
||||
private static final int S2 = 14;
|
||||
private static final int S3 = 21;
|
||||
private static final int S4 = 28;
|
||||
|
||||
private final static int M1 = (1 << S1) - 1;
|
||||
private final static int M2 = (1 << S2) - 1;
|
||||
private final static int M3 = (1 << S3) - 1;
|
||||
private final static int M4 = (1 << S4) - 1;
|
||||
private static final int M1 = (1 << S1) - 1;
|
||||
private static final int M2 = (1 << S2) - 1;
|
||||
private static final int M3 = (1 << S3) - 1;
|
||||
private static final int M4 = (1 << S4) - 1;
|
||||
|
||||
protected static final boolean debug = false;
|
||||
|
||||
@@ -47,20 +47,20 @@ public abstract class PbfDecoder implements ITileDecoder {
|
||||
}
|
||||
}
|
||||
|
||||
final static ProtobufException TRUNCATED_MSG =
|
||||
static final ProtobufException TRUNCATED_MSG =
|
||||
new ProtobufException("truncated msg");
|
||||
|
||||
protected final static ProtobufException INVALID_VARINT =
|
||||
protected static final ProtobufException INVALID_VARINT =
|
||||
new ProtobufException("invalid varint");
|
||||
|
||||
protected final static ProtobufException INVALID_PACKED_SIZE =
|
||||
protected static final ProtobufException INVALID_PACKED_SIZE =
|
||||
new ProtobufException("invalid message size");
|
||||
|
||||
protected void error(String msg) throws IOException {
|
||||
throw new ProtobufException(msg);
|
||||
}
|
||||
|
||||
private final static int BUFFER_SIZE = 1 << 15; // 32kb
|
||||
private static final int BUFFER_SIZE = 1 << 15; // 32kb
|
||||
protected byte[] buffer = new byte[BUFFER_SIZE];
|
||||
|
||||
// position in buffer
|
||||
|
||||
@@ -460,7 +460,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
mTileSeparator.setRect(xSmin, ySmin, xSmax, ySmax);
|
||||
}
|
||||
|
||||
//private final static Tag mWaterTag = new Tag("natural", "water");
|
||||
//private static final Tag mWaterTag = new Tag("natural", "water");
|
||||
|
||||
/**
|
||||
* Map rendering.
|
||||
|
||||
@@ -70,7 +70,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
private final String mLocale;
|
||||
private ITileDataSink mMapDataCallback;
|
||||
|
||||
private final static float REF_TILE_SIZE = 4096.0f;
|
||||
private static final float REF_TILE_SIZE = 4096.0f;
|
||||
private float mScale;
|
||||
|
||||
public TileDecoder() {
|
||||
@@ -399,9 +399,9 @@ public class TileDecoder extends PbfDecoder {
|
||||
}
|
||||
}
|
||||
|
||||
private final static int CLOSE_PATH = 0x07;
|
||||
private final static int MOVE_TO = 0x01;
|
||||
private final static int LINE_TO = 0x02;
|
||||
private static final int CLOSE_PATH = 0x07;
|
||||
private static final int MOVE_TO = 0x01;
|
||||
private static final int LINE_TO = 0x02;
|
||||
|
||||
private int lastX, lastY;
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.oscim.tiling.source.UrlTileSource;
|
||||
|
||||
public class OSciMap4TileSource extends UrlTileSource {
|
||||
|
||||
private final static String DEFAULT_URL = "http://opensciencemap.org/tiles/vtm";
|
||||
private final static String DEFAULT_PATH = "/{Z}/{X}/{Y}.vtm";
|
||||
private static final String DEFAULT_URL = "http://opensciencemap.org/tiles/vtm";
|
||||
private static final String DEFAULT_PATH = "/{Z}/{X}/{Y}.vtm";
|
||||
|
||||
public static class Builder<T extends Builder<T>> extends UrlTileSource.Builder<T> {
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ package org.oscim.tiling.source.oscimap4;
|
||||
public class Tags {
|
||||
// TODO this should be retrieved from tile 0/0/0
|
||||
|
||||
public final static int ATTRIB_OFFSET = 256;
|
||||
public static final int ATTRIB_OFFSET = 256;
|
||||
|
||||
// the keys that were imported via osm2pgsql + some more
|
||||
public final static String[] keys = {
|
||||
public static final String[] keys = {
|
||||
"access",
|
||||
"addr:housename",
|
||||
"addr:housenumber",
|
||||
@@ -93,10 +93,10 @@ public class Tags {
|
||||
"roof:height",
|
||||
"rank"
|
||||
};
|
||||
public final static int MAX_KEY = keys.length - 1;
|
||||
public static final int MAX_KEY = keys.length - 1;
|
||||
|
||||
// most popular values for the selected key (created from taginfo db)
|
||||
public final static String[] values = {
|
||||
public static final String[] values = {
|
||||
"yes",
|
||||
"residential",
|
||||
"service",
|
||||
@@ -354,6 +354,6 @@ public class Tags {
|
||||
"florist",
|
||||
"butcher"
|
||||
};
|
||||
public final static int MAX_VALUE = values.length - 1;
|
||||
public static final int MAX_VALUE = values.length - 1;
|
||||
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
private int mVersion;
|
||||
|
||||
// scale coordinates to tile size
|
||||
private final static float REF_TILE_SIZE = 4096.0f;
|
||||
private static final float REF_TILE_SIZE = 4096.0f;
|
||||
private final float mScaleFactor = REF_TILE_SIZE / Tile.SIZE;
|
||||
|
||||
public TileDecoder() {
|
||||
|
||||
@@ -10,7 +10,7 @@ import static org.oscim.utils.FastMath.clamp;
|
||||
|
||||
public class ColorUtil {
|
||||
|
||||
private final static Vec3 TMP_VEC = new Vec3();
|
||||
private static final Vec3 TMP_VEC = new Vec3();
|
||||
|
||||
public static synchronized int desaturate(int color) {
|
||||
Vec3 hsl = TMP_VEC;
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.net.Socket;
|
||||
* A utility class with IO-specific helper methods.
|
||||
*/
|
||||
public final class IOUtils {
|
||||
final static Logger log = LoggerFactory.getLogger(IOUtils.class);
|
||||
static final Logger log = LoggerFactory.getLogger(IOUtils.class);
|
||||
|
||||
/**
|
||||
* Invokes the {@link Closeable#close()} method on the given object. If an
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.slf4j.LoggerFactory;
|
||||
* An abstract base class for threads which support pausing and resuming.
|
||||
*/
|
||||
public abstract class PausableThread extends Thread {
|
||||
private final static Logger log = LoggerFactory.getLogger(PausableThread.class);
|
||||
private final static boolean dbg = false;
|
||||
private static final Logger log = LoggerFactory.getLogger(PausableThread.class);
|
||||
private static final boolean dbg = false;
|
||||
|
||||
private boolean mPausing = true;
|
||||
private boolean mRunning = true;
|
||||
|
||||
@@ -45,10 +45,10 @@ public class RTree<T> implements SpatialIndex<T>, Iterable<T> {
|
||||
|
||||
static final Logger log = LoggerFactory.getLogger(RTree.class);
|
||||
|
||||
final static int MAXNODES = 8;
|
||||
final static int MINNODES = 4;
|
||||
static final int MAXNODES = 8;
|
||||
static final int MINNODES = 4;
|
||||
|
||||
final static int NUMDIMS = 2;
|
||||
static final int NUMDIMS = 2;
|
||||
|
||||
static final boolean DEBUG = true;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class RTree<T> implements SpatialIndex<T>, Iterable<T> {
|
||||
* The parents level determines this.
|
||||
* If the parents level is 0, then this is data
|
||||
*/
|
||||
final static class Branch<E> extends Rect {
|
||||
static final class Branch<E> extends Rect {
|
||||
/**
|
||||
* Child node or data item
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ public class RTree<T> implements SpatialIndex<T>, Iterable<T> {
|
||||
/**
|
||||
* Node for each branch level
|
||||
*/
|
||||
final static class Node {
|
||||
static final class Node {
|
||||
|
||||
/**
|
||||
* Leaf is zero, others positive
|
||||
@@ -492,7 +492,7 @@ public class RTree<T> implements SpatialIndex<T>, Iterable<T> {
|
||||
return null;
|
||||
}
|
||||
|
||||
final static double mergedArea(Rect a, Rect b) {
|
||||
static final double mergedArea(Rect a, Rect b) {
|
||||
return ((a.xmax > b.xmax ? a.xmax : b.xmax) - (a.xmin < b.xmin ? a.xmin : b.xmin)
|
||||
* ((a.ymax > b.ymax ? a.ymax : b.ymax) - (a.ymin < b.ymin ? a.ymin : b.ymin)));
|
||||
}
|
||||
@@ -898,7 +898,7 @@ public class RTree<T> implements SpatialIndex<T>, Iterable<T> {
|
||||
|
||||
/* Max stack size. Allows almost n^32 where n is number of branches in
|
||||
* node */
|
||||
final static int MAX_STACK = 32;
|
||||
static final int MAX_STACK = 32;
|
||||
|
||||
static class StackElement {
|
||||
Node node;
|
||||
|
||||
@@ -36,14 +36,14 @@ public class OBB2D {
|
||||
return v[a] * v[b] + v[a + 1] * v[b + 1];
|
||||
}
|
||||
|
||||
public final static float lengthSquared(float[] v, int pos) {
|
||||
public static final float lengthSquared(float[] v, int pos) {
|
||||
float x = v[pos + 0];
|
||||
float y = v[pos + 1];
|
||||
|
||||
return x * x + y * y;
|
||||
}
|
||||
|
||||
public final static void normalizeSquared(float[] v, int pos) {
|
||||
public static final void normalizeSquared(float[] v, int pos) {
|
||||
float x = v[pos + 0];
|
||||
float y = v[pos + 1];
|
||||
|
||||
@@ -53,7 +53,7 @@ public class OBB2D {
|
||||
v[pos + 1] = y / length;
|
||||
}
|
||||
|
||||
public final static void normalize(float[] v, int pos) {
|
||||
public static final void normalize(float[] v, int pos) {
|
||||
float x = v[pos + 0];
|
||||
float y = v[pos + 1];
|
||||
|
||||
@@ -63,24 +63,24 @@ public class OBB2D {
|
||||
v[pos + 1] = (float) (y / length);
|
||||
}
|
||||
|
||||
public final static float length(float[] v, int pos) {
|
||||
public static final float length(float[] v, int pos) {
|
||||
float x = v[pos + 0];
|
||||
float y = v[pos + 1];
|
||||
|
||||
return (float) Math.sqrt(x * x + y * y);
|
||||
}
|
||||
|
||||
public final static void add(float[] v, int r, int a, int b) {
|
||||
public static final void add(float[] v, int r, int a, int b) {
|
||||
v[r + 0] = v[a + 0] + v[b + 0];
|
||||
v[r + 1] = v[a + 1] + v[b + 1];
|
||||
}
|
||||
|
||||
public final static void sub(float[] v, int r, int a, int b) {
|
||||
public static final void sub(float[] v, int r, int a, int b) {
|
||||
v[r + 0] = v[a + 0] - v[b + 0];
|
||||
v[r + 1] = v[a + 1] - v[b + 1];
|
||||
}
|
||||
|
||||
public final static void mul(float[] v, int pos, float a) {
|
||||
public static final void mul(float[] v, int pos, float a) {
|
||||
v[pos + 0] *= a;
|
||||
v[pos + 1] *= a;
|
||||
}
|
||||
@@ -93,20 +93,20 @@ public class OBB2D {
|
||||
|
||||
// Corners of the box, where 0 is the lower left.
|
||||
//public final float[] corner = new float[ 4 * 2];
|
||||
private final static int CORNER_X = 0;
|
||||
private final static int CORNER_Y = CORNER_X + 1;
|
||||
private final static int CORNER_0 = CORNER_X;
|
||||
private final static int CORNER_1 = CORNER_X + 2;
|
||||
//private final static int CORNER_2 = CORNER_X + 4;
|
||||
private final static int CORNER_3 = CORNER_X + 6;
|
||||
private static final int CORNER_X = 0;
|
||||
private static final int CORNER_Y = CORNER_X + 1;
|
||||
private static final int CORNER_0 = CORNER_X;
|
||||
private static final int CORNER_1 = CORNER_X + 2;
|
||||
//private static final int CORNER_2 = CORNER_X + 4;
|
||||
private static final int CORNER_3 = CORNER_X + 6;
|
||||
|
||||
// Two edges of the box extended away from origin[CORNER_X + 0].
|
||||
//public final float[] axis = new float[2 * 2];
|
||||
private final static int AXIS_X = 2 * 4;
|
||||
private final static int AXIS_Y = AXIS_X + 1;
|
||||
private static final int AXIS_X = 2 * 4;
|
||||
private static final int AXIS_Y = AXIS_X + 1;
|
||||
|
||||
private final static int AXIS_1 = AXIS_X;
|
||||
private final static int AXIS_2 = AXIS_X + 2;
|
||||
private static final int AXIS_1 = AXIS_X;
|
||||
private static final int AXIS_2 = AXIS_X + 2;
|
||||
|
||||
// Returns true if other overlaps one dimension of this.
|
||||
private boolean overlaps1Way(OBB2D other) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import static org.oscim.utils.geom.GeometryUtils.squareSegmentDistance;
|
||||
* https://github.com/ekeneijeoma/simplify-java
|
||||
*/
|
||||
public class SimplifyDP {
|
||||
final static Logger log = LoggerFactory.getLogger(SimplifyDP.class);
|
||||
static final Logger log = LoggerFactory.getLogger(SimplifyDP.class);
|
||||
|
||||
boolean[] markers = new boolean[128];
|
||||
int[] stack = new int[32];
|
||||
|
||||
@@ -18,12 +18,12 @@ import java.util.Arrays;
|
||||
*/
|
||||
public class BoxTree<T extends BoxItem<E>, E> extends TileIndex<BoxNode<T>, T> {
|
||||
|
||||
final static Logger log = LoggerFactory.getLogger(BoxTree.class);
|
||||
static final Logger log = LoggerFactory.getLogger(BoxTree.class);
|
||||
static boolean dbg = false;
|
||||
|
||||
protected final int extents;
|
||||
protected final int maxDepth;
|
||||
private final static int MAX_STACK = 32;
|
||||
private static final int MAX_STACK = 32;
|
||||
|
||||
static class Stack<E> extends Inlist<Stack<E>> {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user