[josm-dev] Plugin for "wifi geolocalization inside building" ...
Minh Quang
chumkhungbo2003 at yahoo.com
Wed Jan 13 15:06:49 GMT 2010
Now, I would like to know how JOSM save dataset of a layer to OSM file. I see some classes SaveAction, SaveActionBase, and their methods ... There is a method I really didnt understand is doSave(Layer layer). Normally, it will export the layer to a data output. But when I go inside export method at ExtensionFileFilter class ( exporter.exportData(file, layer); ), I dont see anything a part from throm exception....
My question may be newbie, but it's just a first time I work on the code of JOSM. I hope that u dont care so much.
public boolean doSave(Layer layer) {
if (layer == null)
return false;
if ( !(layer instanceof OsmDataLayer) && !(layer instanceof GpxLayer))
return false;
if (!checkSaveConditions(layer))
return false;
File file = getFile(layer);
if (file == null)
return false;
try {
boolean exported = false;
for (FileExporter exporter : ExtensionFileFilter.exporters) {
if (exporter.acceptFile(file, layer)) {
exporter.exportData(file, layer);
exported = true;
}
}
if (!exported) {
JOptionPane.showMessageDialog(Main.parent, tr("No Exporter found! Nothing saved."), tr("Warning"),
JOptionPane.WARNING_MESSAGE);
return false;
}
layer.setName(file.getName());
layer.setAssociatedFile(file);
if (layer instanceof OsmDataLayer) {
((OsmDataLayer) layer).onPostSaveToFile();
}
Main.parent.repaint();
} catch (IOException e) {
e.printStackTrace();
return false;
}
return true;
}
Thanks
--- On Wed, 1/13/10, Sebastian Klein <bastikln at googlemail.com> wrote:
From: Sebastian Klein <bastikln at googlemail.com>
Subject: Re: [josm-dev] Plugin for "wifi geolocalization inside building" ...
To: josm-dev at openstreetmap.org
Date: Wednesday, January 13, 2010, 12:35 PM
Minh Quang wrote:
> Hi,
> Thanks for your reply. As you sugested, we can use the filter to hide and display objects according to their tags.
> Now, I dont know how to use this feature,
I send you PM on how to activate this feature.
> in which directory, I can find it... Thanks
>
I'm sure you find out yourself. :)
_______________________________________________
josm-dev mailing list
josm-dev at openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev
More information about the josm-dev
mailing list