1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.dialogs.relation;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.osm.Relation;
|
---|
5 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * Super interface of relation editors.
|
---|
9 | * @since 9659
|
---|
10 | */
|
---|
11 | public interface IRelationEditor {
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Replies the currently edited relation
|
---|
15 | *
|
---|
16 | * @return the currently edited relation
|
---|
17 | */
|
---|
18 | Relation getRelation();
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Sets the currently edited relation. Creates a snapshot of the current
|
---|
22 | * state of the relation. See {@link #getRelationSnapshot()}
|
---|
23 | *
|
---|
24 | * @param relation the relation
|
---|
25 | */
|
---|
26 | void setRelation(Relation relation);
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Replies the state of the edited relation when the editor has been launched.
|
---|
30 | * @return the state of the edited relation when the editor has been launched
|
---|
31 | */
|
---|
32 | Relation getRelationSnapshot();
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Replies true if the currently edited relation has been changed elsewhere.
|
---|
36 | *
|
---|
37 | * In this case a relation editor can't apply updates to the relation directly. Rather,
|
---|
38 | * it has to create a conflict.
|
---|
39 | *
|
---|
40 | * @return true if the currently edited relation has been changed elsewhere.
|
---|
41 | */
|
---|
42 | boolean isDirtyRelation();
|
---|
43 |
|
---|
44 | /**
|
---|
45 | * Reloads data from relation.
|
---|
46 | */
|
---|
47 | void reloadDataFromRelation();
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * Replies the {@link OsmDataLayer} in whose context this relation editor is open
|
---|
51 | *
|
---|
52 | * @return the {@link OsmDataLayer} in whose context this relation editor is open
|
---|
53 | */
|
---|
54 | OsmDataLayer getLayer();
|
---|
55 | }
|
---|