source: josm/trunk/src/org/openstreetmap/josm/io/session/SessionLayerExporter.java@ 13228

Last change on this file since 13228 was 9455, checked in by Don-vip, 8 years ago

session - refactor duplicated code, add javadoc, fix warnings

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