Changeset 11452 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2017-01-12T01:24:40+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r11367 r11452 616 616 double den = 100 * getScale(); 617 617 double scaleMin = 0.01 * den / dm / 100; 618 if ( !Double.isInfinite(scaleMin) && newScale < scaleMin) {618 if (newScale < scaleMin && !Double.isInfinite(scaleMin)) { 619 619 newScale = scaleMin; 620 620 } -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r11386 r11452 130 130 @Override 131 131 public void mouseDragged(MouseEvent e) { 132 if ( (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK &&133 !(Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK) && iStartSelectionPoint != null) {132 if (iStartSelectionPoint != null && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK 133 && !(Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) { 134 134 iEndSelectionPoint = e.getPoint(); 135 135 iSlippyMapChooser.setSelection(iStartSelectionPoint, iEndSelectionPoint); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java
r10378 r11452 83 83 RelationMemberConflictDecision that = (RelationMemberConflictDecision) obj; 84 84 return pos == that.pos && 85 Objects.equals(relation, that.relation)&&86 Objects.equals(originalPrimitive, that.originalPrimitive) &&87 Objects.equals(role, that.role) &&88 decision == that.decision;85 decision == that.decision && 86 Objects.equals(relation, that.relation) && 87 Objects.equals(originalPrimitive, that.originalPrimitive) && 88 Objects.equals(role, that.role); 89 89 } 90 90 -
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r11357 r11452 246 246 for (int i = 0; i < n; ++i) { 247 247 final ToggleDialog dlg = allDialogs.get(i); 248 if (dlg .isDialogInDefaultView() && dlg != triggeredBy) {248 if (dlg != triggeredBy && dlg.isDialogInDefaultView()) { 249 249 final int ha = dlg.getSize().height; // current 250 250 final int h0 = ha * r / sumA; // proportional shrinking … … 261 261 for (int i = 0; i < n; ++i) { 262 262 final ToggleDialog dlg = allDialogs.get(i); 263 if (dlg .isDialogInDefaultView() && dlg != triggeredBy) {263 if (dlg != triggeredBy && dlg.isDialogInDefaultView()) { 264 264 final int ha = dlg.getHeight(); 265 265 final int h0 = ha * r / sumA; -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java
r10627 r11452 118 118 } 119 119 120 if ( Main.isDisplayingMapView() && changed) {120 if (changed && Main.isDisplayingMapView()) { 121 121 Main.map.mapView.repaint(); 122 122 Main.map.filterDialog.updateDialogHeader(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r11177 r11452 159 159 txtMappaint.append(tr("The 2 selected objects have different style caches.")); 160 160 } 161 if (sc1 .equals(sc2) && sc1 != sc2) {161 if (sc1 != sc2 && sc1.equals(sc2)) { 162 162 txtMappaint.append(tr("Warning: The 2 selected objects have equal, but not identical style caches.")); 163 163 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/MinimapDialog.java
r10784 r11452 55 55 @Override 56 56 public void zoomChanged() { 57 if ( Main.isDisplayingMapView() && !skipEvents) {57 if (!skipEvents && Main.isDisplayingMapView()) { 58 58 MapView mv = Main.map.mapView; 59 59 final Bounds currentBounds = new Bounds( -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerListTransferHandler.java
r10762 r11452 96 96 boolean isSameLayerManager = tableModel.getLayerManager() == layers.getManager(); 97 97 98 if ( support.getDropAction() == MOVE && isSameLayerManager) {98 if (isSameLayerManager && support.getDropAction() == MOVE) { 99 99 for (Layer layer : layers.getLayers()) { 100 100 boolean wasBeforeInsert = layers.getManager().getLayers().indexOf(layer) <= dropLocation; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r11386 r11452 1207 1207 * content lengths, so we have to be fuzzy.. (this is UGLY, recode if u know better) 1208 1208 */ 1209 if ( conn.getContentLength() != -1 && osize >-1 && Math.abs(conn.getContentLength() - osize) > 200) {1209 if (osize > -1 && conn.getContentLength() != -1 && Math.abs(conn.getContentLength() - osize) > 200) { 1210 1210 Main.info("{0} is a mediawiki redirect", u); 1211 1211 conn.disconnect(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
r10965 r11452 98 98 } 99 99 100 if ( !RelationSortUtils.isOneway(m) && lastWct != null) {100 if (lastWct != null && !RelationSortUtils.isOneway(m)) { 101 101 wct.direction = determineDirection(i-1, lastWct.direction, i); 102 102 wct.linkPrev = wct.direction != NONE; … … 307 307 return FORWARD; 308 308 } 309 if ( n == RelationNodeMap.lastOnewayNode(m) && reversed) {309 if (reversed && n == RelationNodeMap.lastOnewayNode(m)) { 310 310 if (RelationSortUtils.isBackward(m)) 311 311 return FORWARD; -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r11366 r11452 643 643 Collection<String> history = Main.pref.getCollection(historyKey, def); 644 644 int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0)); 645 if ( age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4))646 && history != null &&!history.isEmpty()) {645 if (history != null && age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4)) 646 && !history.isEmpty()) { 647 647 return history.iterator().next(); 648 648 } else { -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r11381 r11452 1584 1584 List<Tile> newlyMissedTiles = new LinkedList<>(); 1585 1585 for (Tile missed : missedTiles) { 1586 if ( "no-tile".equals(missed.getValue("tile-info")) && zoomOffset > 0) {1586 if (zoomOffset > 0 && "no-tile".equals(missed.getValue("tile-info"))) { 1587 1587 // Don't try to paint from higher zoom levels when tile is overzoomed 1588 1588 newlyMissedTiles.add(missed); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r11288 r11452 1071 1071 } 1072 1072 1073 if ( e.isTagged() && e.getExifCoor() == null && !tagged) {1073 if (!tagged && e.isTagged() && e.getExifCoor() == null) { 1074 1074 continue; 1075 1075 } … … 1202 1202 } 1203 1203 1204 if ( curImg.tmp.getPos() == null && prevWp != null) {1204 if (prevWp != null && curImg.tmp.getPos() == null) { 1205 1205 // The values of timeDiff are between 0 and 1, it is not seconds but a dimensionless variable 1206 1206 double timeDiff = (double) (imgTime - prevWpTime) / interval; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r10763 r11452 306 306 imageChanged = currentEntry != entry; 307 307 308 if (centerView && Main.isDisplayingMapView() && entry != null&& entry.getPos() != null) {308 if (centerView && entry != null && Main.isDisplayingMapView() && entry.getPos() != null) { 309 309 Main.map.mapView.zoomTo(entry.getPos()); 310 310 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r11451 r11452 175 175 SystemOfMeasurement som = SystemOfMeasurement.getSystemOfMeasurement(); 176 176 velocityScale.addTitle(tr("Velocity, {0}", som.speedName)); 177 if ( Main.isDisplayingMapView() && oldSoM != null && newSoM != null) {177 if (oldSoM != null && newSoM != null && Main.isDisplayingMapView()) { 178 178 Main.map.mapView.repaint(); 179 179 } … … 1167 1167 */ 1168 1168 private void checkCache() { 1169 if ((computeCacheMaxLineLengthUsed != maxLineLength) || (!neutralColor.equals(computeCacheColorUsed)) 1170 || (computeCacheColored != colored) || (computeCacheColorTracksTune != colorTracksTune) 1169 if ((computeCacheMaxLineLengthUsed != maxLineLength) 1170 || (computeCacheColored != colored) 1171 || (computeCacheColorTracksTune != colorTracksTune) 1171 1172 || (computeCacheColorDynamic != colorModeDynamic) 1172 1173 || (computeCacheHeatMapDrawColorTableIdx != heatMapDrawColorTableIdx) 1174 || (!neutralColor.equals(computeCacheColorUsed)) 1173 1175 ) { 1174 1176 computeCacheMaxLineLengthUsed = maxLineLength; -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r11366 r11452 166 166 167 167 // (a) try explicit timestamped waypoints - unless suppressed 168 if ( Main.pref.getBoolean("marker.audiofromexplicitwaypoints", true) && hasWaypoints) {168 if (hasWaypoints && Main.pref.getBoolean("marker.audiofromexplicitwaypoints", true)) { 169 169 for (WayPoint w : layer.data.waypoints) { 170 170 if (w.time > firstTime) { … … 177 177 178 178 // (b) try explicit waypoints without timestamps - unless suppressed 179 if ( Main.pref.getBoolean("marker.audiofromuntimedwaypoints", true) && hasWaypoints) {179 if (hasWaypoints && Main.pref.getBoolean("marker.audiofromuntimedwaypoints", true)) { 180 180 for (WayPoint w : layer.data.waypoints) { 181 181 if (waypoints.contains(w)) { … … 197 197 198 198 // (c) use explicitly named track points, again unless suppressed 199 if ( (Main.pref.getBoolean("marker.audiofromnamedtrackpoints", false)) && layer.data.tracks != null199 if (layer.data.tracks != null && Main.pref.getBoolean("marker.audiofromnamedtrackpoints", false) 200 200 && !layer.data.tracks.isEmpty()) { 201 201 for (GpxTrack track : layer.data.tracks) { … … 211 211 212 212 // (d) use timestamp of file as location on track 213 if ( (Main.pref.getBoolean("marker.audiofromwavtimestamps", false)) && hasTracks) {213 if (hasTracks && Main.pref.getBoolean("marker.audiofromwavtimestamps", false)) { 214 214 double lastModified = wavFile.lastModified() / 1000.0; // lastModified is in 215 215 // milliseconds -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java
r10600 r11452 282 282 if (!super.equals(obj)) return false; 283 283 BoxTextElement that = (BoxTextElement) obj; 284 return Objects.equals(text, that.text)&&285 Objects.equals(boxProvider, that.boxProvider)&&286 Objects.equals(box, that.box) &&287 hAlign == that.hAlign&&288 vAlign == that.vAlign;284 return hAlign == that.hAlign && 285 vAlign == that.vAlign && 286 Objects.equals(text, that.text) && 287 Objects.equals(boxProvider, that.boxProvider) && 288 Objects.equals(box, that.box); 289 289 } 290 290 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
r11090 r11452 160 160 return false; 161 161 final LineElement other = (LineElement) obj; 162 return Objects.equals(line, other.line)&&163 Objects.equals(color, other.color)&&164 Objects.equals(dashesLine, other.dashesLine)&&165 Objects.equals(dashesBackground, other.dashesBackground) &&166 offset == other.offset&&167 realWidth == other.realWidth&&168 wayDirectionArrows == other.wayDirectionArrows;162 return offset == other.offset && 163 realWidth == other.realWidth && 164 wayDirectionArrows == other.wayDirectionArrows && 165 Objects.equals(line, other.line) && 166 Objects.equals(color, other.color) && 167 Objects.equals(dashesLine, other.dashesLine) && 168 Objects.equals(dashesBackground, other.dashesBackground); 169 169 } 170 170 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
r11148 r11452 96 96 if (!super.equals(obj)) return false; 97 97 RepeatImageElement that = (RepeatImageElement) obj; 98 return Float.compare(that.offset, offset) == 0&&99 Float.compare(that.spacing, spacing) == 0 &&100 Float.compare(that.phase, phase) == 0 &&101 Objects.equals(pattern, that.pattern)&&102 align == that.align;98 return align == that.align && 99 Float.compare(that.offset, offset) == 0 && 100 Float.compare(that.spacing, spacing) == 0 && 101 Float.compare(that.phase, phase) == 0 && 102 Objects.equals(pattern, that.pattern); 103 103 } 104 104 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r10238 r11452 199 199 if (o == null || getClass() != o.getClass()) return false; 200 200 StyleElement that = (StyleElement) o; 201 return Float.compare(that.majorZIndex, majorZIndex) == 0&&202 Float.compare(that.zIndex, zIndex) == 0 &&203 Float.compare(that.objectZIndex, objectZIndex) == 0 &&204 isModifier == that.isModifier;201 return isModifier == that.isModifier && 202 Float.compare(that.majorZIndex, majorZIndex) == 0 && 203 Float.compare(that.zIndex, zIndex) == 0 && 204 Float.compare(that.objectZIndex, objectZIndex) == 0; 205 205 } 206 206 -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
r11384 r11452 94 94 } 95 95 final UserInputTag other = (UserInputTag) obj; 96 return Objects.equals(this.key, other.key)97 && Objects.equals(this. value, other.value)98 && this.defaultKey == other.defaultKey;96 return this.defaultKey == other.defaultKey 97 && Objects.equals(this.key, other.key) 98 && Objects.equals(this.value, other.value); 99 99 } 100 100 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java
r9665 r11452 92 92 public void addCommands(List<Tag> changedTags) { 93 93 // if the user hasn't changed anything, don't create a command. 94 if ( check.getState() == initialState && def == null) return;94 if (def == null && check.getState() == initialState) return; 95 95 96 96 // otherwise change things according to the selected value. -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java
r11017 r11452 85 85 // all items were unset (and so is default) 86 86 originalValue = lhm.get(""); 87 if ( "force".equals(use_last_as_default) && LAST_VALUES.containsKey(key) && !presetInitiallyMatches) {87 if (!presetInitiallyMatches && "force".equals(use_last_as_default) && LAST_VALUES.containsKey(key)) { 88 88 combobox.setSelectedItem(lhm.get(LAST_VALUES.get(key))); 89 89 } else { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r11381 r11452 492 492 } 493 493 494 if ( Main.pref.getBoolean("taggingpreset.sortvalues", true) && values_sort) {494 if (values_sort && Main.pref.getBoolean("taggingpreset.sortvalues", true)) { 495 495 Collections.sort(entries); 496 496 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r11017 r11452 88 88 } else if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { 89 89 // selected osm primitives are untagged or filling default values feature is enabled 90 if (! "false".equals(use_last_as_default) && LAST_VALUES.containsKey(key) && !presetInitiallyMatches) {90 if (!presetInitiallyMatches && !"false".equals(use_last_as_default) && LAST_VALUES.containsKey(key)) { 91 91 textField.setText(LAST_VALUES.get(key)); 92 92 } else { -
trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java
r9463 r11452 66 66 67 67 /** 68 * Tries to determine a suitable height for the given contents and return 69 * that dimension. 68 * Tries to determine a suitable height for the given contents and return that dimension. 70 69 */ 71 70 @Override 72 71 public Dimension getPreferredSize() { 73 // Without this check it will result in an infinite loop calling 74 // getPreferredSize. Remember the old bounds and only recalculate if 75 // the size actually changed. 76 if (this.getBounds().equals(oldbounds) && oldPreferred != null) { 72 // Without this check it will result in an infinite loop calling getPreferredSize. 73 // Remember the old bounds and only recalculate if the size actually changed. 74 if (oldPreferred != null && this.getBounds().equals(oldbounds)) { 77 75 return oldPreferred; 78 76 }
Note:
See TracChangeset
for help on using the changeset viewer.