Changeset 14030 in josm for trunk


Ignore:
Timestamp:
2018-07-15T12:39:47+02:00 (6 years ago)
Author:
michael2402
Message:

See #16388: Fix Checkstyle / Test issues.

Location:
trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r14029 r14030  
    613613        /**
    614614         * Constructs a new {@code LeftButtonToolbar}.
    615          * @param re relation editor
     615         * @param editorAccess relation editor
    616616         */
    617617        LeftButtonToolbar(IRelationEditorActionAccess editorAccess) {
     
    650650
    651651            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");
    655658            inputMap.put((KeyStroke) new DownloadIncompleteMembersAction(
    656659                    editorAccess, "downloadIncomplete").getValue(AbstractAction.ACCELERATOR_KEY), "downloadIncomplete");
     
    660663    /**
    661664     * 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
    666666     *
    667667     * @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.
    12package org.openstreetmap.josm.gui.dialogs.relation;
    23
     
    910/**
    1011 * This class allows to hook into the relation editor. It can be used to overwrite specific behavior.
    11  * 
     12 *
    1213 * @author Michael Zangl
    1314 * @since 14027
    1415 */
    15 public class RelationEditorHooks {
    16    
     16public final class RelationEditorHooks {
     17
    1718    private static final CopyOnWriteArrayList<IRelationEditorActionGroup> memberActions = new CopyOnWriteArrayList<>();
    1819    private static final CopyOnWriteArrayList<IRelationEditorActionGroup> selectionActions = new CopyOnWriteArrayList<>();
     
    2122        // only static methods.
    2223    }
    23    
     24
    2425    /**
    2526     * Adds actions to the members action toolbar
     
    2930        memberActions.add(group);
    3031    }
    31    
     32
    3233    /**
    3334     * Adds actions to the selection action toolbar
     
    3738        selectionActions.add(group);
    3839    }
    39    
     40
    4041    /* package */ static List<IRelationEditorActionGroup> getMemberActions() {
    4142        return Collections.unmodifiableList(memberActions);
    4243    }
    43    
     44
    4445    /* package */ static List<IRelationEditorActionGroup> getSelectActions() {
    4546        return Collections.unmodifiableList(selectionActions);
    4647    }
    47    
     48
    4849}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorAction.java

    r14029 r14030  
    2626/**
    2727 * Abstract superclass of relation editor actions.
    28  * 
     28 *
    2929 * @since 9496
    3030 */
     
    3636    /**
    3737     * Create a new relation editor action
    38      * 
     38     *
    3939     * @param editorAccess
    4040     *            The editor this action is for
    41      * @param actionMapKey
    42      *            The key for the member table action map.
    4341     * @param updateOn
    4442     *            The events that may cause the enabled state of this button to
     
    5755    /**
    5856     * Create a new relation editor action
    59      * 
     57     *
    6058     * @param editorAccess
    6159     *            The editor this action is for
     
    127125    }
    128126
     127    /**
     128     * Indicates that this action only visible in expert mode
     129     * @return <code>true</code> for expert mode actions.
     130     * @since 14027
     131     */
    129132    public boolean isExpertOnly() {
    130133        return false;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddFromSelectionAction.java

    r14029 r14030  
    3434        ConditionalOptionPaneUtil.startBulkOperation("add_primitive_to_relation");
    3535        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)) {
    3738                GenericRelationEditor.warnOfCircularReferences(primitive);
    3839                continue;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAfterSelection.java

    r14029 r14030  
    1919    /**
    2020     * 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.
    2422     */
    2523    public AddSelectedAfterSelection(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtEndAction.java

    r14029 r14030  
    1919    /**
    2020     * 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.
    2422     */
    2523    public AddSelectedAtEndAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtStartAction.java

    r14029 r14030  
    1919    /**
    2020     * 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.
    2422     */
    2523    public AddSelectedAtStartAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedBeforeSelection.java

    r14029 r14030  
    1919    /**
    2020     * 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.
    2422     */
    2523    public AddSelectedBeforeSelection(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ApplyAction.java

    r14029 r14030  
    1717    /**
    1818     * 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.
    2420     */
    2521    public ApplyAction(IRelationEditorActionAccess editorAccess) {
     
    2824        new ImageProvider("save").getResource().attachImageIcon(this, true);
    2925        putValue(NAME, tr("Apply"));
    30         updateEnabledState();       
     26        updateEnabledState();
    3127    }
    3228
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/CancelAction.java

    r14029 r14030  
    2626    /**
    2727     * 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.
    3429     */
    3530    public CancelAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/CopyMembersAction.java

    r14029 r14030  
    1818    /**
    1919     * 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.
    2321     */
    2422    public CopyMembersAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DeleteCurrentRelationAction.java

    r14029 r14030  
    66import java.awt.event.ActionEvent;
    77import java.beans.PropertyChangeEvent;
    8 import java.beans.PropertyChangeListener;
    98
    109import org.openstreetmap.josm.actions.mapmode.DeleteAction;
     
    1716 * @since 9496
    1817 */
    19 public class DeleteCurrentRelationAction extends AbstractRelationEditorAction implements PropertyChangeListener {
     18public class DeleteCurrentRelationAction extends AbstractRelationEditorAction {
    2019    private static final long serialVersionUID = 1L;
    2120
    2221    /**
    2322     * 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.
    2624     */
    2725    public DeleteCurrentRelationAction(IRelationEditorActionAccess editorAccess) {
     
    4846    @Override
    4947    public void propertyChange(PropertyChangeEvent evt) {
     48        // Do not call super.
    5049        if (GenericRelationEditor.RELATION_SNAPSHOT_PROP.equals(evt.getPropertyName())) {
    5150            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java

    r14029 r14030  
    2323    /**
    2424     * 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.
    2726     * @param actionMapKey action map key
    28      * @param layer OSM data layer
    29      * @param editor relation editor
    3027     */
    3128    public DownloadIncompleteMembersAction(IRelationEditorActionAccess editorAccess, String actionMapKey) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadSelectedIncompleteMembersAction.java

    r14029 r14030  
    2020    /**
    2121     * 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.
    2723     */
    2824    public DownloadSelectedIncompleteMembersAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DuplicateRelationAction.java

    r14029 r14030  
    2020    /**
    2121     * 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.
    2523     */
    2624    public DuplicateRelationAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/EditAction.java

    r14029 r14030  
    2323    /**
    2424     * 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.
    2826     */
    2927    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.
    12package org.openstreetmap.josm.gui.dialogs.relation.actions;
    23
     
    1415 * This interface provides access to the relation editor for actions.
    1516 * <p>
    16  * 
     17 *
    1718 * @author Michael Zangl
    1819 * @since 14027
     
    3435     */
    3536    MemberTable getMemberTable();
    36    
     37
    3738    /**
    3839     * Get the model the member table is using.
     
    4041     */
    4142    MemberTableModel getMemberTableModel();
    42    
     43
    4344    /**
    4445     * Get the table that displays the current user selection
     
    4647     */
    4748    SelectionTable getSelectionTable();
    48    
     49
    4950    /**
    5051     * Get the model that the selection table is based on.
     
    5253     */
    5354    SelectionTableModel getSelectionTableModel();
    54    
     55
     56    /**
     57     * Get the current relation editor
     58     * @return The relation editor object.
     59     */
    5560    IRelationEditor getEditor();
     61
     62    /**
     63     * Gets the model for the tag table.
     64     * @return The tag editor model.
     65     */
    5666    TagEditorModel getTagModel();
    57    
     67
    5868    /**
    5969     * 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.
    12package org.openstreetmap.josm.gui.dialogs.relation.actions;
    23
     
    1112/**
    1213 * An action group for the relation editor, to be used in one of the tool bars.
    13  * 
     14 *
    1415 * @author Michael Zangl
    1516 * @since 14027
     
    1920    /**
    2021     * Get the position at which the action group should be added.
    21      * 
     22     *
    2223     * @return The order index, default is to add at the end.
    2324     */
     
    2829    /**
    2930     * Get the actions in this action group.
    30      * 
     31     *
    3132     * @param editorAccess
    3233     *            Methods to access the relation editor.
     
    3536    List<AbstractRelationEditorAction> getActions(IRelationEditorActionAccess editorAccess);
    3637
     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     */
    3746    static void fillToolbar(JToolBar toolbar, List<IRelationEditorActionGroup> groups,
    3847            IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/IRelationEditorUpdateOn.java

    r14029 r14030  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.gui.dialogs.relation.actions;
    23
     
    67 * <p>
    78 * It holds common constants that are often used.
    8  * 
     9 *
    910 * @author Michael Zangl
    1011 * @since 14027
     
    2324            .addListSelectionListener(action);
    2425
     26    /**
     27     * Update when a tag of the relation changed
     28     */
    2529    IRelationEditorUpdateOn TAG_CHANGE = (editor, action) -> editor.getTagModel().addPropertyChangeListener(action);
     30
     31    /**
     32     * Update when a relation changed
     33     */
    2634    IRelationEditorUpdateOn SELECTION_TABLE_CHANGE = (editor, action) -> editor.getSelectionTableModel()
    2735            .addTableModelListener(action);
    2836
     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     */
    2942    void register(IRelationEditorActionAccess editor, AbstractRelationEditorAction action);
    3043}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java

    r14029 r14030  
    2020    /**
    2121     * 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.
    2423     * @param actionMapKey action map key
    2524     */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java

    r14029 r14030  
    2020    /**
    2121     * 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
    2524     */
    2625    public MoveUpAction(IRelationEditorActionAccess editorAccess, String actionMapKey) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/OKAction.java

    r14029 r14030  
    1717    /**
    1818     * 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.
    2520     */
    2621    public OKAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/PasteMembersAction.java

    r14029 r14030  
    2222    /**
    2323     * 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.
    2725     */
    2826    public PasteMembersAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java

    r14029 r14030  
    99import javax.swing.JComponent;
    1010import javax.swing.JOptionPane;
     11import javax.swing.JRootPane;
    1112
    1213import org.openstreetmap.josm.Main;
     
    1617import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    1718import org.openstreetmap.josm.gui.MainApplication;
     19import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
    1820import org.openstreetmap.josm.tools.ImageProvider;
    1921import org.openstreetmap.josm.tools.Shortcut;
     
    2830    /**
    2931     * 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.
    3533     */
    3634    public RefreshAction(IRelationEditorActionAccess editorAccess) {
     
    4240        new ImageProvider("dialogs/refresh").getResource().attachImageIcon(this, true);
    4341        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");
    4747        }
    4848        MainApplication.undoRedo.addCommandQueueListener(this);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java

    r14029 r14030  
    2020    /**
    2121     * 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.
    2423     * @param actionMapKey action map key
    2524     */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveSelectedAction.java

    r14029 r14030  
    1818    /**
    1919     * 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.
    2321     */
    2422    public RemoveSelectedAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ReverseAction.java

    r14029 r14030  
    1717    /**
    1818     * Constructs a new {@code ReverseAction}.
    19      * @param editorAccess
     19     * @param editorAccess An interface to access the relation editor contents.
    2020     */
    2121    public ReverseAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectAction.java

    r14029 r14030  
    1818    /**
    1919     * 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.
    2221     */
    2322    public SelectAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectPrimitivesForSelectedMembersAction.java

    r14029 r14030  
    1818    /**
    1919     * 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.
    2321     */
    2422    public SelectPrimitivesForSelectedMembersAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectedMembersForSelectionAction.java

    r14029 r14030  
    1717    /**
    1818     * 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.
    2220     */
    2321    public SelectedMembersForSelectionAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SetRoleAction.java

    r14029 r14030  
    2727    /**
    2828     * 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.
    3230     */
    3331    public SetRoleAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java

    r14029 r14030  
    2020    /**
    2121     * 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.
    2423     */
    2524    public SortAction(IRelationEditorActionAccess editorAccess) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortBelowAction.java

    r14029 r14030  
    1717    /**
    1818     * 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.
    2120     */
    2221    public SortBelowAction(IRelationEditorActionAccess editorAccess) {
     
    3534    @Override
    3635    protected void updateEnabledState() {
    37         setEnabled(editorAccess.getMemberTableModel().getRowCount() > 0 && !editorAccess.getMemberTableModel().getSelectionModel().isSelectionEmpty());
     36        setEnabled(editorAccess.getMemberTableModel().getRowCount() > 0
     37                && !editorAccess.getMemberTableModel().getSelectionModel().isSelectionEmpty());
    3838    }
    39    
     39
    4040    @Override
    4141    public boolean isExpertOnly() {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java

    r12865 r14030  
    3131public class RelationNodeMap {
    3232
     33    private static final String ROLE_BACKWARD = "backward";
     34
    3335    private static class NodesWays {
    3436        public final Map<Node, Set<Integer>> nodes = new TreeMap<>();
     
    6264    private final List<Integer> notSortable = new ArrayList<>();
    6365
     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     */
    6471    public static Node firstOnewayNode(RelationMember m) {
    6572        if (!m.isWay()) return null;
    66         if ("backward".equals(m.getRole())) {
     73        if (ROLE_BACKWARD.equals(m.getRole())) {
    6774            return m.getWay().lastNode();
    6875        }
     
    7077    }
    7178
     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     */
    7284    public static Node lastOnewayNode(RelationMember m) {
    7385        if (!m.isWay()) return null;
    74         if ("backward".equals(m.getRole())) {
     86        if (ROLE_BACKWARD.equals(m.getRole())) {
    7587            return m.getWay().firstNode();
    7688        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionType.java

    r12658 r14030  
    7878
    7979    /**
    80      * Returns tooltip.
    81      * @return tooltip
     80     * Returns the tooltip to display when hovering over the relation member.
     81     * @return The tooltip, never null.
    8282     * @since 10248
    8383     */
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java

    r14028 r14030  
    44import static org.junit.Assert.assertNotNull;
    55import static org.junit.Assert.assertNull;
     6import static org.junit.Assert.assertSame;
    67
    78import java.util.Collections;
     
    9495    /**
    9596     * Unit test of {@code GenericRelationEditor#build*} methods.
     97     * <p>
     98     * This test only tests if they do not throw exceptions.
    9699     */
    97100    @Test
     
    111114        assertNotNull(top);
    112115        assertNotNull(tagEditorPanel.getModel());
     116        assertNotNull(tagModel);
     117        assertSame(memberTableModel, memberTable.getModel());
     118        assertSame(selectionTableModel, selectionTable.getModel());
    113119    }
    114120}
Note: See TracChangeset for help on using the changeset viewer.