split vtm-web into library and vtm-web-app
This commit is contained in:
parent
1bbf77df0c
commit
4e4d4270db
@ -8,6 +8,7 @@ include ':vtm-gdx'
|
|||||||
include ':vtm-desktop'
|
include ':vtm-desktop'
|
||||||
include ':vtm-android-gdx'
|
include ':vtm-android-gdx'
|
||||||
include ':vtm-web'
|
include ':vtm-web'
|
||||||
|
include ':vtm-web-app'
|
||||||
include ':vtm-ios'
|
include ':vtm-ios'
|
||||||
include ':vtm-jeo'
|
include ':vtm-jeo'
|
||||||
include ':vtm-jeo-desktop'
|
include ':vtm-jeo-desktop'
|
||||||
|
4
vtm-web-app/.gitignore
vendored
Normal file
4
vtm-web-app/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
war/
|
||||||
|
assets/
|
||||||
|
gwt-unitCache/
|
||||||
|
build/
|
98
vtm-web-app/build.gradle
Normal file
98
vtm-web-app/build.gradle
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
maven { url 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/' }
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'war'
|
||||||
|
apply plugin: 'jetty'
|
||||||
|
apply plugin: 'gwt'
|
||||||
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
//main.java.srcDirs = ['src', 'src/org/oscim/gdx/emu']
|
||||||
|
main.java.srcDirs = ['src']
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
providedCompile project(':vtm-web')
|
||||||
|
providedCompile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
||||||
|
providedCompile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
||||||
|
providedCompile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
||||||
|
providedCompile 'ru.finam:slf4j-gwt:1.2.1'
|
||||||
|
providedCompile 'org.slf4j:slf4j-api:1.7.5'
|
||||||
|
}
|
||||||
|
|
||||||
|
// explicit dependencies for org.gradle.configureondemand=true
|
||||||
|
evaluationDependsOn(':vtm')
|
||||||
|
evaluationDependsOn(':vtm-themes')
|
||||||
|
evaluationDependsOn(':vtm-gdx')
|
||||||
|
evaluationDependsOn(':vtm-web')
|
||||||
|
|
||||||
|
|
||||||
|
gwt {
|
||||||
|
gwtVersion='2.6.0'
|
||||||
|
modules 'org.oscim.web.VtmWebApp'
|
||||||
|
|
||||||
|
superDev {
|
||||||
|
noPrecompile=true
|
||||||
|
}
|
||||||
|
compiler {
|
||||||
|
enableClosureCompiler = false; // activates -XenableClosureCompiler
|
||||||
|
disableClassMetadata = true; // activates -XdisableClassMetadata
|
||||||
|
disableCastChecking = true; // activates -XdisableCastChecking
|
||||||
|
}
|
||||||
|
|
||||||
|
src += files(sourceSets.main.java.srcDirs)
|
||||||
|
src += files(project(':vtm').sourceSets.main.allJava.srcDirs)
|
||||||
|
src += files(project(':vtm-themes').sourceSets.main.allJava.srcDirs)
|
||||||
|
src += files(project(':vtm-themes').sourceSets.main.resources.srcDirs)
|
||||||
|
src += files(project(':vtm-gdx').sourceSets.main.allJava.srcDirs)
|
||||||
|
src += files(project(':vtm-web').sourceSets.main.allJava.srcDirs)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run jetty with draft compiled war
|
||||||
|
task jettyDraftWar(type: JettyRunWar) {
|
||||||
|
dependsOn draftWar
|
||||||
|
dependsOn.remove('war')
|
||||||
|
webApp=draftWar.archivePath
|
||||||
|
}
|
||||||
|
|
||||||
|
task copyThemeAssets(type: Copy) {
|
||||||
|
from "$rootDir/vtm-themes/resources/assets"
|
||||||
|
into "assets"
|
||||||
|
include '**/*'
|
||||||
|
}
|
||||||
|
|
||||||
|
task copyVtmAssets(type: Copy) {
|
||||||
|
from "$rootDir/vtm/resources/assets"
|
||||||
|
into "assets"
|
||||||
|
include '**/*'
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile) { compileTask ->
|
||||||
|
compileTask.dependsOn copyThemeAssets
|
||||||
|
compileTask.dependsOn copyVtmAssets
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configuring Eclipse classpath
|
||||||
|
eclipse.classpath {
|
||||||
|
|
||||||
|
defaultOutputDir = file('war/WEB-INF/classes')
|
||||||
|
|
||||||
|
//file {
|
||||||
|
// whenMerged { classpath ->
|
||||||
|
// classpath.entries.findAll { entry ->
|
||||||
|
// entry.path == 'src' }*.excludes = ['main','org/oscim/gdx/emu/']
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
@ -137,11 +137,9 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body oncontextmenu="return false;">
|
<body oncontextmenu="return false;">
|
||||||
<script type="text/javascript" src="js/_tessellate.js"></script>
|
- <script type="text/javascript" src="VtmWebApp/js/_tessellate.js"></script>
|
||||||
<script type="text/javascript" src="js/tessellate.js"></script>
|
<script type="text/javascript" src="VtmWebApp/js/tessellate.js"></script>
|
||||||
|
<script type="text/javascript" src="VtmWebApp/VtmWebApp.nocache.js"></script>
|
||||||
<script type="text/javascript"
|
|
||||||
src="org.oscim.gdx.GwtDefinition/org.oscim.gdx.GwtDefinition.nocache.js"></script>
|
|
||||||
|
|
||||||
<div id="credits">
|
<div id="credits">
|
||||||
<a href="https://github.com/hjanetzek/vtm">Source</a>
|
<a href="https://github.com/hjanetzek/vtm">Source</a>
|
@ -1,27 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<module>
|
<module rename-to="VtmWebApp">
|
||||||
<entry-point class="org.oscim.gdx.client.GwtLauncher" />
|
|
||||||
<inherits name="com.google.gwt.xml.XML" />
|
<entry-point class="org.oscim.web.client.GwtLauncher" />
|
||||||
<inherits name="ru.finam.slf4jgwt.logging.gwt.Logging"/>
|
<inherits name="org.oscim.gdx.VtmWeb" />
|
||||||
|
|
||||||
<set-property name='gwt.logging.enabled' value='TRUE' />
|
<set-property name='gwt.logging.enabled' value='TRUE' />
|
||||||
<set-property name='gwt.logging.consoleHandler' value='ENABLED' />
|
<set-property name='gwt.logging.consoleHandler' value='ENABLED' />
|
||||||
<set-property name='gwt.logging.firebugHandler' value='DISABLED' />
|
<set-property name='gwt.logging.firebugHandler' value='DISABLED' />
|
||||||
<set-property name='gwt.logging.popupHandler' value='DISABLED' />
|
<set-property name='gwt.logging.popupHandler' value='DISABLED' />
|
||||||
<set-property name="gwt.logging.logLevel" value="FINE"/>
|
<set-property name="gwt.logging.logLevel" value="FINE"/>
|
||||||
|
|
||||||
<inherits name="GdxMap" />
|
|
||||||
<inherits name="com.badlogic.gdx.backends.gdx_backends_gwt" />
|
|
||||||
<inherits name="com.google.gwt.user.theme.chrome.Chrome" />
|
|
||||||
|
|
||||||
<!-- super dev mode -->
|
<!-- super dev mode -->
|
||||||
<add-linker name="xsiframe"/>
|
<!-- <add-linker name="xsiframe"/>
|
||||||
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
||||||
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
|
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- <super-source path="emu" /> -->
|
||||||
|
|
||||||
<super-source path="emu" />
|
<set-configuration-property name="gdx.assetpath" value="assets" />
|
||||||
|
|
||||||
<set-configuration-property name="gdx.assetpath" value="./assets" />
|
|
||||||
<!-- for gradle build, commend out for eclipse build/devmode -->
|
<!-- for gradle build, commend out for eclipse build/devmode -->
|
||||||
<set-configuration-property name="gdx.assetoutputpath" value="build/gwt/draftOut" />
|
<set-configuration-property name="gdx.assetoutputpath" value="build/gwt/draftOut" />
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.gdx.client;
|
package org.oscim.web.client;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@ -23,8 +23,11 @@ import org.oscim.backend.GL20;
|
|||||||
import org.oscim.backend.GLAdapter;
|
import org.oscim.backend.GLAdapter;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.core.MercatorProjection;
|
import org.oscim.core.MercatorProjection;
|
||||||
|
import org.oscim.gdx.GdxAssets;
|
||||||
import org.oscim.gdx.GdxMap;
|
import org.oscim.gdx.GdxMap;
|
||||||
|
import org.oscim.gdx.client.GwtGdxGraphics;
|
||||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
|
import org.oscim.layers.tile.vector.BuildingLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
@ -56,11 +59,13 @@ class GwtGdxMap extends GdxMap {
|
|||||||
// <- circle/stroke test 800ms firefox, 80ms chromium..
|
// <- circle/stroke test 800ms firefox, 80ms chromium..
|
||||||
// TODO use texture atlas to avoid drawing text-textures
|
// TODO use texture atlas to avoid drawing text-textures
|
||||||
if (GwtApplication.agentInfo().isLinux() && GwtApplication.agentInfo().isFirefox())
|
if (GwtApplication.agentInfo().isLinux() && GwtApplication.agentInfo().isFirefox())
|
||||||
GwtCanvasAdapter.NO_STROKE_TEXT = true;
|
GwtGdxGraphics.NO_STROKE_TEXT = true;
|
||||||
|
|
||||||
CanvasAdapter.g = GwtCanvasAdapter.INSTANCE;
|
GwtGdxGraphics.init();
|
||||||
|
GdxAssets.init("");
|
||||||
CanvasAdapter.textScale = 0.7f;
|
CanvasAdapter.textScale = 0.7f;
|
||||||
GLAdapter.g = (GL20) Gdx.graphics.getGL20();
|
|
||||||
|
GLAdapter.init((GL20) Gdx.graphics.getGL20());
|
||||||
GLAdapter.GDX_WEBGL_QUIRKS = true;
|
GLAdapter.GDX_WEBGL_QUIRKS = true;
|
||||||
MapRenderer.setBackgroundColor(0xffffff);
|
MapRenderer.setBackgroundColor(0xffffff);
|
||||||
//Gdx.app.setLogLevel(Application.LOG_DEBUG);
|
//Gdx.app.setLogLevel(Application.LOG_DEBUG);
|
||||||
@ -173,6 +178,9 @@ class GwtGdxMap extends GdxMap {
|
|||||||
if (l != null) {
|
if (l != null) {
|
||||||
if (!params.containsKey("nolabel"))
|
if (!params.containsKey("nolabel"))
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
|
if (!params.containsKey("nobuildings"))
|
||||||
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
}
|
}
|
||||||
|
|
||||||
mSearchBox = new SearchBox(mMap);
|
mSearchBox = new SearchBox(mMap);
|
@ -14,15 +14,12 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.gdx.client;
|
package org.oscim.web.client;
|
||||||
|
|
||||||
// -draftCompile -localWorkers 2
|
// -draftCompile -localWorkers 2
|
||||||
import org.oscim.core.Tile;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.ApplicationListener;
|
import com.badlogic.gdx.ApplicationListener;
|
||||||
import com.badlogic.gdx.backends.gwt.GwtApplication;
|
import com.badlogic.gdx.backends.gwt.GwtApplication;
|
||||||
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
|
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
|
||||||
import com.badlogic.gdx.backends.gwt.GwtGraphics;
|
|
||||||
import com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderCallback;
|
import com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderCallback;
|
||||||
import com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderState;
|
import com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderState;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
@ -35,8 +32,8 @@ public class GwtLauncher extends GwtApplication {
|
|||||||
@Override
|
@Override
|
||||||
public GwtApplicationConfiguration getConfig() {
|
public GwtApplicationConfiguration getConfig() {
|
||||||
GwtApplicationConfiguration cfg =
|
GwtApplicationConfiguration cfg =
|
||||||
new GwtApplicationConfiguration(GwtGraphics.getWindowWidthJSNI(),
|
new GwtApplicationConfiguration(getWindowWidthJSNI(),
|
||||||
GwtGraphics.getWindowHeightJSNI());
|
getWindowHeightJSNI());
|
||||||
|
|
||||||
DockLayoutPanel p = new DockLayoutPanel(Unit.EM);
|
DockLayoutPanel p = new DockLayoutPanel(Unit.EM);
|
||||||
p.setHeight("100%");
|
p.setHeight("100%");
|
||||||
@ -64,10 +61,10 @@ public class GwtLauncher extends GwtApplication {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApplicationListener getApplicationListener() {
|
public ApplicationListener getApplicationListener() {
|
||||||
if (GwtGraphics.getDevicePixelRatioJSNI() > 1)
|
// if (GwtGraphics.getDevicePixelRatioJSNI() > 1)
|
||||||
Tile.SIZE = 400;
|
// Tile.SIZE = 400;
|
||||||
else
|
// else
|
||||||
Tile.SIZE = 360;
|
// Tile.SIZE = 360;
|
||||||
|
|
||||||
return new GwtGdxMap();
|
return new GwtGdxMap();
|
||||||
}
|
}
|
||||||
@ -86,4 +83,13 @@ public class GwtLauncher extends GwtApplication {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static native int getWindowWidthJSNI() /*-{
|
||||||
|
return $wnd.innerWidth;
|
||||||
|
}-*/;
|
||||||
|
|
||||||
|
public static native int getWindowHeightJSNI() /*-{
|
||||||
|
return $wnd.innerHeight;
|
||||||
|
}-*/;
|
||||||
|
|
||||||
}
|
}
|
@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.gdx.client;
|
package org.oscim.web.client;
|
||||||
|
|
||||||
import com.google.gwt.core.client.JavaScriptObject;
|
import com.google.gwt.core.client.JavaScriptObject;
|
||||||
|
|
@ -14,18 +14,18 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.gdx.client;
|
package org.oscim.web.client;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.oscim.core.BoundingBox;
|
import org.oscim.core.BoundingBox;
|
||||||
import org.oscim.core.GeometryBuffer;
|
import org.oscim.core.GeometryBuffer;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.layers.PathLayer;
|
import org.oscim.layers.PathLayer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.google.gwt.cell.client.AbstractCell;
|
import com.google.gwt.cell.client.AbstractCell;
|
||||||
import com.google.gwt.core.client.JavaScriptObject;
|
import com.google.gwt.core.client.JavaScriptObject;
|
@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.gdx.client;
|
package org.oscim.web.client;
|
||||||
|
|
||||||
import org.oscim.core.GeometryBuffer;
|
import org.oscim.core.GeometryBuffer;
|
||||||
|
|
@ -13,9 +13,10 @@ repositories {
|
|||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'war'
|
//apply plugin: 'war'
|
||||||
apply plugin: 'jetty'
|
//apply plugin: 'jetty'
|
||||||
apply plugin: 'gwt'
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'gwt-base'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@ -23,12 +24,12 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
providedCompile project(':vtm-gdx')
|
compile project(':vtm-gdx')
|
||||||
providedCompile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
||||||
providedCompile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
||||||
providedCompile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
||||||
providedCompile 'ru.finam:slf4j-gwt:1.2.1'
|
compile 'ru.finam:slf4j-gwt:1.2.1'
|
||||||
providedCompile 'org.slf4j:slf4j-api:1.7.5'
|
compile 'org.slf4j:slf4j-api:1.7.5'
|
||||||
}
|
}
|
||||||
|
|
||||||
// explicit dependencies for org.gradle.configureondemand=true
|
// explicit dependencies for org.gradle.configureondemand=true
|
||||||
@ -38,7 +39,7 @@ evaluationDependsOn(':vtm-gdx')
|
|||||||
|
|
||||||
gwt {
|
gwt {
|
||||||
gwtVersion='2.6.0'
|
gwtVersion='2.6.0'
|
||||||
modules 'org.oscim.gdx.GwtDefinition'
|
modules 'org.oscim.gdx.VtmWeb'
|
||||||
|
|
||||||
superDev {
|
superDev {
|
||||||
noPrecompile=true
|
noPrecompile=true
|
||||||
@ -57,28 +58,28 @@ gwt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run jetty with draft compiled war
|
// Run jetty with draft compiled war
|
||||||
task jettyDraftWar(type: JettyRunWar) {
|
//task jettyDraftWar(type: JettyRunWar) {
|
||||||
dependsOn draftWar
|
// dependsOn draftWar
|
||||||
dependsOn.remove('war')
|
// dependsOn.remove('war')
|
||||||
webApp=draftWar.archivePath
|
// webApp=draftWar.archivePath
|
||||||
}
|
//}
|
||||||
|
|
||||||
task copyThemeAssets(type: Copy) {
|
//task copyThemeAssets(type: Copy) {
|
||||||
from "$rootDir/vtm-themes/resources/assets"
|
// from "$rootDir/vtm-themes/resources/assets"
|
||||||
into "assets"
|
// into "assets"
|
||||||
include '**/*'
|
// include '**/*'
|
||||||
}
|
//}
|
||||||
|
|
||||||
task copyVtmAssets(type: Copy) {
|
//task copyVtmAssets(type: Copy) {
|
||||||
from "$rootDir/vtm/resources/assets"
|
// from "$rootDir/vtm/resources/assets"
|
||||||
into "assets"
|
// into "assets"
|
||||||
include '**/*'
|
// include '**/*'
|
||||||
}
|
//}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) { compileTask ->
|
//tasks.withType(JavaCompile) { compileTask ->
|
||||||
compileTask.dependsOn copyThemeAssets
|
// compileTask.dependsOn copyThemeAssets
|
||||||
compileTask.dependsOn copyVtmAssets
|
// compileTask.dependsOn copyVtmAssets
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Configuring Eclipse classpath
|
// Configuring Eclipse classpath
|
||||||
eclipse.classpath {
|
eclipse.classpath {
|
||||||
|
33
vtm-web/src/com/badlogic/gdx/backends/Gdx.gwt.xml
Normal file
33
vtm-web/src/com/badlogic/gdx/backends/Gdx.gwt.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
|
||||||
|
<module rename-to='com.badlogic.gdx.backends.gwt'>
|
||||||
|
<inherits name='com.google.gwt.user.User' />
|
||||||
|
<!-- Inherit edited chrome theme ("gwt"-prefixed classes only) for a little bit of default styling in the text input dialogs -->
|
||||||
|
<inherits name='com.badlogic.gdx.backends.gwt.theme.chrome.Chrome'/>
|
||||||
|
<inherits name="com.google.gwt.http.HTTP"/>
|
||||||
|
|
||||||
|
<inherits name="com.badlogic.gdx" />
|
||||||
|
<inherits name="com.google.gwt.webgl.WebGL" />
|
||||||
|
<inherits name="com.badlogic.gwtref.GwtReflect"/>
|
||||||
|
|
||||||
|
<!-- <script src="soundmanager2-setup.js"/>
|
||||||
|
<script src="soundmanager2-jsmin.js"/> -->
|
||||||
|
|
||||||
|
<!-- <public path="gwt/resources"/> -->
|
||||||
|
<super-source path="gwt/emu" />
|
||||||
|
<source path="gwt">
|
||||||
|
<exclude name="**/emu/**" />
|
||||||
|
<exclude name="**/theme/**" />
|
||||||
|
<exclude name="**/PreloaderBundleGenerator.java"/>
|
||||||
|
<exclude name="**/FileWrapper.java"/>
|
||||||
|
<exclude name="**/emu/**" />
|
||||||
|
</source>
|
||||||
|
|
||||||
|
<define-configuration-property name="gdx.assetpath" is-multi-valued="false"/>
|
||||||
|
<define-configuration-property name="gdx.assetfilterclass" is-multi-valued="false"/>
|
||||||
|
<define-configuration-property name="gdx.assetoutputpath" is-multi-valued="false"/>
|
||||||
|
|
||||||
|
<generate-with class="com.badlogic.gdx.backends.gwt.preloader.PreloaderBundleGenerator">
|
||||||
|
<when-type-assignable class="com.badlogic.gdx.backends.gwt.preloader.PreloaderBundle"/>
|
||||||
|
</generate-with>
|
||||||
|
</module>
|
75
vtm-web/src/org/oscim/gdx/VtmWeb.gwt.xml
Normal file
75
vtm-web/src/org/oscim/gdx/VtmWeb.gwt.xml
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<module>
|
||||||
|
<!-- <entry-point class="org.oscim.gdx.client.GwtLauncher" /> -->
|
||||||
|
|
||||||
|
<inherits name="com.google.gwt.xml.XML" />
|
||||||
|
<inherits name="ru.finam.slf4jgwt.logging.gwt.Logging" />
|
||||||
|
|
||||||
|
<!-- <set-property name='gwt.logging.enabled' value='TRUE' />
|
||||||
|
<set-property name='gwt.logging.consoleHandler' value='ENABLED' />
|
||||||
|
<set-property name='gwt.logging.firebugHandler' value='DISABLED' />
|
||||||
|
<set-property name='gwt.logging.popupHandler' value='DISABLED' />
|
||||||
|
<set-property name="gwt.logging.logLevel" value="FINE"/>
|
||||||
|
-->
|
||||||
|
<inherits name="VtmGdx" />
|
||||||
|
<!-- <inherits name="com.badlogic.gdx.backends.gdx_backends_gwt" /> -->
|
||||||
|
<inherits name="com.badlogic.gdx.backends.Gdx" />
|
||||||
|
<inherits name="com.google.gwt.user.theme.chrome.Chrome" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.scenes.scene2d" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.math" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.g2d.TextureRegion" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.g2d.BitmapFont" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.g2d.NinePatch" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include"
|
||||||
|
value="com.badlogic.gdx.graphics.g3d.materials.MaterialAttribute" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.Color" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.Texture" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.utils.Array" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.utils.ObjectMap" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.utils.OrderedMap" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.utils.Disposable" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.VertexAttribute" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.g3d.model" />
|
||||||
|
-->
|
||||||
|
<clear-configuration-property name="gdx.reflect.include" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.util.List" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.util.ArrayList" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.util.Map" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.util.HashMap" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.String" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Boolean" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Byte" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Short" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Character" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Integer" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Float" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Double" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.CharSequence" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Enum" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Object" />
|
||||||
|
|
||||||
|
<!-- super dev mode -->
|
||||||
|
<!--
|
||||||
|
<add-linker name="xsiframe"/>
|
||||||
|
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
||||||
|
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- does not work with super dev mode, include directly in page -->
|
||||||
|
<!--
|
||||||
|
<script src="_tessellate.js"/>
|
||||||
|
<script src="tessellate.js"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<public path="resources" />
|
||||||
|
|
||||||
|
<super-source path="emu" />
|
||||||
|
|
||||||
|
<!-- <set-configuration-property name="gdx.assetpath" value="./assets" /> -->
|
||||||
|
<!-- for gradle build, commend out for eclipse build/devmode -->
|
||||||
|
<!-- <set-configuration-property name="gdx.assetoutputpath" value="build/gwt/draftOut" /> -->
|
||||||
|
|
||||||
|
<!-- <set-property name="user.agent" value="safari"/> -->
|
||||||
|
</module>
|
@ -47,7 +47,7 @@ public class GwtCanvas implements org.oscim.backend.canvas.Canvas {
|
|||||||
|
|
||||||
GwtPaint p = (GwtPaint) paint;
|
GwtPaint p = (GwtPaint) paint;
|
||||||
|
|
||||||
if (p.stroke && GwtCanvasAdapter.NO_STROKE_TEXT)
|
if (p.stroke && GwtGdxGraphics.NO_STROKE_TEXT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Context2d ctx = bitmap.pixmap.getContext();
|
Context2d ctx = bitmap.pixmap.getContext();
|
||||||
|
@ -26,11 +26,11 @@ import com.google.gwt.canvas.client.Canvas;
|
|||||||
import com.google.gwt.canvas.dom.client.Context2d;
|
import com.google.gwt.canvas.dom.client.Context2d;
|
||||||
import com.google.gwt.canvas.dom.client.TextMetrics;
|
import com.google.gwt.canvas.dom.client.TextMetrics;
|
||||||
|
|
||||||
public class GwtCanvasAdapter extends CanvasAdapter {
|
public class GwtGdxGraphics extends CanvasAdapter {
|
||||||
|
|
||||||
public static boolean NO_STROKE_TEXT = false;
|
public static boolean NO_STROKE_TEXT = false;
|
||||||
|
|
||||||
public static final GwtCanvasAdapter INSTANCE = new GwtCanvasAdapter();
|
public static final GwtGdxGraphics INSTANCE = new GwtGdxGraphics();
|
||||||
static final Context2d ctx;
|
static final Context2d ctx;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -40,7 +40,7 @@ public class GwtCanvasAdapter extends CanvasAdapter {
|
|||||||
ctx = canvas.getContext2d();
|
ctx = canvas.getContext2d();
|
||||||
}
|
}
|
||||||
|
|
||||||
static synchronized float getTextWidth(String text, String font) {
|
public static synchronized float getTextWidth(String text, String font) {
|
||||||
ctx.setFont(font);
|
ctx.setFont(font);
|
||||||
TextMetrics tm = ctx.measureText(text);
|
TextMetrics tm = ctx.measureText(text);
|
||||||
return (float) tm.getWidth();
|
return (float) tm.getWidth();
|
||||||
@ -72,4 +72,8 @@ public class GwtCanvasAdapter extends CanvasAdapter {
|
|||||||
return new GwtCanvas();
|
return new GwtCanvas();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
g = INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -107,7 +107,7 @@ public class GwtPaint implements Paint {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float measureText(String text) {
|
public float measureText(String text) {
|
||||||
return GwtCanvasAdapter.getTextWidth(text, font);
|
return GwtGdxGraphics.getTextWidth(text, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME all estimates. no idea how to properly measure canvas text..
|
// FIXME all estimates. no idea how to properly measure canvas text..
|
||||||
|
Loading…
x
Reference in New Issue
Block a user