Changeset 8968 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-10-29T18:56:35+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java
r8325 r8968 8 8 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 9 9 10 /** 11 * Global mappaint settings. 12 * @since 2675 13 */ 10 14 public final class MapPaintSettings implements PreferenceChangedListener { 11 15 16 /** The unique instance **/ 12 17 public static final MapPaintSettings INSTANCE = new MapPaintSettings(); 13 18 … … 17 22 /** Preference: should arrows for oneways be displayed */ 18 23 private boolean showOnewayArrow; 24 /** Preference: default width for ways segments */ 19 25 private int defaultSegmentWidth; 20 26 /** Preference: should the segment numbers of ways be displayed */ … … 41 47 /** Preference: should multiply connected nodes be filled */ 42 48 private boolean fillConnectionNode; 49 /** Preference: should only the data area outline be drawn */ 43 50 private boolean outlineOnly; 44 51 /** Color Preference for selected objects */ … … 82 89 } 83 90 84 85 91 showOrderNumber = Main.pref.getBoolean("draw.segment.order_number", false); 86 92 showHeadArrowOnly = Main.pref.getBoolean("draw.segment.head_only", false); … … 100 106 101 107 outlineOnly = Main.pref.getBoolean("draw.data.area_outline_only", false); 102 103 108 } 104 109 … … 108 113 } 109 114 115 /** 116 * Determines if the real width of ways should be used 117 * @return {@code true} if the real width of ways should be used 118 */ 110 119 public boolean isUseRealWidth() { 111 120 return useRealWidth; 112 121 } 113 122 123 /** 124 * Determines if directional arrows should be displayed 125 * @return {@code true} if directional arrows should be displayed 126 */ 114 127 public boolean isShowDirectionArrow() { 115 128 return showDirectionArrow; 116 129 } 117 130 131 /** 132 * Determines if arrows for oneways should be displayed 133 * @return {@code true} if arrows for oneways should be displayed 134 */ 118 135 public boolean isShowOnewayArrow() { 119 136 return showOnewayArrow; 120 137 } 121 138 139 /** 140 * Returns color for selected objects (nodes and ways) 141 * @return color for selected objects 142 */ 122 143 public Color getSelectedColor() { 123 144 return selectedColor; 124 145 } 125 146 147 /** 148 * Returns color for selected objects (nodes and ways) with a given alpha 149 * @param alpha alpha component in the range 0-255 150 * @return color for selected objects 151 */ 152 public Color getSelectedColor(int alpha) { 153 return new Color(selectedColor.getRGB() & 0x00ffffff | (alpha << 24), true); 154 } 155 156 /** 157 * Returns default width for ways segments 158 * @return default width for ways segments 159 */ 126 160 public int getDefaultSegmentWidth() { 127 161 return defaultSegmentWidth; 128 162 } 129 163 130 public Color getSelectedColor(int alpha) {131 return new Color(selectedColor.getRGB() & 0x00ffffff | (alpha << 24), true);132 }133 164 /** 165 * Returns color for selected relations 166 * @return color for selected relations 167 */ 134 168 public Color getRelationSelectedColor() { 135 169 return relationSelectedColor; 136 170 } 137 171 172 /** 173 * Returns color for selected relations with a given alpha 174 * @param alpha alpha component in the range 0-255 175 * @return color for selected relations 176 */ 138 177 public Color getRelationSelectedColor(int alpha) { 139 178 return new Color(relationSelectedColor.getRGB() & 0x00ffffff | (alpha << 24), true); 140 179 } 141 180 181 /** 182 * Returns color for hightlighted objects 183 * @return color for hightlighted objects 184 */ 142 185 public Color getHighlightColor() { 143 186 return highlightColor; 144 187 } 145 188 189 /** 190 * Returns color for inactive objects 191 * @return color for inactive objects 192 */ 146 193 public Color getInactiveColor() { 147 194 return inactiveColor; 148 195 } 149 196 197 /** 198 * Returns color for nodes 199 * @return color for nodes 200 */ 150 201 public Color getNodeColor() { 151 202 return nodeColor; 152 203 } 153 204 205 /** 206 * Returns color for tagged nodes 207 * @return color for tagged nodes 208 */ 154 209 public Color getTaggedColor() { 155 210 return taggedColor; 156 211 } 157 212 213 /** 214 * Returns color for multiply connected nodes 215 * @return color for multiply connected nodes 216 */ 158 217 public Color getConnectionColor() { 159 218 return connectionColor; 160 219 } 161 220 221 /** 222 * Returns color for tagged and multiply connected nodes 223 * @return color for tagged and multiply connected nodes 224 */ 162 225 public Color getTaggedConnectionColor() { 163 226 return taggedConnectionColor; 164 227 } 165 228 229 /** 230 * Determines if the segment numbers of ways should be displayed 231 * @return {@code true} if the segment numbers of ways should be displayed 232 */ 166 233 public boolean isShowOrderNumber() { 167 234 return showOrderNumber; 168 235 } 169 236 237 /** 238 * Specifies if only the last arrow of a way should be displayed 239 * @param showHeadArrowOnly {@code true} if only the last arrow of a way should be displayed 240 */ 170 241 public void setShowHeadArrowOnly(boolean showHeadArrowOnly) { 171 242 this.showHeadArrowOnly = showHeadArrowOnly; 172 243 } 173 244 245 /** 246 * Determines if only the last arrow of a way should be displayed 247 * @return {@code true} if only the last arrow of a way should be displayed 248 */ 174 249 public boolean isShowHeadArrowOnly() { 175 250 return showHeadArrowOnly; 176 251 } 177 252 253 /** 254 * Returns the distance at which names should be drawn 255 * @return the distance at which names should be drawn 256 */ 178 257 public int getShowNamesDistance() { 179 258 return showNamesDistance; 180 259 } 181 260 261 /** 262 * Returns the distance at which strokes should be used 263 * @return the distance at which strokes should be used 264 */ 182 265 public int getUseStrokesDistance() { 183 266 return useStrokesDistance; 184 267 } 185 268 269 /** 270 * Returns the distance at which icons should be drawn 271 * @return the distance at which icons should be drawn 272 */ 186 273 public int getShowIconsDistance() { 187 274 return showIconsDistance; 188 275 } 189 276 277 /** 278 * Returns the size of selected nodes 279 * @return the size of selected nodes 280 */ 190 281 public int getSelectedNodeSize() { 191 282 return selectedNodeSize; 192 283 } 193 284 285 /** 286 * Returns the size of multiply connected nodes 287 * @return the size of multiply connected nodes 288 */ 194 289 public int getConnectionNodeSize() { 195 290 return connectionNodeSize; 196 291 } 197 292 293 /** 294 * Returns the size of unselected nodes 295 * @return the size of unselected nodes 296 */ 198 297 public int getUnselectedNodeSize() { 199 298 return unselectedNodeSize; 200 299 } 201 300 301 /** 302 * Returns the size of tagged nodes 303 * @return the size of tagged nodes 304 */ 202 305 public int getTaggedNodeSize() { 203 306 return taggedNodeSize; 204 307 } 205 308 309 /** 310 * Determines if selected nodes should be filled 311 * @return {@code true} if selected nodes should be filled 312 */ 206 313 public boolean isFillSelectedNode() { 207 314 return fillSelectedNode; 208 315 } 209 316 317 /** 318 * Determines if unselected nodes should be filled 319 * @return {@code true} if unselected nodes should be filled 320 */ 210 321 public boolean isFillUnselectedNode() { 211 322 return fillUnselectedNode; 212 323 } 213 324 325 /** 326 * Determines if multiply connected nodes should be filled 327 * @return {@code true} if multiply connected nodes should be filled 328 */ 214 329 public boolean isFillConnectionNode() { 215 330 return fillConnectionNode; 216 331 } 217 332 333 /** 334 * Determines if tagged nodes should be filled 335 * @return {@code true} if tagged nodes should be filled 336 */ 218 337 public boolean isFillTaggedNode() { 219 338 return fillTaggedNode; 220 339 } 221 340 341 /** 342 * Determines if only the data area outline should be drawn 343 * @return {@code true} if only the data area outline should be drawn 344 */ 222 345 public boolean isOutlineOnly() { 223 346 return outlineOnly;
Note:
See TracChangeset
for help on using the changeset viewer.