Changeset 10853 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-08-19T03:43:18+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10827 r10853 53 53 import org.openstreetmap.josm.data.osm.visitor.paint.MapPath2D; 54 54 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 55 import org.openstreetmap.josm.data.preferences.ColorProperty; 55 56 import org.openstreetmap.josm.gui.MainMenu; 56 57 import org.openstreetmap.josm.gui.MapFrame; … … 246 247 @Override 247 248 protected void readPreferences() { 248 rubberLineColor = Main.pref.getColor(marktr("helper line"), null); 249 if (rubberLineColor == null) rubberLineColor = PaintColors.SELECTED.get(); 249 rubberLineColor = new ColorProperty(marktr("helper line"), (Color) null).get(); 250 if (rubberLineColor == null) 251 rubberLineColor = PaintColors.SELECTED.get(); 250 252 251 253 rubberLineStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.stroke.helper-line", "3")); … … 1456 1458 1457 1459 normalStroke = rubberLineStroke; 1458 snapHelperColor = Main.pref.getColor(marktr("draw angle snap"), Color.ORANGE);1459 1460 highlightColor = Main.pref.getColor(marktr("draw angle snap highlight"), ORANGE_TRANSPARENT);1460 snapHelperColor = new ColorProperty(marktr("draw angle snap"), Color.ORANGE).get(); 1461 1462 highlightColor = new ColorProperty(marktr("draw angle snap highlight"), ORANGE_TRANSPARENT).get(); 1461 1463 highlightStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.anglesnap.stroke.highlight", "10")); 1462 1464 helperStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.anglesnap.stroke.helper", "1 4")); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r10716 r10853 44 44 import org.openstreetmap.josm.data.osm.WaySegment; 45 45 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 46 import org.openstreetmap.josm.data.preferences.ColorProperty; 46 47 import org.openstreetmap.josm.gui.MainMenu; 47 48 import org.openstreetmap.josm.gui.MapFrame; … … 304 305 initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200); 305 306 initialMoveThreshold = Main.pref.getInteger("extrude.initial-move-threshold", 1); 306 mainColor = Main.pref.getColor(marktr("Extrude: main line"), null);307 mainColor = new ColorProperty(marktr("Extrude: main line"), (Color) null).get(); 307 308 if (mainColor == null) mainColor = PaintColors.SELECTED.get(); 308 helperColor = Main.pref.getColor(marktr("Extrude: helper line"), Color.ORANGE);309 helperColor = new ColorProperty(marktr("Extrude: helper line"), Color.ORANGE).get(); 309 310 helperStrokeDash = GuiHelper.getCustomizedStroke(Main.pref.get("extrude.stroke.helper-line", "1 4")); 310 311 helperStrokeRA = new BasicStroke(1); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r10827 r10853 37 37 import org.openstreetmap.josm.data.osm.visitor.paint.MapPath2D; 38 38 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 39 import org.openstreetmap.josm.data.preferences.ColorProperty; 39 40 import org.openstreetmap.josm.gui.MapFrame; 40 41 import org.openstreetmap.josm.gui.MapView; … … 152 153 @Override 153 154 protected void readPreferences() { 154 guideColor = Main.pref.getColor(marktr("improve way accuracy helper line"), null); 155 if (guideColor == null) guideColor = PaintColors.HIGHLIGHT.get(); 155 guideColor = new ColorProperty(marktr("improve way accuracy helper line"), (Color) null).get(); 156 if (guideColor == null) 157 guideColor = PaintColors.HIGHLIGHT.get(); 156 158 157 159 selectTargetWayStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.select-target", "2")); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r10716 r10853 29 29 import org.openstreetmap.josm.data.osm.WaySegment; 30 30 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 31 import org.openstreetmap.josm.data.preferences.ColorProperty; 31 32 import org.openstreetmap.josm.gui.MapFrame; 32 33 import org.openstreetmap.josm.gui.MapView; … … 155 156 helpLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.hepler-line", "1")); 156 157 refLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.ref-line", "1 2 2")); 157 mainColor = Main.pref.getColor(marktr("make parallel helper line"), null); 158 if (mainColor == null) mainColor = PaintColors.SELECTED.get(); 158 mainColor = new ColorProperty(marktr("make parallel helper line"), (Color) null).get(); 159 if (mainColor == null) 160 mainColor = PaintColors.SELECTED.get(); 159 161 160 162 //// Needed to update the mouse cursor if modifiers are changed when the mouse is motionless -
trunk/src/org/openstreetmap/josm/data/validation/Severity.java
r10378 r10853 8 8 9 9 import org.openstreetmap.josm.Main; 10 import org.openstreetmap.josm.data.preferences.ColorProperty; 10 11 11 12 /** The error severity */ … … 13 14 // CHECKSTYLE.OFF: SingleSpaceSeparator 14 15 /** Error messages */ 15 ERROR(tr("Errors"), /* ICON(data/) */"error", Main.pref.getColor(marktr("validation error"), Color.RED)),16 ERROR(tr("Errors"), /* ICON(data/) */"error", new ColorProperty(marktr("validation error"), Color.RED).get()), 16 17 /** Warning messages */ 17 WARNING(tr("Warnings"), /* ICON(data/) */"warning", Main.pref.getColor(marktr("validation warning"), Color.YELLOW)),18 WARNING(tr("Warnings"), /* ICON(data/) */"warning", new ColorProperty(marktr("validation warning"), Color.YELLOW).get()), 18 19 /** Other messages */ 19 OTHER(tr("Other"), /* ICON(data/) */"other", Main.pref.getColor(marktr("validation other"), Color.CYAN));20 OTHER(tr("Other"), /* ICON(data/) */"other", new ColorProperty(marktr("validation other"), Color.CYAN).get()); 20 21 // CHECKSTYLE.ON: SingleSpaceSeparator 21 22 -
trunk/src/org/openstreetmap/josm/gui/MapScaler.java
r10504 r10853 15 15 import javax.swing.JComponent; 16 16 17 import org.openstreetmap.josm. Main;17 import org.openstreetmap.josm.data.preferences.ColorProperty; 18 18 import org.openstreetmap.josm.gui.help.Helpful; 19 19 … … 28 28 private static final int PADDING_LEFT = 5; 29 29 private static final int PADDING_RIGHT = 50; 30 31 private static final ColorProperty SCALER_COLOR = new ColorProperty(marktr("scale"), Color.WHITE); 30 32 31 33 /** … … 61 63 */ 62 64 public static Color getColor() { 63 return Main.pref.getColor(marktr("scale"), Color.white);65 return SCALER_COLOR.get(); 64 66 } 65 67 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r10763 r10853 53 53 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 54 54 import org.openstreetmap.josm.data.osm.visitor.Visitor; 55 import org.openstreetmap.josm.data.preferences.ColorProperty; 55 56 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 56 57 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; … … 76 77 public final class ConflictDialog extends ToggleDialog implements ActiveLayerChangeListener, IConflictListener, SelectionChangedListener { 77 78 79 private static final ColorProperty CONFLICT_COLOR = new ColorProperty(marktr("conflict"), Color.GRAY); 80 private static final ColorProperty BACKGROUND_COLOR = new ColorProperty(marktr("background"), Color.BLACK); 81 78 82 /** the collection of conflicts displayed by this conflict dialog */ 79 83 private transient ConflictCollection conflicts; … … 110 114 */ 111 115 public static Color getColor() { 112 return Main.pref.getColor(marktr("conflict"), Color.gray);116 return CONFLICT_COLOR.get(); 113 117 } 114 118 … … 259 263 public void paintConflicts(final Graphics g, final NavigatableComponent nc) { 260 264 Color preferencesColor = getColor(); 261 if (preferencesColor.equals( Main.pref.getColor(marktr("background"), Color.black)))265 if (preferencesColor.equals(BACKGROUND_COLOR.get())) 262 266 return; 263 267 g.setColor(preferencesColor); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r10806 r10853 77 77 import org.openstreetmap.josm.data.osm.visitor.paint.Rendering; 78 78 import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache; 79 import org.openstreetmap.josm.data.preferences.ColorProperty; 79 80 import org.openstreetmap.josm.data.preferences.IntegerProperty; 80 81 import org.openstreetmap.josm.data.preferences.StringProperty; … … 135 136 public static final StringProperty PROPERTY_SAVE_EXTENSION = new StringProperty("save.extension.osm", "osm"); 136 137 138 private static final ColorProperty PROPERTY_BACKGROUND_COLOR = new ColorProperty(marktr("background"), Color.BLACK); 139 private static final ColorProperty PROPERTY_OUTSIDE_COLOR = new ColorProperty(marktr("outside downloaded area"), Color.YELLOW); 137 140 138 141 /** List of recent relations */ … … 320 323 */ 321 324 public static Color getBackgroundColor() { 322 return Main.pref != null ? Main.pref.getColor(marktr("background"), Color.BLACK) : Color.BLACK;325 return PROPERTY_BACKGROUND_COLOR.get(); 323 326 } 324 327 … … 328 331 */ 329 332 public static Color getOutsideColor() { 330 return Main.pref != null ? Main.pref.getColor(marktr("outside downloaded area"), Color.YELLOW) : Color.YELLOW;333 return PROPERTY_OUTSIDE_COLOR.get(); 331 334 } 332 335 -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
r10109 r10853 29 29 import javax.swing.table.DefaultTableModel; 30 30 31 import org.openstreetmap.josm. Main;31 import org.openstreetmap.josm.data.preferences.ColorProperty; 32 32 import org.openstreetmap.josm.data.preferences.ListListSetting; 33 33 import org.openstreetmap.josm.data.preferences.ListSetting; … … 336 336 static final class SettingCellRenderer extends DefaultTableCellRenderer { 337 337 private final Color backgroundColor = UIManager.getColor("Table.background"); 338 private final Color changedColor = Main.pref.getColor(338 private final Color changedColor = new ColorProperty( 339 339 marktr("Advanced Background: Changed"), 340 new Color(200, 255, 200)) ;341 private final Color nonDefaultColor = Main.pref.getColor(340 new Color(200, 255, 200)).get(); 341 private final Color nonDefaultColor = new ColorProperty( 342 342 marktr("Advanced Background: NonDefault"), 343 new Color(255, 255, 200)) ;343 new Color(255, 255, 200)).get(); 344 344 345 345 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r10627 r10853 56 56 import org.openstreetmap.josm.data.imagery.OffsetBookmark; 57 57 import org.openstreetmap.josm.data.imagery.Shape; 58 import org.openstreetmap.josm.data.preferences.ColorProperty; 58 59 import org.openstreetmap.josm.gui.download.DownloadDialog; 59 60 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; … … 239 240 private static class ImageryURLTableCellRenderer extends DefaultTableCellRenderer { 240 241 242 private static final ColorProperty IMAGERY_BACKGROUND_COLOR = new ColorProperty( 243 marktr("Imagery Background: Default"), 244 new Color(200, 255, 200)); 245 241 246 private final transient List<ImageryInfo> layers; 242 247 … … 255 260 for (ImageryInfo l : layers) { 256 261 if (l.getExtendedUrl().equals(t)) { 257 GuiHelper.setBackgroundReadable(label, Main.pref.getColor( 258 marktr("Imagery Background: Default"), 259 new Color(200, 255, 200))); 262 GuiHelper.setBackgroundReadable(label, IMAGERY_BACKGROUND_COLOR.get()); 260 263 break; 261 264 } -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r10378 r10853 46 46 47 47 import org.openstreetmap.josm.Main; 48 import org.openstreetmap.josm.data.preferences.ColorProperty; 48 49 import org.openstreetmap.josm.gui.util.GuiHelper; 49 50 import org.openstreetmap.josm.gui.widgets.JosmComboBox; … … 158 159 private class ShortcutTableCellRenderer extends DefaultTableCellRenderer { 159 160 161 private final transient ColorProperty SHORTCUT_BACKGROUND_USER_COLOR = new ColorProperty( 162 marktr("Shortcut Background: User"), 163 new Color(200, 255, 200)); 164 private final transient ColorProperty SHORTCUT_BACKGROUND_MODIFIED_COLOR = new ColorProperty( 165 marktr("Shortcut Background: Modified"), 166 new Color(255, 255, 200)); 167 160 168 private final boolean name; 161 169 … … 175 183 GuiHelper.setBackgroundReadable(label, UIManager.getColor("Table.background")); 176 184 if (sc.isAssignedUser()) { 177 GuiHelper.setBackgroundReadable(label, Main.pref.getColor( 178 marktr("Shortcut Background: User"), 179 new Color(200, 255, 200))); 185 GuiHelper.setBackgroundReadable(label, SHORTCUT_BACKGROUND_USER_COLOR.get()); 180 186 } else if (!sc.isAssignedDefault()) { 181 GuiHelper.setBackgroundReadable(label, Main.pref.getColor( 182 marktr("Shortcut Background: Modified"), 183 new Color(255, 255, 200))); 187 GuiHelper.setBackgroundReadable(label, SHORTCUT_BACKGROUND_MODIFIED_COLOR.get()); 184 188 } 185 189 return label;
Note:
See TracChangeset
for help on using the changeset viewer.