vtm-theme-comparator improvements #387
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## New since 0.8.0
|
## New since 0.8.0
|
||||||
|
|
||||||
|
- vtm-theme-comparator module [#387](https://github.com/mapsforge/vtm/issues/387)
|
||||||
- Many other minor improvements and bug fixes
|
- Many other minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.0)
|
||||||
|
|
||||||
|
|||||||
@@ -2,28 +2,16 @@ apply plugin: 'java'
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm-desktop')
|
compile project(':vtm-desktop')
|
||||||
compile project(':vtm-extras')
|
compile 'ch.qos.logback:logback-classic:1.2.3'
|
||||||
compile project(':vtm-http')
|
compile 'com.fifesoft:rsyntaxtextarea:2.6.1'
|
||||||
compile project(':vtm-json')
|
compile 'com.jtattoo:JTattoo:1.6.11'
|
||||||
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
|
|
||||||
|
|
||||||
|
|
||||||
compile group: 'com.jtattoo', name: 'JTattoo', version: '1.6.11'
|
|
||||||
compile group: 'com.fifesoft', name: 'rsyntaxtextarea', version: '2.6.1'
|
|
||||||
|
|
||||||
|
|
||||||
compile 'org.mapsforge:mapsforge-core:0.8.0'
|
compile 'org.mapsforge:mapsforge-core:0.8.0'
|
||||||
compile 'org.mapsforge:mapsforge-themes:0.8.0'
|
|
||||||
compile 'org.mapsforge:mapsforge-map:0.8.0'
|
compile 'org.mapsforge:mapsforge-map:0.8.0'
|
||||||
compile 'org.mapsforge:mapsforge-map-reader:0.8.0'
|
|
||||||
compile("org.mapsforge:mapsforge-map-awt:0.8.0")
|
compile("org.mapsforge:mapsforge-map-awt:0.8.0")
|
||||||
compile 'com.kitfox.svg:svg-salamander:1.0'
|
compile 'org.mapsforge:mapsforge-map-reader:0.8.0'
|
||||||
|
compile 'org.mapsforge:mapsforge-themes:0.8.0'
|
||||||
compile 'net.sf.kxml:kxml2:2.3.0'
|
compile 'net.sf.kxml:kxml2:2.3.0'
|
||||||
|
|
||||||
//include libs
|
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 Longri
|
* Copyright 2017 Longri
|
||||||
|
* Copyright 2017 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -85,7 +86,7 @@ public class Main {
|
|||||||
|
|
||||||
new SharedLibraryLoader().load("vtm-jni");
|
new SharedLibraryLoader().load("vtm-jni");
|
||||||
AwtGraphics.init();
|
AwtGraphics.init();
|
||||||
GdxAssets.init("");
|
GdxAssets.init("assets/");
|
||||||
GLAdapter.init(new LwjglGL20());
|
GLAdapter.init(new LwjglGL20());
|
||||||
GLAdapter.GDX_DESKTOP_QUIRKS = true;
|
GLAdapter.GDX_DESKTOP_QUIRKS = true;
|
||||||
window = new MainWindow();
|
window = new MainWindow();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 Longri
|
* Copyright 2017 Longri
|
||||||
|
* Copyright 2017 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -22,9 +23,12 @@ import org.oscim.theme.comparator.vtm.VtmPanel;
|
|||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
import java.awt.event.WindowAdapter;
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JSplitPane;
|
import javax.swing.JSplitPane;
|
||||||
|
import javax.swing.WindowConstants;
|
||||||
|
|
||||||
class MainWindow extends JFrame {
|
class MainWindow extends JFrame {
|
||||||
|
|
||||||
@@ -78,6 +82,16 @@ class MainWindow extends JFrame {
|
|||||||
splitPane.setResizeWeight(0.5);
|
splitPane.setResizeWeight(0.5);
|
||||||
|
|
||||||
this.add(splitPane);
|
this.add(splitPane);
|
||||||
|
|
||||||
|
addWindowListener(new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent e) {
|
||||||
|
mapsforgeMapPanel.destroy();
|
||||||
|
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
dispose();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 Longri
|
* Copyright 2017 Longri
|
||||||
|
* Copyright 2017 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -43,6 +44,7 @@ import java.awt.event.ComponentAdapter;
|
|||||||
import java.awt.event.ComponentEvent;
|
import java.awt.event.ComponentEvent;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
@@ -92,7 +94,7 @@ public class MapsforgeMapPanel extends JPanel {
|
|||||||
|
|
||||||
private Layer createTileRendererLayer(TileCache tileCache, MapViewPosition mapViewPosition, File mapFile, File themeFile) {
|
private Layer createTileRendererLayer(TileCache tileCache, MapViewPosition mapViewPosition, File mapFile, File themeFile) {
|
||||||
|
|
||||||
TileRendererLayer tileRendererLayer = new TileRendererLayer(tileCache, new MapFile(mapFile), mapViewPosition, false, true, true, GRAPHIC_FACTORY);
|
TileRendererLayer tileRendererLayer = new TileRendererLayer(tileCache, new MapFile(mapFile), mapViewPosition, false, true, false, GRAPHIC_FACTORY);
|
||||||
|
|
||||||
if (themeFile != null) {
|
if (themeFile != null) {
|
||||||
|
|
||||||
@@ -120,11 +122,16 @@ public class MapsforgeMapPanel extends JPanel {
|
|||||||
|
|
||||||
private TileCache createTileCache() {
|
private TileCache createTileCache() {
|
||||||
TileCache firstLevelTileCache = new InMemoryTileCache(64);
|
TileCache firstLevelTileCache = new InMemoryTileCache(64);
|
||||||
File cacheDirectory = new File(System.getProperty("java.io.tmpdir"), "mapsforge");
|
File cacheDirectory = new File(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
|
||||||
TileCache secondLevelTileCache = new FileSystemTileCache(1024, cacheDirectory, GRAPHIC_FACTORY);
|
TileCache secondLevelTileCache = new FileSystemTileCache(1024, cacheDirectory, GRAPHIC_FACTORY);
|
||||||
return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
|
return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroy() {
|
||||||
|
mapView.destroyAll();
|
||||||
|
AwtGraphicFactory.clearResourceMemoryCache();
|
||||||
|
}
|
||||||
|
|
||||||
public void loadMap(File mapFile, File themeFile) {
|
public void loadMap(File mapFile, File themeFile) {
|
||||||
log.debug("reload MAP:{} THEME:{}", mapFile, themeFile);
|
log.debug("reload MAP:{} THEME:{}", mapFile, themeFile);
|
||||||
this.mapFile = mapFile;
|
this.mapFile = mapFile;
|
||||||
|
|||||||
Reference in New Issue
Block a user