rename theme style classes

This commit is contained in:
Hannes Janetzek 2014-03-17 22:48:20 +01:00
parent 4e473bf242
commit 46b2eb2a3e
28 changed files with 178 additions and 178 deletions

View File

@ -15,8 +15,8 @@ import org.oscim.jeo.JeoUtils;
import org.oscim.map.Map; import org.oscim.map.Map;
import org.oscim.renderer.elements.LineLayer; import org.oscim.renderer.elements.LineLayer;
import org.oscim.renderer.elements.MeshLayer; import org.oscim.renderer.elements.MeshLayer;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -117,7 +117,7 @@ public class JeoVectorLayer extends JtsLayer {
if (ll.line == null) { if (ll.line == null) {
RGB color = rule.color(f, CartoCSS.LINE_COLOR, RGB.black); RGB color = rule.color(f, CartoCSS.LINE_COLOR, RGB.black);
float width = rule.number(f, CartoCSS.LINE_WIDTH, 1.2f); float width = rule.number(f, CartoCSS.LINE_WIDTH, 1.2f);
ll.line = new Line(0, JeoUtils.color(color), width); ll.line = new LineStyle(0, JeoUtils.color(color), width);
ll.setDropDistance(0.5f); ll.setDropDistance(0.5f);
} }
@ -131,14 +131,14 @@ public class JeoVectorLayer extends JtsLayer {
if (ll.line == null) { if (ll.line == null) {
float width = rule.number(f, CartoCSS.LINE_WIDTH, 1.2f); float width = rule.number(f, CartoCSS.LINE_WIDTH, 1.2f);
RGB color = rule.color(f, CartoCSS.LINE_COLOR, RGB.black); RGB color = rule.color(f, CartoCSS.LINE_COLOR, RGB.black);
ll.line = new Line(0, JeoUtils.color(color), width); ll.line = new LineStyle(0, JeoUtils.color(color), width);
ll.setDropDistance(0.5f); ll.setDropDistance(0.5f);
} }
MeshLayer mesh = t.layers.getMeshLayer(0); MeshLayer mesh = t.layers.getMeshLayer(0);
if (mesh.area == null) { if (mesh.area == null) {
int color = JeoUtils.color(rule.color(f, CartoCSS.POLYGON_FILL, RGB.red)); int color = JeoUtils.color(rule.color(f, CartoCSS.POLYGON_FILL, RGB.red));
mesh.area = new Area(color); mesh.area = new AreaStyle(color);
} }
addPolygon(t, g, mesh, ll); addPolygon(t, g, mesh, ll);

View File

@ -15,10 +15,10 @@ import org.oscim.renderer.elements.LineLayer;
import org.oscim.renderer.elements.MeshLayer; import org.oscim.renderer.elements.MeshLayer;
import org.oscim.renderer.elements.TextItem; import org.oscim.renderer.elements.TextItem;
import org.oscim.renderer.elements.TextLayer; import org.oscim.renderer.elements.TextLayer;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
import org.oscim.theme.styles.Text.TextBuilder; import org.oscim.theme.styles.TextStyle.TextBuilder;
import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
@ -27,7 +27,7 @@ import com.vividsolutions.jts.geom.LineString;
public class OSMIndoorLayer extends JeoVectorLayer { public class OSMIndoorLayer extends JeoVectorLayer {
protected TextLayer mTextLayer; protected TextLayer mTextLayer;
protected Text mText = new TextBuilder() protected TextStyle mText = new TextBuilder()
.setFontSize(16).setColor(Color.BLACK) .setFontSize(16).setColor(Color.BLACK)
.setStrokeWidth(2.2f).setStroke(Color.WHITE) .setStrokeWidth(2.2f).setStroke(Color.WHITE)
.build(); .build();
@ -62,7 +62,7 @@ public class OSMIndoorLayer extends JeoVectorLayer {
if (ll.line == null) { if (ll.line == null) {
RGB color = rule.color(f, CartoCSS.LINE_COLOR, RGB.black); RGB color = rule.color(f, CartoCSS.LINE_COLOR, RGB.black);
float width = rule.number(f, CartoCSS.LINE_WIDTH, 1.2f); float width = rule.number(f, CartoCSS.LINE_WIDTH, 1.2f);
ll.line = new Line(0, JeoUtils.color(color), width); ll.line = new LineStyle(0, JeoUtils.color(color), width);
ll.heightOffset = level * 4; ll.heightOffset = level * 4;
ll.setDropDistance(0); ll.setDropDistance(0);
} }
@ -84,7 +84,7 @@ public class OSMIndoorLayer extends JeoVectorLayer {
if (level > -2 && !active) if (level > -2 && !active)
color = Color.fade(color, 0.1f); color = Color.fade(color, 0.1f);
ll.line = new Line(0, color, width); ll.line = new LineStyle(0, color, width);
ll.heightOffset = level * 4; ll.heightOffset = level * 4;
ll.setDropDistance(0); ll.setDropDistance(0);
} }
@ -95,7 +95,7 @@ public class OSMIndoorLayer extends JeoVectorLayer {
if (level > -2 && !active) if (level > -2 && !active)
color = Color.fade(color, 0.1f); color = Color.fade(color, 0.1f);
mesh.area = new Area(color); mesh.area = new AreaStyle(color);
//mesh.area = new Area(Color.fade(Color.DKGRAY, 0.1f)); //mesh.area = new Area(Color.fade(Color.DKGRAY, 0.1f));
mesh.heightOffset = level * 4f; mesh.heightOffset = level * 4f;
} }

View File

@ -19,8 +19,8 @@ import org.oscim.core.MapElement;
import org.oscim.core.Tag; import org.oscim.core.Tag;
import org.oscim.core.TagSet; import org.oscim.core.TagSet;
import org.oscim.theme.IRenderTheme; import org.oscim.theme.IRenderTheme;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.RenderStyle; import org.oscim.theme.styles.RenderStyle;
public class RenderTheme implements IRenderTheme { public class RenderTheme implements IRenderTheme {
@ -147,11 +147,11 @@ public class RenderTheme implements IRenderTheme {
} }
if (p != null) { if (p != null) {
s.ri[0] = new Area(mCurLevel++, color(p)); s.ri[0] = new AreaStyle(mCurLevel++, color(p));
} }
if (l != null) { if (l != null) {
s.ri[1] = new Line(mCurLevel++, color(l), 1); s.ri[1] = new LineStyle(mCurLevel++, color(l), 1);
} }
if (p != null || l != null) { if (p != null || l != null) {
@ -198,7 +198,7 @@ public class RenderTheme implements IRenderTheme {
RGB c = r.color(f, CartoCSS.POLYGON_FILL, RGB.black); RGB c = r.color(f, CartoCSS.POLYGON_FILL, RGB.black);
out.println(z + " " + c); out.println(z + " " + c);
return new RenderStyle[] { return new RenderStyle[] {
new Area(z, color(c)) new AreaStyle(z, color(c))
}; };
} else if (type == GeometryType.LINE) { } else if (type == GeometryType.LINE) {
@ -207,7 +207,7 @@ public class RenderTheme implements IRenderTheme {
//out.println(z + " " + c); //out.println(z + " " + c);
return new RenderStyle[] { return new RenderStyle[] {
new Line(100 + z, color(c), width) new LineStyle(100 + z, color(c), width)
}; };
} else if (type == GeometryType.POINT) { } else if (type == GeometryType.POINT) {

View File

@ -32,7 +32,7 @@ import org.oscim.renderer.ElementRenderer;
import org.oscim.renderer.GLViewport; import org.oscim.renderer.GLViewport;
import org.oscim.renderer.elements.ElementLayers; import org.oscim.renderer.elements.ElementLayers;
import org.oscim.renderer.elements.LineLayer; import org.oscim.renderer.elements.LineLayer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.utils.FastMath; import org.oscim.utils.FastMath;
import org.oscim.utils.async.SimpleWorker; import org.oscim.utils.async.SimpleWorker;
import org.oscim.utils.geom.LineClipper; import org.oscim.utils.geom.LineClipper;
@ -45,14 +45,14 @@ public class PathLayer extends Layer {
protected boolean mUpdatePoints; protected boolean mUpdatePoints;
/** Line style */ /** Line style */
Line mLineStyle; LineStyle mLineStyle;
final Worker mWorker; final Worker mWorker;
public PathLayer(Map map, int lineColor, float lineWidth) { public PathLayer(Map map, int lineColor, float lineWidth) {
super(map); super(map);
mWorker = new Worker(map); mWorker = new Worker(map);
mLineStyle = new Line(lineColor, lineWidth, Cap.BUTT); mLineStyle = new LineStyle(lineColor, lineWidth, Cap.BUTT);
mRenderer = new RenderPath(); mRenderer = new RenderPath();
mPoints = new ArrayList<GeoPoint>(); mPoints = new ArrayList<GeoPoint>();
} }

View File

@ -3,8 +3,8 @@ package org.oscim.layers;
import org.oscim.backend.canvas.Paint.Cap; import org.oscim.backend.canvas.Paint.Cap;
import org.oscim.map.Map; import org.oscim.map.Map;
import org.oscim.renderer.GridRenderer; import org.oscim.renderer.GridRenderer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
public class TileGridLayer extends GenericLayer { public class TileGridLayer extends GenericLayer {
@ -13,10 +13,10 @@ public class TileGridLayer extends GenericLayer {
} }
public TileGridLayer(Map map, int color, float width, int repeat) { public TileGridLayer(Map map, int color, float width, int repeat) {
super(map, new GridRenderer(repeat, new Line(color, width, Cap.BUTT), null)); super(map, new GridRenderer(repeat, new LineStyle(color, width, Cap.BUTT), null));
} }
public TileGridLayer(Map map, int color, float width, Text text, int repeat) { public TileGridLayer(Map map, int color, float width, TextStyle text, int repeat) {
super(map, new GridRenderer(repeat, new Line(color, width, Cap.BUTT), text)); super(map, new GridRenderer(repeat, new LineStyle(color, width, Cap.BUTT), text));
} }
} }

View File

@ -28,7 +28,7 @@ import org.oscim.layers.tile.VectorTileRenderer;
import org.oscim.map.Map; import org.oscim.map.Map;
import org.oscim.renderer.elements.ElementLayers; import org.oscim.renderer.elements.ElementLayers;
import org.oscim.renderer.elements.LineLayer; import org.oscim.renderer.elements.LineLayer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -52,7 +52,7 @@ public class TestTileLayer extends TileLayer {
} }
GeometryBuffer mGeom = new GeometryBuffer(128, 16); GeometryBuffer mGeom = new GeometryBuffer(128, 16);
Line mLineStyle = new Line(Color.BLUE, 2f, Cap.ROUND); LineStyle mLineStyle = new LineStyle(Color.BLUE, 2f, Cap.ROUND);
@Override @Override
public boolean loadTile(MapTile tile) { public boolean loadTile(MapTile tile) {

View File

@ -40,14 +40,14 @@ import org.oscim.renderer.elements.SymbolItem;
import org.oscim.renderer.elements.TextItem; import org.oscim.renderer.elements.TextItem;
import org.oscim.theme.IRenderTheme; import org.oscim.theme.IRenderTheme;
import org.oscim.theme.RenderTheme; import org.oscim.theme.RenderTheme;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Circle; import org.oscim.theme.styles.CircleStyle;
import org.oscim.theme.styles.Extrusion; import org.oscim.theme.styles.ExtrusionStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.LineSymbol; import org.oscim.theme.styles.LineSymbol;
import org.oscim.theme.styles.RenderStyle; import org.oscim.theme.styles.RenderStyle;
import org.oscim.theme.styles.Symbol; import org.oscim.theme.styles.SymbolStyle;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
import org.oscim.tiling.ITileDataSource; import org.oscim.tiling.ITileDataSource;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -248,7 +248,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
/*** RenderThemeCallback ***/ /*** RenderThemeCallback ***/
@Override @Override
public void renderWay(Line line, int level) { public void renderWay(LineStyle line, int level) {
int numLayer = mCurLayer + level; int numLayer = mCurLayer + level;
if (line.stipple == 0) { if (line.stipple == 0) {
@ -297,7 +297,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
protected final static boolean USE_MESH_POLY = false; protected final static boolean USE_MESH_POLY = false;
@Override @Override
public void renderArea(Area area, int level) { public void renderArea(AreaStyle area, int level) {
int numLayer = mCurLayer + level; int numLayer = mCurLayer + level;
if (USE_MESH_POLY) { if (USE_MESH_POLY) {
MeshLayer l = mTile.layers.getMeshLayer(numLayer); MeshLayer l = mTile.layers.getMeshLayer(numLayer);
@ -311,7 +311,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
} }
@Override @Override
public void renderAreaText(Text text) { public void renderAreaText(TextStyle text) {
// TODO place somewhere on polygon // TODO place somewhere on polygon
String value = mElement.tags.getValue(text.textKey); String value = mElement.tags.getValue(text.textKey);
if (value == null || value.length() == 0) if (value == null || value.length() == 0)
@ -332,7 +332,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
} }
@Override @Override
public void renderPointText(Text text) { public void renderPointText(TextStyle text) {
String value = mElement.tags.getValue(text.textKey); String value = mElement.tags.getValue(text.textKey);
if (value == null || value.length() == 0) if (value == null || value.length() == 0)
return; return;
@ -344,7 +344,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
} }
@Override @Override
public void renderWayText(Text text) { public void renderWayText(TextStyle text) {
String value = mElement.tags.getValue(text.textKey); String value = mElement.tags.getValue(text.textKey);
if (value == null || value.length() == 0) if (value == null || value.length() == 0)
return; return;
@ -362,11 +362,11 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
} }
@Override @Override
public void renderPointCircle(Circle circle, int level) { public void renderPointCircle(CircleStyle circle, int level) {
} }
@Override @Override
public void renderPointSymbol(Symbol symbol) { public void renderPointSymbol(SymbolStyle symbol) {
if (symbol.texture == null) if (symbol.texture == null)
return; return;
@ -380,7 +380,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
} }
@Override @Override
public void renderAreaSymbol(Symbol symbol) { public void renderAreaSymbol(SymbolStyle symbol) {
} }
@Override @Override
@ -389,7 +389,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
} }
@Override @Override
public void renderExtrusion(Extrusion extrusion, int level) { public void renderExtrusion(ExtrusionStyle extrusion, int level) {
int height = 0; int height = 0;
int minHeight = 0; int minHeight = 0;

View File

@ -20,14 +20,14 @@ package org.oscim.layers.tile.vector;
import org.oscim.core.Tile; import org.oscim.core.Tile;
import org.oscim.layers.tile.MapTile; import org.oscim.layers.tile.MapTile;
import org.oscim.renderer.elements.TextItem; import org.oscim.renderer.elements.TextItem;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
import org.oscim.utils.geom.GeometryUtils; import org.oscim.utils.geom.GeometryUtils;
import org.oscim.utils.geom.LineClipper; import org.oscim.utils.geom.LineClipper;
public final class WayDecorator { public final class WayDecorator {
public static void renderText(LineClipper clipper, float[] coordinates, String string, public static void renderText(LineClipper clipper, float[] coordinates, String string,
Text text, int pos, int len, MapTile tile) { TextStyle text, int pos, int len, MapTile tile) {
//TextItem items = textItems; //TextItem items = textItems;
TextItem t = null; TextItem t = null;

View File

@ -22,7 +22,7 @@ import org.oscim.renderer.GLViewport;
import org.oscim.renderer.elements.ElementLayers; import org.oscim.renderer.elements.ElementLayers;
import org.oscim.renderer.elements.LineLayer; import org.oscim.renderer.elements.LineLayer;
import org.oscim.renderer.elements.TextItem; import org.oscim.renderer.elements.TextItem;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
class Debug { class Debug {
@ -71,12 +71,12 @@ class Debug {
int alpha = 0xaaffffff; int alpha = 0xaaffffff;
dbg.clear(); dbg.clear();
dbg.addLineLayer(0, new Line((Color.BLUE & alpha), 2)); dbg.addLineLayer(0, new LineStyle((Color.BLUE & alpha), 2));
dbg.addLineLayer(1, new Line((Color.RED & alpha), 2)); dbg.addLineLayer(1, new LineStyle((Color.RED & alpha), 2));
dbg.addLineLayer(3, new Line((Color.YELLOW & alpha), 2)); dbg.addLineLayer(3, new LineStyle((Color.YELLOW & alpha), 2));
dbg.addLineLayer(2, new Line((Color.GREEN & alpha), 2)); dbg.addLineLayer(2, new LineStyle((Color.GREEN & alpha), 2));
dbg.addLineLayer(4, new Line((Color.CYAN & alpha), 2)); dbg.addLineLayer(4, new LineStyle((Color.CYAN & alpha), 2));
dbg.addLineLayer(5, new Line((Color.MAGENTA & alpha), 2)); dbg.addLineLayer(5, new LineStyle((Color.MAGENTA & alpha), 2));
} }
public static void draw(MapPosition pos, GLViewport m, ElementLayers layers) { public static void draw(MapPosition pos, GLViewport m, ElementLayers layers) {

View File

@ -23,13 +23,13 @@ import org.oscim.core.Tile;
import org.oscim.renderer.elements.LineLayer; import org.oscim.renderer.elements.LineLayer;
import org.oscim.renderer.elements.TextItem; import org.oscim.renderer.elements.TextItem;
import org.oscim.renderer.elements.TextLayer; import org.oscim.renderer.elements.TextLayer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
import org.oscim.theme.styles.Text.TextBuilder; import org.oscim.theme.styles.TextStyle.TextBuilder;
public class GridRenderer extends ElementRenderer { public class GridRenderer extends ElementRenderer {
private final TextLayer mTextLayer; private final TextLayer mTextLayer;
private final Text mText; private final TextStyle mText;
private final LineLayer mLineLayer; private final LineLayer mLineLayer;
private final GeometryBuffer mLines; private final GeometryBuffer mLines;
private final StringBuffer mStringBuffer; private final StringBuffer mStringBuffer;
@ -37,11 +37,11 @@ public class GridRenderer extends ElementRenderer {
private int mCurX, mCurY, mCurZ; private int mCurX, mCurY, mCurZ;
public GridRenderer() { public GridRenderer() {
this(1, new Line(Color.LTGRAY, 1.2f, Cap.BUTT), this(1, new LineStyle(Color.LTGRAY, 1.2f, Cap.BUTT),
new TextBuilder().setFontSize(22).setColor(Color.RED).build()); new TextBuilder().setFontSize(22).setColor(Color.RED).build());
} }
public GridRenderer(int numLines, Line lineStyle, Text textStyle) { public GridRenderer(int numLines, LineStyle lineStyle, TextStyle textStyle) {
int size = Tile.SIZE; int size = Tile.SIZE;
// not needed to set but we know: // not needed to set but we know:

View File

@ -25,8 +25,8 @@ import java.nio.ShortBuffer;
import org.oscim.backend.GL20; import org.oscim.backend.GL20;
import org.oscim.renderer.BufferObject; import org.oscim.renderer.BufferObject;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -83,7 +83,7 @@ public class ElementLayers {
* add the LineLayer for a level with a given Line style. Levels are * add the LineLayer for a level with a given Line style. Levels are
* ordered from bottom (0) to top * ordered from bottom (0) to top
*/ */
public LineLayer addLineLayer(int level, Line style) { public LineLayer addLineLayer(int level, LineStyle style) {
LineLayer l = (LineLayer) getLayer(level, LINE); LineLayer l = (LineLayer) getLayer(level, LINE);
if (l == null) if (l == null)
return null; return null;
@ -93,7 +93,7 @@ public class ElementLayers {
return l; return l;
} }
public PolygonLayer addPolygonLayer(int level, Area style) { public PolygonLayer addPolygonLayer(int level, AreaStyle style) {
PolygonLayer l = (PolygonLayer) getLayer(level, POLYGON); PolygonLayer l = (PolygonLayer) getLayer(level, POLYGON);
if (l == null) if (l == null)
return null; return null;
@ -101,7 +101,7 @@ public class ElementLayers {
return l; return l;
} }
public MeshLayer addMeshLayer(int level, Area style) { public MeshLayer addMeshLayer(int level, AreaStyle style) {
MeshLayer l = (MeshLayer) getLayer(level, MESH); MeshLayer l = (MeshLayer) getLayer(level, MESH);
if (l == null) if (l == null)
return null; return null;

View File

@ -29,7 +29,7 @@ import org.oscim.renderer.GLState;
import org.oscim.renderer.GLUtils; import org.oscim.renderer.GLUtils;
import org.oscim.renderer.GLViewport; import org.oscim.renderer.GLViewport;
import org.oscim.renderer.MapRenderer; import org.oscim.renderer.MapRenderer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.utils.pool.Inlist; import org.oscim.utils.pool.Inlist;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -64,7 +64,7 @@ public final class LineLayer extends RenderElement {
/* lines referenced by this outline layer */ /* lines referenced by this outline layer */
public LineLayer outlines; public LineLayer outlines;
public Line line; public LineStyle line;
public float scale = 1; public float scale = 1;
public boolean roundCap; public boolean roundCap;
@ -749,7 +749,7 @@ public final class LineLayer extends RenderElement {
RenderElement l = curLayer; RenderElement l = curLayer;
for (; l != null && l.type == RenderElement.LINE; l = l.next) { for (; l != null && l.type == RenderElement.LINE; l = l.next) {
LineLayer ll = (LineLayer) l; LineLayer ll = (LineLayer) l;
Line line = (Line) ll.line.getCurrent(); LineStyle line = (LineStyle) ll.line.getCurrent();
if (ll.heightOffset != heightOffset) { if (ll.heightOffset != heightOffset) {
heightOffset = ll.heightOffset; heightOffset = ll.heightOffset;
@ -820,7 +820,7 @@ public final class LineLayer extends RenderElement {
/* draw LineLayers references by this outline */ /* draw LineLayers references by this outline */
for (LineLayer ref = ll.outlines; ref != null; ref = ref.outlines) { for (LineLayer ref = ll.outlines; ref != null; ref = ref.outlines) {
Line core = (Line) ref.line.getCurrent(); LineStyle core = (LineStyle) ref.line.getCurrent();
// core width // core width
if (core.fixed) { if (core.fixed) {

View File

@ -26,7 +26,7 @@ import org.oscim.renderer.GLState;
import org.oscim.renderer.GLUtils; import org.oscim.renderer.GLUtils;
import org.oscim.renderer.GLViewport; import org.oscim.renderer.GLViewport;
import org.oscim.renderer.MapRenderer; import org.oscim.renderer.MapRenderer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.utils.pool.Inlist; import org.oscim.utils.pool.Inlist;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -86,7 +86,7 @@ public final class LineTexLayer extends RenderElement {
/* lines referenced by this outline layer */ /* lines referenced by this outline layer */
public LineLayer outlines; public LineLayer outlines;
public Line line; public LineStyle line;
public float width; public float width;
//public boolean roundCap; //public boolean roundCap;
@ -362,7 +362,7 @@ public final class LineTexLayer extends RenderElement {
RenderElement l = curLayer; RenderElement l = curLayer;
for (; l != null && l.type == TEXLINE; l = l.next) { for (; l != null && l.type == TEXLINE; l = l.next) {
LineTexLayer ll = (LineTexLayer) l; LineTexLayer ll = (LineTexLayer) l;
Line line = ll.line; LineStyle line = ll.line;
GLUtils.setColor(hTexColor, line.stippleColor, 1); GLUtils.setColor(hTexColor, line.stippleColor, 1);
GLUtils.setColor(hBgColor, line.color, 1); GLUtils.setColor(hBgColor, line.color, 1);

View File

@ -27,7 +27,7 @@ import org.oscim.renderer.GLState;
import org.oscim.renderer.GLUtils; import org.oscim.renderer.GLUtils;
import org.oscim.renderer.GLViewport; import org.oscim.renderer.GLViewport;
import org.oscim.renderer.MapRenderer; import org.oscim.renderer.MapRenderer;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.utils.Tessellator; import org.oscim.utils.Tessellator;
import org.oscim.utils.pool.Inlist; import org.oscim.utils.pool.Inlist;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -41,7 +41,7 @@ public class MeshLayer extends RenderElement {
int numIndices; int numIndices;
VertexItem indiceItems; VertexItem indiceItems;
public Area area; public AreaStyle area;
public float heightOffset; public float heightOffset;
public MeshLayer(int level) { public MeshLayer(int level) {

View File

@ -29,7 +29,7 @@ import org.oscim.renderer.GLState;
import org.oscim.renderer.GLUtils; import org.oscim.renderer.GLUtils;
import org.oscim.renderer.GLViewport; import org.oscim.renderer.GLViewport;
import org.oscim.renderer.MapRenderer; import org.oscim.renderer.MapRenderer;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.utils.FastMath; import org.oscim.utils.FastMath;
import org.oscim.utils.math.Interpolation; import org.oscim.utils.math.Interpolation;
import org.oscim.utils.pool.Inlist; import org.oscim.utils.pool.Inlist;
@ -46,7 +46,7 @@ public final class PolygonLayer extends RenderElement {
private static final boolean enableTexture = true; private static final boolean enableTexture = true;
public Area area; public AreaStyle area;
PolygonLayer(int layer) { PolygonLayer(int layer) {
super(RenderElement.POLYGON); super(RenderElement.POLYGON);
@ -181,7 +181,7 @@ public final class PolygonLayer extends RenderElement {
int shader = polyShader; int shader = polyShader;
for (int c = start; c < end; c++) { for (int c = start; c < end; c++) {
Area a = (Area) mFillPolys[c].area.getCurrent(); AreaStyle a = (AreaStyle) mFillPolys[c].area.getCurrent();
if (enableTexture && a.texture != null) { if (enableTexture && a.texture != null) {
shader = texShader; shader = texShader;

View File

@ -16,7 +16,7 @@
*/ */
package org.oscim.renderer.elements; package org.oscim.renderer.elements;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
import org.oscim.utils.pool.Inlist; import org.oscim.utils.pool.Inlist;
import org.oscim.utils.pool.SyncPool; import org.oscim.utils.pool.SyncPool;
@ -57,7 +57,7 @@ public class TextItem extends Inlist<TextItem> {
return ti; return ti;
} }
public TextItem set(float x, float y, String string, Text text) { public TextItem set(float x, float y, String string, TextStyle text) {
this.x = x; this.x = x;
this.y = y; this.y = y;
this.string = string; this.string = string;
@ -77,7 +77,7 @@ public class TextItem extends Inlist<TextItem> {
public String string; public String string;
// text style // text style
public Text text; public TextStyle text;
// label width // label width
public float width; public float width;

View File

@ -28,9 +28,9 @@ import org.oscim.renderer.atlas.TextureAtlas.Slot;
import org.oscim.renderer.elements.LineLayer; import org.oscim.renderer.elements.LineLayer;
import org.oscim.renderer.elements.TextItem; import org.oscim.renderer.elements.TextItem;
import org.oscim.renderer.elements.TextLayer; import org.oscim.renderer.elements.TextLayer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
import org.oscim.theme.styles.Text.TextBuilder; import org.oscim.theme.styles.TextStyle.TextBuilder;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -43,19 +43,19 @@ public class AtlasRenderLayer extends ElementRenderer {
TextureAtlas mAtlas = TextureAtlas.create(2048, 2048, 1); TextureAtlas mAtlas = TextureAtlas.create(2048, 2048, 1);
LineLayer ll = layers.getLineLayer(0); LineLayer ll = layers.getLineLayer(0);
ll.line = new Line(Color.BLUE, 3, Cap.BUTT); ll.line = new LineStyle(Color.BLUE, 3, Cap.BUTT);
ll.scale = 1f; ll.scale = 1f;
LineLayer ll2 = layers.getLineLayer(1); LineLayer ll2 = layers.getLineLayer(1);
ll2.line = new Line(Color.RED, 3, Cap.BUTT); ll2.line = new LineStyle(Color.RED, 3, Cap.BUTT);
ll2.scale = 1f; ll2.scale = 1f;
LineLayer ll3 = layers.getLineLayer(2); LineLayer ll3 = layers.getLineLayer(2);
ll3.line = new Line(Color.GREEN, 3, Cap.BUTT); ll3.line = new LineStyle(Color.GREEN, 3, Cap.BUTT);
ll3.scale = 1f; ll3.scale = 1f;
TextLayer tl = new TextLayer(); TextLayer tl = new TextLayer();
Text t = new TextBuilder().setFontSize(20).setColor(Color.BLACK).build(); TextStyle t = new TextBuilder().setFontSize(20).setColor(Color.BLACK).build();
layers.setTextureLayers(tl); layers.setTextureLayers(tl);
float[] points = new float[10]; float[] points = new float[10];

View File

@ -8,7 +8,7 @@ import org.oscim.core.Point;
import org.oscim.renderer.ElementRenderer; import org.oscim.renderer.ElementRenderer;
import org.oscim.renderer.GLViewport; import org.oscim.renderer.GLViewport;
import org.oscim.renderer.elements.LineLayer; import org.oscim.renderer.elements.LineLayer;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.utils.geom.BezierPath; import org.oscim.utils.geom.BezierPath;
public class BezierPathLayer extends ElementRenderer { public class BezierPathLayer extends ElementRenderer {
@ -27,7 +27,7 @@ public class BezierPathLayer extends ElementRenderer {
// System.out.println(pts[i]); // System.out.println(pts[i]);
g.addPoint(pts[i]); g.addPoint(pts[i]);
} }
LineLayer ll = layers.addLineLayer(0, new Line(Color.BLUE, 2f)); LineLayer ll = layers.addLineLayer(0, new LineStyle(Color.BLUE, 2f));
ll.addLine(g); ll.addLine(g);
List<Point> ctrl = BezierPath.cubicSplineControlPoints(pts, 0.1f); List<Point> ctrl = BezierPath.cubicSplineControlPoints(pts, 0.1f);
@ -49,7 +49,7 @@ public class BezierPathLayer extends ElementRenderer {
} }
p0 = p3; p0 = p3;
} }
ll = layers.addLineLayer(1, new Line(Color.CYAN, 2f)); ll = layers.addLineLayer(1, new LineStyle(Color.CYAN, 2f));
ll.addLine(g); ll.addLine(g);
} }

View File

@ -3,14 +3,14 @@ package org.oscim.theme;
import org.oscim.backend.canvas.Color; import org.oscim.backend.canvas.Color;
import org.oscim.core.GeometryBuffer.GeometryType; import org.oscim.core.GeometryBuffer.GeometryType;
import org.oscim.core.TagSet; import org.oscim.core.TagSet;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.RenderStyle; import org.oscim.theme.styles.RenderStyle;
public class DebugTheme implements IRenderTheme { public class DebugTheme implements IRenderTheme {
private final static Line[] line = { new Line(1, Color.MAGENTA, 2) }; private final static LineStyle[] line = { new LineStyle(1, Color.MAGENTA, 2) };
private final static Area[] area = { new Area(0, Color.CYAN) }; private final static AreaStyle[] area = { new AreaStyle(0, Color.CYAN) };
@Override @Override
public RenderStyle[] matchElement(GeometryType type, TagSet tags, int zoomLevel) { public RenderStyle[] matchElement(GeometryType type, TagSet tags, int zoomLevel) {

View File

@ -19,14 +19,14 @@ package org.oscim.theme;
import org.oscim.core.GeometryBuffer.GeometryType; import org.oscim.core.GeometryBuffer.GeometryType;
import org.oscim.core.TagSet; import org.oscim.core.TagSet;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Circle; import org.oscim.theme.styles.CircleStyle;
import org.oscim.theme.styles.Extrusion; import org.oscim.theme.styles.ExtrusionStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.LineSymbol; import org.oscim.theme.styles.LineSymbol;
import org.oscim.theme.styles.RenderStyle; import org.oscim.theme.styles.RenderStyle;
import org.oscim.theme.styles.Symbol; import org.oscim.theme.styles.SymbolStyle;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
public interface IRenderTheme { public interface IRenderTheme {
@ -76,7 +76,7 @@ public interface IRenderTheme {
* @param area * @param area
* @param level * @param level
*/ */
void renderArea(Area area, int level); void renderArea(AreaStyle area, int level);
/** /**
* Renders an extrusion with the given parameters. * Renders an extrusion with the given parameters.
@ -84,7 +84,7 @@ public interface IRenderTheme {
* @param extrusion * @param extrusion
* @param level * @param level
*/ */
void renderExtrusion(Extrusion extrusion, int level); void renderExtrusion(ExtrusionStyle extrusion, int level);
/** /**
* Renders an area symbol with the given bitmap. * Renders an area symbol with the given bitmap.
@ -92,7 +92,7 @@ public interface IRenderTheme {
* @param symbol * @param symbol
* the symbol to be rendered. * the symbol to be rendered.
*/ */
void renderAreaSymbol(Symbol symbol); void renderAreaSymbol(SymbolStyle symbol);
/** /**
* Renders an area caption with the given text. * Renders an area caption with the given text.
@ -100,7 +100,7 @@ public interface IRenderTheme {
* @param text * @param text
* the text to be rendered. * the text to be rendered.
*/ */
void renderAreaText(Text text); void renderAreaText(TextStyle text);
/** /**
* Renders a point of interest circle with the given parameters. * Renders a point of interest circle with the given parameters.
@ -110,7 +110,7 @@ public interface IRenderTheme {
* @param level * @param level
* the drawing level on which the circle should be rendered. * the drawing level on which the circle should be rendered.
*/ */
void renderPointCircle(Circle circle, int level); void renderPointCircle(CircleStyle circle, int level);
/** /**
* Renders a point of interest symbol with the given bitmap. * Renders a point of interest symbol with the given bitmap.
@ -118,7 +118,7 @@ public interface IRenderTheme {
* @param symbol * @param symbol
* the symbol to be rendered. * the symbol to be rendered.
*/ */
void renderPointSymbol(Symbol symbol); void renderPointSymbol(SymbolStyle symbol);
/** /**
* Renders a point of interest caption with the given text. * Renders a point of interest caption with the given text.
@ -126,7 +126,7 @@ public interface IRenderTheme {
* @param text * @param text
* the text to be rendered. * the text to be rendered.
*/ */
void renderPointText(Text text); void renderPointText(TextStyle text);
/** /**
* Renders a way with the given parameters. * Renders a way with the given parameters.
@ -134,7 +134,7 @@ public interface IRenderTheme {
* @param line * @param line
* @param level * @param level
*/ */
void renderWay(Line line, int level); void renderWay(LineStyle line, int level);
/** /**
* Renders a way with the given symbol along the way path. * Renders a way with the given symbol along the way path.
@ -149,7 +149,7 @@ public interface IRenderTheme {
* *
* @param text * @param text
*/ */
void renderWayText(Text text); void renderWayText(TextStyle text);
} }

View File

@ -13,8 +13,8 @@ import org.oscim.theme.rule.RuleBuilder;
import org.oscim.theme.rule.Selector; import org.oscim.theme.rule.Selector;
import org.oscim.theme.rule.SingleKeyMatcher; import org.oscim.theme.rule.SingleKeyMatcher;
import org.oscim.theme.rule.SingleValueMatcher; import org.oscim.theme.rule.SingleValueMatcher;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.RenderStyle; import org.oscim.theme.styles.RenderStyle;
public class ThemeBuilder { public class ThemeBuilder {
@ -90,11 +90,11 @@ public class ThemeBuilder {
b.push(RuleBuilder.get().select(Selector.FIRST)) b.push(RuleBuilder.get().select(Selector.FIRST))
.push("highway", null) .push("highway", null)
.addStyle(new Line(1, 1, 1)) .addStyle(new LineStyle(1, 1, 1))
.pop() .pop()
.push(RuleBuilder.get().select(Selector.WHEN_MATCHED)) .push(RuleBuilder.get().select(Selector.WHEN_MATCHED))
.addStyle(new Area(1, 1)) .addStyle(new AreaStyle(1, 1))
.pop() .pop()
.pop(); .pop();

View File

@ -41,17 +41,17 @@ import org.oscim.renderer.elements.TextureItem;
import org.oscim.theme.IRenderTheme.ThemeException; import org.oscim.theme.IRenderTheme.ThemeException;
import org.oscim.theme.rule.Rule; import org.oscim.theme.rule.Rule;
import org.oscim.theme.rule.RuleBuilder; import org.oscim.theme.rule.RuleBuilder;
import org.oscim.theme.styles.Area; import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.Area.AreaBuilder; import org.oscim.theme.styles.AreaStyle.AreaBuilder;
import org.oscim.theme.styles.Circle; import org.oscim.theme.styles.CircleStyle;
import org.oscim.theme.styles.Extrusion; import org.oscim.theme.styles.ExtrusionStyle;
import org.oscim.theme.styles.Line; import org.oscim.theme.styles.LineStyle;
import org.oscim.theme.styles.Line.LineBuilder; import org.oscim.theme.styles.LineStyle.LineBuilder;
import org.oscim.theme.styles.LineSymbol; import org.oscim.theme.styles.LineSymbol;
import org.oscim.theme.styles.RenderStyle; import org.oscim.theme.styles.RenderStyle;
import org.oscim.theme.styles.Symbol; import org.oscim.theme.styles.SymbolStyle;
import org.oscim.theme.styles.Text; import org.oscim.theme.styles.TextStyle;
import org.oscim.theme.styles.Text.TextBuilder; import org.oscim.theme.styles.TextStyle.TextBuilder;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes; import org.xml.sax.Attributes;
@ -205,7 +205,7 @@ public class XmlThemeBuilder extends DefaultHandler {
} else if ("style-text".equals(localName)) { } else if ("style-text".equals(localName)) {
checkState(localName, Element.STYLE); checkState(localName, Element.STYLE);
Text text = createText(localName, attributes, false); TextStyle text = createText(localName, attributes, false);
mStyles.put(TEXT_STYLE + text.style, text); mStyles.put(TEXT_STYLE + text.style, text);
} else if ("style-area".equals(localName)) { } else if ("style-area".equals(localName)) {
@ -218,7 +218,7 @@ public class XmlThemeBuilder extends DefaultHandler {
} else if ("outline-layer".equals(localName)) { } else if ("outline-layer".equals(localName)) {
checkState(localName, Element.RENDERING_INSTRUCTION); checkState(localName, Element.RENDERING_INSTRUCTION);
Line line = createLine(null, localName, attributes, mLevels++, true); LineStyle line = createLine(null, localName, attributes, mLevels++, true);
mStyles.put(OUTLINE_STYLE + line.style, line); mStyles.put(OUTLINE_STYLE + line.style, line);
} else if ("area".equals(localName)) { } else if ("area".equals(localName)) {
@ -227,11 +227,11 @@ public class XmlThemeBuilder extends DefaultHandler {
} else if ("caption".equals(localName)) { } else if ("caption".equals(localName)) {
checkState(localName, Element.RENDERING_INSTRUCTION); checkState(localName, Element.RENDERING_INSTRUCTION);
Text text = createText(localName, attributes, true); TextStyle text = createText(localName, attributes, true);
mCurrentRule.addStyle(text); mCurrentRule.addStyle(text);
} else if ("circle".equals(localName)) { } else if ("circle".equals(localName)) {
checkState(localName, Element.RENDERING_INSTRUCTION); checkState(localName, Element.RENDERING_INSTRUCTION);
Circle circle = createCircle(localName, attributes, mLevels++); CircleStyle circle = createCircle(localName, attributes, mLevels++);
mCurrentRule.addStyle(circle); mCurrentRule.addStyle(circle);
} else if ("line".equals(localName)) { } else if ("line".equals(localName)) {
@ -247,10 +247,10 @@ public class XmlThemeBuilder extends DefaultHandler {
checkState(localName, Element.RENDERING_INSTRUCTION); checkState(localName, Element.RENDERING_INSTRUCTION);
String style = attributes.getValue("use"); String style = attributes.getValue("use");
if (style == null) { if (style == null) {
Text text = createText(localName, attributes, false); TextStyle text = createText(localName, attributes, false);
mCurrentRule.addStyle(text); mCurrentRule.addStyle(text);
} else { } else {
Text pt = (Text) mStyles.get(TEXT_STYLE + style); TextStyle pt = (TextStyle) mStyles.get(TEXT_STYLE + style);
if (pt != null) if (pt != null)
mCurrentRule.addStyle(pt); mCurrentRule.addStyle(pt);
else else
@ -259,7 +259,7 @@ public class XmlThemeBuilder extends DefaultHandler {
} else if ("symbol".equals(localName)) { } else if ("symbol".equals(localName)) {
checkState(localName, Element.RENDERING_INSTRUCTION); checkState(localName, Element.RENDERING_INSTRUCTION);
Symbol symbol = createSymbol(localName, attributes); SymbolStyle symbol = createSymbol(localName, attributes);
mCurrentRule.addStyle(symbol); mCurrentRule.addStyle(symbol);
} else if ("outline".equals(localName)) { } else if ("outline".equals(localName)) {
@ -268,7 +268,7 @@ public class XmlThemeBuilder extends DefaultHandler {
} else if ("extrusion".equals(localName)) { } else if ("extrusion".equals(localName)) {
checkState(localName, Element.RENDERING_INSTRUCTION); checkState(localName, Element.RENDERING_INSTRUCTION);
Extrusion extrusion = createExtrusion(localName, attributes, mLevels++); ExtrusionStyle extrusion = createExtrusion(localName, attributes, mLevels++);
mCurrentRule.addStyle(extrusion); mCurrentRule.addStyle(extrusion);
} else if ("atlas".equals(localName)) { } else if ("atlas".equals(localName)) {
@ -306,17 +306,17 @@ public class XmlThemeBuilder extends DefaultHandler {
throws SAXException { throws SAXException {
String use = attributes.getValue("use"); String use = attributes.getValue("use");
Line style = null; LineStyle style = null;
if (use != null) { if (use != null) {
style = (Line) mStyles.get(LINE_STYLE + use); style = (LineStyle) mStyles.get(LINE_STYLE + use);
if (style == null) { if (style == null) {
log.debug("missing line style 'use': " + use); log.debug("missing line style 'use': " + use);
return; return;
} }
} }
Line line = createLine(style, localName, attributes, mLevels++, false); LineStyle line = createLine(style, localName, attributes, mLevels++, false);
if (isStyle) { if (isStyle) {
mStyles.put(LINE_STYLE + line.style, line); mStyles.put(LINE_STYLE + line.style, line);
@ -337,7 +337,7 @@ public class XmlThemeBuilder extends DefaultHandler {
* is outline layer * is outline layer
* @return a new Line with the given rendering attributes. * @return a new Line with the given rendering attributes.
*/ */
private Line createLine(Line line, String elementName, Attributes attributes, private LineStyle createLine(LineStyle line, String elementName, Attributes attributes,
int level, boolean isOutline) { int level, boolean isOutline) {
LineBuilder b = mLineBuilder.set(line); LineBuilder b = mLineBuilder.set(line);
b.isOutline(isOutline); b.isOutline(isOutline);
@ -414,17 +414,17 @@ public class XmlThemeBuilder extends DefaultHandler {
throws SAXException { throws SAXException {
String use = attributes.getValue("use"); String use = attributes.getValue("use");
Area style = null; AreaStyle style = null;
if (use != null) { if (use != null) {
style = (Area) mStyles.get(AREA_STYLE + use); style = (AreaStyle) mStyles.get(AREA_STYLE + use);
if (style == null) { if (style == null) {
log.debug("missing area style 'use': " + use); log.debug("missing area style 'use': " + use);
return; return;
} }
} }
Area area = createArea(style, localName, attributes, mLevels); AreaStyle area = createArea(style, localName, attributes, mLevels);
mLevels += 2; mLevels += 2;
if (isStyle) { if (isStyle) {
@ -437,7 +437,7 @@ public class XmlThemeBuilder extends DefaultHandler {
/** /**
* @return a new Area with the given rendering attributes. * @return a new Area with the given rendering attributes.
*/ */
private Area createArea(Area area, String elementName, Attributes attributes, int level) { private AreaStyle createArea(AreaStyle area, String elementName, Attributes attributes, int level) {
AreaBuilder b = mAreaBuilder.set(area); AreaBuilder b = mAreaBuilder.set(area);
b.level(level); b.level(level);
@ -494,7 +494,7 @@ public class XmlThemeBuilder extends DefaultHandler {
private void addOutline(String style) { private void addOutline(String style) {
if (style != null) { if (style != null) {
Line line = (Line) mStyles.get(OUTLINE_STYLE + style); LineStyle line = (LineStyle) mStyles.get(OUTLINE_STYLE + style);
if (line != null && line.outline) if (line != null && line.outline)
mCurrentRule.addStyle(line); mCurrentRule.addStyle(line);
else else
@ -644,7 +644,7 @@ public class XmlThemeBuilder extends DefaultHandler {
* ... * ...
* @return a new Text with the given rendering attributes. * @return a new Text with the given rendering attributes.
*/ */
private Text createText(String elementName, Attributes attributes, boolean caption) { private TextStyle createText(String elementName, Attributes attributes, boolean caption) {
TextBuilder b = mTextBuilder.reset(); TextBuilder b = mTextBuilder.reset();
b.caption = caption; b.caption = caption;
@ -706,7 +706,7 @@ public class XmlThemeBuilder extends DefaultHandler {
* the drawing level of this instruction. * the drawing level of this instruction.
* @return a new Circle with the given rendering attributes. * @return a new Circle with the given rendering attributes.
*/ */
private static Circle createCircle(String elementName, Attributes attributes, int level) { private static CircleStyle createCircle(String elementName, Attributes attributes, int level) {
Float radius = null; Float radius = null;
boolean scaleRadius = false; boolean scaleRadius = false;
int fill = Color.TRANSPARENT; int fill = Color.TRANSPARENT;
@ -740,7 +740,7 @@ public class XmlThemeBuilder extends DefaultHandler {
validateNonNegative("radius", radius); validateNonNegative("radius", radius);
validateNonNegative("stroke-width", strokeWidth); validateNonNegative("stroke-width", strokeWidth);
return new Circle(radius, scaleRadius, fill, stroke, strokeWidth, level); return new CircleStyle(radius, scaleRadius, fill, stroke, strokeWidth, level);
} }
/** /**
@ -775,7 +775,7 @@ public class XmlThemeBuilder extends DefaultHandler {
/** /**
* @return a new Symbol with the given rendering attributes. * @return a new Symbol with the given rendering attributes.
*/ */
private Symbol createSymbol(String elementName, Attributes attributes) { private SymbolStyle createSymbol(String elementName, Attributes attributes) {
String src = null; String src = null;
for (int i = 0; i < attributes.getLength(); ++i) { for (int i = 0; i < attributes.getLength(); ++i) {
@ -790,10 +790,10 @@ public class XmlThemeBuilder extends DefaultHandler {
validateExists("src", src, elementName); validateExists("src", src, elementName);
return new Symbol(getAtlasRegion(src)); return new SymbolStyle(getAtlasRegion(src));
} }
private Extrusion createExtrusion(String elementName, Attributes attributes, int level) { private ExtrusionStyle createExtrusion(String elementName, Attributes attributes, int level) {
int colorSide = 0; int colorSide = 0;
int colorTop = 0; int colorTop = 0;
int colorLine = 0; int colorLine = 0;
@ -819,7 +819,7 @@ public class XmlThemeBuilder extends DefaultHandler {
logUnknownAttribute(elementName, name, value, i); logUnknownAttribute(elementName, name, value, i);
} }
return new Extrusion(level, colorSide, colorTop, colorLine, defaultHeight); return new ExtrusionStyle(level, colorSide, colorTop, colorLine, defaultHeight);
} }
public static void validateNonNegative(String name, float value) { public static void validateNonNegative(String name, float value) {

View File

@ -22,7 +22,7 @@ import org.oscim.backend.canvas.Color;
import org.oscim.renderer.elements.TextureItem; import org.oscim.renderer.elements.TextureItem;
import org.oscim.theme.IRenderTheme.Callback; import org.oscim.theme.IRenderTheme.Callback;
public class Area extends RenderStyle { public class AreaStyle extends RenderStyle {
/** Drawing order level */ /** Drawing order level */
private final int level; private final int level;
@ -46,13 +46,13 @@ public class Area extends RenderStyle {
public final TextureItem texture; public final TextureItem texture;
/** Outline */ /** Outline */
public final Line outline; public final LineStyle outline;
public Area(int color) { public AreaStyle(int color) {
this(0, color); this(0, color);
} }
public Area(int level, int color) { public AreaStyle(int level, int color) {
this.level = level; this.level = level;
this.style = ""; this.style = "";
this.fadeScale = -1; this.fadeScale = -1;
@ -63,7 +63,7 @@ public class Area extends RenderStyle {
this.outline = null; this.outline = null;
} }
public Area(AreaBuilder b) { public AreaStyle(AreaBuilder b) {
this.level = b.level; this.level = b.level;
this.style = b.style; this.style = b.style;
this.fadeScale = b.fadeScale; this.fadeScale = b.fadeScale;
@ -77,7 +77,7 @@ public class Area extends RenderStyle {
b.outlineWidth == b.outline.width) { b.outlineWidth == b.outline.width) {
this.outline = b.outline; this.outline = b.outline;
} else if (b.outlineColor != Color.TRANSPARENT) { } else if (b.outlineColor != Color.TRANSPARENT) {
this.outline = new Line(-1, b.outlineColor, b.outlineWidth); this.outline = new LineStyle(-1, b.outlineColor, b.outlineWidth);
} else { } else {
this.outline = null; this.outline = null;
} }
@ -91,8 +91,8 @@ public class Area extends RenderStyle {
outline.update(); outline.update();
} }
public Area current() { public AreaStyle current() {
return (Area) (mCurrent == null ? this : mCurrent); return (AreaStyle) (mCurrent == null ? this : mCurrent);
} }
@Override @Override
@ -106,7 +106,7 @@ public class Area extends RenderStyle {
public static class AreaBuilder { public static class AreaBuilder {
public int level; public int level;
public String style; public String style;
public Line outline; public LineStyle outline;
public int color; public int color;
public int fadeScale; public int fadeScale;
public int blendColor; public int blendColor;
@ -117,7 +117,7 @@ public class Area extends RenderStyle {
public TextureItem texture; public TextureItem texture;
public AreaBuilder set(Area area) { public AreaBuilder set(AreaStyle area) {
if (area == null) if (area == null)
return reset(); return reset();
@ -220,8 +220,8 @@ public class Area extends RenderStyle {
return this; return this;
} }
public Area build() { public AreaStyle build() {
return new Area(this); return new AreaStyle(this);
} }
} }
} }

View File

@ -22,7 +22,7 @@ import org.oscim.theme.IRenderTheme.Callback;
/** /**
* Represents a round area on the map. * Represents a round area on the map.
*/ */
public final class Circle extends RenderStyle { public final class CircleStyle extends RenderStyle {
public final int level; public final int level;
@ -33,7 +33,7 @@ public final class Circle extends RenderStyle {
public final boolean scaleRadius; public final boolean scaleRadius;
public final float strokeWidth; public final float strokeWidth;
public Circle(Float radius, boolean scaleRadius, int fill, int stroke, public CircleStyle(Float radius, boolean scaleRadius, int fill, int stroke,
float strokeWidth, int level) { float strokeWidth, int level) {
super(); super();

View File

@ -19,9 +19,9 @@ package org.oscim.theme.styles;
import org.oscim.backend.canvas.Color; import org.oscim.backend.canvas.Color;
import org.oscim.theme.IRenderTheme.Callback; import org.oscim.theme.IRenderTheme.Callback;
public class Extrusion extends RenderStyle { public class ExtrusionStyle extends RenderStyle {
public Extrusion(int level, int colorSides, int colorTop, int colorLine, int defaultHeight) { public ExtrusionStyle(int level, int colorSides, int colorTop, int colorLine, int defaultHeight) {
this.colors = new float[16]; this.colors = new float[16];
fillColors(colorSides, colorTop, colorLine, colors); fillColors(colorSides, colorTop, colorLine, colors);

View File

@ -23,7 +23,7 @@ import org.oscim.backend.canvas.Color;
import org.oscim.backend.canvas.Paint.Cap; import org.oscim.backend.canvas.Paint.Cap;
import org.oscim.theme.IRenderTheme.Callback; import org.oscim.theme.IRenderTheme.Callback;
public final class Line extends RenderStyle { public final class LineStyle extends RenderStyle {
final int level; final int level;
public final String style; public final String style;
@ -39,7 +39,7 @@ public final class Line extends RenderStyle {
public final int stippleColor; public final int stippleColor;
public final float stippleWidth; public final float stippleWidth;
private Line(LineBuilder builer) { private LineStyle(LineBuilder builer) {
this.level = builer.level; this.level = builer.level;
this.style = builer.style; this.style = builer.style;
this.width = builer.width; this.width = builer.width;
@ -54,7 +54,7 @@ public final class Line extends RenderStyle {
this.stippleWidth = builer.stippleWidth; this.stippleWidth = builer.stippleWidth;
} }
public Line(int level, String style, int color, float width, public LineStyle(int level, String style, int color, float width,
Cap cap, boolean fixed, Cap cap, boolean fixed,
int stipple, int stippleColor, float stippleWidth, int stipple, int stippleColor, float stippleWidth,
int fadeScale, float blur, boolean isOutline) { int fadeScale, float blur, boolean isOutline) {
@ -76,15 +76,15 @@ public final class Line extends RenderStyle {
this.fadeScale = fadeScale; this.fadeScale = fadeScale;
} }
public Line(int stroke, float width) { public LineStyle(int stroke, float width) {
this(0, "", stroke, width, Cap.BUTT, true, 0, 0, 0, -1, 0, false); this(0, "", stroke, width, Cap.BUTT, true, 0, 0, 0, -1, 0, false);
} }
public Line(int level, int stroke, float width) { public LineStyle(int level, int stroke, float width) {
this(level, "", stroke, width, Cap.BUTT, true, 0, 0, 0, -1, 0, false); this(level, "", stroke, width, Cap.BUTT, true, 0, 0, 0, -1, 0, false);
} }
public Line(int stroke, float width, Cap cap) { public LineStyle(int stroke, float width, Cap cap) {
this(0, "", stroke, width, cap, true, 0, 0, 0, -1, 0, false); this(0, "", stroke, width, cap, true, 0, 0, 0, -1, 0, false);
} }
@ -109,7 +109,7 @@ public final class Line extends RenderStyle {
public int stippleColor; public int stippleColor;
public float stippleWidth; public float stippleWidth;
public LineBuilder set(Line line) { public LineBuilder set(LineStyle line) {
if (line == null) if (line == null)
return reset(); return reset();
this.level = line.level; this.level = line.level;
@ -195,8 +195,8 @@ public final class Line extends RenderStyle {
return this; return this;
} }
public Line build() { public LineStyle build() {
return new Line(this); return new LineStyle(this);
} }
} }
} }

View File

@ -23,11 +23,11 @@ import org.oscim.theme.IRenderTheme.Callback;
/** /**
* Represents an icon on the map. * Represents an icon on the map.
*/ */
public final class Symbol extends RenderStyle { public final class SymbolStyle extends RenderStyle {
public final TextureRegion texture; public final TextureRegion texture;
public Symbol(TextureRegion symbol) { public SymbolStyle(TextureRegion symbol) {
this.texture = symbol; this.texture = symbol;
} }

View File

@ -25,7 +25,7 @@ import org.oscim.backend.canvas.Paint.FontStyle;
import org.oscim.renderer.atlas.TextureRegion; import org.oscim.renderer.atlas.TextureRegion;
import org.oscim.theme.IRenderTheme.Callback; import org.oscim.theme.IRenderTheme.Callback;
public final class Text extends RenderStyle { public final class TextStyle extends RenderStyle {
public static class TextBuilder { public static class TextBuilder {
@ -64,15 +64,15 @@ public final class Text extends RenderStyle {
reset(); reset();
} }
public Text build() { public TextStyle build() {
Text t = new Text(this); TextStyle t = new TextStyle(this);
t.fontHeight = t.paint.getFontHeight(); t.fontHeight = t.paint.getFontHeight();
t.fontDescent = t.paint.getFontDescent(); t.fontDescent = t.paint.getFontDescent();
return t; return t;
} }
public Text buildInternal() { public TextStyle buildInternal() {
return new Text(this); return new TextStyle(this);
} }
public TextBuilder setStyle(String style) { public TextBuilder setStyle(String style) {
@ -136,7 +136,7 @@ public final class Text extends RenderStyle {
} }
} }
Text(TextBuilder tb) { TextStyle(TextBuilder tb) {
this.style = tb.style; this.style = tb.style;
this.textKey = tb.textKey; this.textKey = tb.textKey;
this.caption = tb.caption; this.caption = tb.caption;