Changeset 12846 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement
- Timestamp:
- 2017-09-13T23:24:50+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
r12841 r12846 7 7 import java.util.Objects; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 10 import org.openstreetmap.josm.data.osm.Relation; … … 17 16 import org.openstreetmap.josm.gui.mappaint.Environment; 18 17 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 18 import org.openstreetmap.josm.spi.preferences.Config; 19 19 import org.openstreetmap.josm.tools.CheckParameterUtil; 20 20 import org.openstreetmap.josm.tools.HiDPISupport; … … 90 90 ); 91 91 92 fillImage.alpha = Utils.clamp( Main.pref.getInt("mappaint.fill-image-alpha", 255), 0, 255);92 fillImage.alpha = Utils.clamp(Config.getPref().getInt("mappaint.fill-image-alpha", 255), 0, 255); 93 93 Integer pAlpha = Utils.colorFloat2int(c.get(FILL_OPACITY, null, float.class)); 94 94 if (pAlpha != null) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java
r12841 r12846 12 12 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 13 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 import org.openstreetmap.josm.spi.preferences.Config; 14 15 import org.openstreetmap.josm.tools.LanguageInfo; 15 16 … … 233 234 */ 234 235 public final void initNameTagsFromPreferences() { 235 if ( Main.pref== null) {236 if (Config.getPref() == null) { 236 237 this.nameTags = new ArrayList<>(Arrays.asList(DEFAULT_NAME_TAGS)); 237 238 this.nameComplementTags = new ArrayList<>(Arrays.asList(DEFAULT_NAME_COMPLEMENT_TAGS)); 238 239 } else { 239 240 this.nameTags = new ArrayList<>( 240 Main.pref.getList("mappaint.nameOrder", Arrays.asList(DEFAULT_NAME_TAGS))241 Config.getPref().getList("mappaint.nameOrder", Arrays.asList(DEFAULT_NAME_TAGS)) 241 242 ); 242 243 this.nameComplementTags = new ArrayList<>( 243 Main.pref.getList("mappaint.nameComplementOrder", Arrays.asList(DEFAULT_NAME_COMPLEMENT_TAGS))244 Config.getPref().getList("mappaint.nameComplementOrder", Arrays.asList(DEFAULT_NAME_COMPLEMENT_TAGS)) 244 245 ); 245 246 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r12841 r12846 10 10 import java.util.stream.IntStream; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.osm.Node; 14 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 25 24 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.BoxProvider; 26 25 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.SimpleBoxProvider; 26 import org.openstreetmap.josm.spi.preferences.Config; 27 27 import org.openstreetmap.josm.tools.CheckParameterUtil; 28 28 import org.openstreetmap.josm.tools.Logging; … … 196 196 mapImage.offsetY = Math.round(offsetYF); 197 197 198 mapImage.alpha = Utils.clamp( Main.pref.getInt("mappaint.icon-image-alpha", 255), 0, 255);198 mapImage.alpha = Utils.clamp(Config.getPref().getInt("mappaint.icon-image-alpha", 255), 0, 255); 199 199 Integer pAlpha = Utils.colorFloat2int(c.get(keys[ICON_OPACITY_IDX], null, float.class)); 200 200 if (pAlpha != null) { … … 356 356 // This is only executed once, so no performance concerns. 357 357 // However, it would be better, if the settings could be changed at runtime. 358 int size = max( 359 Main.pref.getInt("mappaint.node.selected-size", 5), 360 Main.pref.getInt("mappaint.node.unselected-size", 3), 361 Main.pref.getInt("mappaint.node.connection-size", 5), 362 Main.pref.getInt("mappaint.node.tagged-size", 3) 358 int size = max(Config.getPref().getInt("mappaint.node.selected-size", 5), 359 Config.getPref().getInt("mappaint.node.unselected-size", 3), 360 Config.getPref().getInt("mappaint.node.connection-size", 5), 361 Config.getPref().getInt("mappaint.node.tagged-size", 3) 363 362 ); 364 363 return new SimpleBoxProvider(new Rectangle(-size/2, -size/2, size, size)); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r12841 r12846 7 7 import java.util.Objects; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 10 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; … … 15 14 import org.openstreetmap.josm.gui.mappaint.StyleKeys; 16 15 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.RelativeFloat; 16 import org.openstreetmap.josm.spi.preferences.Config; 17 17 18 18 /** … … 148 148 s = defaultFontSize; 149 149 if (s == null) { 150 defaultFontSize = s = (float) Main.pref.getInt("mappaint.fontsize", 8);150 defaultFontSize = s = (float) Config.getPref().getInt("mappaint.fontsize", 8); 151 151 } 152 152 } … … 161 161 n = defaultFontName; 162 162 if (n == null) { 163 defaultFontName = n = Main.pref.get("mappaint.font", "Droid Sans");163 defaultFontName = n = Config.getPref().get("mappaint.font", "Droid Sans"); 164 164 } 165 165 }
Note:
See TracChangeset
for help on using the changeset viewer.