Ignore:
Timestamp:
2019-01-06T12:11:10+01:00 (5 years ago)
Author:
simon04
Message:

Extract PropertiesMembershipChoiceDialog.ExistingBothNew enum

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r14397 r14650  
    3737import org.openstreetmap.josm.gui.Notification;
    3838import org.openstreetmap.josm.gui.dialogs.PropertiesMembershipChoiceDialog;
    39 import org.openstreetmap.josm.gui.dialogs.PropertiesMembershipChoiceDialog.ExistingBothNewChoice;
     39import org.openstreetmap.josm.gui.dialogs.PropertiesMembershipChoiceDialog.ExistingBothNew;
    4040import org.openstreetmap.josm.tools.Logging;
    4141import org.openstreetmap.josm.tools.Shortcut;
     
    180180    }
    181181
    182     private static void updateProperties(ExistingBothNewChoice tags, Node existingNode, Iterable<Node> newNodes, Collection<Command> cmds) {
    183         if (tags != null && tags.newNode.isSelected()) {
     182    private static void updateProperties(ExistingBothNew tags, Node existingNode, Iterable<Node> newNodes, Collection<Command> cmds) {
     183        if (ExistingBothNew.NEW.equals(tags)) {
    184184            final Node newSelectedNode = new Node(existingNode);
    185185            newSelectedNode.removeAll();
    186186            cmds.add(new ChangeCommand(existingNode, newSelectedNode));
    187         } else if (tags != null && tags.oldNode.isSelected()) {
     187        } else if (ExistingBothNew.OLD.equals(tags)) {
    188188            for (Node newNode : newNodes) {
    189189                newNode.removeAll();
     
    192192    }
    193193
    194     private static void updateMemberships(ExistingBothNewChoice memberships, Node existingNode, List<Node> newNodes, Collection<Command> cmds) {
    195         if (memberships != null && memberships.bothNodes.isSelected()) {
     194    private static void updateMemberships(ExistingBothNew memberships, Node existingNode, List<Node> newNodes, Collection<Command> cmds) {
     195        if (ExistingBothNew.BOTH.equals(memberships)) {
    196196            fixRelations(existingNode, cmds, newNodes, false);
    197         } else if (memberships != null && memberships.newNode.isSelected()) {
     197        } else if (ExistingBothNew.NEW.equals(memberships)) {
    198198            fixRelations(existingNode, cmds, newNodes, true);
    199199        }
     
    203203     * Assumes there is one tagged Node stored in selectedNode that it will try to unglue.
    204204     * (i.e. copy node and remove all tags from the old one. Relations will not be removed)
    205      * @param e event that trigerred the action
     205     * @param e event that triggered the action
    206206     */
    207207    private void unglueOneNodeAtMostOneWay(ActionEvent e) {
Note: See TracChangeset for help on using the changeset viewer.