Changeset 9659 in josm
- Timestamp:
- 2016-01-27T23:38:23+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r9657 r9659 254 254 } 255 255 256 /** 257 * Reloads data from relation. 258 */ 256 @Override 259 257 public void reloadDataFromRelation() { 260 258 setRelation(getRelation()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/IRelationEditor.java
r9655 r9659 5 5 6 6 /** 7 * Super interface of relation -awareeditors.8 * @since 9 4967 * Super interface of relation editors. 8 * @since 9659 9 9 */ 10 public interface RelationAware{10 public interface IRelationEditor { 11 11 12 12 /** … … 40 40 */ 41 41 boolean isDirtyRelation(); 42 43 /** 44 * Reloads data from relation. 45 */ 46 void reloadDataFromRelation(); 42 47 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
r9496 r9659 23 23 * @since 1599 24 24 */ 25 public abstract class RelationEditor extends ExtendedDialog implements RelationAware{25 public abstract class RelationEditor extends ExtendedDialog implements IRelationEditor { 26 26 27 27 /** the property name for the current relation. -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorAction.java
r9496 r9659 10 10 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 11 11 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 12 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;12 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 13 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 14 14 … … 21 21 protected final MemberTableModel memberTableModel; 22 22 protected final transient OsmDataLayer layer; 23 protected final transient RelationAwareeditor;23 protected final transient IRelationEditor editor; 24 24 25 25 protected AbstractRelationEditorAction(MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey) { … … 28 28 29 29 protected AbstractRelationEditorAction(MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey, 30 OsmDataLayer layer, RelationAwareeditor) {30 OsmDataLayer layer, IRelationEditor editor) { 31 31 this.memberTable = memberTable; 32 32 this.memberTableModel = memberTableModel; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddFromSelectionAction.java
r9496 r9659 13 13 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 14 14 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 15 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;15 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 16 16 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTable; 17 17 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTableModel; … … 28 28 29 29 protected AddFromSelectionAction(MemberTable memberTable, MemberTableModel memberTableModel, SelectionTable selectionTable, 30 SelectionTableModel selectionTableModel, String actionMapKey, OsmDataLayer layer, RelationAwareeditor) {30 SelectionTableModel selectionTableModel, String actionMapKey, OsmDataLayer layer, IRelationEditor editor) { 31 31 super(memberTable, memberTableModel, actionMapKey, layer, editor); 32 32 this.selectionTable = selectionTable; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAfterSelection.java
r9496 r9659 9 9 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.AddAbortException; 10 10 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 11 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;11 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 12 12 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTableModel; 13 13 import org.openstreetmap.josm.tools.ImageProvider; … … 25 25 * @param editor relation editor 26 26 */ 27 public AddSelectedAfterSelection(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, RelationAwareeditor) {27 public AddSelectedAfterSelection(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, IRelationEditor editor) { 28 28 super(null, memberTableModel, null, selectionTableModel, null, null, editor); 29 29 putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset after the last selected member")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtEndAction.java
r9496 r9659 9 9 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.AddAbortException; 10 10 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 11 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;11 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 12 12 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTableModel; 13 13 import org.openstreetmap.josm.tools.ImageProvider; … … 25 25 * @param editor relation editor 26 26 */ 27 public AddSelectedAtEndAction(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, RelationAwareeditor) {27 public AddSelectedAtEndAction(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, IRelationEditor editor) { 28 28 super(null, memberTableModel, null, selectionTableModel, null, null, editor); 29 29 putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset after the last member")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtStartAction.java
r9496 r9659 9 9 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.AddAbortException; 10 10 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 11 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;11 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 12 12 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTableModel; 13 13 import org.openstreetmap.josm.tools.ImageProvider; … … 25 25 * @param editor relation editor 26 26 */ 27 public AddSelectedAtStartAction(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, RelationAwareeditor) {27 public AddSelectedAtStartAction(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, IRelationEditor editor) { 28 28 super(null, memberTableModel, null, selectionTableModel, null, null, editor); 29 29 putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset before the first member")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedBeforeSelection.java
r9496 r9659 9 9 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.AddAbortException; 10 10 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 11 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;11 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 12 12 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTableModel; 13 13 import org.openstreetmap.josm.tools.ImageProvider; … … 25 25 * @param editor relation editor 26 26 */ 27 public AddSelectedBeforeSelection(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, RelationAwareeditor) {27 public AddSelectedBeforeSelection(MemberTableModel memberTableModel, SelectionTableModel selectionTableModel, IRelationEditor editor) { 28 28 super(null, memberTableModel, null, selectionTableModel, null, null, editor); 29 29 putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset before the first selected member")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ApplyAction.java
r9657 r9659 5 5 6 6 import java.awt.event.ActionEvent; 7 8 7 import java.beans.PropertyChangeEvent; 9 8 import java.beans.PropertyChangeListener; … … 12 11 import javax.swing.event.TableModelListener; 13 12 14 import org.openstreetmap.josm.gui.dialogs.relation. GenericRelationEditor;13 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 15 14 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 16 15 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 17 import org.openstreetmap.josm.gui.dialogs.relation.RelationAware;18 16 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 17 import org.openstreetmap.josm.gui.tagging.TagEditorModel; … … 35 33 */ 36 34 public ApplyAction(MemberTable memberTable, MemberTableModel memberTableModel, TagEditorModel tagModel, OsmDataLayer layer, 37 RelationAwareeditor) {35 IRelationEditor editor) { 38 36 super(memberTable, memberTableModel, tagModel, layer, editor, null); 39 37 putValue(SHORT_DESCRIPTION, tr("Apply the current updates")); … … 48 46 public void actionPerformed(ActionEvent e) { 49 47 if (applyChanges()) { 50 ((GenericRelationEditor) editor).reloadDataFromRelation();48 editor.reloadDataFromRelation(); 51 49 } 52 50 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/CancelAction.java
r9657 r9659 18 18 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 19 19 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 20 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;20 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 21 21 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 22 22 import org.openstreetmap.josm.gui.tagging.TagEditorModel; … … 40 40 */ 41 41 public CancelAction(MemberTable memberTable, MemberTableModel memberTableModel, TagEditorModel tagModel, OsmDataLayer layer, 42 RelationAwareeditor, AutoCompletingTextField tfRole) {42 IRelationEditor editor, AutoCompletingTextField tfRole) { 43 43 super(memberTable, memberTableModel, tagModel, layer, editor, tfRole); 44 44 putValue(SHORT_DESCRIPTION, tr("Cancel the updates and close the dialog")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/CopyMembersAction.java
r9496 r9659 10 10 import org.openstreetmap.josm.data.osm.RelationMember; 11 11 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 12 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;12 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 13 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 14 14 … … 25 25 * @param editor relation editor 26 26 */ 27 public CopyMembersAction(MemberTableModel memberTableModel, OsmDataLayer layer, RelationAwareeditor) {27 public CopyMembersAction(MemberTableModel memberTableModel, OsmDataLayer layer, IRelationEditor editor) { 28 28 super(null, memberTableModel, null, null, null, layer, editor); 29 29 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DeleteCurrentRelationAction.java
r9496 r9659 11 11 import org.openstreetmap.josm.data.osm.Relation; 12 12 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor; 13 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;13 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 14 14 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 15 15 import org.openstreetmap.josm.tools.ImageProvider; … … 26 26 * @param editor relation editor 27 27 */ 28 public DeleteCurrentRelationAction(OsmDataLayer layer, RelationAwareeditor) {28 public DeleteCurrentRelationAction(OsmDataLayer layer, IRelationEditor editor) { 29 29 super(null, null, null, layer, editor); 30 30 putValue(SHORT_DESCRIPTION, tr("Delete the currently edited relation")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java
r9496 r9659 12 12 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 13 13 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 14 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;14 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 15 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 16 import org.openstreetmap.josm.io.OnlineResource; … … 33 33 */ 34 34 public DownloadIncompleteMembersAction(MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey, 35 OsmDataLayer layer, RelationAwareeditor) {35 OsmDataLayer layer, IRelationEditor editor) { 36 36 super(memberTable, memberTableModel, actionMapKey, layer, editor); 37 37 Shortcut sc = Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadSelectedIncompleteMembersAction.java
r9496 r9659 11 11 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 12 12 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 13 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;13 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 14 14 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 15 15 import org.openstreetmap.josm.io.OnlineResource; … … 31 31 */ 32 32 public DownloadSelectedIncompleteMembersAction(MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey, 33 OsmDataLayer layer, RelationAwareeditor) {33 OsmDataLayer layer, IRelationEditor editor) { 34 34 super(memberTable, memberTableModel, actionMapKey, layer, editor); 35 35 // Shortcut.register Shortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/OKAction.java
r9657 r9659 9 9 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 10 10 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 11 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;11 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 12 12 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 13 13 import org.openstreetmap.josm.gui.tagging.TagEditorModel; … … 30 30 */ 31 31 public OKAction(MemberTable memberTable, MemberTableModel memberTableModel, TagEditorModel tagModel, OsmDataLayer layer, 32 RelationAwareeditor, AutoCompletingTextField tfRole) {32 IRelationEditor editor, AutoCompletingTextField tfRole) { 33 33 super(memberTable, memberTableModel, tagModel, layer, editor, tfRole); 34 34 putValue(SHORT_DESCRIPTION, tr("Apply the updates and close the dialog")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/PasteMembersAction.java
r9496 r9659 16 16 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.AddAbortException; 17 17 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 18 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;18 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 19 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 20 20 … … 31 31 * @param editor relation editor 32 32 */ 33 public PasteMembersAction(MemberTableModel memberTableModel, OsmDataLayer layer, RelationAwareeditor) {33 public PasteMembersAction(MemberTableModel memberTableModel, OsmDataLayer layer, IRelationEditor editor) { 34 34 super(null, memberTableModel, null, null, null, layer, editor); 35 35 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java
r9657 r9659 17 17 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 18 18 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 19 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;19 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 20 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 21 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; … … 39 39 */ 40 40 public RefreshAction(MemberTable memberTable, MemberTableModel memberTableModel, TagEditorModel tagModel, OsmDataLayer layer, 41 RelationAwareeditor) {41 IRelationEditor editor) { 42 42 super(memberTable, memberTableModel, tagModel, layer, editor, null); 43 43 // CHECKSTYLE.OFF: LineLength -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
r9657 r9659 23 23 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 24 24 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 25 import org.openstreetmap.josm.gui.dialogs.relation. RelationAware;25 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 26 26 import org.openstreetmap.josm.gui.dialogs.relation.RelationDialogManager; 27 27 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; … … 41 41 42 42 protected SavingAction(MemberTable memberTable, MemberTableModel memberTableModel, TagEditorModel tagModel, OsmDataLayer layer, 43 RelationAwareeditor, AutoCompletingTextField tfRole) {43 IRelationEditor editor, AutoCompletingTextField tfRole) { 44 44 super(memberTable, memberTableModel, null, layer, editor); 45 45 this.tagModel = tagModel; -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java
r9657 r9659 7 7 import org.openstreetmap.josm.data.osm.DataSet; 8 8 import org.openstreetmap.josm.data.osm.Relation; 9 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 9 10 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; 10 11 import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; 11 import org.openstreetmap.josm.gui.dialogs.relation.RelationAware;12 12 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTableModel; 13 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 40 40 SelectionTableModel selectionTableModel = new SelectionTableModel(layer); 41 41 42 RelationAware editor = new RelationAware() {42 IRelationEditor editor = new IRelationEditor() { 43 43 private Relation r = orig; 44 44 … … 61 61 public Relation getRelation() { 62 62 return r; 63 } 64 65 @Override 66 public void reloadDataFromRelation() { 67 // Do nothing 63 68 } 64 69 };
Note:
See TracChangeset
for help on using the changeset viewer.