extract theme assets to vtm-themes project
@ -7,3 +7,4 @@ include ':vtm-gdx-desktop'
|
||||
include ':vtm-gdx-html'
|
||||
include ':vtm-gdx-android'
|
||||
include ':vtm-android-app'
|
||||
include ':vtm-themes'
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit da1e3b8aa8c523e5e374d8e7329def769edb3c0a
|
||||
Subproject commit 2fc23ee26b0eb99e13fba3c65177c761f3b6cdf1
|
@ -10,18 +10,19 @@ buildscript {
|
||||
apply plugin: 'android'
|
||||
|
||||
dependencies {
|
||||
//compile fileTree(dir: 'libs', include: '*.jar')
|
||||
compile project(':vtm-android')
|
||||
compile fileTree(dir: 'libs', include: '*.jar')
|
||||
compile project(':vtm-themes')
|
||||
}
|
||||
|
||||
task copyAssets(type: Copy) {
|
||||
from "$rootDir/vtm/assets"
|
||||
into "assets"
|
||||
include '**/*'
|
||||
}
|
||||
// task copyAssets(type: Copy) {
|
||||
// from "$rootDir/vtm/assets"
|
||||
// into "assets"
|
||||
// include '**/*'
|
||||
// }
|
||||
|
||||
tasks.withType(JavaCompile) { compileTask ->
|
||||
compileTask.dependsOn copyAssets }
|
||||
// tasks.withType(JavaCompile) { compileTask ->
|
||||
// compileTask.dependsOn copyAssets }
|
||||
|
||||
android {
|
||||
compileSdkVersion 19
|
||||
@ -60,12 +61,12 @@ eclipse.classpath {
|
||||
|
||||
// Manipulation of the classpath XML before merging local
|
||||
// and generated copies
|
||||
beforeMerged { classpath ->
|
||||
// Remove all source entries to avoid overlap
|
||||
classpath.entries.removeAll() { c ->
|
||||
c.kind == 'src'
|
||||
}
|
||||
}
|
||||
// beforeMerged { classpath ->
|
||||
// // Remove all source entries to avoid overlap
|
||||
// classpath.entries.removeAll() { c ->
|
||||
// c.kind == 'src'
|
||||
// }
|
||||
// }
|
||||
|
||||
// Direct manipulation of the generated classpath XML
|
||||
withXml {
|
||||
@ -82,14 +83,13 @@ eclipse.classpath {
|
||||
}
|
||||
|
||||
eclipse.project {
|
||||
natures = ['com.android.ide.eclipse.adt.AndroidNature',
|
||||
natures = ['com.android.ide.eclipse.adt.AndroidNature',
|
||||
'org.eclipse.jdt.core.javanature']
|
||||
|
||||
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
|
||||
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
|
||||
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'
|
||||
|
||||
linkedResource name: 'assets', type: '2',
|
||||
locationUri: 'PARENT-1-PROJECT_LOC/vtm/assets'
|
||||
linkedResource name: 'assets', type: '2',
|
||||
locationUri: 'PARENT-1-PROJECT_LOC/vtm-themes/resources/assets'
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.theme.InternalRenderTheme;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
import org.oscim.tiling.source.mapfile.MapFileTileSource;
|
||||
import org.oscim.tiling.source.mapfile.MapInfo;
|
||||
|
||||
@ -68,17 +68,17 @@ public class MapsforgeMapActivity extends MapActivity {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.theme_default:
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_tubes:
|
||||
mMap.setTheme(InternalRenderTheme.TRONRENDER);
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmarender:
|
||||
mMap.setTheme(InternalRenderTheme.OSMARENDER);
|
||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
}
|
||||
@ -100,17 +100,17 @@ public class MapsforgeMapActivity extends MapActivity {
|
||||
if (mTileSource.setMapFile(file)) {
|
||||
|
||||
VectorTileLayer l = mMap.setBaseMap(mTileSource);
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
mMap.layers().add(new LabelLayer(mMap, l));
|
||||
|
||||
MapInfo info = mTileSource.getMapInfo();
|
||||
if (info.boundingBox != null) {
|
||||
MapPosition pos = new MapPosition();
|
||||
pos.setByBoundingBox(info.boundingBox,
|
||||
Tile.SIZE * 4,
|
||||
Tile.SIZE * 4);
|
||||
Tile.SIZE * 4,
|
||||
Tile.SIZE * 4);
|
||||
mMap.setMapPosition(pos);
|
||||
Samples.log.debug("set position {}",pos);
|
||||
Samples.log.debug("set position {}", pos);
|
||||
} else if (info.mapCenter != null) {
|
||||
|
||||
double scale = 1 << 8;
|
||||
|
@ -18,7 +18,7 @@
|
||||
import org.oscim.layers.tile.vector.BuildingLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.map.Layers;
|
||||
import org.oscim.theme.InternalRenderTheme;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
@ -36,9 +36,10 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
|
||||
//layers.add(new TileGridLayer(mMap));
|
||||
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
//mMap.setTheme(InternalRenderTheme.TRONRENDER);
|
||||
//mMap.setTheme(InternalRenderTheme.OSMARENDER);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
//mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
//mMap.setTheme(VtmThemes.TRON2);
|
||||
//mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
|
||||
mMap.setMapPosition(53.08, 8.83, Math.pow(2, 10));
|
||||
}
|
||||
@ -54,17 +55,17 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.theme_default:
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_tubes:
|
||||
mMap.setTheme(InternalRenderTheme.TRONRENDER);
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmarender:
|
||||
mMap.setTheme(InternalRenderTheme.OSMARENDER);
|
||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
}
|
||||
@ -77,18 +78,18 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
mMapView.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InternalRenderTheme t;
|
||||
VtmThemes t;
|
||||
if (i == 0)
|
||||
t = InternalRenderTheme.DEFAULT;
|
||||
t = VtmThemes.DEFAULT;
|
||||
else if (i == 1)
|
||||
t = InternalRenderTheme.TRONRENDER;
|
||||
t = VtmThemes.TRONRENDER;
|
||||
else
|
||||
t = InternalRenderTheme.OSMARENDER;
|
||||
t = VtmThemes.OSMARENDER;
|
||||
|
||||
mMapView.getMap().setTheme(t);
|
||||
|
||||
loooop((i + 1) % 3);
|
||||
}
|
||||
}, 300 + (int)(Math.random() * 200));
|
||||
}, 300 + (int) (Math.random() * 200));
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit cc278b239cea8bfc16f1915fb23f5e3ad93b2c7a
|
||||
Subproject commit 416f8e79e2128394575d3b302d5178cb56fd1d25
|
@ -9,20 +9,25 @@ buildscript {
|
||||
|
||||
apply plugin: 'android'
|
||||
|
||||
ext.gdxVersion = "1.0-SNAPSHOT"
|
||||
|
||||
dependencies {
|
||||
compile project(':vtm-gdx')
|
||||
compile project(':vtm-themes')
|
||||
compile files('../vtm-ext-libs/gdx/gdx-backend-android.jar')
|
||||
compile fileTree(dir: 'libs', include: '*.jar')
|
||||
//natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
|
||||
//natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
|
||||
//compile fileTree(dir: 'libs', include: '*.jar')
|
||||
}
|
||||
|
||||
task copyAssets(type: Copy) {
|
||||
from "$rootDir/vtm/assets"
|
||||
into "assets"
|
||||
include '**/*'
|
||||
}
|
||||
// task copyAssets(type: Copy) {
|
||||
// from "$rootDir/vtm/assets"
|
||||
// into "assets"
|
||||
// include '**/*'
|
||||
// }
|
||||
|
||||
tasks.withType(JavaCompile) { compileTask ->
|
||||
compileTask.dependsOn copyAssets }
|
||||
// tasks.withType(JavaCompile) { compileTask ->
|
||||
// compileTask.dependsOn copyAssets }
|
||||
|
||||
android {
|
||||
compileSdkVersion 19
|
||||
@ -83,14 +88,14 @@ eclipse.classpath {
|
||||
}
|
||||
|
||||
eclipse.project {
|
||||
natures = ['com.android.ide.eclipse.adt.AndroidNature',
|
||||
natures = ['com.android.ide.eclipse.adt.AndroidNature',
|
||||
'org.eclipse.jdt.core.javanature']
|
||||
|
||||
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
|
||||
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
|
||||
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'
|
||||
|
||||
linkedResource name: 'assets', type: '2',
|
||||
linkedResource name: 'assets', type: '2',
|
||||
locationUri: 'PARENT-1-PROJECT_LOC/vtm/assets'
|
||||
|
||||
// use extracted jni .so in eclipse
|
||||
|
@ -5,14 +5,14 @@ apply plugin: 'application'
|
||||
|
||||
mainClassName = 'org.oscim.gdx.GdxMapApp'
|
||||
|
||||
task copyAssets(type: Copy) {
|
||||
from "$rootDir/vtm/assets"
|
||||
into "assets"
|
||||
include '**/*'
|
||||
}
|
||||
// task copyAssets(type: Copy) {
|
||||
// from "$rootDir/vtm/assets"
|
||||
// into "assets"
|
||||
// include '**/*'
|
||||
// }
|
||||
|
||||
tasks.withType(JavaCompile) { compileTask ->
|
||||
compileTask.dependsOn copyAssets }
|
||||
// tasks.withType(JavaCompile) { compileTask ->
|
||||
// compileTask.dependsOn copyAssets }
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
@ -25,15 +25,15 @@ run { ignoreExitValue = true }
|
||||
|
||||
dependencies {
|
||||
compile project(':vtm-gdx')
|
||||
compile project(':vtm-themes')
|
||||
compile files('../vtm-ext-libs/gdx/gdx-backend-lwjgl.jar')
|
||||
compile files('../vtm-ext-libs/gdx/gdx-backend-lwjgl-natives.jar')
|
||||
compile files('../vtm-ext-libs/gdx/gdx-natives.jar')
|
||||
compile files('../vtm-ext-libs/gdx/vtm-jni-natives.jar')
|
||||
//compile 'org.slf4j:slf4j-api:1.7.5'
|
||||
compile 'org.slf4j:slf4j-simple:1.7.5'
|
||||
}
|
||||
|
||||
eclipse.project {
|
||||
linkedResource name: 'assets', type: '2',
|
||||
locationUri: 'PARENT-1-PROJECT_LOC/vtm/assets'
|
||||
locationUri: 'PARENT-1-PROJECT_LOC/vtm-themes/resources/assets'
|
||||
}
|
@ -8,6 +8,7 @@ sourceSets {
|
||||
|
||||
dependencies {
|
||||
compile project(':vtm')
|
||||
compile project(':vtm-themes')
|
||||
compile files('../vtm-ext-libs/gdx/gdx.jar')
|
||||
//compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
}
|
@ -27,7 +27,7 @@ import org.oscim.map.Layers;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.map.ViewController;
|
||||
import org.oscim.renderer.MapRenderer;
|
||||
import org.oscim.theme.InternalRenderTheme;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
import org.oscim.tiling.TileSource;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
@ -133,7 +133,7 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
|
||||
if (tileSource != null) {
|
||||
mMapLayer = mMap.setBaseMap(tileSource);
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
|
||||
if (buildings)
|
||||
layers.add(new BuildingLayer(mMap, mMapLayer));
|
||||
@ -292,17 +292,17 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
break;
|
||||
|
||||
case Input.Keys.D:
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
case Input.Keys.T:
|
||||
mMap.setTheme(InternalRenderTheme.TRONRENDER);
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
case Input.Keys.R:
|
||||
mMap.setTheme(InternalRenderTheme.OSMARENDER);
|
||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
|
12
vtm-themes/build.gradle
Normal file
@ -0,0 +1,12 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
|
||||
|
||||
dependencies {
|
||||
compile project(':vtm')
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
main.resources.srcDirs = ['resources']
|
||||
}
|
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 728 B After Width: | Height: | Size: 728 B |
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
Before Width: | Height: | Size: 834 B After Width: | Height: | Size: 834 B |
Before Width: | Height: | Size: 893 B After Width: | Height: | Size: 893 B |
Before Width: | Height: | Size: 849 B After Width: | Height: | Size: 849 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
@ -24,7 +24,7 @@ import org.oscim.backend.AssetAdapter;
|
||||
/**
|
||||
* Enumeration of all internal rendering themes.
|
||||
*/
|
||||
public enum InternalRenderTheme implements Theme {
|
||||
public enum VtmThemes implements ThemeFile {
|
||||
|
||||
DEFAULT("styles/default.xml"),
|
||||
TRONRENDER("styles/tronrender.xml"),
|
||||
@ -34,7 +34,7 @@ public enum InternalRenderTheme implements Theme {
|
||||
|
||||
private final String mPath;
|
||||
|
||||
private InternalRenderTheme(String path) {
|
||||
private VtmThemes(String path) {
|
||||
mPath = path;
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
|
||||
|
||||
|
||||
dependencies {
|
||||
compile 'org.slf4j:slf4j-api:1.7.6'
|
||||
compile 'com.google.code.findbugs:annotations:2.0.1'
|
||||
|
@ -29,7 +29,7 @@ import org.oscim.layers.tile.vector.OsmTileLayer;
|
||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||
import org.oscim.renderer.MapRenderer;
|
||||
import org.oscim.theme.IRenderTheme;
|
||||
import org.oscim.theme.InternalRenderTheme;
|
||||
import org.oscim.theme.ThemeFile;
|
||||
import org.oscim.theme.ThemeLoader;
|
||||
import org.oscim.tiling.TileSource;
|
||||
import org.oscim.utils.async.AsyncExecutor;
|
||||
@ -146,7 +146,7 @@ public abstract class Map {
|
||||
* Utility function to set theme of base vector-layer and
|
||||
* use map background color from theme.
|
||||
*/
|
||||
public void setTheme(InternalRenderTheme theme) {
|
||||
public void setTheme(ThemeFile theme) {
|
||||
if (mBaseLayer == null) {
|
||||
log.error("No base layer set");
|
||||
throw new IllegalStateException();
|
||||
|
@ -30,7 +30,7 @@ import org.oscim.backend.AssetAdapter;
|
||||
* An ExternalRenderTheme allows for customizing the rendering style of the map
|
||||
* via an XML file.
|
||||
*/
|
||||
public class ExternalRenderTheme implements Theme {
|
||||
public class ExternalRenderTheme implements ThemeFile {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final long mFileModificationDate;
|
||||
|
@ -21,7 +21,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface Theme extends Serializable {
|
||||
public interface ThemeFile extends Serializable {
|
||||
/**
|
||||
* @return an InputStream to read the render theme data from.
|
||||
* @throws FileNotFoundException
|
@ -29,16 +29,6 @@ import org.slf4j.LoggerFactory;
|
||||
public class ThemeLoader {
|
||||
static final Logger log = LoggerFactory.getLogger(ThemeLoader.class);
|
||||
|
||||
/**
|
||||
* Load internal theme, see {@link InternalRenderTheme}.
|
||||
*
|
||||
* @param internalRenderTheme ...
|
||||
* @return ...
|
||||
*/
|
||||
public static IRenderTheme load(InternalRenderTheme internalRenderTheme) {
|
||||
return load((Theme) internalRenderTheme);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load theme from XML file.
|
||||
*
|
||||
@ -50,7 +40,7 @@ public class ThemeLoader {
|
||||
return load(new ExternalRenderTheme(renderThemePath));
|
||||
}
|
||||
|
||||
public static IRenderTheme load(Theme theme) {
|
||||
public static IRenderTheme load(ThemeFile theme) {
|
||||
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
|