Update default settings map creator

This commit is contained in:
Victor Shcherb 2012-06-23 13:24:45 +02:00
parent 3a345c5bbd
commit ffb68a1cee
2 changed files with 19 additions and 15 deletions

View file

@ -132,7 +132,7 @@ public class NativeSwingRendering extends NativeLibrary {
public static NativeSwingRendering getDefaultFromSettings() {
String filename = DataExtractionSettings.getSettings().getNativeLibFile();
if(!(new File(filename).exists())) {
if(filename.length() == 0 || !(new File(filename).exists())) {
return null;
}
NativeSwingRendering lib = NativeSwingRendering.loadLibrary(filename);

View file

@ -240,21 +240,25 @@ public class OsmExtractionUI implements IMapLocationListener {
}
private void initNativeRendering() {
NativeSwingRendering lib = NativeSwingRendering.loadLibrary(
DataExtractionSettings.getSettings().getNativeLibFile());
if(lib != null) {
try {
lib.initFilesInDir(new File(DataExtractionSettings.getSettings().getBinaryFilesDir()));
lib.loadRuleStorage(DataExtractionSettings.getSettings().getRenderXmlPath());
mapPanel.setNativeLibrary(lib);
mapPanel.repaint();
} catch (SAXException e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
String fl = DataExtractionSettings.getSettings().getNativeLibFile();
if (fl != null) {
NativeSwingRendering lib = NativeSwingRendering.loadLibrary(fl);
if (lib != null) {
try {
lib.initFilesInDir(new File(DataExtractionSettings.getSettings().getBinaryFilesDir()));
lib.loadRuleStorage(DataExtractionSettings.getSettings().getRenderXmlPath());
mapPanel.setNativeLibrary(lib);
mapPanel.repaint();
} catch (SAXException e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
}
}
} else {
JOptionPane.showMessageDialog(frame, "Native library was not configured in settings");
}
}