| 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.w3c.dom.Element;
|
|---|
| 9 |
|
|---|
| 10 | import org.openstreetmap.josm.gui.layer.Layer;
|
|---|
| 11 | import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport;
|
|---|
| 12 |
|
|---|
| 13 | public interface SessionLayerExporter {
|
|---|
| 14 |
|
|---|
| 15 | /**
|
|---|
| 16 | * Return the Layers, this Layer depends on.
|
|---|
| 17 | */
|
|---|
| 18 | Collection<Layer> getDependencies();
|
|---|
| 19 |
|
|---|
| 20 | /**
|
|---|
| 21 | * The GUI for exporting this layer.
|
|---|
| 22 | */
|
|---|
| 23 | Component getExportPanel();
|
|---|
| 24 |
|
|---|
| 25 | /**
|
|---|
| 26 | * Return true, if the layer should be included in the
|
|---|
| 27 | * list of exported layers.
|
|---|
| 28 | *
|
|---|
| 29 | * The user can veto this in the export panel.
|
|---|
| 30 | */
|
|---|
| 31 | boolean shallExport();
|
|---|
| 32 |
|
|---|
| 33 | /**
|
|---|
| 34 | * Return true, if some data needs to be included in
|
|---|
| 35 | * 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
|
|---|
| 39 | * .joz. Otherwise both .jos and .joz are possible.
|
|---|
| 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 | */
|
|---|
| 47 | Element export(ExportSupport support) throws IOException;
|
|---|
| 48 |
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|