Changeset 2666 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-12-20T16:19:03+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 added
- 7 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r2655 r2666 2 2 package org.openstreetmap.josm.actions.mapmode; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr;5 4 import static org.openstreetmap.josm.tools.I18n.tr; 6 5 import static org.openstreetmap.josm.tools.I18n.trn; … … 48 47 import org.openstreetmap.josm.data.osm.Way; 49 48 import org.openstreetmap.josm.data.osm.WaySegment; 49 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 50 50 import org.openstreetmap.josm.gui.MapFrame; 51 51 import org.openstreetmap.josm.gui.MapView; … … 208 208 super.enterMode(); 209 209 currCursor = Cursors.crosshair; 210 selectedColor = Main.pref.getColor(marktr("selected"), Color.red);210 selectedColor =PaintColors.SELECTED.get(); 211 211 drawHelperLine = Main.pref.getBoolean("draw.helper-line", true); 212 212 drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true); … … 344 344 newSelection.add(n); 345 345 getCurrentDataSet().setSelected(n); 346 selection = getCurrentDataSet().getSelected();347 346 // The user explicitly selected a node, so let him continue drawing 348 347 wayIsFinished = false; -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r2450 r2666 2 2 package org.openstreetmap.josm.actions.mapmode; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr;5 4 import static org.openstreetmap.josm.tools.I18n.tr; 6 5 … … 34 33 import org.openstreetmap.josm.data.osm.Way; 35 34 import org.openstreetmap.josm.data.osm.WaySegment; 35 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 36 36 import org.openstreetmap.josm.gui.MapFrame; 37 37 import org.openstreetmap.josm.gui.MapView; … … 65 65 * counts as a move, in milliseconds 66 66 */ 67 private staticint initialMoveDelay = 200;67 private int initialMoveDelay = 200; 68 68 /** 69 69 * The initial EastNorths of node1 and node2 … … 105 105 putValue("help", "Action/Extrude/Extrude"); 106 106 initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay",200); 107 selectedColor = Main.pref.getColor(marktr("selected"), Color.red);107 selectedColor = PaintColors.SELECTED.get(); 108 108 } 109 109 … … 235 235 } else { 236 236 if (newN1en != null) { 237 Graphics2D g2 = (Graphics2D)g;237 Graphics2D g2 = g; 238 238 g2.setColor(selectedColor); 239 239 g2.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r2512 r2666 20 20 import java.util.Set; 21 21 import java.util.TreeSet; 22 import java.util.logging.Logger;23 22 24 23 import javax.swing.JOptionPane; … … 39 38 import org.openstreetmap.josm.data.osm.WaySegment; 40 39 import org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor; 41 import org.openstreetmap.josm.data.osm.visitor. SimplePaintVisitor;40 import org.openstreetmap.josm.data.osm.visitor.paint.SimplePaintVisitor; 42 41 import org.openstreetmap.josm.gui.ExtendedDialog; 43 42 import org.openstreetmap.josm.gui.MapFrame; … … 62 61 */ 63 62 public class SelectAction extends MapMode implements SelectionEnded { 64 static private final Logger logger = Logger.getLogger(SelectAction.class.getName());63 //static private final Logger logger = Logger.getLogger(SelectAction.class.getName()); 65 64 66 65 /** -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r2655 r2666 52 52 private File preferencesDirFile = null; 53 53 54 public staticinterface PreferenceChangeEvent{55 publicString getKey();56 publicString getOldValue();57 publicString getNewValue();58 } 59 60 public staticinterface PreferenceChangedListener {54 public interface PreferenceChangeEvent{ 55 String getKey(); 56 String getOldValue(); 57 String getNewValue(); 58 } 59 60 public interface PreferenceChangedListener { 61 61 void preferenceChanged(PreferenceChangeEvent e); 62 62 } … … 124 124 this.area = area; 125 125 } 126 } 127 128 public interface ColorKey { 129 String getColorName(); 130 String getSpecialName(); 131 Color getDefault(); 126 132 } 127 133 … … 581 587 } 582 588 589 public Color getColor(ColorKey key) { 590 return getColor(key.getColorName(), key.getSpecialName(), key.getDefault()); 591 } 592 583 593 /** 584 594 * Convenience method for accessing colour preferences. -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintVisitor.java
r2665 r2666 1 1 /* License: GPL. Copyright 2007 by Immanuel Scholz and others */ 2 package org.openstreetmap.josm.data.osm.visitor ;2 package org.openstreetmap.josm.data.osm.visitor.paint; 3 3 4 4 /* To enable debugging or profiling remove the double / signs */ 5 5 6 import static org.openstreetmap.josm.tools.I18n.marktr;7 6 import static org.openstreetmap.josm.tools.I18n.tr; 8 7 … … 41 40 import org.openstreetmap.josm.data.osm.RelationMember; 42 41 import org.openstreetmap.josm.data.osm.Way; 42 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 43 43 import org.openstreetmap.josm.gui.DefaultNameFormatter; 44 44 import org.openstreetmap.josm.gui.mappaint.AreaElemStyle; … … 1248 1248 { 1249 1249 super.getColors(); 1250 untaggedColor = Main.pref.getColor(marktr("untagged"),Color.GRAY);1251 textColor = Main.pref.getColor (marktr("text"), Color.WHITE);1252 areaTextColor = Main.pref.getColor (marktr("areatext"), Color.LIGHT_GRAY);1250 untaggedColor = PaintColors.UNTAGGED.get(); 1251 textColor = PaintColors.TEXT.get(); 1252 areaTextColor = PaintColors.AREA_TEXT.get(); 1253 1253 } 1254 1254 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/SimplePaintVisitor.java
r2665 r2666 1 1 /* License: GPL. Copyright 2007 by Immanuel Scholz and others */ 2 package org.openstreetmap.josm.data.osm.visitor ;2 package org.openstreetmap.josm.data.osm.visitor.paint; 3 3 4 4 /* To enable debugging or profiling remove the double / signs */ 5 6 import static org.openstreetmap.josm.tools.I18n.marktr;7 5 8 6 import java.awt.BasicStroke; … … 26 24 import org.openstreetmap.josm.data.osm.RelationMember; 27 25 import org.openstreetmap.josm.data.osm.Way; 26 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 28 27 import org.openstreetmap.josm.gui.NavigatableComponent; 29 28 … … 35 34 */ 36 35 public class SimplePaintVisitor extends AbstractVisitor { 37 38 public final static Color darkerblue = new Color(0,0,96);39 public final static Color darkblue = new Color(0,0,128);40 public final static Color darkgreen = new Color(0,128,0);41 public final static Color teal = new Color(0,128,128);42 public final static Color lightteal= new Color(0, 255, 186);43 44 36 /** 45 37 * The environment to paint to. … … 92 84 public void getColors() 93 85 { 94 inactiveColor = Main.pref.getColor(marktr("inactive"), Color.darkGray);95 selectedColor = Main.pref.getColor(marktr("selected"), Color.red);96 nodeColor = Main.pref.getColor(marktr("node"), Color.yellow);97 dfltWayColor = Main.pref.getColor(marktr("way"), darkblue);98 relationColor = Main.pref.getColor(marktr("relation"), teal);99 untaggedWayColor = Main.pref.getColor(marktr("untagged way"), darkgreen);100 incompleteColor = Main.pref.getColor(marktr("incomplete way"), darkerblue);101 backgroundColor = Main.pref.getColor(marktr("background"), Color.BLACK);102 highlightColor = Main.pref.getColor(marktr("highlight"), lightteal);86 inactiveColor = PaintColors.INACTIVE.get(); 87 selectedColor = PaintColors.SELECTED.get(); 88 nodeColor = PaintColors.NODE.get(); 89 dfltWayColor = PaintColors.DEFAULT_WAY.get(); 90 relationColor = PaintColors.RELATION.get(); 91 untaggedWayColor = PaintColors.UNTAGGED_WAY.get(); 92 incompleteColor = PaintColors.INCOMPLETE_WAY.get(); 93 backgroundColor = PaintColors.BACKGROUND.get(); 94 highlightColor = PaintColors.HIGHLIGHT.get(); 103 95 } 104 96 -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r2655 r2666 44 44 import org.openstreetmap.josm.data.osm.OsmPrimitive; 45 45 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 46 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 46 47 import org.openstreetmap.josm.gui.layer.GpxLayer; 47 48 import org.openstreetmap.josm.gui.layer.Layer; … … 444 445 Graphics2D tempG = offscreenBuffer.createGraphics(); 445 446 tempG.setClip(g.getClip()); 446 tempG.setColor( Main.pref.getColor("background", Color.BLACK));447 tempG.setColor(PaintColors.BACKGROUND.get()); 447 448 tempG.fillRect(0, 0, getWidth(), getHeight()); 448 449 -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r2578 r2666 59 59 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 60 60 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 61 import org.openstreetmap.josm.data.osm.visitor. MapPaintVisitor;62 import org.openstreetmap.josm.data.osm.visitor. SimplePaintVisitor;61 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintVisitor; 62 import org.openstreetmap.josm.data.osm.visitor.paint.SimplePaintVisitor; 63 63 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 64 64 import org.openstreetmap.josm.gui.MapView; -
trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
r2512 r2666 34 34 35 35 import org.openstreetmap.josm.Main; 36 import org.openstreetmap.josm.data.osm.visitor. MapPaintVisitor;36 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintVisitor; 37 37 import org.openstreetmap.josm.gui.MapScaler; 38 38 import org.openstreetmap.josm.gui.dialogs.ConflictDialog;
Note:
See TracChangeset
for help on using the changeset viewer.