cleanup + formatting
This commit is contained in:
parent
f26cc5b062
commit
fba6f44f30
@ -82,10 +82,6 @@ public class RenderTheme implements IRenderTheme {
|
|||||||
mElementCache[2] = new ElementCache(Element.POLY);
|
mElementCache[2] = new ElementCache(Element.POLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.oscim.theme.IRenderTheme#destroy()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
|
|
||||||
@ -98,29 +94,16 @@ public class RenderTheme implements IRenderTheme {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.oscim.theme.IRenderTheme#getLevels()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int getLevels() {
|
public int getLevels() {
|
||||||
return mLevels;
|
return mLevels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.oscim.theme.IRenderTheme#getMapBackground()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int getMapBackground() {
|
public int getMapBackground() {
|
||||||
return mMapBackground;
|
return mMapBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.oscim.theme.IRenderTheme#matchWay(org.oscim.core.Tag[], byte,
|
|
||||||
* boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public RenderInstruction[] matchElement(MapElement element, int zoomLevel) {
|
public RenderInstruction[] matchElement(MapElement element, int zoomLevel) {
|
||||||
|
|
||||||
@ -143,7 +126,7 @@ public class RenderTheme implements IRenderTheme {
|
|||||||
|
|
||||||
synchronized (cache) {
|
synchronized (cache) {
|
||||||
|
|
||||||
if (cache.prevItem == null || (cache.prevItem.zoom & zoomMask) == 0) {
|
if ((cache.prevItem == null) || (cache.prevItem.zoom & zoomMask) == 0) {
|
||||||
// previous instructions zoom does not match
|
// previous instructions zoom does not match
|
||||||
cache.cacheKey.set(element.tags, null);
|
cache.cacheKey.set(element.tags, null);
|
||||||
} else {
|
} else {
|
||||||
@ -266,10 +249,6 @@ public class RenderTheme implements IRenderTheme {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.oscim.theme.IRenderTheme#scaleStrokeWidth(float)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void scaleStrokeWidth(float scaleFactor) {
|
public void scaleStrokeWidth(float scaleFactor) {
|
||||||
|
|
||||||
@ -277,10 +256,6 @@ public class RenderTheme implements IRenderTheme {
|
|||||||
mRules[i].scaleStrokeWidth(scaleFactor * mBaseStrokeWidth);
|
mRules[i].scaleStrokeWidth(scaleFactor * mBaseStrokeWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.oscim.theme.IRenderTheme#scaleTextSize(float)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void scaleTextSize(float scaleFactor) {
|
public void scaleTextSize(float scaleFactor) {
|
||||||
|
|
||||||
|
@ -110,16 +110,16 @@ public class RenderThemeHandler extends DefaultHandler {
|
|||||||
*/
|
*/
|
||||||
public static void logUnknownAttribute(String element, String name,
|
public static void logUnknownAttribute(String element, String name,
|
||||||
String value, int attributeIndex) {
|
String value, int attributeIndex) {
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
stringBuilder.append("unknown attribute in element ");
|
sb.append("unknown attribute in element ");
|
||||||
stringBuilder.append(element);
|
sb.append(element);
|
||||||
stringBuilder.append(" (");
|
sb.append(" (");
|
||||||
stringBuilder.append(attributeIndex);
|
sb.append(attributeIndex);
|
||||||
stringBuilder.append("): ");
|
sb.append("): ");
|
||||||
stringBuilder.append(name);
|
sb.append(name);
|
||||||
stringBuilder.append('=');
|
sb.append('=');
|
||||||
stringBuilder.append(value);
|
sb.append(value);
|
||||||
Log.d(TAG, stringBuilder.toString());
|
Log.d(TAG, sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private final ArrayList<Rule> mRulesList = new ArrayList<Rule>();
|
private final ArrayList<Rule> mRulesList = new ArrayList<Rule>();
|
||||||
@ -140,7 +140,6 @@ public class RenderThemeHandler extends DefaultHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mRenderTheme.complete(mRulesList, mLevel);
|
mRenderTheme.complete(mRulesList, mLevel);
|
||||||
// mRenderTheme.mTextureAtlas = mTextureAtlas;
|
|
||||||
|
|
||||||
mTextureAtlas = null;
|
mTextureAtlas = null;
|
||||||
mRulesList.clear();
|
mRulesList.clear();
|
||||||
@ -281,8 +280,8 @@ public class RenderThemeHandler extends DefaultHandler {
|
|||||||
|
|
||||||
if ((symbol.texture = mTextureAtlas.getTextureRegion(symbol.src)) == null)
|
if ((symbol.texture = mTextureAtlas.getTextureRegion(symbol.src)) == null)
|
||||||
Log.d(TAG, "missing texture atlas item '" + symbol.src + "'");
|
Log.d(TAG, "missing texture atlas item '" + symbol.src + "'");
|
||||||
else
|
//else
|
||||||
Log.d(TAG, "using atlas item '" + symbol.src + "'");
|
// Log.d(TAG, "using atlas item '" + symbol.src + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (ELEMENT_NAME_USE_STYLE_LINE.equals(localName)) {
|
else if (ELEMENT_NAME_USE_STYLE_LINE.equals(localName)) {
|
||||||
|
@ -223,7 +223,6 @@ public abstract class Rule {
|
|||||||
// check subrules
|
// check subrules
|
||||||
for (Rule subRule : mSubRuleArray)
|
for (Rule subRule : mSubRuleArray)
|
||||||
subRule.matchElement(type, tags, zoomLevel, matchingList);
|
subRule.matchElement(type, tags, zoomLevel, matchingList);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +243,6 @@ public abstract class Rule {
|
|||||||
|
|
||||||
for (Rule subRule : mSubRuleArray)
|
for (Rule subRule : mSubRuleArray)
|
||||||
subRule.onComplete();
|
subRule.onComplete();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
@ -253,7 +251,6 @@ public abstract class Rule {
|
|||||||
|
|
||||||
for (Rule subRule : mSubRuleArray)
|
for (Rule subRule : mSubRuleArray)
|
||||||
subRule.onDestroy();
|
subRule.onDestroy();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void scaleStrokeWidth(float scaleFactor) {
|
public void scaleStrokeWidth(float scaleFactor) {
|
||||||
@ -262,7 +259,6 @@ public abstract class Rule {
|
|||||||
|
|
||||||
for (Rule subRule : mSubRuleArray)
|
for (Rule subRule : mSubRuleArray)
|
||||||
subRule.scaleStrokeWidth(scaleFactor);
|
subRule.scaleStrokeWidth(scaleFactor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void scaleTextSize(float scaleFactor) {
|
public void scaleTextSize(float scaleFactor) {
|
||||||
@ -270,6 +266,5 @@ public abstract class Rule {
|
|||||||
ri.scaleTextSize(scaleFactor);
|
ri.scaleTextSize(scaleFactor);
|
||||||
for (Rule subRule : mSubRuleArray)
|
for (Rule subRule : mSubRuleArray)
|
||||||
subRule.scaleTextSize(scaleFactor);
|
subRule.scaleTextSize(scaleFactor);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user