- Timestamp:
- 2018-07-15T12:39:47+02:00 (6 years ago)
- Location:
- trunk
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r14029 r14030 613 613 /** 614 614 * Constructs a new {@code LeftButtonToolbar}. 615 * @param rerelation editor615 * @param editorAccess relation editor 616 616 */ 617 617 LeftButtonToolbar(IRelationEditorActionAccess editorAccess) { … … 650 650 651 651 InputMap inputMap = editorAccess.getMemberTable().getInputMap(MemberTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); 652 inputMap.put((KeyStroke) new RemoveAction(editorAccess, "removeSelected").getValue(AbstractAction.ACCELERATOR_KEY), "removeSelected"); 653 inputMap.put((KeyStroke) new MoveUpAction(editorAccess, "moveUp").getValue(AbstractAction.ACCELERATOR_KEY), "moveUp"); 654 inputMap.put((KeyStroke) new MoveDownAction(editorAccess, "moveDown").getValue(AbstractAction.ACCELERATOR_KEY), "moveDown"); 652 inputMap.put((KeyStroke) new RemoveAction(editorAccess, "removeSelected") 653 .getValue(AbstractAction.ACCELERATOR_KEY), "removeSelected"); 654 inputMap.put((KeyStroke) new MoveUpAction(editorAccess, "moveUp") 655 .getValue(AbstractAction.ACCELERATOR_KEY), "moveUp"); 656 inputMap.put((KeyStroke) new MoveDownAction(editorAccess, "moveDown") 657 .getValue(AbstractAction.ACCELERATOR_KEY), "moveDown"); 655 658 inputMap.put((KeyStroke) new DownloadIncompleteMembersAction( 656 659 editorAccess, "downloadIncomplete").getValue(AbstractAction.ACCELERATOR_KEY), "downloadIncomplete"); … … 660 663 /** 661 664 * build the toolbar with the buttons for adding or removing the current selection 662 * @param memberTable member table 663 * @param memberTableModel member table model 664 * @param selectionTableModel selection table model 665 * @param re relation editor 665 * @param editorAccess relation editor 666 666 * 667 667 * @return control buttons panel for selection/members -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditorHooks.java
r14029 r14030 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.dialogs.relation; 2 3 … … 9 10 /** 10 11 * This class allows to hook into the relation editor. It can be used to overwrite specific behavior. 11 * 12 * 12 13 * @author Michael Zangl 13 14 * @since 14027 14 15 */ 15 public class RelationEditorHooks {16 16 public final class RelationEditorHooks { 17 17 18 private static final CopyOnWriteArrayList<IRelationEditorActionGroup> memberActions = new CopyOnWriteArrayList<>(); 18 19 private static final CopyOnWriteArrayList<IRelationEditorActionGroup> selectionActions = new CopyOnWriteArrayList<>(); … … 21 22 // only static methods. 22 23 } 23 24 24 25 /** 25 26 * Adds actions to the members action toolbar … … 29 30 memberActions.add(group); 30 31 } 31 32 32 33 /** 33 34 * Adds actions to the selection action toolbar … … 37 38 selectionActions.add(group); 38 39 } 39 40 40 41 /* package */ static List<IRelationEditorActionGroup> getMemberActions() { 41 42 return Collections.unmodifiableList(memberActions); 42 43 } 43 44 44 45 /* package */ static List<IRelationEditorActionGroup> getSelectActions() { 45 46 return Collections.unmodifiableList(selectionActions); 46 47 } 47 48 48 49 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorAction.java
r14029 r14030 26 26 /** 27 27 * Abstract superclass of relation editor actions. 28 * 28 * 29 29 * @since 9496 30 30 */ … … 36 36 /** 37 37 * Create a new relation editor action 38 * 38 * 39 39 * @param editorAccess 40 40 * The editor this action is for 41 * @param actionMapKey42 * The key for the member table action map.43 41 * @param updateOn 44 42 * The events that may cause the enabled state of this button to … … 57 55 /** 58 56 * Create a new relation editor action 59 * 57 * 60 58 * @param editorAccess 61 59 * The editor this action is for … … 127 125 } 128 126 127 /** 128 * Indicates that this action only visible in expert mode 129 * @return <code>true</code> for expert mode actions. 130 * @since 14027 131 */ 129 132 public boolean isExpertOnly() { 130 133 return false; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddFromSelectionAction.java
r14029 r14030 34 34 ConditionalOptionPaneUtil.startBulkOperation("add_primitive_to_relation"); 35 35 for (OsmPrimitive primitive : primitives) { 36 if (primitive instanceof Relation && editorAccess.getEditor().getRelation() != null && editorAccess.getEditor().getRelation().equals(primitive)) { 36 if (primitive instanceof Relation 37 && editorAccess.getEditor().getRelation() != null && editorAccess.getEditor().getRelation().equals(primitive)) { 37 38 GenericRelationEditor.warnOfCircularReferences(primitive); 38 39 continue; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAfterSelection.java
r14029 r14030 19 19 /** 20 20 * Constructs a new {@code AddSelectedAfterSelection}. 21 * @param memberTableModel member table model 22 * @param selectionTableModel selection table model 23 * @param editor relation editor 21 * @param editorAccess An interface to access the relation editor contents. 24 22 */ 25 23 public AddSelectedAfterSelection(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtEndAction.java
r14029 r14030 19 19 /** 20 20 * Constructs a new {@code AddSelectedAtEndAction}. 21 * @param memberTableModel member table model 22 * @param selectionTableModel selection table model 23 * @param editor relation editor 21 * @param editorAccess An interface to access the relation editor contents. 24 22 */ 25 23 public AddSelectedAtEndAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtStartAction.java
r14029 r14030 19 19 /** 20 20 * Constructs a new {@code AddSelectedAtStartAction}. 21 * @param memberTableModel member table model 22 * @param selectionTableModel selection table model 23 * @param editor relation editor 21 * @param editorAccess An interface to access the relation editor contents. 24 22 */ 25 23 public AddSelectedAtStartAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedBeforeSelection.java
r14029 r14030 19 19 /** 20 20 * Constructs a new {@code AddSelectedBeforeSelection}. 21 * @param memberTableModel member table model 22 * @param selectionTableModel selection table model 23 * @param editor relation editor 21 * @param editorAccess An interface to access the relation editor contents. 24 22 */ 25 23 public AddSelectedBeforeSelection(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ApplyAction.java
r14029 r14030 17 17 /** 18 18 * Constructs a new {@code ApplyAction}. 19 * @param memberTable member table 20 * @param memberTableModel member table model 21 * @param layer OSM data layer 22 * @param editor relation editor 23 * @param tagModel tag editor model 19 * @param editorAccess An interface to access the relation editor contents. 24 20 */ 25 21 public ApplyAction(IRelationEditorActionAccess editorAccess) { … … 28 24 new ImageProvider("save").getResource().attachImageIcon(this, true); 29 25 putValue(NAME, tr("Apply")); 30 updateEnabledState(); 26 updateEnabledState(); 31 27 } 32 28 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/CancelAction.java
r14029 r14030 26 26 /** 27 27 * Constructs a new {@code CancelAction}. 28 * @param memberTable member table 29 * @param memberTableModel member table model 30 * @param tagModel tag editor model 31 * @param layer OSM data layer 32 * @param editor relation editor 33 * @param tfRole role text field 28 * @param editorAccess An interface to access the relation editor contents. 34 29 */ 35 30 public CancelAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/CopyMembersAction.java
r14029 r14030 18 18 /** 19 19 * Constructs a new {@code CopyMembersAction}. 20 * @param memberTableModel member table model 21 * @param layer OSM data layer 22 * @param editor relation editor 20 * @param editorAccess An interface to access the relation editor contents. 23 21 */ 24 22 public CopyMembersAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DeleteCurrentRelationAction.java
r14029 r14030 6 6 import java.awt.event.ActionEvent; 7 7 import java.beans.PropertyChangeEvent; 8 import java.beans.PropertyChangeListener;9 8 10 9 import org.openstreetmap.josm.actions.mapmode.DeleteAction; … … 17 16 * @since 9496 18 17 */ 19 public class DeleteCurrentRelationAction extends AbstractRelationEditorAction implements PropertyChangeListener{18 public class DeleteCurrentRelationAction extends AbstractRelationEditorAction { 20 19 private static final long serialVersionUID = 1L; 21 20 22 21 /** 23 22 * Constructs a new {@code DeleteCurrentRelationAction}. 24 * @param layer OSM data layer 25 * @param editor relation editor 23 * @param editorAccess An interface to access the relation editor contents. 26 24 */ 27 25 public DeleteCurrentRelationAction(IRelationEditorActionAccess editorAccess) { … … 48 46 @Override 49 47 public void propertyChange(PropertyChangeEvent evt) { 48 // Do not call super. 50 49 if (GenericRelationEditor.RELATION_SNAPSHOT_PROP.equals(evt.getPropertyName())) { 51 50 updateEnabledState(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java
r14029 r14030 23 23 /** 24 24 * Constructs a new {@code DownloadIncompleteMembersAction}. 25 * @param memberTable member table 26 * @param memberTableModel member table model 25 * @param editorAccess An interface to access the relation editor contents. 27 26 * @param actionMapKey action map key 28 * @param layer OSM data layer29 * @param editor relation editor30 27 */ 31 28 public DownloadIncompleteMembersAction(IRelationEditorActionAccess editorAccess, String actionMapKey) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadSelectedIncompleteMembersAction.java
r14029 r14030 20 20 /** 21 21 * Constructs a new {@code DownloadSelectedIncompleteMembersAction}. 22 * @param memberTable member table 23 * @param memberTableModel member table model 24 * @param actionMapKey action map key 25 * @param layer OSM data layer 26 * @param editor relation editor 22 * @param editorAccess An interface to access the relation editor contents. 27 23 */ 28 24 public DownloadSelectedIncompleteMembersAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DuplicateRelationAction.java
r14029 r14030 20 20 /** 21 21 * Constructs a new {@code DuplicateRelationAction}. 22 * @param memberTableModel member table model 23 * @param tagEditorModel tag editor model 24 * @param layer OSM data layer 22 * @param editorAccess An interface to access the relation editor contents. 25 23 */ 26 24 public DuplicateRelationAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/EditAction.java
r14029 r14030 23 23 /** 24 24 * Constructs a new {@code EditAction}. 25 * @param memberTable member table 26 * @param memberTableModel member table model 27 * @param layer layer 25 * @param editorAccess An interface to access the relation editor contents. 28 26 */ 29 27 public EditAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/IRelationEditorActionAccess.java
r14029 r14030 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.dialogs.relation.actions; 2 3 … … 14 15 * This interface provides access to the relation editor for actions. 15 16 * <p> 16 * 17 * 17 18 * @author Michael Zangl 18 19 * @since 14027 … … 34 35 */ 35 36 MemberTable getMemberTable(); 36 37 37 38 /** 38 39 * Get the model the member table is using. … … 40 41 */ 41 42 MemberTableModel getMemberTableModel(); 42 43 43 44 /** 44 45 * Get the table that displays the current user selection … … 46 47 */ 47 48 SelectionTable getSelectionTable(); 48 49 49 50 /** 50 51 * Get the model that the selection table is based on. … … 52 53 */ 53 54 SelectionTableModel getSelectionTableModel(); 54 55 56 /** 57 * Get the current relation editor 58 * @return The relation editor object. 59 */ 55 60 IRelationEditor getEditor(); 61 62 /** 63 * Gets the model for the tag table. 64 * @return The tag editor model. 65 */ 56 66 TagEditorModel getTagModel(); 57 67 58 68 /** 59 69 * Get the text field that is used to edit the role. -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/IRelationEditorActionGroup.java
r14029 r14030 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.dialogs.relation.actions; 2 3 … … 11 12 /** 12 13 * An action group for the relation editor, to be used in one of the tool bars. 13 * 14 * 14 15 * @author Michael Zangl 15 16 * @since 14027 … … 19 20 /** 20 21 * Get the position at which the action group should be added. 21 * 22 * 22 23 * @return The order index, default is to add at the end. 23 24 */ … … 28 29 /** 29 30 * Get the actions in this action group. 30 * 31 * 31 32 * @param editorAccess 32 33 * Methods to access the relation editor. … … 35 36 List<AbstractRelationEditorAction> getActions(IRelationEditorActionAccess editorAccess); 36 37 38 /** 39 * Fills the toolbar with some action groups. 40 * <p> 41 * Groups are sorted by their ordered index and expert buttons are hidden in non-expert mode. 42 * @param toolbar The toolbar to add the buttons to. 43 * @param groups An unordered list of action groups. 44 * @param editorAccess The relation editor 45 */ 37 46 static void fillToolbar(JToolBar toolbar, List<IRelationEditorActionGroup> groups, 38 47 IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/IRelationEditorUpdateOn.java
r14029 r14030 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.dialogs.relation.actions; 2 3 … … 6 7 * <p> 7 8 * It holds common constants that are often used. 8 * 9 * 9 10 * @author Michael Zangl 10 11 * @since 14027 … … 23 24 .addListSelectionListener(action); 24 25 26 /** 27 * Update when a tag of the relation changed 28 */ 25 29 IRelationEditorUpdateOn TAG_CHANGE = (editor, action) -> editor.getTagModel().addPropertyChangeListener(action); 30 31 /** 32 * Update when a relation changed 33 */ 26 34 IRelationEditorUpdateOn SELECTION_TABLE_CHANGE = (editor, action) -> editor.getSelectionTableModel() 27 35 .addTableModelListener(action); 28 36 37 /** 38 * Registers the given action as listener on the relation editor. 39 * @param editor The relation editor to register the listeners on 40 * @param action The action that should be registered 41 */ 29 42 void register(IRelationEditorActionAccess editor, AbstractRelationEditorAction action); 30 43 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java
r14029 r14030 20 20 /** 21 21 * Constructs a new {@code MoveDownAction}. 22 * @param memberTable member table 23 * @param memberTableModel member table model 22 * @param editorAccess An interface to access the relation editor contents. 24 23 * @param actionMapKey action map key 25 24 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java
r14029 r14030 20 20 /** 21 21 * Constructs a new {@code MoveUpAction}. 22 * @param memberTable member table 23 * @param memberTableModel member table model 24 * @param actionMapKey key in table action map 22 * @param editorAccess An interface to access the relation editor contents. 23 * @param actionMapKey action map key 25 24 */ 26 25 public MoveUpAction(IRelationEditorActionAccess editorAccess, String actionMapKey) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/OKAction.java
r14029 r14030 17 17 /** 18 18 * Constructs a new {@code OKAction}. 19 * @param memberTable member table 20 * @param memberTableModel member table model 21 * @param tagModel tag editor model 22 * @param layer OSM data layer 23 * @param editor relation editor 24 * @param tfRole role text field 19 * @param editorAccess An interface to access the relation editor contents. 25 20 */ 26 21 public OKAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/PasteMembersAction.java
r14029 r14030 22 22 /** 23 23 * Constructs a new {@code PasteMembersAction}. 24 * @param memberTable member table 25 * @param layer OSM data layer 26 * @param editor relation editor 24 * @param editorAccess An interface to access the relation editor contents. 27 25 */ 28 26 public PasteMembersAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java
r14029 r14030 9 9 import javax.swing.JComponent; 10 10 import javax.swing.JOptionPane; 11 import javax.swing.JRootPane; 11 12 12 13 import org.openstreetmap.josm.Main; … … 16 17 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 17 18 import org.openstreetmap.josm.gui.MainApplication; 19 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 18 20 import org.openstreetmap.josm.tools.ImageProvider; 19 21 import org.openstreetmap.josm.tools.Shortcut; … … 28 30 /** 29 31 * Constructs a new {@code RefreshAction}. 30 * @param memberTable member table 31 * @param memberTableModel member table model 32 * @param layer OSM data layer 33 * @param editor relation editor 34 * @param tagModel tag editor model 32 * @param editorAccess An interface to access the relation editor contents. 35 33 */ 36 34 public RefreshAction(IRelationEditorActionAccess editorAccess) { … … 42 40 new ImageProvider("dialogs/refresh").getResource().attachImageIcon(this, true); 43 41 putValue(NAME, tr("Refresh")); 44 if (editorAccess.getEditor() instanceof JComponent) { 45 ((JComponent) editorAccess.getEditor()).getRootPane().getActionMap().put("refresh", this); 46 ((JComponent) editorAccess.getEditor()).getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), "refresh"); 42 IRelationEditor editor = editorAccess.getEditor(); 43 if (editor instanceof JComponent) { 44 JRootPane rootPane = ((JComponent) editorAccess.getEditor()).getRootPane(); 45 rootPane.getActionMap().put("refresh", this); 46 rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), "refresh"); 47 47 } 48 48 MainApplication.undoRedo.addCommandQueueListener(this); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java
r14029 r14030 20 20 /** 21 21 * Constructs a new {@code RemoveAction}. 22 * @param memberTable member table 23 * @param memberTableModel member table model 22 * @param editorAccess An interface to access the relation editor contents. 24 23 * @param actionMapKey action map key 25 24 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveSelectedAction.java
r14029 r14030 18 18 /** 19 19 * Constructs a new {@code RemoveSelectedAction}. 20 * @param memberTableModel member table model 21 * @param selectionTableModel selection table model 22 * @param layer OSM data layer 20 * @param editorAccess An interface to access the relation editor contents. 23 21 */ 24 22 public RemoveSelectedAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ReverseAction.java
r14029 r14030 17 17 /** 18 18 * Constructs a new {@code ReverseAction}. 19 * @param editorAccess 19 * @param editorAccess An interface to access the relation editor contents. 20 20 */ 21 21 public ReverseAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectAction.java
r14029 r14030 18 18 /** 19 19 * Constructs a new {@code SelectAction}. 20 * @param layer OSM data layer 21 * @param editor relation editor 20 * @param editorAccess An interface to access the relation editor contents. 22 21 */ 23 22 public SelectAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectPrimitivesForSelectedMembersAction.java
r14029 r14030 18 18 /** 19 19 * Select objects for selected relation members. 20 * @param memberTable member table 21 * @param memberTableModel member table model 22 * @param layer layer 20 * @param editorAccess An interface to access the relation editor contents. 23 21 */ 24 22 public SelectPrimitivesForSelectedMembersAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectedMembersForSelectionAction.java
r14029 r14030 17 17 /** 18 18 * Constructs a new {@code SelectedMembersForSelectionAction}. 19 * @param memberTableModel member table model 20 * @param selectionTableModel selection table model 21 * @param layer OSM data layer 19 * @param editorAccess An interface to access the relation editor contents. 22 20 */ 23 21 public SelectedMembersForSelectionAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SetRoleAction.java
r14029 r14030 27 27 /** 28 28 * Constructs a new {@code SetRoleAction}. 29 * @param memberTable member table 30 * @param memberTableModel member table model 31 * @param tfRole role text field 29 * @param editorAccess An interface to access the relation editor contents. 32 30 */ 33 31 public SetRoleAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java
r14029 r14030 20 20 /** 21 21 * Constructs a new {@code SortAction}. 22 * @param memberTable member table 23 * @param memberTableModel member table model 22 * @param editorAccess An interface to access the relation editor contents. 24 23 */ 25 24 public SortAction(IRelationEditorActionAccess editorAccess) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortBelowAction.java
r14029 r14030 17 17 /** 18 18 * Constructs a new {@code SortBelowAction}. 19 * @param memberTable member table 20 * @param memberTableModel member table model 19 * @param editorAccess An interface to access the relation editor contents. 21 20 */ 22 21 public SortBelowAction(IRelationEditorActionAccess editorAccess) { … … 35 34 @Override 36 35 protected void updateEnabledState() { 37 setEnabled(editorAccess.getMemberTableModel().getRowCount() > 0 && !editorAccess.getMemberTableModel().getSelectionModel().isSelectionEmpty()); 36 setEnabled(editorAccess.getMemberTableModel().getRowCount() > 0 37 && !editorAccess.getMemberTableModel().getSelectionModel().isSelectionEmpty()); 38 38 } 39 39 40 40 @Override 41 41 public boolean isExpertOnly() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java
r12865 r14030 31 31 public class RelationNodeMap { 32 32 33 private static final String ROLE_BACKWARD = "backward"; 34 33 35 private static class NodesWays { 34 36 public final Map<Node, Set<Integer>> nodes = new TreeMap<>(); … … 62 64 private final List<Integer> notSortable = new ArrayList<>(); 63 65 66 /** 67 * Gets the start node of the member, respecting the direction role. 68 * @param m The relation member. 69 * @return <code>null</code> if the member is no way, the node otherwise. 70 */ 64 71 public static Node firstOnewayNode(RelationMember m) { 65 72 if (!m.isWay()) return null; 66 if ( "backward".equals(m.getRole())) {73 if (ROLE_BACKWARD.equals(m.getRole())) { 67 74 return m.getWay().lastNode(); 68 75 } … … 70 77 } 71 78 79 /** 80 * Gets the end node of the member, respecting the direction role. 81 * @param m The relation member. 82 * @return <code>null</code> if the member is no way, the node otherwise. 83 */ 72 84 public static Node lastOnewayNode(RelationMember m) { 73 85 if (!m.isWay()) return null; 74 if ( "backward".equals(m.getRole())) {86 if (ROLE_BACKWARD.equals(m.getRole())) { 75 87 return m.getWay().firstNode(); 76 88 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionType.java
r12658 r14030 78 78 79 79 /** 80 * Returns t ooltip.81 * @return tooltip80 * Returns the tooltip to display when hovering over the relation member. 81 * @return The tooltip, never null. 82 82 * @since 10248 83 83 */ -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java
r14028 r14030 4 4 import static org.junit.Assert.assertNotNull; 5 5 import static org.junit.Assert.assertNull; 6 import static org.junit.Assert.assertSame; 6 7 7 8 import java.util.Collections; … … 94 95 /** 95 96 * Unit test of {@code GenericRelationEditor#build*} methods. 97 * <p> 98 * This test only tests if they do not throw exceptions. 96 99 */ 97 100 @Test … … 111 114 assertNotNull(top); 112 115 assertNotNull(tagEditorPanel.getModel()); 116 assertNotNull(tagModel); 117 assertSame(memberTableModel, memberTable.getModel()); 118 assertSame(selectionTableModel, selectionTable.getModel()); 113 119 } 114 120 }
Note:
See TracChangeset
for help on using the changeset viewer.