Update default settings map creator
This commit is contained in:
parent
f57a5c11f3
commit
ec3d9660aa
3 changed files with 5 additions and 27 deletions
|
@ -158,13 +158,6 @@ public class DataExtractionSettings {
|
|||
preferences.put("cityAdminLevel", s);
|
||||
}
|
||||
|
||||
public int getRouteDirection(){
|
||||
return preferences.getInt("routeDirection", 0);
|
||||
}
|
||||
|
||||
public void setRouteDirection(int s){
|
||||
preferences.putInt("routeDirection", s);
|
||||
}
|
||||
|
||||
public String getRouteMode(){
|
||||
return preferences.get("routeMode", "car");
|
||||
|
|
|
@ -25,6 +25,7 @@ import net.osmand.render.RenderingRulesStorage.RenderingRulesStorageResolver;
|
|||
public class NativeSwingRendering extends NativeLibrary {
|
||||
|
||||
RenderingRulesStorage storage;
|
||||
private static NativeSwingRendering defaultLoadedLibrary;
|
||||
|
||||
public void loadRuleStorage(String path) throws SAXException, IOException{
|
||||
RenderingRulesStorage storage = new RenderingRulesStorage();
|
||||
|
@ -131,6 +132,9 @@ public class NativeSwingRendering extends NativeLibrary {
|
|||
}
|
||||
|
||||
public static NativeSwingRendering getDefaultFromSettings() {
|
||||
if(defaultLoadedLibrary != null) {
|
||||
return defaultLoadedLibrary;
|
||||
}
|
||||
String filename = DataExtractionSettings.getSettings().getNativeLibFile();
|
||||
if(filename.length() == 0 || !(new File(filename).exists())) {
|
||||
return null;
|
||||
|
@ -138,6 +142,7 @@ public class NativeSwingRendering extends NativeLibrary {
|
|||
NativeSwingRendering lib = NativeSwingRendering.loadLibrary(filename);
|
||||
if(lib != null){
|
||||
lib.initFilesInDir(new File(DataExtractionSettings.getSettings().getBinaryFilesDir()));
|
||||
defaultLoadedLibrary = lib;
|
||||
}
|
||||
return lib;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ public class OsmExtractionPreferencesDialog extends JDialog {
|
|||
private JTextField streetSuffixes;
|
||||
private JTextField streetDefaultSuffixes;
|
||||
private JTextField mapZooms;
|
||||
private JTextField directionPlanRoute;
|
||||
private JTextField routingMode;
|
||||
private JTextField lineSmoothness;
|
||||
private JTextField renderingTypesFile;
|
||||
|
@ -171,17 +170,6 @@ public class OsmExtractionPreferencesDialog extends JDialog {
|
|||
constr.anchor = GridBagConstraints.WEST;
|
||||
l.setConstraints(label, constr);
|
||||
|
||||
directionPlanRoute = new JTextField();
|
||||
|
||||
directionPlanRoute.setText(DataExtractionSettings.getSettings().getRouteDirection() +"");
|
||||
panel.add(directionPlanRoute);
|
||||
constr = new GridBagConstraints();
|
||||
constr.weightx = 1;
|
||||
constr.fill = GridBagConstraints.HORIZONTAL;
|
||||
constr.ipadx = 5;
|
||||
constr.gridx = 1;
|
||||
constr.gridy = gridY++;
|
||||
l.setConstraints(directionPlanRoute, constr);
|
||||
|
||||
label = new JLabel("Routing config file (path : ");
|
||||
panel.add(label);
|
||||
|
@ -404,14 +392,6 @@ public class OsmExtractionPreferencesDialog extends JDialog {
|
|||
if(!settings.getMapRenderingTypesFile().equals(renderingTypesFile.getText())){
|
||||
settings.setMapRenderingTypesFile(renderingTypesFile.getText());
|
||||
}
|
||||
int directionRoute = 0;
|
||||
try {
|
||||
directionRoute = Integer.parseInt(directionPlanRoute.getText());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if(directionRoute != settings.getRouteDirection()){
|
||||
settings.setRouteDirection(directionRoute);
|
||||
}
|
||||
if(!settings.getBinaryFilesDir().equals(nativeFilesDirectory.getText())){
|
||||
settings.setBinaryFilesDir(nativeFilesDirectory.getText());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue