Changeset 5889 in josm
- Timestamp:
- 2013-04-20T15:50:18+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r5854 r5889 455 455 // listen to change events of the very first layer 456 456 // 457 firstLayer.addPropertyChangeListener(LayerListDialog.getInstance().getModel()); 457 if (firstLayer != null) { 458 firstLayer.addPropertyChangeListener(LayerListDialog.getInstance().getModel()); 459 } 458 460 } 459 461 -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r5698 r5889 47 47 import org.openstreetmap.josm.tools.Shortcut; 48 48 49 50 49 /** 51 50 * Join Areas (i.e. closed ways and multipolygons) … … 55 54 private LinkedList<Command> cmds = new LinkedList<Command>(); 56 55 private int cmdsCount = 0; 57 58 56 59 57 /** … … 799 797 800 798 //if odd number of crossings, invert orientation 801 if (intersectionCount % 2 == 1) {799 if (intersectionCount % 2 != 0) { 802 800 curWayInsideToTheRight = !curWayInsideToTheRight; 803 801 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r5886 r5889 81 81 } 82 82 83 private static LinkedList<SearchSetting> searchHistory = null; 84 83 private static final LinkedList<SearchSetting> searchHistory = new LinkedList<SearchSetting>(); 84 static { 85 for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) { 86 SearchSetting ss = SearchSetting.readFromString(s); 87 if (ss != null) { 88 searchHistory.add(ss); 89 } 90 } 91 } 92 85 93 public static Collection<SearchSetting> getSearchHistory() { 86 if (searchHistory == null) {87 searchHistory = new LinkedList<SearchSetting>();88 for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) {89 SearchSetting ss = SearchSetting.readFromString(s);90 if (ss != null) {91 searchHistory.add(ss);92 }93 }94 }95 96 94 return searchHistory; 97 95 } -
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r5874 r5889 295 295 try { 296 296 String jvmId = reader.readLine(); 297 String pid = jvmId.split("@")[0]; 298 skipFile = jvmPerfDataFileExists(pid); 297 if (jvmId != null) { 298 String pid = jvmId.split("@")[0]; 299 skipFile = jvmPerfDataFileExists(pid); 300 } 299 301 } catch (Throwable t) { 300 302 System.err.println(t.getClass()+":"+t.getMessage()); -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r5548 r5889 366 366 367 367 public static double parseDouble(Map<String, String> parameters, String parameterName) throws ProjectionConfigurationException { 368 if (!parameters.containsKey(parameterName)) 369 throw new IllegalArgumentException(tr("Unknown parameter ''{0}''", parameterName)); 368 370 String doubleStr = parameters.get(parameterName); 369 if (doubleStr == null && parameters.containsKey(parameterName))371 if (doubleStr == null) 370 372 throw new ProjectionConfigurationException( 371 373 tr("Expected number argument for parameter ''{0}''", parameterName)); -
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r5634 r5889 165 165 if (proj != null) return proj; 166 166 ProjectionChoice pc = allProjectionChoicesByCode.get(code); 167 if (pc != null) {167 if (pc == null) { 168 168 Pair<String, String> pair = inits.get(code); 169 169 if (pair == null) return null; … … 183 183 return Collections.unmodifiableCollection(allCodes); 184 184 } 185 186 185 } -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r5886 r5889 31 31 import org.openstreetmap.josm.tools.WikiReader; 32 32 33 public class GettingStarted extends JPanel {33 public final class GettingStarted extends JPanel { 34 34 private String content = ""; 35 35 private static final String STYLE = "<style type=\"text/css\">\n" -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r5886 r5889 1155 1155 return null; 1156 1156 1157 for (int i = 0; i< 4; i++) {1157 for (int style : new int[]{DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, DateFormat.FULL}) { 1158 1158 try { 1159 DateFormat df = null; 1160 switch(i) { 1161 case 0: df = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.getDefault()); break; 1162 case 1: df = DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.getDefault()); break; 1163 case 2: df = DateFormat.getTimeInstance(DateFormat.LONG, Locale.getDefault()); break; 1164 case 3: df = DateFormat.getTimeInstance(DateFormat.FULL,Locale.getDefault()); break; 1165 } 1166 Date d = df.parse(getComponent().getText()); 1167 return d; 1159 return DateFormat.getTimeInstance(style, Locale.getDefault()).parse(getComponent().getText()); 1168 1160 } catch(ParseException e) { 1169 1161 continue; -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r5810 r5889 118 118 protected boolean autoDownloadEnabled = true; 119 119 protected boolean settingsChanged; 120 protected ImageryInfo info;121 120 public WmsCache cache; 122 121 private AttributionSupport attribution = new AttributionSupport(); … … 159 158 setBackgroundLayer(true); /* set global background variable */ 160 159 initializeImages(); 161 this.info = new ImageryInfo(info);162 160 163 161 attribution.initialize(this.info); -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSLayerTree.java
r5617 r5889 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.preferences.imagery; 2 3 … … 4 5 5 6 import java.awt.Component; 6 import java.io.Serializable;7 7 import java.util.LinkedList; 8 8 import java.util.List; 9 9 10 import javax.swing.JOptionPane; 10 11 import javax.swing.JTree; … … 16 17 import javax.swing.tree.MutableTreeNode; 17 18 import javax.swing.tree.TreePath; 19 18 20 import org.openstreetmap.josm.io.imagery.WMSImagery; 19 21 20 public class WMSLayerTree implements Serializable{22 public class WMSLayerTree { 21 23 private final MutableTreeNode treeRootNode = new DefaultMutableTreeNode(); 22 24 private final DefaultTreeModel treeData = new DefaultTreeModel(treeRootNode); … … 37 39 } 38 40 41 /** 42 * Constructs a new {@code WMSLayerTree}. 43 */ 39 44 public WMSLayerTree() { 40 45 layerTree.setCellRenderer(new LayerTreeCellRenderer()); 41 46 layerTree.addTreeSelectionListener(new WMSTreeSelectionListener()); 42 43 47 } 44 48 -
trunk/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java
r5855 r5889 41 41 @Override 42 42 public int read() throws IOException { 43 return filter((byte) read());43 return filter((byte)super.read()); 44 44 } 45 45 -
trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java
r5863 r5889 50 50 public void run() { 51 51 CredentialDialog dialog = null; 52 switch(requestorType) {53 case SERVER: dialog = CredentialDialog.getOsmApiCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText()); break;54 case PROXY: dialog = CredentialDialog.getHttpProxyCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText()); break;55 }52 if (requestorType.equals(RequestorType.PROXY)) 53 dialog = CredentialDialog.getHttpProxyCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText()); 54 else 55 dialog = CredentialDialog.getOsmApiCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText()); 56 56 dialog.setVisible(true); 57 57 response.setCanceled(dialog.isCanceled()); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r5876 r5889 135 135 Writer out = null; 136 136 try { 137 OutputStream raw = new BufferedOutputStream( 138 request.getOutputStream()); 137 OutputStream raw = new BufferedOutputStream(request.getOutputStream()); 139 138 out = new OutputStreamWriter(raw); 140 139 BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream(), "ASCII")); 141 140 142 141 String get = in.readLine(); 142 if (get == null) { 143 sendError(out); 144 return; 145 } 143 146 System.out.println("RemoteControl received: " + get); 144 147 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r5872 r5889 77 77 int urlIdx = query.indexOf("&url="); 78 78 if (urlIdx != -1) { 79 /*String url =*/ query.substring(urlIdx + 1);80 79 args.put("url", decodeParam(query.substring(urlIdx + 5))); 81 80 query = query.substring(0, urlIdx);
Note:
See TracChangeset
for help on using the changeset viewer.