Ticket #20706: antialias.patch
| File antialias.patch, 3.0 KB (added by , 5 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/MainApplication.java
1030 1030 } 1031 1031 // Disable automatic POST retry after 5 minutes, see #17882 / https://bugs.openjdk.java.net/browse/JDK-6382788 1032 1032 Utils.updateSystemProperty("sun.net.http.retryPost", "false"); 1033 // Force text antialiasing, not including mappaint text 1034 if (Config.getPref().getBoolean("gui.forceAntialiasing", true)) { 1035 Utils.updateSystemProperty("awt.useSystemAAFontSettings", "on"); 1036 } 1033 1037 } 1034 1038 1035 1039 /** -
src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
3 3 4 4 import java.awt.Color; 5 5 import java.awt.Font; 6 import java.awt.Graphics; 7 import java.awt.Graphics2D; 8 import java.awt.RenderingHints; 6 9 import java.io.IOException; 7 10 import java.io.InputStream; 8 11 import java.net.URL; … … 15 18 import javax.swing.text.html.StyleSheet; 16 19 17 20 import org.openstreetmap.josm.gui.util.GuiHelper; 21 import org.openstreetmap.josm.spi.preferences.Config; 18 22 import org.openstreetmap.josm.tools.ColorHelper; 19 23 import org.openstreetmap.josm.tools.Destroyable; 20 24 import org.openstreetmap.josm.tools.HttpClient; … … 21 25 import org.openstreetmap.josm.tools.LanguageInfo; 22 26 23 27 /** 24 * Subclass of {@link JEditorPane} that adds a "native" context menu (cut/copy/paste/select all) 25 * and effectively uses JOSM user agent when performing HTTP request in {@link #setPage(URL)} method. 28 * Subclass of {@link JEditorPane} that adds a "native" context menu (cut/copy/paste/select all), forces text and bullet 29 * point antialiasing based on user preferences, and effectively uses JOSM user agent when performing HTTP request in 30 * {@link #setPage(URL)} method. 26 31 * @since 5886 27 32 */ 28 33 public class JosmEditorPane extends JEditorPane implements Destroyable { … … 86 91 return conn.getContent(); 87 92 } 88 93 94 @Override 95 public void paintComponent(Graphics g) { 96 // Force antialiasing within the JosmEditorPane for antialiased bullet points 97 if (Config.getPref().getBoolean("gui.forceAntialiasing", true)) { 98 Graphics2D g2d = (Graphics2D) g.create(); 99 g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 100 g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); 101 super.paintComponent(g2d); 102 g2d.dispose(); 103 } else { 104 super.paintComponent(g); 105 } 106 } 107 89 108 /** 90 109 * Adapts a {@link JEditorPane} to be used as a powerful replacement of {@link javax.swing.JLabel}. 91 110 * @param pane The editor pane to adapt
