Changeset 16438 in josm for trunk/src/org/openstreetmap/josm/gui/util
- Timestamp:
- 2020-05-17T14:18:22+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r15586 r16438 33 33 import java.util.concurrent.ExecutionException; 34 34 import java.util.concurrent.FutureTask; 35 import java.util.stream.Stream; 35 36 36 37 import javax.swing.GrayFilter; … … 640 641 Collection<String> fonts = Arrays.asList( 641 642 GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); 642 for (String f : new String[]{"Khmer UI", "DaunPenh", "MoolBoran"}) { 643 if (fonts.contains(f)) { 644 setUIFont(f); 645 break; 646 } 647 } 643 Stream.of("Khmer UI", "DaunPenh", "MoolBoran") 644 .filter(fonts::contains) 645 .findFirst() 646 .ifPresent(GuiHelper::setUIFont); 648 647 } 649 648 } -
trunk/src/org/openstreetmap/josm/gui/util/StayOpenPopupMenu.java
r15497 r16438 56 56 Field tableField = appContextClass.getDeclaredField("table"); 57 57 ReflectionUtils.setObjectsAccessible(tableField); 58 Object mouseGrabber = null; 59 for (Entry<?, ?> e : ((Map<?, ?>) 60 tableField.get(appContextClass.getMethod("getAppContext").invoke(appContextClass))).entrySet()) { 61 if (MOUSE_GRABBER_KEY.equals(Objects.toString(e.getKey()))) { 62 mouseGrabber = e.getValue(); 63 break; 64 } 65 } 58 Object mouseGrabber = ((Map<?, ?>) tableField.get(appContextClass.getMethod("getAppContext").invoke(appContextClass))) 59 .entrySet().stream() 60 .filter(e -> MOUSE_GRABBER_KEY.equals(Objects.toString(e.getKey()))) 61 .map(Entry::getValue) 62 .findFirst().orElse(null); 66 63 final ChangeListener changeListener = (ChangeListener) mouseGrabber; 67 64 final AWTEventListener awtEventListener = (AWTEventListener) mouseGrabber;
Note:
See TracChangeset
for help on using the changeset viewer.