Changeset 23191 in osm for applications/editors/josm/plugins/openstreetbugs/src
- Timestamp:
- 2010-09-15T18:56:19+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/ConfigKeys.java
r19282 r23191 1 1 /* Copyright (c) 2008, Henrik Niehaus 2 2 * All rights reserved. 3 * 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are met: 6 * 6 * 7 7 * 1. Redistributions of source code must retain the above copyright notice, 8 8 * this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * this list of conditions and the following disclaimer in the documentation 9 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * this list of conditions and the following disclaimer in the documentation 11 11 * and/or other materials provided with the distribution. 12 * 3. Neither the name of the project nor the names of its 13 * contributors may be used to endorse or promote products derived from this 12 * 3. Neither the name of the project nor the names of its 13 * contributors may be used to endorse or promote products derived from this 14 14 * software without specific prior written permission. 15 * 15 * 16 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbDownloadLoop.java
r19282 r23191 78 78 79 79 // auto download if configured 80 if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) && !Main.pref.getBoolean(ConfigKeys.OSB_API_OFFLINE) && 80 if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) && !Main.pref.getBoolean(ConfigKeys.OSB_API_OFFLINE) && 81 81 plugin != null && plugin.getDialog() != null && plugin.getDialog().isDialogShowing() ) { 82 82 if(countdown < 0) { -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java
r22684 r23191 84 84 UploadAction.registerUploadHook(uploadHook); 85 85 } else { 86 87 88 86 MapView.removeLayerChangeListener(this); 87 UploadAction.unregisterUploadHook(uploadHook); 88 uploadHook = null; 89 89 } 90 90 } … … 231 231 public void layerRemoved(Layer oldLayer) { 232 232 if(oldLayer == layer) { 233 234 233 MapView.removeLayerChangeListener(this); 234 MapView.removeLayerChangeListener(dialog); 235 235 layer = null; 236 236 } -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/AddCommentAction.java
r19282 r23191 49 49 50 50 private EditAction editAction = new EditAction(); 51 51 52 52 private String comment; 53 53 54 54 private Node node; 55 55 … … 73 73 OsbPlugin.loadIcon("add_comment22.png"), 74 74 history, l); 75 75 76 76 if(comment == null) { 77 77 cancelled = true; … … 84 84 editAction.execute(node, comment); 85 85 } 86 86 87 87 @Override 88 88 public String toString() { 89 89 return tr("Comment: " + node.get("note") + " - " + comment); 90 90 } 91 91 92 92 @Override 93 93 public AddCommentAction clone() { -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/CloseIssueAction.java
r19282 r23191 51 51 private CloseAction closeAction = new CloseAction(); 52 52 private EditAction commentAction = new EditAction(); 53 53 54 54 private String comment; 55 55 56 56 private Node node; 57 57 … … 74 74 OsbPlugin.loadIcon("icon_valid22.png"), 75 75 history, l); 76 76 77 77 if(comment == null) { 78 78 cancelled = true; … … 89 89 closeAction.execute(node); 90 90 } 91 91 92 92 @Override 93 93 public String toString() { 94 94 return tr("Close: " + node.get("note") + " - Comment: " + comment); 95 95 } 96 96 97 97 @Override 98 98 public CloseIssueAction clone() { -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/NewIssueAction.java
r19282 r23191 51 51 52 52 private String result; 53 53 54 54 private Point p; 55 55 56 56 private NewAction newAction = new NewAction(); 57 57 58 58 public NewIssueAction(OsbPlugin plugin, Point p) { 59 59 super(tr("New issue"), plugin.getDialog()); … … 77 77 OsbPlugin.loadIcon("icon_error_add22.png"), 78 78 history, l); 79 79 80 80 if(result == null) { 81 81 cancelled = true; … … 96 96 } 97 97 } 98 98 99 99 @Override 100 100 public String toString() { 101 101 return tr("Create: " + result); 102 102 } 103 103 104 104 @Override 105 105 public OsbAction clone() { -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/PointToNewIssueAction.java
r19285 r23191 46 46 47 47 private JToggleButton button; 48 48 49 49 private OsbPlugin plugin; 50 50 51 51 private Cursor previousCursor; 52 52 53 53 public PointToNewIssueAction(JToggleButton button, OsbPlugin plugin) { 54 54 super(tr("New issue")); -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/dialogs/TextInputDialog.java
r17872 r23191 1 1 /* Copyright (c) 2008, Henrik Niehaus 2 2 * All rights reserved. 3 * 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are met: 6 * 6 * 7 7 * 1. Redistributions of source code must retain the above copyright notice, 8 8 * this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * this list of conditions and the following disclaimer in the documentation 9 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * this list of conditions and the following disclaimer in the documentation 11 11 * and/or other materials provided with the distribution. 12 * 3. Neither the name of the project nor the names of its 13 * contributors may be used to endorse or promote products derived from this 12 * 3. Neither the name of the project nor the names of its 13 * contributors may be used to endorse or promote products derived from this 14 14 * software without specific prior written permission. 15 * 15 * 16 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE … … 74 74 private JLabel lblText; 75 75 private JPanel pnlMain; 76 76 77 77 private String value = null; 78 78 79 79 private TextInputDialog() { 80 80 initGUI(); … … 88 88 } 89 89 }); 90 90 91 91 btnOk.addActionListener(new ActionListener() { 92 92 public void actionPerformed(ActionEvent e) { … … 94 94 } 95 95 }); 96 96 97 97 btnCancel.addActionListener(new ActionListener() { 98 98 public void actionPerformed(ActionEvent e) { … … 101 101 }); 102 102 } 103 103 104 104 private void okPressed() { 105 105 value = input.getText(); … … 155 155 setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 156 156 } 157 157 158 158 public static String showDialog(JComponent parent, String title, String text, List<String> history, HistoryChangedListener l) { 159 159 return showDialog(parent, title, text, null, history, l); 160 160 } 161 161 162 162 /** 163 163 * Opens a text input dialog and returns the entered text … … 180 180 int y = (int) (p.getY() + (double)(parent.getHeight() - tid.getHeight()) / 2); 181 181 tid.setLocation(x, y); 182 182 183 183 //tid.pack(); 184 184 tid.setVisible(true); … … 189 189 return this.value; 190 190 } 191 191 192 192 public void setDescription(String text) { 193 193 lblText.setText(text); 194 194 } 195 195 196 196 public void setHistory(List<String> history) { 197 197 input.setHistory(history); … … 199 199 value = null; 200 200 } 201 201 202 202 public void addHistoryChangedListener(HistoryChangedListener l) { 203 203 ((ComboBoxHistory)input.getModel()).addHistoryChangedListener(l); 204 204 } 205 205 206 206 public void setIcon(Icon icon) { 207 207 lblIcon.setIcon(icon);
Note:
See TracChangeset
for help on using the changeset viewer.