Changeset 295 in josm for src/org/openstreetmap/josm/gui
- Timestamp:
- 2007-07-24T11:23:01+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r286 r295 57 57 58 58 public final List<DownloadSelection> downloadSelections = new ArrayList<DownloadSelection>(); 59 public final JTabbedPane tabpane = new JTabbedPane(); 60 public final JCheckBox newLayer; 59 61 60 62 public double minlon; … … 63 65 public double maxlat; 64 66 65 public JTabbedPane tabpane = new JTabbedPane();66 67 67 public DownloadDialog( int tabindex) {68 public DownloadDialog() { 68 69 setLayout(new GridBagLayout()); 69 70 … … 103 104 boundingBoxChanged(null); 104 105 } 105 106 107 newLayer = new JCheckBox(tr("Download as new layer"), Main.pref.getBoolean("download.newlayer", true)); 108 add(newLayer, GBC.eol().insets(0,5,0,0)); 109 106 110 add(new JLabel(tr("Download Area")), GBC.eol().insets(0,5,0,0)); 107 111 add(tabpane, GBC.eol().fill()); 108 112 109 113 try { 110 tabpane.setSelectedIndex( tabindex);114 tabpane.setSelectedIndex(Integer.parseInt(Main.pref.get("download.tab", "0"))); 111 115 } catch (Exception ex) { 112 // ignore116 Main.pref.put("download.tab", "0"); 113 117 } 114 //Dimension d = getPreferredSize();115 //setPreferredSize(new Dimension((int)(d.width*1.5), d.height));116 //wc.addInputFields(latlon, osmUrl, osmUrlRefresher);117 118 } 118 119 -
src/org/openstreetmap/josm/gui/layer/RawGpsLayer.java
r290 r295 103 103 */ 104 104 public final Collection<Collection<GpsPoint>> data; 105 106 public RawGpsLayer(Collection<Collection<GpsPoint>> data, String name, File associatedFile) { 105 public final boolean fromServer; 106 107 public RawGpsLayer(boolean fromServer, Collection<Collection<GpsPoint>> data, String name, File associatedFile) { 107 108 super(name); 109 this.fromServer = fromServer; 108 110 this.associatedFile = associatedFile; 109 111 this.data = data; -
src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
r269 r295 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 import static org.xnap.commons.i18n.I18n.marktr; 4 5 5 6 import java.awt.Color; … … 27 28 28 29 import org.openstreetmap.josm.Main; 30 import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor; 29 31 import org.openstreetmap.josm.tools.ColorHelper; 30 32 import org.openstreetmap.josm.tools.GBC; … … 34 36 private DefaultTableModel tableModel; 35 37 private JTable colors; 36 public static final String PREF_COLOR_PREFIX = "color."; 37 38 38 39 /** 39 40 * Set the colors to be shown in the preference table. This method creates a table model if … … 89 90 public void addGui(final PreferenceDialog gui) { 90 91 // initial fill with colors from preferences: 91 Map<String,String> prefColorMap = new TreeMap<String, String>(Main.pref.getAllPrefix(PREF_COLOR_PREFIX)); 92 Map<String,String> prefColorMap = new TreeMap<String, String>(Main.pref.getAllPrefix("color.")); 93 fixColorPrefixes(prefColorMap); 92 94 Map<String,String> colorMap = new TreeMap<String, String>(); 93 95 for(String key : prefColorMap.keySet()) { 94 colorMap.put(key.substring( PREF_COLOR_PREFIX.length()), prefColorMap.get(key));96 colorMap.put(key.substring("color.".length()), prefColorMap.get(key)); 95 97 } 96 98 setColorModel(colorMap); … … 137 139 } 138 140 141 /** 142 * Add all missing color entries. 143 */ 144 private void fixColorPrefixes(Map<String, String> prefColorMap) { 145 String[] cp = { 146 marktr("background"), ColorHelper.color2html(Color.black), 147 marktr("node"), ColorHelper.color2html(Color.red), 148 marktr("segment"), ColorHelper.color2html(SimplePaintVisitor.darkgreen), 149 marktr("way"), ColorHelper.color2html(SimplePaintVisitor.darkblue), 150 marktr("incomplete way"), ColorHelper.color2html(SimplePaintVisitor.darkerblue), 151 marktr("selected"), ColorHelper.color2html(Color.white), 152 marktr("gps point"), ColorHelper.color2html(Color.gray), 153 marktr("conflict"), ColorHelper.color2html(Color.gray), 154 marktr("scale"), ColorHelper.color2html(Color.white), 155 marktr("inactive"), ColorHelper.color2html(Color.darkGray), 156 }; 157 for (int i = 0; i < cp.length/2; ++i) 158 if (!Main.pref.hasKey("color."+cp[i*2])) 159 Main.pref.put("color."+cp[i*2], cp[i*2+1]); 160 } 161 139 162 public void ok() { 140 163 for (int i = 0; i < colors.getRowCount(); ++i) { 141 164 String name = (String)colors.getValueAt(i, 0); 142 165 Color col = (Color)colors.getValueAt(i, 1); 143 Main.pref.put( PREF_COLOR_PREFIX+ name, ColorHelper.color2html(col));166 Main.pref.put("color." + name, ColorHelper.color2html(col)); 144 167 } 145 168 }
Note:
See TracChangeset
for help on using the changeset viewer.