1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.io.session;
|
---|
3 |
|
---|
4 | import java.awt.Component;
|
---|
5 | import java.io.IOException;
|
---|
6 | import java.util.Collection;
|
---|
7 |
|
---|
8 | import org.openstreetmap.josm.gui.layer.Layer;
|
---|
9 | import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport;
|
---|
10 | import org.w3c.dom.Element;
|
---|
11 |
|
---|
12 | public interface SessionLayerExporter {
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Return the Layers, this Layer depends on.
|
---|
16 | * @return the layer dependencies
|
---|
17 | */
|
---|
18 | Collection<Layer> getDependencies();
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * The GUI for exporting this layer.
|
---|
22 | * @return the export panel
|
---|
23 | */
|
---|
24 | Component getExportPanel();
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Return true, if the layer should be included in the list of exported layers.
|
---|
28 | *
|
---|
29 | * The user can veto this in the export panel.
|
---|
30 | * @return {@code true} if the layer should be included in the list of exported layers, {@code false} otherwise.
|
---|
31 | */
|
---|
32 | boolean shallExport();
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Return true, if some data needs to be included in the zip archive. This decision depends on the user
|
---|
36 | * selection in the export panel.
|
---|
37 | *
|
---|
38 | * If any layer requires zip, the user can only save as .joz. Otherwise both .jos and .joz are possible.
|
---|
39 | * @return {@code true} if some data needs to be included in the zip archive, {@code false} otherwise.
|
---|
40 | */
|
---|
41 | boolean requiresZip();
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * Save meta data to the .jos file. Return a layer XML element.
|
---|
45 | * Use <code>support</code> to save files in the zip archive as needed.
|
---|
46 | * @param support support class providing export utilities
|
---|
47 | * @return the resulting XML element
|
---|
48 | * @throws IOException if any I/O error occurs
|
---|
49 | */
|
---|
50 | Element export(ExportSupport support) throws IOException;
|
---|
51 | }
|
---|