Ticket #4429: josmtextfield_01.patch
| File josmtextfield_01.patch, 50.5 KB (added by , 13 years ago) |
|---|
-
src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
19 19 20 20 import javax.swing.JLabel; 21 21 import javax.swing.JPanel; 22 import javax.swing.JTextField;23 22 24 23 import org.openstreetmap.josm.Main; 25 24 import org.openstreetmap.josm.actions.mapmode.MapMode; … … 30 29 import org.openstreetmap.josm.gui.layer.ImageryLayer; 31 30 import org.openstreetmap.josm.tools.GBC; 32 31 import org.openstreetmap.josm.tools.ImageProvider; 32 import org.openstreetmap.josm.gui.widgets.JosmTextField; 33 33 34 34 35 35 public class ImageryAdjustAction extends MapMode implements MouseListener, MouseMotionListener, AWTEventListener{ … … 148 148 } 149 149 150 150 class ImageryOffsetDialog extends ExtendedDialog implements FocusListener { 151 public final J TextField tOffset = new JTextField();152 J TextField tBookmarkName = new JTextField();151 public final JosmTextField tOffset = new JosmTextField(); 152 JosmTextField tBookmarkName = new JosmTextField(); 153 153 private boolean ignoreListener; 154 154 public ImageryOffsetDialog() { 155 155 super(Main.parent, -
src/org/openstreetmap/josm/actions/search/SearchAction.java
29 29 import javax.swing.JOptionPane; 30 30 import javax.swing.JPanel; 31 31 import javax.swing.JRadioButton; 32 import javax.swing.JTextField;33 32 import javax.swing.text.BadLocationException; 34 33 35 34 import org.openstreetmap.josm.Main; … … 50 49 import org.openstreetmap.josm.tools.Property; 51 50 import org.openstreetmap.josm.tools.Shortcut; 52 51 import org.openstreetmap.josm.tools.Utils; 52 import org.openstreetmap.josm.gui.widgets.JosmTextField; 53 53 54 54 55 public class SearchAction extends JosmAction implements ParameterizedAction { 55 56 56 57 public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15; … … 194 195 @Override 195 196 public void mouseClicked(MouseEvent e) { 196 197 try { 197 J TextField tf = (JTextField) hcb.getEditor().getEditorComponent();198 JosmTextField tf = (JosmTextField) hcb.getEditor().getEditorComponent(); 198 199 tf.getDocument().insertString(tf.getCaretPosition(), " " + insertText, null); 199 200 } catch (BadLocationException ex) { 200 201 throw new RuntimeException(ex.getMessage(), ex); -
src/org/openstreetmap/josm/actions/RenameLayerAction.java
13 13 import javax.swing.JCheckBox; 14 14 import javax.swing.JDialog; 15 15 import javax.swing.JOptionPane; 16 import javax.swing.JTextField;17 16 18 17 import org.openstreetmap.josm.Main; 19 18 import org.openstreetmap.josm.gui.layer.Layer; 20 19 import org.openstreetmap.josm.tools.ImageProvider; 20 import org.openstreetmap.josm.gui.widgets.JosmTextField; 21 21 22 22 /** 23 23 * Action to rename an specific layer. Provides the option to rename the … … 43 43 44 44 public void actionPerformed(ActionEvent e) { 45 45 Box panel = Box.createVerticalBox(); 46 final J TextField name = new JTextField(layer.getName());46 final JosmTextField name = new JosmTextField(layer.getName()); 47 47 panel.add(name); 48 48 JCheckBox filerename = new JCheckBox(tr("Also rename the file")); 49 49 if (Main.applet) { -
src/org/openstreetmap/josm/actions/JumpToAction.java
13 13 import javax.swing.JLabel; 14 14 import javax.swing.JOptionPane; 15 15 import javax.swing.JPanel; 16 import javax.swing.JTextField;17 16 import javax.swing.event.DocumentEvent; 18 17 import javax.swing.event.DocumentListener; 19 18 … … 24 23 import org.openstreetmap.josm.tools.GBC; 25 24 import org.openstreetmap.josm.tools.OsmUrlToBounds; 26 25 import org.openstreetmap.josm.tools.Shortcut; 26 import org.openstreetmap.josm.gui.widgets.JosmTextField; 27 27 28 28 public class JumpToAction extends JosmAction implements MouseListener { 29 29 public JumpToAction() { … … 33 33 Main.toolbar.register(this); 34 34 } 35 35 36 private J TextField url = new JTextField();37 private J TextField lat = new JTextField();38 private J TextField lon = new JTextField();39 private J TextField zm = new JTextField();36 private JosmTextField url = new JosmTextField(); 37 private JosmTextField lat = new JosmTextField(); 38 private JosmTextField lon = new JosmTextField(); 39 private JosmTextField zm = new JosmTextField(); 40 40 41 41 private double zoomFactor = 0; 42 42 public void showJumpToDialog() { -
src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java
16 16 import javax.swing.JOptionPane; 17 17 import javax.swing.JPanel; 18 18 import javax.swing.JRadioButton; 19 import javax.swing.JTextField;20 19 21 20 import org.openstreetmap.josm.Main; 22 21 import org.openstreetmap.josm.data.imagery.ImageryInfo; … … 26 25 import org.openstreetmap.josm.tools.Shortcut; 27 26 import org.openstreetmap.josm.tools.UrlLabel; 28 27 import org.openstreetmap.josm.tools.Utils; 28 import org.openstreetmap.josm.gui.widgets.JosmTextField; 29 29 30 30 public class Map_Rectifier_WMSmenuAction extends JosmAction { 31 31 /** … … 110 110 JPanel panel = new JPanel(new GridBagLayout()); 111 111 panel.add(new JLabel(tr("Supported Rectifier Services:")), GBC.eol()); 112 112 113 J TextField tfWmsUrl = new JTextField(30);113 JosmTextField tfWmsUrl = new JosmTextField(30); 114 114 115 115 String clip = Utils.getClipboardContent(); 116 116 clip = clip == null ? "" : clip.trim(); -
src/org/openstreetmap/josm/gui/MapStatus.java
33 33 import javax.swing.JPanel; 34 34 import javax.swing.JProgressBar; 35 35 import javax.swing.JScrollPane; 36 import javax.swing.JTextField;37 36 import javax.swing.Popup; 38 37 import javax.swing.PopupFactory; 39 38 import javax.swing.UIManager; … … 49 48 import org.openstreetmap.josm.gui.util.GuiHelper; 50 49 import org.openstreetmap.josm.tools.GBC; 51 50 import org.openstreetmap.josm.tools.ImageProvider; 51 import org.openstreetmap.josm.gui.widgets.JosmTextField; 52 52 53 53 /** 54 54 * A component that manages some status information display about the map. … … 150 150 151 151 final ImageLabel lonText = new ImageLabel("lon", tr("The geographic longitude at the mouse pointer."), 11); 152 152 final ImageLabel nameText = new ImageLabel("name", tr("The name of the object at the mouse pointer."), 20); 153 final J TextField helpText = new JTextField();153 final JosmTextField helpText = new JosmTextField(); 154 154 final ImageLabel latText = new ImageLabel("lat", tr("The geographic latitude at the mouse pointer."), 11); 155 155 final ImageLabel angleText = new ImageLabel("angle", tr("The angle between the previous and the current way segment."), 6); 156 156 final ImageLabel headingText = new ImageLabel("heading", tr("The (compass) heading of the line segment being drawn."), 6); -
src/org/openstreetmap/josm/gui/MainApplet.java
22 22 import javax.swing.JOptionPane; 23 23 import javax.swing.JPanel; 24 24 import javax.swing.JPasswordField; 25 import javax.swing.JTextField;26 25 27 26 import org.openstreetmap.josm.Main; 28 27 import org.openstreetmap.josm.actions.JosmAction; … … 32 31 import org.openstreetmap.josm.tools.GBC; 33 32 import org.openstreetmap.josm.tools.I18n; 34 33 import org.openstreetmap.josm.tools.Shortcut; 34 import org.openstreetmap.josm.gui.widgets.JosmTextField; 35 35 36 36 public class MainApplet extends JApplet { 37 37 … … 112 112 JPanel p = new JPanel(new GridBagLayout()); 113 113 p.add(new JLabel(tr(e.realm)), GBC.eol().fill(GBC.HORIZONTAL)); 114 114 p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,20,0)); 115 J TextField user = new JTextField(username == null ? "" : username);115 JosmTextField user = new JosmTextField(username == null ? "" : username); 116 116 p.add(user, GBC.eol().fill(GBC.HORIZONTAL)); 117 117 p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,20,0)); 118 118 JPasswordField pass = new JosmPasswordField(password == null ? "" : password); -
src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java
30 30 import javax.swing.JList; 31 31 import javax.swing.JPanel; 32 32 import javax.swing.JScrollPane; 33 import javax.swing.JTextField;34 33 import javax.swing.event.DocumentEvent; 35 34 import javax.swing.event.DocumentListener; 36 35 … … 49 48 import org.openstreetmap.josm.gui.tagging.TaggingPreset.PresetType; 50 49 import org.openstreetmap.josm.gui.tagging.TaggingPreset.Role; 51 50 import org.openstreetmap.josm.gui.tagging.TaggingPreset.Roles; 51 import org.openstreetmap.josm.gui.widgets.JosmTextField; 52 52 53 53 54 public class TaggingPresetSearchDialog extends ExtendedDialog implements SelectionChangedListener { 54 55 55 56 private static final int CLASSIFICATION_IN_FAVORITES = 300; … … 191 192 return instance; 192 193 } 193 194 194 private J TextField edSearchText;195 private JosmTextField edSearchText; 195 196 private JList lsResult; 196 197 private JCheckBox ckOnlyApplicable; 197 198 private JCheckBox ckSearchInTags; … … 238 239 JPanel content = new JPanel(); 239 240 content.setLayout(new BorderLayout()); 240 241 241 edSearchText = new J TextField();242 edSearchText = new JosmTextField(); 242 243 edSearchText.getDocument().addDocumentListener(new DocumentListener() { 243 244 244 245 @Override -
src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
10 10 11 11 import javax.swing.ComboBoxEditor; 12 12 import javax.swing.JTable; 13 import javax.swing.JTextField;14 13 import javax.swing.event.CellEditorListener; 15 14 import javax.swing.table.TableCellEditor; 16 15 import javax.swing.text.AttributeSet; … … 21 20 22 21 import org.openstreetmap.josm.Main; 23 22 import org.openstreetmap.josm.gui.util.TableCellEditorSupport; 23 import org.openstreetmap.josm.gui.widgets.JosmTextField; 24 24 25 25 26 /** 26 27 * AutoCompletingTextField is an text field with autocompletion behaviour. It 27 28 * can be used as table cell editor in {@link JTable}s. … … 31 32 * 32 33 * 33 34 */ 34 public class AutoCompletingTextField extends J TextField implements ComboBoxEditor, TableCellEditor {35 public class AutoCompletingTextField extends JosmTextField implements ComboBoxEditor, TableCellEditor { 35 36 36 37 private Integer maxChars; 37 38 -
src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
45 45 import javax.swing.JOptionPane; 46 46 import javax.swing.JPanel; 47 47 import javax.swing.JScrollPane; 48 import javax.swing.JTextField;49 48 import javax.swing.JToggleButton; 50 49 import javax.swing.ListCellRenderer; 51 50 import javax.swing.ListModel; … … 91 90 import org.openstreetmap.josm.tools.template_engine.TemplateEntry; 92 91 import org.openstreetmap.josm.tools.template_engine.TemplateParser; 93 92 import org.xml.sax.SAXException; 93 import org.openstreetmap.josm.gui.widgets.JosmTextField; 94 94 95 95 96 /** 96 97 * This class read encapsulate one tagging preset. A class method can 97 98 * read in all predefined presets, either shipped with JOSM or that are … … 521 522 private static String getValue(Component comp) { 522 523 if (comp instanceof JosmComboBox) { 523 524 return ((JosmComboBox) comp).getEditor().getItem().toString(); 524 } else if (comp instanceof J TextField) {525 return ((J TextField) comp).getText();525 } else if (comp instanceof JosmTextField) { 526 return ((JosmTextField) comp).getText(); 526 527 } else if (comp instanceof JPanel) { 527 528 return getValue(((JPanel)comp).getComponent(0)); 528 529 } else { -
src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
25 25 import javax.swing.JPanel; 26 26 import javax.swing.JSeparator; 27 27 import javax.swing.JTabbedPane; 28 import javax.swing.JTextField;29 28 import javax.swing.UIManager; 30 29 import javax.swing.event.ChangeEvent; 31 30 import javax.swing.event.ChangeListener; 32 31 import javax.swing.event.DocumentEvent; 33 32 import javax.swing.event.DocumentListener; 34 33 34 import org.openstreetmap.josm.gui.widgets.JosmTextField; 35 35 36 import org.openstreetmap.josm.Main; 36 37 import org.openstreetmap.josm.data.coor.CoordinateFormat; 37 38 import org.openstreetmap.josm.data.coor.EastNorth; … … 46 47 private static final Color BG_COLOR_ERROR = new Color(255,224,224); 47 48 48 49 public JTabbedPane tabs; 49 private J TextField tfLatLon, tfEastNorth;50 private JosmTextField tfLatLon, tfEastNorth; 50 51 private LatLon latLonCoordinates; 51 52 private EastNorth eastNorthCoordinates; 52 53 … … 76 77 pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 77 78 78 79 pnl.add(new JLabel(tr("Coordinates:")), GBC.std().insets(0,10,5,0)); 79 tfLatLon = new J TextField(24);80 tfLatLon = new JosmTextField(24); 80 81 pnl.add(tfLatLon, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0)); 81 82 82 83 pnl.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0,5,0,5)); … … 128 129 pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 129 130 130 131 pnl.add(new JLabel(tr("Projected coordinates:")), GBC.std().insets(0,10,5,0)); 131 tfEastNorth = new J TextField(24);132 tfEastNorth = new JosmTextField(24); 132 133 133 134 pnl.add(tfEastNorth, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0)); 134 135 … … 207 208 return eastNorthCoordinates; 208 209 } 209 210 210 protected void setErrorFeedback(J TextField tf, String message) {211 protected void setErrorFeedback(JosmTextField tf, String message) { 211 212 tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1)); 212 213 tf.setToolTipText(message); 213 214 tf.setBackground(BG_COLOR_ERROR); 214 215 } 215 216 216 protected void clearErrorFeedback(J TextField tf, String message) {217 protected void clearErrorFeedback(JosmTextField tf, String message) { 217 218 tf.setBorder(UIManager.getBorder("TextField.border")); 218 219 tf.setToolTipText(message); 219 220 tf.setBackground(UIManager.getColor("TextField.background")); … … 328 329 static class TextFieldFocusHandler implements FocusListener { 329 330 public void focusGained(FocusEvent e) { 330 331 Component c = e.getComponent(); 331 if (c instanceof J TextField) {332 J TextField tf = (JTextField)c;332 if (c instanceof JosmTextField) { 333 JosmTextField tf = (JosmTextField)c; 333 334 tf.selectAll(); 334 335 } 335 336 } -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
26 26 import javax.swing.JOptionPane; 27 27 import javax.swing.JPanel; 28 28 import javax.swing.JTextArea; 29 import javax.swing.JTextField;30 29 import javax.swing.JToolBar; 31 30 32 31 import org.openstreetmap.josm.Main; … … 40 39 import org.openstreetmap.josm.gui.help.HelpUtil; 41 40 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 42 41 import org.openstreetmap.josm.tools.ImageProvider; 42 import org.openstreetmap.josm.gui.widgets.JosmTextField; 43 43 44 44 45 /** 45 46 * This panel displays the properties of the currently selected changeset in the 46 47 * {@link ChangesetCacheManager}. … … 48 49 */ 49 50 public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener{ 50 51 51 private J TextField tfID;52 private JosmTextField tfID; 52 53 private JTextArea taComment; 53 private J TextField tfOpen;54 private J TextField tfUser;55 private J TextField tfCreatedOn;56 private J TextField tfClosedOn;54 private JosmTextField tfOpen; 55 private JosmTextField tfUser; 56 private JosmTextField tfCreatedOn; 57 private JosmTextField tfClosedOn; 57 58 private DonwloadChangesetContentAction actDownloadChangesetContent; 58 59 private UpdateChangesetAction actUpdateChangesets; 59 60 private RemoveFromCacheAction actRemoveFromCache; … … 117 118 gc.fill = GridBagConstraints.HORIZONTAL; 118 119 gc.weightx = 0.0; 119 120 gc.gridx = 1; 120 pnl.add(tfID = new J TextField(10), gc);121 pnl.add(tfID = new JosmTextField(10), gc); 121 122 tfID.setEditable(false); 122 123 123 124 //-- comment … … 144 145 145 146 gc.fill = GridBagConstraints.HORIZONTAL; 146 147 gc.gridx = 1; 147 pnl.add(tfOpen= new J TextField(10), gc);148 pnl.add(tfOpen= new JosmTextField(10), gc); 148 149 tfOpen.setEditable(false); 149 150 150 151 //-- Created by: … … 157 158 gc.fill = GridBagConstraints.HORIZONTAL; 158 159 gc.weightx = 1.0; 159 160 gc.gridx = 1; 160 pnl.add(tfUser= new J TextField(""), gc);161 pnl.add(tfUser= new JosmTextField(""), gc); 161 162 tfUser.setEditable(false); 162 163 163 164 //-- Created On: … … 169 170 170 171 gc.fill = GridBagConstraints.HORIZONTAL; 171 172 gc.gridx = 1; 172 pnl.add(tfCreatedOn= new J TextField(20), gc);173 pnl.add(tfCreatedOn= new JosmTextField(20), gc); 173 174 tfCreatedOn.setEditable(false); 174 175 175 176 //-- Closed On: … … 181 182 182 183 gc.fill = GridBagConstraints.HORIZONTAL; 183 184 gc.gridx = 1; 184 pnl.add(tfClosedOn= new J TextField(20), gc);185 pnl.add(tfClosedOn= new JosmTextField(20), gc); 185 186 tfClosedOn.setEditable(false); 186 187 187 188 return pnl; -
src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
15 15 import javax.swing.BorderFactory; 16 16 import javax.swing.JLabel; 17 17 import javax.swing.JPanel; 18 import javax.swing.JTextField;19 18 import javax.swing.event.DocumentEvent; 20 19 import javax.swing.event.DocumentListener; 21 20 import javax.swing.event.HyperlinkEvent; … … 26 25 import org.openstreetmap.josm.io.OsmApi; 27 26 import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException; 28 27 import org.openstreetmap.josm.tools.ImageProvider; 28 import org.openstreetmap.josm.gui.widgets.JosmTextField; 29 29 30 30 31 31 public class UrlBasedQueryPanel extends JPanel { 32 32 33 private J TextField tfUrl;33 private JosmTextField tfUrl; 34 34 private JLabel lblValid; 35 35 36 36 protected JPanel buildURLPanel() { … … 44 44 gc.gridx = 1; 45 45 gc.weightx = 1.0; 46 46 gc.fill = GridBagConstraints.HORIZONTAL; 47 pnl.add(tfUrl = new J TextField(), gc);47 pnl.add(tfUrl = new JosmTextField(), gc); 48 48 tfUrl.getDocument().addDocumentListener(new ChangetQueryUrlValidator()); 49 49 tfUrl.addFocusListener( 50 50 new FocusAdapter() { -
src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
24 24 import javax.swing.JPanel; 25 25 import javax.swing.JRadioButton; 26 26 import javax.swing.JScrollPane; 27 import javax.swing.JTextField;28 27 import javax.swing.text.JTextComponent; 29 28 30 29 import org.openstreetmap.josm.Main; … … 38 37 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 39 38 import org.openstreetmap.josm.io.ChangesetQuery; 40 39 import org.openstreetmap.josm.tools.CheckParameterUtil; 40 import org.openstreetmap.josm.gui.widgets.JosmTextField; 41 41 42 42 43 /** 43 44 * This panel allows to specify a changeset query 44 45 * … … 374 375 private JRadioButton rbRestrictToMyself; 375 376 private JRadioButton rbRestrictToUid; 376 377 private JRadioButton rbRestrictToUserName; 377 private J TextField tfUid;378 private JosmTextField tfUid; 378 379 private UidInputFieldValidator valUid; 379 private J TextField tfUserName;380 private JosmTextField tfUserName; 380 381 private UserNameInputValidator valUserName; 381 382 private JMultilineLabel lblRestrictedToMyself; 382 383 … … 389 390 pnl.add(new JLabel(tr("User ID:")), gc); 390 391 391 392 gc.gridx = 1; 392 pnl.add(tfUid = new J TextField(10),gc);393 pnl.add(tfUid = new JosmTextField(10),gc); 393 394 SelectAllOnFocusGainedDecorator.decorate(tfUid); 394 395 valUid = UidInputFieldValidator.decorate(tfUid); 395 396 … … 409 410 pnl.add(new JLabel(tr("User name:")), gc); 410 411 411 412 gc.gridx = 1; 412 pnl.add(tfUserName = new J TextField(10),gc);413 pnl.add(tfUserName = new JosmTextField(10),gc); 413 414 SelectAllOnFocusGainedDecorator.decorate(tfUserName); 414 415 valUserName = UserNameInputValidator.decorate(tfUserName); 415 416 … … 634 635 635 636 private JRadioButton rbClosedAfter; 636 637 private JRadioButton rbClosedAfterAndCreatedBefore; 637 private J TextField tfClosedAfterDate1;638 private JosmTextField tfClosedAfterDate1; 638 639 private DateValidator valClosedAfterDate1; 639 private J TextField tfClosedAfterTime1;640 private JosmTextField tfClosedAfterTime1; 640 641 private TimeValidator valClosedAfterTime1; 641 private J TextField tfClosedAfterDate2;642 private JosmTextField tfClosedAfterDate2; 642 643 private DateValidator valClosedAfterDate2; 643 private J TextField tfClosedAfterTime2;644 private JosmTextField tfClosedAfterTime2; 644 645 private TimeValidator valClosedAfterTime2; 645 private J TextField tfCreatedBeforeDate;646 private JosmTextField tfCreatedBeforeDate; 646 647 private DateValidator valCreatedBeforeDate; 647 private J TextField tfCreatedBeforeTime;648 private JosmTextField tfCreatedBeforeTime; 648 649 private TimeValidator valCreatedBeforeTime; 649 650 650 651 protected JPanel buildClosedAfterInputPanel() { … … 657 658 658 659 gc.gridx = 1; 659 660 gc.weightx = 0.7; 660 pnl.add(tfClosedAfterDate1 = new J TextField(),gc);661 pnl.add(tfClosedAfterDate1 = new JosmTextField(),gc); 661 662 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate1); 662 663 valClosedAfterDate1 = DateValidator.decorate(tfClosedAfterDate1); 663 664 tfClosedAfterDate1.setToolTipText(valClosedAfterDate1.getStandardTooltipTextAsHtml()); … … 668 669 669 670 gc.gridx = 3; 670 671 gc.weightx = 0.3; 671 pnl.add(tfClosedAfterTime1 = new J TextField(),gc);672 pnl.add(tfClosedAfterTime1 = new JosmTextField(),gc); 672 673 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime1); 673 674 valClosedAfterTime1 = TimeValidator.decorate(tfClosedAfterTime1); 674 675 tfClosedAfterTime1.setToolTipText(valClosedAfterTime1.getStandardTooltipTextAsHtml()); … … 691 692 692 693 gc.gridx = 2; 693 694 gc.weightx = 0.7; 694 pnl.add(tfClosedAfterDate2 = new J TextField(),gc);695 pnl.add(tfClosedAfterDate2 = new JosmTextField(),gc); 695 696 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate2); 696 697 valClosedAfterDate2 = DateValidator.decorate(tfClosedAfterDate2); 697 698 tfClosedAfterDate2.setToolTipText(valClosedAfterDate2.getStandardTooltipTextAsHtml()); … … 701 702 702 703 gc.gridx = 4; 703 704 gc.weightx = 0.3; 704 pnl.add(tfClosedAfterTime2 = new J TextField(),gc);705 pnl.add(tfClosedAfterTime2 = new JosmTextField(),gc); 705 706 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime2); 706 707 valClosedAfterTime2 = TimeValidator.decorate(tfClosedAfterTime2); 707 708 tfClosedAfterTime2.setToolTipText(valClosedAfterTime2.getStandardTooltipTextAsHtml()); … … 721 722 722 723 gc.gridx = 2; 723 724 gc.weightx = 0.7; 724 pnl.add(tfCreatedBeforeDate = new J TextField(),gc);725 pnl.add(tfCreatedBeforeDate = new JosmTextField(),gc); 725 726 SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeDate); 726 727 valCreatedBeforeDate = DateValidator.decorate(tfCreatedBeforeDate); 727 728 tfCreatedBeforeDate.setToolTipText(valCreatedBeforeDate.getStandardTooltipTextAsHtml()); … … 732 733 733 734 gc.gridx = 4; 734 735 gc.weightx = 0.3; 735 pnl.add(tfCreatedBeforeTime = new J TextField(),gc);736 pnl.add(tfCreatedBeforeTime = new JosmTextField(),gc); 736 737 SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeTime); 737 738 valCreatedBeforeTime = TimeValidator.decorate(tfCreatedBeforeTime); 738 739 tfCreatedBeforeTime.setToolTipText(valCreatedBeforeDate.getStandardTooltipTextAsHtml()); -
src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
34 34 import javax.swing.JPopupMenu; 35 35 import javax.swing.JSlider; 36 36 import javax.swing.JTable; 37 import javax.swing.JTextField;38 37 import javax.swing.JViewport; 39 38 import javax.swing.KeyStroke; 40 39 import javax.swing.ListSelectionModel; … … 71 70 import org.openstreetmap.josm.tools.MultikeyShortcutAction; 72 71 import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo; 73 72 import org.openstreetmap.josm.tools.Shortcut; 73 import org.openstreetmap.josm.gui.widgets.JosmTextField; 74 74 75 75 /** 76 76 * This is a toggle dialog which displays the list of layers. Actions allow to … … 193 193 layerList.getColumnModel().getColumn(1).setPreferredWidth(16); 194 194 layerList.getColumnModel().getColumn(1).setResizable(false); 195 195 layerList.getColumnModel().getColumn(2).setCellRenderer(new LayerNameCellRenderer()); 196 layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new J TextField()));196 layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new JosmTextField())); 197 197 for (KeyStroke ks : new KeyStroke[] { 198 198 KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK), 199 199 KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK), … … 1008 1008 } 1009 1009 1010 1010 private static class LayerNameCellEditor extends DefaultCellEditor { 1011 public LayerNameCellEditor(J TextField tf) {1011 public LayerNameCellEditor(JosmTextField tf) { 1012 1012 super(tf); 1013 1013 } 1014 1014 1015 1015 @Override 1016 1016 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 1017 J TextField tf = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);1017 JosmTextField tf = (JosmTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column); 1018 1018 tf.setText(value == null ? "" : ((Layer) value).getName()); 1019 1019 return tf; 1020 1020 } -
src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
26 26 import javax.swing.JPanel; 27 27 import javax.swing.JPopupMenu; 28 28 import javax.swing.JScrollPane; 29 import javax.swing.JTextField;30 29 import javax.swing.KeyStroke; 31 30 import javax.swing.ListSelectionModel; 32 31 import javax.swing.SwingUtilities; … … 75 74 import org.openstreetmap.josm.tools.Predicate; 76 75 import org.openstreetmap.josm.tools.Shortcut; 77 76 import org.openstreetmap.josm.tools.Utils; 77 import org.openstreetmap.josm.gui.widgets.JosmTextField; 78 78 79 79 /** 80 80 * A dialog showing all known relations, with buttons to add, edit, and … … 95 95 private final JPopupMenu popupMenu = new JPopupMenu(); 96 96 private final PopupMenuHandler popupMenuHandler = new PopupMenuHandler(popupMenu); 97 97 98 private final J TextField filter;98 private final JosmTextField filter; 99 99 100 100 // Actions 101 101 /** the edit action */ … … 259 259 } 260 260 } 261 261 262 private J TextField setupFilter() {263 final J TextField f = new DisableShortcutsOnFocusGainedTextField();262 private JosmTextField setupFilter() { 263 final JosmTextField f = new DisableShortcutsOnFocusGainedTextField(); 264 264 f.setToolTipText(tr("Relation list filter")); 265 265 f.getDocument().addDocumentListener(new DocumentListener() { 266 266 -
src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
32 32 import javax.swing.JLabel; 33 33 import javax.swing.JPanel; 34 34 import javax.swing.JSpinner; 35 import javax.swing.JTextField;36 35 import javax.swing.KeyStroke; 37 36 import javax.swing.SpinnerNumberModel; 38 37 import javax.swing.event.ChangeEvent; … … 49 48 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 50 49 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 51 50 import org.openstreetmap.josm.tools.ImageProvider; 51 import org.openstreetmap.josm.gui.widgets.JosmTextField; 52 52 53 53 /** 54 54 * TileSelectionBBoxChooser allows to select a bounding box (i.e. for downloading) based … … 209 209 static private class TileGridInputPanel extends JPanel implements PropertyChangeListener{ 210 210 static public final String TILE_BOUNDS_PROP = TileGridInputPanel.class.getName() + ".tileBounds"; 211 211 212 private J TextField tfMaxY;213 private J TextField tfMinY;214 private J TextField tfMaxX;215 private J TextField tfMinX;212 private JosmTextField tfMaxY; 213 private JosmTextField tfMinY; 214 private JosmTextField tfMaxX; 215 private JosmTextField tfMinX; 216 216 private TileCoordinateValidator valMaxY; 217 217 private TileCoordinateValidator valMinY; 218 218 private TileCoordinateValidator valMaxX; … … 266 266 267 267 gc.gridx = 1; 268 268 gc.weightx = 0.5; 269 pnl.add(tfMinX = new J TextField(), gc);269 pnl.add(tfMinX = new JosmTextField(), gc); 270 270 valMinX = new TileCoordinateValidator(tfMinX); 271 271 SelectAllOnFocusGainedDecorator.decorate(tfMinX); 272 272 tfMinX.addActionListener(tileBoundsBuilder); … … 274 274 275 275 gc.gridx = 2; 276 276 gc.weightx = 0.5; 277 pnl.add(tfMaxX = new J TextField(), gc);277 pnl.add(tfMaxX = new JosmTextField(), gc); 278 278 valMaxX = new TileCoordinateValidator(tfMaxX); 279 279 SelectAllOnFocusGainedDecorator.decorate(tfMaxX); 280 280 tfMaxX.addActionListener(tileBoundsBuilder); … … 287 287 288 288 gc.gridx = 1; 289 289 gc.weightx = 0.5; 290 pnl.add(tfMinY = new J TextField(), gc);290 pnl.add(tfMinY = new JosmTextField(), gc); 291 291 valMinY = new TileCoordinateValidator(tfMinY); 292 292 SelectAllOnFocusGainedDecorator.decorate(tfMinY); 293 293 tfMinY.addActionListener(tileBoundsBuilder); … … 295 295 296 296 gc.gridx = 2; 297 297 gc.weightx = 0.5; 298 pnl.add(tfMaxY = new J TextField(), gc);298 pnl.add(tfMaxY = new JosmTextField(), gc); 299 299 valMaxY = new TileCoordinateValidator(tfMaxY); 300 300 SelectAllOnFocusGainedDecorator.decorate(tfMaxY); 301 301 tfMaxY.addActionListener(tileBoundsBuilder); … … 427 427 428 428 static public final String TILE_BOUNDS_PROP = TileAddressInputPanel.class.getName() + ".tileBounds"; 429 429 430 private J TextField tfTileAddress;430 private JosmTextField tfTileAddress; 431 431 private TileAddressValidator valTileAddress; 432 432 433 433 protected JPanel buildTextPanel() { … … 451 451 452 452 gc.weightx = 1.0; 453 453 gc.gridx = 1; 454 pnl.add(tfTileAddress = new J TextField(), gc);454 pnl.add(tfTileAddress = new JosmTextField(), gc); 455 455 valTileAddress = new TileAddressValidator(tfTileAddress); 456 456 SelectAllOnFocusGainedDecorator.decorate(tfTileAddress); 457 457 -
src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
58 58 import javax.swing.JScrollPane; 59 59 import javax.swing.JSeparator; 60 60 import javax.swing.JTable; 61 import javax.swing.JTextField;62 61 import javax.swing.JToolBar; 63 62 import javax.swing.KeyStroke; 64 63 import javax.swing.ListCellRenderer; … … 91 90 import org.openstreetmap.josm.tools.LanguageInfo; 92 91 import org.openstreetmap.josm.tools.Utils; 93 92 import org.xml.sax.SAXException; 93 import org.openstreetmap.josm.gui.widgets.JosmTextField; 94 94 95 95 public abstract class SourceEditor extends JPanel { 96 96 … … 679 679 680 680 protected class EditSourceEntryDialog extends ExtendedDialog { 681 681 682 private J TextField tfTitle;683 private J TextField tfURL;682 private JosmTextField tfTitle; 683 private JosmTextField tfURL; 684 684 private JCheckBox cbActive; 685 685 686 686 public EditSourceEntryDialog(Component parent, String title, SourceEntry e) { … … 690 690 691 691 JPanel p = new JPanel(new GridBagLayout()); 692 692 693 tfTitle = new J TextField(60);693 tfTitle = new JosmTextField(60); 694 694 p.add(new JLabel(tr("Name (optional):")), GBC.std().insets(15, 0, 5, 5)); 695 695 p.add(tfTitle, GBC.eol().insets(0, 0, 5, 5)); 696 696 697 tfURL = new J TextField(60);697 tfURL = new JosmTextField(60); 698 698 p.add(new JLabel(tr("URL / File:")), GBC.std().insets(15, 0, 5, 0)); 699 699 p.add(tfURL, GBC.std().insets(0, 0, 5, 5)); 700 700 JButton fileChooser = new JButton(new LaunchFileChooserAction()); … … 1324 1324 } 1325 1325 1326 1326 class FileOrUrlCellEditor extends JPanel implements TableCellEditor { 1327 private J TextField tfFileName;1327 private JosmTextField tfFileName; 1328 1328 private CopyOnWriteArrayList<CellEditorListener> listeners; 1329 1329 private String value; 1330 1330 private boolean isFile; … … 1340 1340 gc.fill = GridBagConstraints.BOTH; 1341 1341 gc.weightx = 1.0; 1342 1342 gc.weighty = 1.0; 1343 add(tfFileName = new J TextField(), gc);1343 add(tfFileName = new JosmTextField(), gc); 1344 1344 1345 1345 gc.gridx = 1; 1346 1346 gc.gridy = 0; -
src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java
7 7 8 8 import javax.swing.AbstractCellEditor; 9 9 import javax.swing.JTable; 10 import javax.swing.JTextField;11 10 import javax.swing.table.TableCellEditor; 12 11 13 12 import org.openstreetmap.josm.data.osm.RelationMember; 13 import org.openstreetmap.josm.gui.widgets.JosmTextField; 14 14 15 15 16 /** 16 17 * {@link TableCellEditor} for the role column in a table for {@link RelationMember}s. 17 18 * 18 19 */ 19 20 public class RelationMemberTableCellEditor extends AbstractCellEditor implements TableCellEditor{ 20 21 21 private final J TextField editor;22 private final JosmTextField editor; 22 23 23 24 public RelationMemberTableCellEditor() { 24 editor = new J TextField();25 editor = new JosmTextField(); 25 26 editor.addFocusListener( 26 27 new FocusAdapter() { 27 28 @Override -
src/org/openstreetmap/josm/gui/widgets/JosmTextField.java
1 package org.openstreetmap.josm.gui.widgets; 2 3 import java.awt.*; 4 import java.awt.event.*; 5 6 import javax.swing.*; 7 import javax.swing.event.*; 8 import javax.swing.text.*; 9 import javax.swing.undo.*; 10 11 import static org.openstreetmap.josm.tools.I18n.tr; 12 13 public class JosmTextField extends JTextField { 14 private JPopupMenu contextMenu; 15 private UndoManager undoManager; 16 17 public JosmTextField(Document doc, String text, int columns){ 18 super(doc, text, columns); 19 init(); 20 } 21 22 public JosmTextField(String text, int columns){ 23 super(text, columns); 24 init(); 25 } 26 27 public JosmTextField(String text){ 28 super(text); 29 init(); 30 } 31 32 public JosmTextField(int columns){ 33 super(columns); 34 init(); 35 } 36 37 public JosmTextField() { 38 super(); 39 init(); 40 } 41 42 private void init(){ 43 undoManager = new UndoManager(); 44 contextMenu = new JPopupMenu(); 45 UndoAction undoAction = new UndoAction(); 46 addToContextMenu(tr("Paste"), DefaultEditorKit.pasteAction); 47 contextMenu.addSeparator(); 48 addToContextMenu(tr("Cut"), DefaultEditorKit.cutAction); 49 addToContextMenu(tr("Copy"), DefaultEditorKit.copyAction); 50 addToContextMenu(tr("Delete"), DefaultEditorKit.deleteNextCharAction); 51 contextMenu.addSeparator(); 52 addToContextMenu(tr("Select All"), DefaultEditorKit.selectAllAction); 53 contextMenu.addSeparator(); 54 contextMenu.add(new JMenuItem(undoAction)); 55 getDocument().addUndoableEditListener(undoAction); 56 57 addMouseListener(new MouseAdapter() { 58 public void mousePressed(MouseEvent e) { 59 if (e.getButton() == MouseEvent.BUTTON3) { 60 contextMenu.show(JosmTextField.this, e.getX(), e.getY()); 61 } 62 } 63 }); 64 } 65 66 private void addToContextMenu(String label, String actionName) { 67 Action action = getActionMap().get(actionName); 68 if (action != null) { 69 JMenuItem mi = new JMenuItem(action); 70 mi.setText(label); 71 contextMenu.add(mi); 72 } 73 } 74 75 76 class UndoAction extends AbstractAction implements UndoableEditListener { 77 public UndoAction() { 78 super(tr("Undo")); 79 setEnabled(false); 80 } 81 82 public void undoableEditHappened(UndoableEditEvent e) { 83 undoManager.addEdit(e.getEdit()); 84 setEnabled(undoManager.canUndo()); 85 } 86 87 public void actionPerformed(ActionEvent e) { 88 try { 89 undoManager.undo(); 90 } catch (CannotUndoException ex) { 91 } 92 setEnabled(undoManager.canUndo()); 93 } 94 } 95 96 } -
src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java
1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.widgets; 3 3 4 import javax.swing.JTextField;5 4 import javax.swing.text.JTextComponent; 6 5 6 import org.openstreetmap.josm.gui.widgets.JosmTextField; 7 7 import org.openstreetmap.josm.tools.Utils; 8 8 9 9 /** … … 12 12 * @param <T> The ID validator class 13 13 * @since 5765 14 14 */ 15 public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends J TextField {15 public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends JosmTextField { 16 16 17 17 protected final T validator; 18 18 -
src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
11 11 import javax.swing.Action; 12 12 import javax.swing.JMenu; 13 13 import javax.swing.JMenuItem; 14 import javax.swing.JTextField;15 14 import javax.swing.KeyStroke; 16 15 import javax.swing.text.Document; 17 16 … … 19 18 import org.openstreetmap.josm.actions.JosmAction; 20 19 import org.openstreetmap.josm.tools.Pair; 21 20 import org.openstreetmap.josm.tools.Shortcut; 21 import org.openstreetmap.josm.gui.widgets.JosmTextField; 22 22 23 23 /** 24 24 * A JTextField that disabled all JOSM shortcuts composed of a single key without modifier (except F1 to F12), … … 26 26 * This allows to include text fields in toggle dialogs (needed for relation filter). 27 27 * @since 5696 28 28 */ 29 public class DisableShortcutsOnFocusGainedTextField extends J TextField implements FocusListener {29 public class DisableShortcutsOnFocusGainedTextField extends JosmTextField implements FocusListener { 30 30 31 31 /** 32 32 * Constructs a new <code>TextField</code>. A default model is created, -
src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java
10 10 import java.beans.PropertyChangeListener; 11 11 12 12 import javax.swing.BorderFactory; 13 import javax.swing.JTextField;14 13 import javax.swing.UIManager; 15 14 import javax.swing.border.Border; 16 15 import javax.swing.event.DocumentEvent; … … 19 18 20 19 import org.openstreetmap.josm.tools.CheckParameterUtil; 21 20 import org.openstreetmap.josm.tools.Utils; 21 import org.openstreetmap.josm.gui.widgets.JosmTextField; 22 22 23 23 /** 24 24 * This is an abstract class for a validator on a text component. … … 109 109 tc.getDocument().addDocumentListener(this); 110 110 } 111 111 if (addActionListener) { 112 if (tc instanceof J TextField) {113 J TextField tf = (JTextField)tc;112 if (tc instanceof JosmTextField) { 113 JosmTextField tf = (JosmTextField)tc; 114 114 tf.addActionListener(this); 115 115 } 116 116 } -
src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
18 18 import javax.swing.JLabel; 19 19 import javax.swing.JPanel; 20 20 import javax.swing.JPopupMenu; 21 import javax.swing.JTextField;22 21 import javax.swing.event.DocumentEvent; 23 22 import javax.swing.event.DocumentListener; 24 23 import javax.swing.text.JTextComponent; … … 31 30 import org.openstreetmap.josm.tools.ImageProvider; 32 31 import org.openstreetmap.josm.tools.OsmUrlToBounds; 33 32 import org.openstreetmap.josm.tools.Utils; 33 import org.openstreetmap.josm.gui.widgets.JosmTextField; 34 34 35 35 /** 36 36 * … … 38 38 */ 39 39 public class BoundingBoxSelectionPanel extends JPanel { 40 40 41 private J TextField[] tfLatLon = null;42 private final J TextField tfOsmUrl = new JTextField();41 private JosmTextField[] tfLatLon = null; 42 private final JosmTextField tfOsmUrl = new JosmTextField(); 43 43 44 44 protected void buildInputFields() { 45 tfLatLon = new J TextField[4];45 tfLatLon = new JosmTextField[4]; 46 46 for(int i=0; i< 4; i++) { 47 tfLatLon[i] = new J TextField(11);48 tfLatLon[i].setMinimumSize(new Dimension(100,new J TextField().getMinimumSize().height));47 tfLatLon[i] = new JosmTextField(11); 48 tfLatLon[i].setMinimumSize(new Dimension(100,new JosmTextField().getMinimumSize().height)); 49 49 SelectAllOnFocusGainedDecorator.decorate(tfLatLon[i]); 50 50 } 51 51 LatitudeValidator.decorate(tfLatLon[0]); -
src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
23 23 import javax.swing.JPanel; 24 24 import javax.swing.JPopupMenu; 25 25 import javax.swing.JTextArea; 26 import javax.swing.JTextField;27 26 import javax.swing.UIManager; 28 27 import javax.swing.border.Border; 29 28 import javax.swing.event.DocumentEvent; … … 37 36 import org.openstreetmap.josm.tools.ImageProvider; 38 37 import org.openstreetmap.josm.tools.OsmUrlToBounds; 39 38 import org.openstreetmap.josm.tools.Utils; 39 import org.openstreetmap.josm.gui.widgets.JosmTextField; 40 40 41 41 /** 42 42 * Bounding box selector. … … 48 48 */ 49 49 public class BoundingBoxSelection implements DownloadSelection { 50 50 51 private J TextField[] latlon = null;51 private JosmTextField[] latlon = null; 52 52 private final JTextArea tfOsmUrl = new JTextArea(); 53 53 private final JTextArea showUrl = new JTextArea(); 54 54 private DownloadDialog parent; … … 62 62 } 63 63 64 64 protected void buildDownloadAreaInputFields() { 65 latlon = new J TextField[4];65 latlon = new JosmTextField[4]; 66 66 for(int i=0; i< 4; i++) { 67 latlon[i] = new J TextField(11);68 latlon[i].setMinimumSize(new Dimension(100,new J TextField().getMinimumSize().height));67 latlon[i] = new JosmTextField(11); 68 latlon[i].setMinimumSize(new Dimension(100,new JosmTextField().getMinimumSize().height)); 69 69 latlon[i].addFocusListener(new SelectAllOnFocusHandler(latlon[i])); 70 70 } 71 71 LatValueChecker latChecker = new LatValueChecker(latlon[0]); … … 190 190 latlon[1].setText(area.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES)); 191 191 latlon[2].setText(area.getMax().latToString(CoordinateFormat.DECIMAL_DEGREES)); 192 192 latlon[3].setText(area.getMax().lonToString(CoordinateFormat.DECIMAL_DEGREES)); 193 for (J TextField tf: latlon) {193 for (JosmTextField tf: latlon) { 194 194 resetErrorMessage(tf); 195 195 } 196 196 } … … 202 202 203 203 private Border errorBorder = BorderFactory.createLineBorder(Color.RED, 1); 204 204 205 protected void setErrorMessage(J TextField tf, String msg) {205 protected void setErrorMessage(JosmTextField tf, String msg) { 206 206 tf.setBorder(errorBorder); 207 207 tf.setToolTipText(msg); 208 208 } 209 209 210 protected void resetErrorMessage(J TextField tf) {210 protected void resetErrorMessage(JosmTextField tf) { 211 211 tf.setBorder(UIManager.getBorder("TextField.border")); 212 212 tf.setToolTipText(""); 213 213 } 214 214 215 215 class LatValueChecker extends FocusAdapter implements ActionListener{ 216 private J TextField tfLatValue;216 private JosmTextField tfLatValue; 217 217 218 public LatValueChecker(J TextField tfLatValue) {218 public LatValueChecker(JosmTextField tfLatValue) { 219 219 this.tfLatValue = tfLatValue; 220 220 } 221 221 … … 245 245 } 246 246 247 247 class LonValueChecker extends FocusAdapter implements ActionListener { 248 private J TextField tfLonValue;248 private JosmTextField tfLonValue; 249 249 250 public LonValueChecker(J TextField tfLonValue) {250 public LonValueChecker(JosmTextField tfLonValue) { 251 251 this.tfLonValue = tfLonValue; 252 252 } 253 253 -
src/org/openstreetmap/josm/gui/download/PlaceSelection.java
60 60 import org.xml.sax.InputSource; 61 61 import org.xml.sax.SAXException; 62 62 import org.xml.sax.helpers.DefaultHandler; 63 import org.openstreetmap.josm.gui.widgets.JosmTextField; 63 64 64 65 public class PlaceSelection implements DownloadSelection { 65 66 private static final String HISTORY_KEY = "download.places.history"; -
src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java
21 21 import javax.swing.JLabel; 22 22 import javax.swing.JOptionPane; 23 23 import javax.swing.JPanel; 24 import javax.swing.JTextField;25 24 import javax.swing.KeyStroke; 26 25 import javax.swing.border.EtchedBorder; 27 26 import javax.swing.plaf.basic.BasicComboBoxEditor; … … 35 34 import org.openstreetmap.josm.gui.widgets.OsmIdTextField; 36 35 import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox; 37 36 import org.openstreetmap.josm.tools.Utils; 37 import org.openstreetmap.josm.gui.widgets.JosmTextField; 38 38 39 39 /** 40 40 * Dialog prompt to user to let him choose OSM primitives to download by specifying their type and IDs … … 81 81 82 82 cbId.setEditor(new BasicComboBoxEditor() { 83 83 @Override 84 protected J TextField createEditorComponent() {84 protected JosmTextField createEditorComponent() { 85 85 return tfId; 86 86 } 87 87 });
