Changeset 30738 in osm for applications/editors/josm/plugins/imagery_offset_db/src/iodb/OffsetDialog.java
- Timestamp:
- 2014-10-19T01:27:04+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery_offset_db/src/iodb/OffsetDialog.java
r30737 r30738 1 1 package iodb; 2 2 3 import java.awt.*; 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 import java.awt.BasicStroke; 6 import java.awt.Color; 7 import java.awt.Component; 8 import java.awt.FlowLayout; 9 import java.awt.Graphics2D; 10 import java.awt.GridLayout; 11 import java.awt.Point; 12 import java.awt.RenderingHints; 4 13 import java.awt.event.ActionEvent; 5 14 import java.awt.event.ActionListener; … … 8 17 import java.net.HttpURLConnection; 9 18 import java.net.URL; 10 import java.util.*; 19 import java.util.ArrayList; 20 import java.util.Date; 11 21 import java.util.List; 12 import javax.swing.*; 22 23 import javax.swing.AbstractAction; 24 import javax.swing.Box; 25 import javax.swing.BoxLayout; 26 import javax.swing.JButton; 27 import javax.swing.JCheckBox; 28 import javax.swing.JComponent; 29 import javax.swing.JDialog; 30 import javax.swing.JOptionPane; 31 import javax.swing.JPanel; 32 import javax.swing.JPopupMenu; 33 import javax.swing.KeyStroke; 13 34 import javax.swing.border.CompoundBorder; 14 35 import javax.swing.border.EmptyBorder; 36 15 37 import org.openstreetmap.josm.Main; 16 38 import org.openstreetmap.josm.data.Bounds; … … 19 41 import org.openstreetmap.josm.gui.layer.ImageryLayer; 20 42 import org.openstreetmap.josm.gui.layer.MapViewPaintable; 21 import org.openstreetmap.josm.tools.*; 22 import static org.openstreetmap.josm.tools.I18n.tr; 43 import org.openstreetmap.josm.tools.ImageProvider; 44 import org.openstreetmap.josm.tools.LanguageInfo; 45 import org.openstreetmap.josm.tools.OpenBrowser; 46 import org.openstreetmap.josm.tools.Utils; 23 47 24 48 /** 25 49 * The dialog which presents a choice between imagery align options. 26 * 50 * 27 51 * @author Zverik 28 52 * @license WTFPL … … 31 55 protected static final String PREF_CALIBRATION = "iodb.show.calibration"; 32 56 protected static final String PREF_DEPRECATED = "iodb.show.deprecated"; 33 private static final int MAX_OFFSETS = Main. main.pref.getInteger("iodb.max.offsets", 4);57 private static final int MAX_OFFSETS = Main.pref.getInteger("iodb.max.offsets", 4); 34 58 35 59 /** … … 45 69 46 70 /** 47 * Initialize the dialog and install listeners. 71 * Initialize the dialog and install listeners. 48 72 * @param offsets The list of offset to choose from. 49 73 */ … … 60 84 JComponent.WHEN_IN_FOCUSED_WINDOW); 61 85 } 62 86 63 87 /** 64 88 * Creates the GUI. … … 69 93 calibrationBox.setSelected(Main.pref.getBoolean(PREF_CALIBRATION, true)); 70 94 calibrationBox.addActionListener(new ActionListener() { 71 public void actionPerformed( ActionEvent e ) { 95 @Override 96 public void actionPerformed( ActionEvent e ) { 72 97 Main.pref.put(PREF_CALIBRATION, calibrationBox.isSelected()); 73 98 updateButtonPanel(); … … 77 102 deprecatedBox.setSelected(Main.pref.getBoolean(PREF_DEPRECATED, false)); 78 103 deprecatedBox.addActionListener(new ActionListener() { 79 public void actionPerformed( ActionEvent e ) { 104 @Override 105 public void actionPerformed( ActionEvent e ) { 80 106 Main.pref.put(PREF_DEPRECATED, deprecatedBox.isSelected()); 81 107 updateButtonPanel(); … … 154 180 * It does nothing, only passes the event to all displayed offset buttons. 155 181 */ 156 public void zoomChanged() { 182 @Override 183 public void zoomChanged() { 157 184 for( Component c : buttonPanel.getComponents() ) { 158 185 if( c instanceof OffsetDialogButton ) { … … 166 193 * value, but looks nice. 167 194 */ 168 public void paint( Graphics2D g, MapView mv, Bounds bbox ) { 195 @Override 196 public void paint( Graphics2D g, MapView mv, Bounds bbox ) { 169 197 if( offsets == null ) 170 198 return; … … 181 209 } 182 210 } 183 211 184 212 /** 185 213 * Display the dialog and get the return value is case of a modal frame. … … 208 236 * @see #applyOffset() 209 237 */ 210 public void actionPerformed( ActionEvent e ) { 238 @Override 239 public void actionPerformed( ActionEvent e ) { 211 240 if( e.getSource() instanceof OffsetDialogButton ) { 212 241 selectedOffset = ((OffsetDialogButton)e.getSource()).getOffset(); … … 283 312 * Remove the deprecated offset from the offsets list. Then rebuild the button panel. 284 313 */ 285 public void queryPassed() { 314 @Override 315 public void queryPassed() { 286 316 offset.setDeprecated(new Date(), JosmUserIdentityManager.getInstance().getUserName(), ""); 287 317 updateButtonPanel(); … … 299 329 } 300 330 301 public void actionPerformed( ActionEvent e ) { 331 @Override 332 public void actionPerformed( ActionEvent e ) { 302 333 String base = Main.pref.get("url.openstreetmap-wiki", "http://wiki.openstreetmap.org/wiki/"); 303 334 String lang = LanguageInfo.getWikiLanguagePrefix();
Note:
See TracChangeset
for help on using the changeset viewer.
