Changeset 9224 in josm
- Timestamp:
- 2015-12-30T22:58:48+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r9218 r9224 50 50 import javax.json.JsonWriter; 51 51 import javax.swing.JOptionPane; 52 import javax.swing.UIManager;53 52 import javax.xml.XMLConstants; 54 53 import javax.xml.stream.XMLInputFactory; … … 1012 1011 public synchronized Color getColor(String colName, Color def) { 1013 1012 return getColor(colName, null, def); 1014 }1015 1016 public synchronized Color getUIColor(String colName) {1017 return UIManager.getColor(colName);1018 1013 } 1019 1014 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r9078 r9224 1115 1115 } 1116 1116 if (c == null) { 1117 c = Main.pref.getUIColor(isSelected ? "Table.selectionForeground" : "Table.foreground");1117 c = UIManager.getColor(isSelected ? "Table.selectionForeground" : "Table.foreground"); 1118 1118 } 1119 1119 label.setForeground(c); -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
r9078 r9224 24 24 import javax.swing.JRadioButton; 25 25 import javax.swing.JTable; 26 import javax.swing.UIManager; 26 27 import javax.swing.table.DefaultTableCellRenderer; 27 28 import javax.swing.table.DefaultTableModel; … … 34 35 import org.openstreetmap.josm.data.Preferences.StringSetting; 35 36 import org.openstreetmap.josm.gui.ExtendedDialog; 37 import org.openstreetmap.josm.gui.util.GuiHelper; 36 38 import org.openstreetmap.josm.gui.widgets.JosmTextField; 37 39 import org.openstreetmap.josm.tools.GBC; … … 298 300 299 301 private static class SettingCellRenderer extends DefaultTableCellRenderer { 300 private final Color backgroundColor = Main.pref.getUIColor("Table.background");302 private final Color backgroundColor = UIManager.getColor("Table.background"); 301 303 private final Color changedColor = Main.pref.getColor( 302 304 marktr("Advanced Background: Changed"), 303 305 new Color(200, 255, 200)); 304 private final Color foregroundColor = Main.pref.getUIColor("Table.foreground");305 306 private final Color nonDefaultColor = Main.pref.getColor( 306 307 marktr("Advanced Background: NonDefault"), … … 319 320 display, isSelected, hasFocus, row, column); 320 321 321 label.setBackground(backgroundColor); 322 if (isSelected) { 323 label.setForeground(foregroundColor); 324 } 322 GuiHelper.setBackgroundReadable(label, backgroundColor); 325 323 if (pe.isChanged()) { 326 label.setBackground(changedColor);324 GuiHelper.setBackgroundReadable(label, changedColor); 327 325 } else if (!pe.isDefault()) { 328 label.setBackground(nonDefaultColor);326 GuiHelper.setBackgroundReadable(label, nonDefaultColor); 329 327 } 330 328 -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r9078 r9224 37 37 import javax.swing.JTable; 38 38 import javax.swing.JToolBar; 39 import javax.swing.UIManager; 39 40 import javax.swing.event.ListSelectionEvent; 40 41 import javax.swing.event.ListSelectionListener; … … 62 63 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 63 64 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 65 import org.openstreetmap.josm.gui.util.GuiHelper; 64 66 import org.openstreetmap.josm.gui.widgets.JosmEditorPane; 65 67 import org.openstreetmap.josm.tools.GBC; … … 248 250 JLabel label = (JLabel) super.getTableCellRendererComponent( 249 251 table, value, isSelected, hasFocus, row, column); 250 label.setBackground(Main.pref.getUIColor("Table.background")); 251 if (isSelected) { 252 label.setForeground(Main.pref.getUIColor("Table.foreground")); 253 } 252 GuiHelper.setBackgroundReadable(label, UIManager.getColor("Table.background")); 254 253 if (value != null) { // Fix #8159 255 254 String t = value.toString(); 256 255 for (ImageryInfo l : layers) { 257 256 if (l.getExtendedUrl().equals(t)) { 258 label.setBackground(Main.pref.getColor(257 GuiHelper.setBackgroundReadable(label, Main.pref.getColor( 259 258 marktr("Imagery Background: Default"), 260 259 new Color(200, 255, 200))); … … 279 278 JLabel label = (JLabel) super.getTableCellRendererComponent( 280 279 table, info.getName(), isSelected, hasFocus, row, column); 281 label.setBackground(Main.pref.getUIColor("Table.background")); 282 if (isSelected) { 283 label.setForeground(Main.pref.getUIColor("Table.foreground")); 284 } 280 GuiHelper.setBackgroundReadable(label, UIManager.getColor("Table.background")); 285 281 label.setToolTipText(info.getToolTipText()); 286 282 return label; -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r9078 r9224 33 33 import javax.swing.RowFilter; 34 34 import javax.swing.SwingConstants; 35 import javax.swing.UIManager; 35 36 import javax.swing.event.DocumentEvent; 36 37 import javax.swing.event.DocumentListener; … … 44 45 45 46 import org.openstreetmap.josm.Main; 47 import org.openstreetmap.josm.gui.util.GuiHelper; 46 48 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 47 49 import org.openstreetmap.josm.gui.widgets.JosmTextField; … … 169 171 JLabel label = (JLabel) super.getTableCellRendererComponent( 170 172 table, name ? sc.getLongText() : sc.getKeyText(), isSelected, hasFocus, row, column); 171 label.setBackground(Main.pref.getUIColor("Table.background")); 172 if (isSelected) { 173 label.setForeground(Main.pref.getUIColor("Table.foreground")); 174 } 173 GuiHelper.setBackgroundReadable(label, UIManager.getColor("Table.background")); 175 174 if (sc.isAssignedUser()) { 176 label.setBackground(Main.pref.getColor(175 GuiHelper.setBackgroundReadable(label, Main.pref.getColor( 177 176 marktr("Shortcut Background: User"), 178 177 new Color(200, 255, 200))); 179 178 } else if (!sc.isAssignedDefault()) { 180 label.setBackground(Main.pref.getColor(179 GuiHelper.setBackgroundReadable(label, Main.pref.getColor( 181 180 marktr("Shortcut Background: Modified"), 182 181 new Color(255, 255, 200)));
Note:
See TracChangeset
for help on using the changeset viewer.