Changeset 8855 in josm for trunk/src/org
- Timestamp:
- 2015-10-10T21:01:42+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 54 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r8851 r8855 539 539 } 540 540 541 protected Node getStartNode() {542 Set<Node> nodes = getNodes();543 for (Node n: nodes) {544 if (successors.get(n) != null && successors.get(n).size() == 1)545 return n;546 }547 return null;548 }549 550 541 protected Set<Node> getTerminalNodes() { 551 542 Set<Node> ret = new LinkedHashSet<>(); -
trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
r8846 r8855 217 217 } 218 218 219 // and display an error message. The while (true)ensures that the dialog pops up again219 // and display an error message. The while loop ensures that the dialog pops up again 220 220 JOptionPane.showMessageDialog(Main.parent, 221 221 tr("Couldn''t match the entered link or id to the selected service. Please try again."), -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r8850 r8855 455 455 v = EN.diff(v, segment); 456 456 } else throw new IllegalStateException(); 457 /**458 * When summing up the length of the sum vector should increase.459 * However, it is possible to construct ways, such that this assertion fails.460 * So only uncomment this for testing461 **/462 // if (segDirections[i].ordinal() % 2 == 0) {463 // if (EN.abs(h) < lh) throw new AssertionError();464 // lh = EN.abs(h);465 // } else {466 // if (EN.abs(v) < lv) throw new AssertionError();467 // lv = EN.abs(v);468 // }469 457 } 470 458 // rotate the vertical vector by 90 degrees (clockwise) and add it to the horizontal vector 471 459 segSum = EN.sum(h, new EastNorth(v.north(), -v.east())); 472 // if (EN.abs(segSum) < lh) throw new AssertionError();473 460 this.heading = EN.polar(new EastNorth(0., 0.), segSum); 474 461 } -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r8846 r8855 56 56 private final Collection<PrimitiveData> source; 57 57 private final Collection<OsmPrimitive> target; 58 private final List<Tag> commands = new ArrayList<>();58 private final List<Tag> tags = new ArrayList<>(); 59 59 60 60 public TagPaster(Collection<PrimitiveData> source, Collection<OsmPrimitive> target) { … … 109 109 } 110 110 111 protected void build ChangeCommand(Collection<? extends OsmPrimitive> selection,TagCollection tc) {111 protected void buildTags(TagCollection tc) { 112 112 for (String key : tc.getKeys()) { 113 commands.add(new Tag(key, tc.getValues(key).iterator().next()));113 tags.add(new Tag(key, tc.getValues(key).iterator().next())); 114 114 } 115 115 } … … 161 161 if (dialog.isCanceled()) 162 162 return; 163 build ChangeCommand(target,dialog.getResolution());163 buildTags(dialog.getResolution()); 164 164 } else { 165 165 // no conflicts in the source tags to resolve. Just apply the tags 166 166 // to the target primitives 167 167 // 168 build ChangeCommand(target,tc);168 buildTags(tc); 169 169 } 170 170 } … … 185 185 * Replies true if this a heterogeneous source can be pasted without conflict to targets 186 186 * 187 * @param targets the collection of target primitives188 187 * @return true if this a heterogeneous source can be pasted without conflicts to targets 189 188 */ 190 protected boolean canPasteFromHeterogeneousSourceWithoutConflict( Collection<OsmPrimitive> targets) {189 protected boolean canPasteFromHeterogeneousSourceWithoutConflict() { 191 190 for (OsmPrimitiveType type : OsmPrimitiveType.dataValues()) { 192 191 if (hasTargetPrimitives(type.getOsmClass())) { … … 200 199 201 200 /** 202 * Pastes the tags in the current selection of the paste buffer to a set of target 203 * primitives. 201 * Pastes the tags in the current selection of the paste buffer to a set of target primitives. 204 202 */ 205 203 protected void pasteFromHeterogeneousSource() { 206 if (canPasteFromHeterogeneousSourceWithoutConflict( target)) {204 if (canPasteFromHeterogeneousSourceWithoutConflict()) { 207 205 for (OsmPrimitiveType type : OsmPrimitiveType.dataValues()) { 208 206 if (hasSourceTagsByType(type) && hasTargetPrimitives(type.getOsmClass())) { 209 build ChangeCommand(target,getSourceTagsByType(type));207 buildTags(getSourceTagsByType(type)); 210 208 } 211 209 } … … 224 222 for (OsmPrimitiveType type : OsmPrimitiveType.dataValues()) { 225 223 if (hasSourceTagsByType(type) && hasTargetPrimitives(type.getOsmClass())) { 226 build ChangeCommand(OsmPrimitive.getFilteredList(target, type.getOsmClass()),dialog.getResolution(type));224 buildTags(dialog.getResolution(type)); 227 225 } 228 226 } … … 231 229 232 230 public List<Tag> execute() { 233 commands.clear();231 tags.clear(); 234 232 if (isHeteogeneousSource()) { 235 233 pasteFromHeterogeneousSource(); … … 237 235 pasteFromHomogeneousSource(); 238 236 } 239 return commands;237 return tags; 240 238 } 241 239 -
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r8443 r8855 127 127 } 128 128 129 protected int getNumWaysInSelection() {130 if (getCurrentDataSet() == null) return 0;131 int ret = 0;132 for (OsmPrimitive primitive : getCurrentDataSet().getSelected()) {133 if (primitive instanceof Way) {134 ret++;135 }136 }137 return ret;138 }139 140 129 @Override 141 130 protected void updateEnabledState() { -
trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java
r8624 r8855 81 81 try { 82 82 final long id = Long.parseLong(searchTerm); 83 new DownloadNotesTask().download( false,id, null);83 new DownloadNotesTask().download(id, null); 84 84 return; 85 85 } catch (NumberFormatException ignore) { -
trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
r8836 r8855 48 48 @Override 49 49 public void actionPerformed(ActionEvent ev) { 50 doValidate( ev,true);50 doValidate(true); 51 51 } 52 52 … … 58 58 * revalidated 59 59 * 60 * @param ev The event61 60 * @param getSelectedItems If selected or last selected items must be validated 62 61 */ 63 public void doValidate( ActionEvent ev,boolean getSelectedItems) {62 public void doValidate(boolean getSelectedItems) { 64 63 if (Main.map == null || !Main.map.isVisible()) 65 64 return; -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java
r8836 r8855 38 38 private DownloadTask downloadTask; 39 39 40 public Future<?> download( boolean newLayer,long id, ProgressMonitor progressMonitor) {40 public Future<?> download(long id, ProgressMonitor progressMonitor) { 41 41 final String url = OsmApi.getOsmApi().getBaseUrl() + "notes/" + id; 42 42 downloadTask = new DownloadRawUrlTask(new OsmServerLocationReader(url), progressMonitor); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesUrlIdTask.java
r8624 r8855 18 18 final Matcher matcher = Pattern.compile(URL_ID_PATTERN).matcher(url); 19 19 if (matcher.matches()) { 20 return download( newLayer,Long.parseLong(matcher.group(2)), null);20 return download(Long.parseLong(matcher.group(2)), null); 21 21 } else { 22 22 throw new IllegalStateException("Failed to parse note id from " + url); -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r8850 r8855 236 236 Main.map.keyDetector.addModifierListener(this); 237 237 ignoreNextKeyRelease = true; 238 // would like to but haven't got mouse position yet:239 // computeHelperLine(false, false, false);240 238 } 241 239 -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r8510 r8855 21 21 * is another. 22 22 * 23 * MapModes should register/deregister all necessary listeners on the map's view 24 * control. 23 * MapModes should register/deregister all necessary listeners on the map's view control. 25 24 */ 26 25 public abstract class MapMode extends JosmAction implements MouseListener, MouseMotionListener { … … 32 31 /** 33 32 * Constructor for mapmodes without an menu 33 * @param mapFrame unused but kept for plugin compatibility. Can be {@code null} 34 34 */ 35 35 public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, MapFrame mapFrame, Cursor cursor) { … … 41 41 /** 42 42 * Constructor for mapmodes with an menu (no shortcut will be registered) 43 * @param mapFrame unused but kept for plugin compatibility. Can be {@code null} 43 44 */ 44 45 public MapMode(String name, String iconName, String tooltip, MapFrame mapFrame, Cursor cursor) { … … 84 85 } 85 86 86 // By default, all tools will work with all layers. Can be overwritten to require 87 // a special type of layer 87 /** 88 * Determines if layer {@code l} is supported by this map mode. 89 * By default, all tools will work with all layers. 90 * Can be overwritten to require a special type of layer 91 * @param l layer 92 * @return {@code true} if the layer is supported by this map mode 93 */ 88 94 public boolean layerIsSupported(Layer l) { 89 return true;95 return l != null; 90 96 } 91 97 -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r8777 r8855 302 302 * <li>it is not referred to by other non-deleted primitives outside of <code>primitivesToDelete</code></li> 303 303 * </ul> 304 * @param layer the layer in whose context primitives are deleted305 304 * @param primitivesToDelete the primitives to delete 306 305 * @return the collection of nodes referred to by primitives in <code>primitivesToDelete</code> which 307 306 * can be deleted too 308 307 */ 309 protected static Collection<Node> computeNodesToDelete( OsmDataLayer layer,Collection<OsmPrimitive> primitivesToDelete) {308 protected static Collection<Node> computeNodesToDelete(Collection<OsmPrimitive> primitivesToDelete) { 310 309 Collection<Node> nodesToDelete = new HashSet<>(); 311 310 for (Way way : OsmPrimitive.getFilteredList(primitivesToDelete, Way.class)) { … … 379 378 if (alsoDeleteNodesInWay) { 380 379 // delete untagged nodes only referenced by primitives in primitivesToDelete, too 381 Collection<Node> nodesToDelete = computeNodesToDelete( layer,primitivesToDelete);380 Collection<Node> nodesToDelete = computeNodesToDelete(primitivesToDelete); 382 381 primitivesToDelete.addAll(nodesToDelete); 383 382 } -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r8836 r8855 215 215 if (this.layers.isEmpty()) 216 216 throw new IllegalArgumentException(tr("No layers defined by getCapabilities document: {0}", info.getUrl())); 217 218 // Not needed ? initProjection();219 217 } 220 218 … … 387 385 388 386 /** 389 * Initializes projection for this TileSource with current projection390 */391 protected void initProjection() {392 initProjection(Main.getProjection());393 }394 395 /**396 387 * Initializes projection for this TileSource with projection 397 388 * @param proj projection to be used by this TileSource -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r8840 r8855 1224 1224 } 1225 1225 1226 void fireHighlightingChanged( OsmPrimitive primitive) {1226 void fireHighlightingChanged() { 1227 1227 highlightUpdateCount++; 1228 1228 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r8840 r8855 640 640 updateFlags(FLAG_HIGHLIGHTED, highlighted); 641 641 if (dataSet != null) { 642 dataSet.fireHighlightingChanged( this);642 dataSet.fireHighlightingChanged(); 643 643 } 644 644 } -
trunk/src/org/openstreetmap/josm/data/osm/Storage.java
r8840 r8855 267 267 */ 268 268 private int rehash(int h) { 269 //return 54435761*h;270 269 return 1103515245*h >> 2; 271 270 } … … 361 360 }; 362 361 } 363 /*364 public static <O> Hash<O,O> identityHash() {365 return new Hash<O,O>() {366 public int getHashCode(O t) {367 return System.identityHashCode(t);368 }369 public boolean equals(O t1, O t2) {370 return t1 == t2;371 }372 };373 }374 */375 362 376 363 private final class FMap<K> implements Map<K, T> { -
trunk/src/org/openstreetmap/josm/data/osm/TigerUtils.java
r8390 r8855 45 45 } 46 46 47 public static String combineTags(S tring name, Set<String> values) {47 public static String combineTags(Set<String> values) { 48 48 Set<Object> resultSet = new TreeSet<>(); 49 49 for (String value: values) { … … 66 66 return combined.toString(); 67 67 } 68 69 public static String combineTags(String name, String t1, String t2) {70 Set<String> set = new TreeSet<>();71 set.add(t1);72 set.add(t2);73 return TigerUtils.combineTags(name, set);74 }75 68 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r8840 r8855 6 6 import java.awt.Graphics2D; 7 7 import java.awt.Point; 8 import java.awt.Polygon;9 8 import java.awt.Rectangle; 10 9 import java.awt.RenderingHints; … … 455 454 456 455 /** 457 * Checks if a polygon is visible in display.458 *459 * @param polygon The polygon to check.460 * @return <code>true</code> if polygon is visible.461 */462 protected boolean isPolygonVisible(Polygon polygon) {463 Rectangle bounds = polygon.getBounds();464 if (bounds.width == 0 && bounds.height == 0) return false;465 if (bounds.x > nc.getWidth()) return false;466 if (bounds.y > nc.getHeight()) return false;467 if (bounds.x + bounds.width < 0) return false;468 if (bounds.y + bounds.height < 0) return false;469 return true;470 }471 472 /**473 456 * Finally display all segments in currect path. 474 457 */ -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r8849 r8855 263 263 } 264 264 // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead) 265 /* for (String a : OsmPrimitive.getDirectionKeys())266 presetsValueData.add(a);267 */268 265 for (String a : Main.pref.getCollection(ValidatorPreference.PREFIX + ".knownkeys", 269 266 Arrays.asList(new String[]{"is_in", "int_ref", "fixme", "population"}))) { … … 704 701 } 705 702 706 public boolean match( OsmPrimitive osm,Map<String, String> keys) {703 public boolean match(Map<String, String> keys) { 707 704 for (Entry<String, String> prop: keys.entrySet()) { 708 705 String key = prop.getKey(); … … 784 781 785 782 for (CheckerElement ce : data) { 786 if (!ce.match( osm,keys))783 if (!ce.match(keys)) 787 784 return false; 788 785 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java
r8829 r8855 4 4 import static org.openstreetmap.josm.tools.I18n.marktr; 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 7 import java.util.Map;8 6 9 7 import org.openstreetmap.josm.command.Command; … … 88 86 } 89 87 90 private boolean contains(Map.Entry<String, String> tag, String s) {91 return tag.getKey().indexOf(s) != -1 || tag.getValue().indexOf(s) != -1;92 }93 94 88 @Override 95 89 public Command fixError(TestError testError) { -
trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
r8513 r8855 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Component;7 6 import java.text.MessageFormat; 8 7 … … 65 64 !Main.isOffline(OnlineResource.OSM_API)) { 66 65 try { 67 instance.initFromOAuth( Main.parent);66 instance.initFromOAuth(); 68 67 } catch (Exception e) { 69 68 Main.error(e); … … 211 210 * Initializes the user identity manager from OAuth request of user details. 212 211 * This method should be called if {@code osm-server.auth-method} is set to {@code oauth}. 213 * @param parent component relative to which the {@link PleaseWaitDialog} is displayed.214 212 * @see #initFromPreferences 215 213 * @since 5434 216 214 */ 217 public void initFromOAuth( Component parent) {215 public void initFromOAuth() { 218 216 try { 219 217 UserInfo info = new OsmServerUserInfoReader().fetchUserInfo(NullProgressMonitor.INSTANCE); … … 283 281 if (OsmApi.isUsingOAuth()) { 284 282 try { 285 getInstance().initFromOAuth( Main.parent);283 getInstance().initFromOAuth(); 286 284 } catch (Exception e) { 287 285 Main.error(e); -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r8840 r8855 927 927 @Override 928 928 public synchronized void addMouseListener(MouseListener ml) { 929 //super.addMouseListener(ml);930 929 lonText.addMouseListener(ml); 931 930 latText.addMouseListener(ml); -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r8732 r8855 198 198 } 199 199 200 protected Point getTopLeftCoordinates() {201 return new Point(center.x - (getWidth() / 2), center.y - (getHeight() / 2));202 }203 204 200 /** 205 201 * Draw the map. -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java
r8510 r8855 53 53 * @param isSelected true, if the current row is selected 54 54 */ 55 protected 55 protected void renderNode(ListMergeModel<Node>.EntriesTableModel model, Node node, int row, boolean isSelected) { 56 56 setIcon(icon); 57 57 setBorder(null); … … 84 84 /** 85 85 * render the row id 86 * @param model 86 * @param model the model 87 87 * @param row the row index 88 * @param isSelected true, if the current row is selected89 88 */ 90 protected void renderRowId(ListMergeModel<Node>.EntriesTableModel model, int row, boolean isSelected) {89 protected void renderRowId(ListMergeModel<Node>.EntriesTableModel model, int row) { 91 90 setIcon(null); 92 91 setBorder(rowNumberBorder); … … 111 110 switch(column) { 112 111 case 0: 113 renderRowId(getModel(table), row , isSelected);112 renderRowId(getModel(table), row); 114 113 break; 115 114 case 1: -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtil.java
r8510 r8855 68 68 for (String key: tc.getKeys()) { 69 69 if (TigerUtils.isTigerTag(key)) { 70 tc.setUniqueForKey(key, TigerUtils.combineTags( key,tc.getValues(key)));70 tc.setUniqueForKey(key, TigerUtils.combineTags(tc.getValues(key))); 71 71 } 72 72 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r8846 r8855 9 9 import java.awt.event.FocusEvent; 10 10 import java.awt.event.FocusListener; 11 import java.text.NumberFormat;12 import java.text.ParsePosition;13 11 import java.util.ArrayList; 14 12 import java.util.Arrays; … … 235 233 } 236 234 237 protected Double parseDoubleFromUserInput(String input) {238 if (input == null) return null;239 // remove white space and an optional degree symbol240 //241 input = input.trim();242 input = input.replaceAll(DEG, "");243 244 // try to parse using the current locale245 //246 NumberFormat f = NumberFormat.getNumberInstance();247 Number n = null;248 ParsePosition pp = new ParsePosition(0);249 n = f.parse(input, pp);250 if (pp.getErrorIndex() >= 0 || pp.getIndex() < input.length()) {251 // fall back - try to parse with the english locale252 //253 pp = new ParsePosition(0);254 f = NumberFormat.getNumberInstance(Locale.ENGLISH);255 n = f.parse(input, pp);256 if (pp.getErrorIndex() >= 0 || pp.getIndex() < input.length())257 return null;258 }259 return n == null ? null : n.doubleValue();260 }261 262 235 protected void parseLatLonUserInput() { 263 236 LatLon latLon; -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r8836 r8855 960 960 } 961 961 962 protected boolean isActiveLayer(Layer layer) {963 if (!Main.isDisplayingMapView())964 return false;965 return Main.map.mapView.getActiveLayer() == layer;966 }967 968 962 @Override 969 963 public void updateEnabledState() { … … 1148 1142 public void showMenu(MouseEvent evt) { 1149 1143 Layer layer = getModel().getLayer(layerList.getSelectedRow()); 1150 menu = new LayerListPopup(getModel().getSelectedLayers() , layer);1144 menu = new LayerListPopup(getModel().getSelectedLayers()); 1151 1145 super.showMenu(evt); 1152 1146 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
r8510 r8855 67 67 } 68 68 69 public LayerListPopup(List<Layer> selectedLayers , final Layer layer) {69 public LayerListPopup(List<Layer> selectedLayers) { 70 70 71 71 List<Action> actions; -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r8846 r8855 839 839 840 840 /** 841 * Change the Geometry of the detached dialog to better fit the content.842 */843 protected Rectangle getDetachedGeometry(Rectangle last) {844 return last;845 }846 847 /**848 841 * Default size of the detached dialog. 849 842 * Override this method to customize the initial dialog size. -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r8840 r8855 16 16 import java.beans.PropertyChangeListener; 17 17 import java.text.DateFormat; 18 import java.util.Collection;19 18 import java.util.Collections; 20 19 import java.util.HashSet; … … 364 363 } 365 364 366 protected void alertNoPrimitivesToSelect( Collection<OsmPrimitive> primitives) {365 protected void alertNoPrimitivesToSelect() { 367 366 HelpAwareOptionPane.showOptionDialog( 368 367 ChangesetDetailPanel.this, … … 391 390 } 392 391 if (target.isEmpty()) { 393 alertNoPrimitivesToSelect( target);392 alertNoPrimitivesToSelect(); 394 393 return; 395 394 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanel.java
r8760 r8855 38 38 } 39 39 40 protected void init(Changeset cs) {41 if (cs == null) {42 model.clear();43 return;44 }45 model.initFromTags(cs.getKeys());46 }47 48 40 /* ---------------------------------------------------------------------------- */ 49 41 /* interface PropertyChangeListener */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r8836 r8855 178 178 tagEditorPanel.getModel().ensureOneTag(); 179 179 180 JSplitPane pane = buildSplitPane( relation);180 JSplitPane pane = buildSplitPane(); 181 181 pane.setPreferredSize(new Dimension(100, 100)); 182 182 … … 460 460 * @return the split panel 461 461 */ 462 protected JSplitPane buildSplitPane( Relation relation) {462 protected JSplitPane buildSplitPane() { 463 463 final JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); 464 464 pane.setTopComponent(buildTagEditorPanel()); … … 468 468 @Override 469 469 public void windowOpened(WindowEvent e) { 470 // has to be called when the window is visible, otherwise 471 // no effect 470 // has to be called when the window is visible, otherwise no effect 472 471 pane.setDividerLocation(0.3); 473 472 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r8840 r8855 675 675 676 676 /** 677 * Replies true if the layer this model belongs to is equal to the active678 * layer679 *680 * @return true if the layer this model belongs to is equal to the active681 * layer682 */683 protected boolean isActiveLayer() {684 if (!Main.isDisplayingMapView()) return false;685 return Main.map.mapView.getActiveLayer() == layer;686 }687 688 /**689 677 * Sort the selected relation members by the way they are linked. 690 678 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRenderer.java
r8510 r8855 48 48 } 49 49 50 protected void renderBackground(OsmPrimitive primitive , boolean isSelected) {50 protected void renderBackground(OsmPrimitive primitive) { 51 51 Color bgc = UIManager.getColor("Table.background"); 52 52 if (primitive != null && model != null && model.getNumMembersWithPrimitive(primitive) == 1) { … … 72 72 return this; 73 73 74 renderBackground((OsmPrimitive) value , isSelected);74 renderBackground((OsmPrimitive) value); 75 75 renderPrimitive((OsmPrimitive) value); 76 76 return this; -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r8510 r8855 132 132 } 133 133 134 protected boolean hasNewNodes(Way way) {135 for (Node n: way.getNodes()) {136 if (n.isNew()) return true;137 }138 return false;139 }140 141 134 protected boolean canShowAsLatest(OsmPrimitive primitive) { 142 135 if (primitive == null) return false; -
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java
r8510 r8855 51 51 } 52 52 53 protected void renderRole(Item diffItem , int row, boolean isSelected) {53 protected void renderRole(Item diffItem) { 54 54 String text = ""; 55 55 Color bgColor = diffItem.state.getColor(); … … 61 61 } 62 62 63 protected void renderPrimitive(Item diffItem , int row, boolean isSelected) {63 protected void renderPrimitive(Item diffItem) { 64 64 String text = ""; 65 65 Color bgColor = diffItem.state.getColor(); … … 87 87 switch(column) { 88 88 case 0: 89 renderRole(member , row, isSelected);89 renderRole(member); 90 90 break; 91 91 case 1: 92 renderPrimitive(member , row, isSelected);92 renderPrimitive(member); 93 93 break; 94 94 } … … 96 96 return this; 97 97 } 98 99 protected DiffTableModel getRelationMemberTableModel(JTable table) {100 return (DiffTableModel) table.getModel();101 }102 98 } -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r8840 r8855 315 315 } 316 316 317 protected void cancelWhenInSaveAndUploadingMode() {318 cancelSafeAndUploadTask();319 }320 321 317 public void cancel() { 322 318 switch(model.getMode()) { -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r8846 r8855 514 514 initTileSource(this.tileSource); 515 515 516 ;517 516 // keep them final here, so we avoid namespace clutter in the class 518 517 final JPopupMenu tileOptionMenu = new JPopupMenu(); -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r8840 r8855 388 388 */ 389 389 public boolean isProjectionSupported(Projection proj) { 390 return true;390 return proj != null; 391 391 } 392 392 -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r8846 r8855 442 442 @Override 443 443 public boolean isMergable(final Layer other) { 444 // isUploadDiscouraged commented toallow merging between normal layers and discouraged layers with a warning (see #7684)445 return other instanceof OsmDataLayer; // && (isUploadDiscouraged() == ((OsmDataLayer)other).isUploadDiscouraged());444 // allow merging between normal layers and discouraged layers with a warning (see #7684) 445 return other instanceof OsmDataLayer; 446 446 } 447 447 -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r8846 r8855 44 44 public void clearCached() { 45 45 // run in EDT to make sure this isn't called during rendering run 46 // {@link org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer#render}47 46 GuiHelper.runInEDT(new Runnable() { 48 47 @Override -
trunk/src/org/openstreetmap/josm/gui/tagging/TagCellRenderer.java
r8840 r8855 69 69 } 70 70 71 protected TagEditorModel getModel(JTable table) {72 return (TagEditorModel) table.getModel();73 }74 75 71 /** 76 72 * replies the cell renderer component for a specific cell -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8846 r8855 233 233 } 234 234 235 public boolean addToPanel(JPanel p , Collection<OsmPrimitive> sel) {235 public boolean addToPanel(JPanel p) { 236 236 String cstring; 237 237 if (count > 0 && !required) { … … 477 477 proles.add(new JLabel(tr("elements")), GBC.eol()); 478 478 for (Role i : roles) { 479 i.addToPanel(proles , sel);479 i.addToPanel(proles); 480 480 } 481 481 p.add(proles, GBC.eol()); -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
r8840 r8855 231 231 if (filter == null) { 232 232 // Collections.copy throws an exception "Source does not fit in dest" 233 // Collections.copy(filtered, list);234 233 filtered.ensureCapacity(list.size()); 235 234 for (AutoCompletionListItem item: list) { -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r8846 r8855 14 14 import java.util.LinkedHashSet; 15 15 import java.util.List; 16 import java.util.NoSuchElementException;17 16 import java.util.Set; 18 17 import java.util.concurrent.Callable; … … 37 36 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 38 37 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 39 import org.openstreetmap.josm.tools.CheckParameterUtil;40 38 import org.openstreetmap.josm.tools.Utils; 41 39 … … 99 97 case RELATION: relations.add(id.getUniqueId()); break; 100 98 } 101 }102 103 /**104 * remembers an {@link OsmPrimitive}'s id. <code>ds</code> must include105 * an {@link OsmPrimitive} with id=<code>id</code>. The id will106 * later we fetched as part of a Multi Get request.107 *108 * Ignore the id if it id <= 0.109 *110 * @param ds the dataset (must not be null)111 * @param id the primitive id112 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},113 * {@link OsmPrimitiveType#RELATION RELATION}114 * @throws IllegalArgumentException if ds is null115 * @throws NoSuchElementException if ds does not include an {@link OsmPrimitive} with id=<code>id</code>116 */117 protected void remember(DataSet ds, long id, OsmPrimitiveType type) throws NoSuchElementException {118 CheckParameterUtil.ensureParameterNotNull(ds, "ds");119 if (id <= 0) return;120 OsmPrimitive primitive = ds.getPrimitiveById(id, type);121 if (primitive == null)122 throw new NoSuchElementException(tr("No primitive with id {0} in local dataset. Cannot infer primitive type.", id));123 remember(primitive.getPrimitiveId());124 return;125 99 } 126 100 -
trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java
r8394 r8855 15 15 import org.openstreetmap.josm.data.osm.DataSet; 16 16 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 17 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;18 17 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 19 18 import org.openstreetmap.josm.gui.util.GuiHelper; … … 45 44 } 46 45 47 protected void importData(InputStream in, final File associatedFile) throws IllegalDataException {48 importData(in, associatedFile, NullProgressMonitor.INSTANCE);49 }50 51 46 protected void importData(InputStream in, final File associatedFile, ProgressMonitor progressMonitor) throws IllegalDataException { 52 47 final DataSet dataSet = OsmChangeReader.parseDataSet(in, progressMonitor); -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r8840 r8855 79 79 private StringBuilder text; 80 80 81 protected void parseChangesetAttributes( Changeset cs,Attributes atts) throws XmlParsingException {81 protected void parseChangesetAttributes(Attributes atts) throws XmlParsingException { 82 82 // -- id 83 83 String value = atts.getValue("id"); … … 204 204 case "changeset": 205 205 current = new Changeset(); 206 parseChangesetAttributes( current,atts);206 parseChangesetAttributes(atts); 207 207 break; 208 208 case "tag": -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r8509 r8855 16 16 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 17 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 18 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;19 18 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 20 19 import org.openstreetmap.josm.gui.util.GuiHelper; … … 78 77 throw new IOException(tr("File ''{0}'' does not exist.", file.getName()), e); 79 78 } 80 }81 82 /**83 * Imports OSM data from stream84 * @param in input stream85 * @param associatedFile filename of data86 */87 protected void importData(InputStream in, final File associatedFile) throws IllegalDataException {88 importData(in, associatedFile, NullProgressMonitor.INSTANCE);89 79 } 90 80 -
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r8510 r8855 44 44 private final Collection<PluginInformation> failed = new LinkedList<>(); 45 45 private final Collection<PluginInformation> downloaded = new LinkedList<>(); 46 //private Exception lastException;47 46 private boolean canceled; 48 47 private HttpURLConnection downloadConnection; -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r8840 r8855 75 75 interrupt(); 76 76 while (result == Result.WAITING) { 77 sleep(10); /* yield(); */77 sleep(10); 78 78 } 79 79 if (result == Result.FAILED) … … 315 315 long bytesToSkip = (long) (calibratedOffset /* seconds (double) */ * bytesPerSecond); 316 316 // skip doesn't seem to want to skip big chunks, so reduce it to smaller ones 317 // audioInputStream.skip(bytesToSkip);318 317 while (bytesToSkip > chunk) { 319 318 nBytesRead = audioInputStream.skip(chunk); -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r8510 r8855 344 344 double a1 = p2.getY() - p1.getY(); 345 345 double b1 = p1.getX() - p2.getX(); 346 // double c1 = 0;347 346 348 347 double a2 = p4.getY() - p3.getY(); -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r8846 r8855 140 140 */ 141 141 public static String getDisplayName(Locale locale) { 142 /*String full = locale.toString();143 if ("ca__valencia".equals(full))144 return t_r_c("language", "Valencian");*/145 146 142 return locale.getDisplayName(); 147 143 } -
trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java
r8744 r8855 48 48 try (final Reader reader = new InputStreamReader( 49 49 getClass().getResourceAsStream("/data/overpass-turbo-ffs.js"), StandardCharsets.UTF_8)) { 50 //engine.eval("var turbo = {ffs: {noPresets: true}};");51 50 engine.eval("var console = {log: function(){}};"); 52 51 engine.eval(reader); -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8846 r8855 1303 1303 */ 1304 1304 public static ThreadFactory newThreadFactory(final String nameFormat, final int threadPriority) { 1305 final String ignore = String.format(Locale.ENGLISH, nameFormat, 0); // fail fast1306 1305 return new ThreadFactory() { 1307 1306 final AtomicLong count = new AtomicLong(0);
Note:
See TracChangeset
for help on using the changeset viewer.