Changeset 10611 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2016-07-23T18:46:45+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r10378 r10611 59 59 public void clearCached() { 60 60 // run in EDT to make sure this isn't called during rendering run 61 GuiHelper.runInEDT(new Runnable() { 62 @Override 63 public void run() { 64 cacheIdx++; 65 preferenceCache.clear(); 66 } 61 GuiHelper.runInEDT(() -> { 62 cacheIdx++; 63 preferenceCache.clear(); 67 64 }); 68 65 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r10567 r10611 365 365 @Override 366 366 protected void finish() { 367 SwingUtilities.invokeLater(new Runnable() { 368 @Override 369 public void run() { 370 fireMapPaintSylesUpdated(); 371 styles.clearCached(); 372 if (Main.isDisplayingMapView()) { 373 Main.map.mapView.preferenceChanged(null); 374 Main.map.mapView.repaint(); 375 } 367 SwingUtilities.invokeLater(() -> { 368 fireMapPaintSylesUpdated(); 369 styles.clearCached(); 370 if (Main.isDisplayingMapView()) { 371 Main.map.mapView.preferenceChanged(null); 372 Main.map.mapView.repaint(); 376 373 } 377 374 }); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r10045 r10611 39 39 import org.openstreetmap.josm.tools.RightAndLefthandTraffic; 40 40 import org.openstreetmap.josm.tools.Utils; 41 import org.openstreetmap.josm.tools.Utils.Function; 41 42 42 43 /** … … 1127 1128 1128 1129 public Float aggregateList(List<?> lst) { 1129 final List<Float> floats = Utils.transform(lst, new Utils.Function<Object, Float>() { 1130 @Override 1131 public Float apply(Object x) { 1132 return Cascade.convertTo(x, float.class); 1133 } 1134 }); 1130 final List<Float> floats = Utils.transform(lst, (Function<Object, Float>) x -> Cascade.convertTo(x, float.class)); 1135 1131 final Collection<Float> nonNullList = Utils.filter(floats, Predicates.not(Predicates.isNull())); 1136 1132 return nonNullList.isEmpty() ? (Float) Float.NaN : computeMax ? Collections.max(nonNullList) : Collections.min(nonNullList); … … 1141 1137 List<?> l = Cascade.convertTo(args.get(0).evaluate(env), List.class); 1142 1138 if (args.size() != 1 || l == null) 1143 l = Utils.transform(args, new Utils.Function<Expression, Object>() { 1144 @Override 1145 public Object apply(Expression x) { 1146 return x.evaluate(env); 1147 } 1148 }); 1139 l = Utils.transform(args, (Function<Expression, Object>) x -> x.evaluate(env)); 1149 1140 return aggregateList(l); 1150 1141 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
r10378 r10611 99 99 .setHeight(height) 100 100 .setOptional(true) 101 .getInBackground(new ImageCallback() { 102 @Override 103 public void finished(ImageIcon result) { 104 synchronized (MapImage.this) { 105 if (result == null) { 106 source.logWarning(tr("Failed to locate image ''{0}''", name)); 107 ImageIcon noIcon = MapPaintStyles.getNoIcon_Icon(source); 108 img = noIcon == null ? null : (BufferedImage) noIcon.getImage(); 109 } else { 110 img = (BufferedImage) rescale(result.getImage()); 111 } 112 if (temporary) { 113 disabledImgCache = null; 114 Main.map.mapView.preferenceChanged(null); // otherwise repaint is ignored, because layer hasn't changed 115 Main.map.mapView.repaint(); 116 } 117 temporary = false; 101 .getInBackground((ImageCallback) result -> { 102 synchronized (MapImage.this) { 103 if (result == null) { 104 source.logWarning(tr("Failed to locate image ''{0}''", name)); 105 ImageIcon noIcon = MapPaintStyles.getNoIcon_Icon(source); 106 img = noIcon == null ? null : (BufferedImage) noIcon.getImage(); 107 } else { 108 img = (BufferedImage) rescale(result.getImage()); 118 109 } 110 if (temporary) { 111 disabledImgCache = null; 112 Main.map.mapView.preferenceChanged(null); // otherwise repaint is ignored, because layer hasn't changed 113 Main.map.mapView.repaint(); 114 } 115 temporary = false; 119 116 } 120 117 }
Note:
See TracChangeset
for help on using the changeset viewer.