Changeset 18759 in josm
- Timestamp:
- 2023-06-14T20:58:53+02:00 (18 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r18442 r18759 65 65 */ 66 66 public SplitWayAction() { 67 super(tr("Split Way"), " splitway", tr("Split a way at the selected node."),67 super(tr("Split Way"), "mapmode/splitway", tr("Split a way at the selected node."), 68 68 Shortcut.registerShortcut("tools:splitway", tr("Tools: {0}", tr("Split Way")), KeyEvent.VK_P, Shortcut.DIRECT), true); 69 69 setHelpId(ht("/Action/SplitWay")); … … 147 147 // Finally, applicableWays contains only one perfect way 148 148 final Way selectedWay = applicableWays.get(0); 149 final List<List<Node>> wayChunks = SplitWayCommand.buildSplitChunks(selectedWay, selectedNodes); 149 final List<OsmPrimitive> sel = new ArrayList<>(ds.getSelectedRelations()); 150 sel.addAll(selectedWays); 151 doSplitWayShowSegmentSelection(selectedWay, selectedNodes, sel); 152 } 153 154 /** 155 * Perform way splitting after presenting the user with a choice which way segment history should be preserved (in expert mode) 156 * @param splitWay The way to split 157 * @param splitNodes The nodes at which the way should be split 158 * @param selection (Optional) selection which should be updated 159 * 160 * @since 18759 161 */ 162 public static void doSplitWayShowSegmentSelection(Way splitWay, List<Node> splitNodes, List<OsmPrimitive> selection) { 163 final List<List<Node>> wayChunks = SplitWayCommand.buildSplitChunks(splitWay, splitNodes); 150 164 if (wayChunks != null) { 151 final List<OsmPrimitive> sel = new ArrayList<>(ds.getSelectedRelations()); 152 sel.addAll(selectedWays); 153 154 final List<Way> newWays = SplitWayCommand.createNewWaysFromChunks(selectedWay, wayChunks); 165 final List<Way> newWays = SplitWayCommand.createNewWaysFromChunks(splitWay, wayChunks); 155 166 final Way wayToKeep = SplitWayCommand.Strategy.keepLongestChunk().determineWayToKeep(newWays); 156 167 157 if (ExpertToggleAction.isExpert() && !s electedWay.isNew()) {158 final ExtendedDialog dialog = new SegmentToKeepSelectionDialog(s electedWay, newWays, wayToKeep, selectedNodes, sel);168 if (ExpertToggleAction.isExpert() && !splitWay.isNew()) { 169 final ExtendedDialog dialog = new SegmentToKeepSelectionDialog(splitWay, newWays, wayToKeep, splitNodes, selection); 159 170 dialog.toggleEnable("way.split.segment-selection-dialog"); 160 171 if (!dialog.toggleCheckState()) { … … 165 176 } 166 177 if (wayToKeep != null) { 167 doSplitWay(s electedWay, wayToKeep, newWays, sel);178 doSplitWay(splitWay, wayToKeep, newWays, selection); 168 179 } 169 180 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r18458 r18759 185 185 * @return extended modifiers 186 186 */ 187 @SuppressWarnings("deprecation")188 187 private static int mapOldModifiers(int modifiers) { 189 188 if ((modifiers & InputEvent.CTRL_MASK) != 0) { 190 189 modifiers |= InputEvent.CTRL_DOWN_MASK; 190 } 191 if ((modifiers & InputEvent.META_MASK) != 0) { 192 modifiers |= InputEvent.META_DOWN_MASK; 191 193 } 192 194 if ((modifiers & InputEvent.ALT_MASK) != 0) { -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r18755 r18759 52 52 import org.openstreetmap.josm.actions.mapmode.SelectAction; 53 53 import org.openstreetmap.josm.actions.mapmode.SelectLassoAction; 54 import org.openstreetmap.josm.actions.mapmode.SplitMode; 54 55 import org.openstreetmap.josm.actions.mapmode.ZoomAction; 55 56 import org.openstreetmap.josm.data.ViewportData; … … 246 247 mapModeDelete = new DeleteAction(); 247 248 248 addMapMode(new IconToggleButton(mapModeSelect ));249 addMapMode(new IconToggleButton(mapModeSelect, false)); 249 250 addMapMode(new IconToggleButton(mapModeSelectLasso, true)); 250 addMapMode(new IconToggleButton(mapModeDraw ));251 addMapMode(new IconToggleButton(mapModeDraw, false)); 251 252 addMapMode(new IconToggleButton(mapModeZoom, true)); 252 253 addMapMode(new IconToggleButton(mapModeDelete, true)); … … 254 255 addMapMode(new IconToggleButton(new ExtrudeAction(), true)); 255 256 addMapMode(new IconToggleButton(new ImproveWayAccuracyAction(), false)); 257 addMapMode(new IconToggleButton(new SplitMode(), false)); 256 258 toolBarActionsGroup.setSelected(allMapModeButtons.get(0).getModel(), true); 257 259 toolBarActions.setFloatable(false); -
trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java
r13434 r18759 80 80 */ 81 81 public boolean setHighlight(OsmPrimitive p, boolean flag) { 82 return setHighlight(p, flag, new HashSet< Relation>());82 return setHighlight(p, flag, new HashSet<>()); 83 83 } 84 84 … … 109 109 110 110 /** 111 * Returns an (unmodifiable) set of currently highlighted primitives 112 * @return Currently highlighted primitives 113 * 114 * @since 18759 115 */ 116 public Set<OsmPrimitive> getHighlighted() { 117 return Collections.unmodifiableSet(highlightedPrimitives); 118 } 119 120 /** 111 121 * Clear highlighting of all remembered primitives 112 122 */ … … 116 126 } 117 127 highlightedPrimitives.clear(); 128 } 129 130 /** 131 * Check whether there are any primitives highlighted 132 * @return true when there are highlighted primitives 133 * 134 * @since 18759 135 */ 136 public boolean anyHighlighted() { 137 return !highlightedPrimitives.isEmpty(); 118 138 } 119 139
Note:
See TracChangeset
for help on using the changeset viewer.