Ticket #4429: josmtextfield_02.patch
| File josmtextfield_02.patch, 113.7 KB (added by , 13 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java
14 14 import javax.swing.JPanel; 15 15 import javax.swing.JScrollPane; 16 16 import javax.swing.JSeparator; 17 import javax.swing.JTextField;18 17 19 18 import org.openstreetmap.josm.data.AutosaveTask; 20 19 import org.openstreetmap.josm.data.preferences.BooleanProperty; … … 25 24 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 26 25 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 27 26 import org.openstreetmap.josm.tools.GBC; 27 import org.openstreetmap.josm.gui.widgets.JosmTextField; 28 28 29 29 public class BackupPreference implements SubPreferenceSetting { 30 30 … … 37 37 private static final BooleanProperty PROP_KEEP_BACKUP = new BooleanProperty("save.keepbackup", false); 38 38 private JCheckBox keepBackup; 39 39 private JCheckBox autosave; 40 private final J TextField autosaveInterval = new JTextField(8);41 private final J TextField backupPerLayer = new JTextField(8);40 private final JosmTextField autosaveInterval = new JosmTextField(8); 41 private final JosmTextField backupPerLayer = new JosmTextField(8); 42 42 43 43 @Override 44 44 public void addGui(PreferenceTabbedPane gui) { -
src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
29 29 import javax.swing.JPanel; 30 30 import javax.swing.JScrollPane; 31 31 import javax.swing.JTabbedPane; 32 import javax.swing.JTextField;33 32 import javax.swing.SwingUtilities; 34 33 import javax.swing.UIManager; 35 34 import javax.swing.event.DocumentEvent; … … 52 51 import org.openstreetmap.josm.plugins.ReadRemotePluginInformationTask; 53 52 import org.openstreetmap.josm.tools.GBC; 54 53 import org.openstreetmap.josm.tools.ImageProvider; 54 import org.openstreetmap.josm.gui.widgets.JosmTextField; 55 55 56 56 public class PluginPreference extends DefaultTabPreferenceSetting { 57 57 public static class Factory implements PreferenceSettingFactory { … … 97 97 return sb.toString(); 98 98 } 99 99 100 private J TextField tfFilter;100 private JosmTextField tfFilter; 101 101 private PluginListPanel pnlPluginPreferences; 102 102 private PluginPreferencesModel model; 103 103 private JScrollPane spPluginPreferences; … … 122 122 123 123 gc.gridx = 1; 124 124 gc.weightx = 1.0; 125 pnl.add(tfFilter = new J TextField(), gc);125 pnl.add(tfFilter = new JosmTextField(), gc); 126 126 tfFilter.setToolTipText(tr("Enter a search expression")); 127 127 SelectAllOnFocusGainedDecorator.decorate(tfFilter); 128 128 tfFilter.getDocument().addDocumentListener(new SearchFieldAdapter()); -
src/org/openstreetmap/josm/gui/preferences/AudioPreference.java
9 9 import javax.swing.JCheckBox; 10 10 import javax.swing.JLabel; 11 11 import javax.swing.JPanel; 12 import javax.swing.JTextField;13 12 14 13 import org.openstreetmap.josm.Main; 15 14 import org.openstreetmap.josm.tools.GBC; 15 import org.openstreetmap.josm.gui.widgets.JosmTextField; 16 16 17 17 /* 18 18 * marker.audiosampleminsecs … … 49 49 private JCheckBox audioMarkersFromWavTimestamps = new JCheckBox(tr("Modified times (time stamps) of audio files.")); 50 50 private JCheckBox audioMarkersFromStart = new JCheckBox(tr("Start of track (will always do this if no other markers available).")); 51 51 52 private J TextField audioLeadIn = new JTextField(8);53 private J TextField audioForwardBackAmount = new JTextField(8);54 private J TextField audioFastForwardMultiplier = new JTextField(8);55 private J TextField audioCalibration = new JTextField(8);52 private JosmTextField audioLeadIn = new JosmTextField(8); 53 private JosmTextField audioForwardBackAmount = new JosmTextField(8); 54 private JosmTextField audioFastForwardMultiplier = new JosmTextField(8); 55 private JosmTextField audioCalibration = new JosmTextField(8); 56 56 57 57 public void addGui(PreferenceTabbedPane gui) { 58 58 JPanel audio = new JPanel(new GridBagLayout()); -
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()); … … 1317 1317 } 1318 1318 1319 1319 class FileOrUrlCellEditor extends JPanel implements TableCellEditor { 1320 private J TextField tfFileName;1320 private JosmTextField tfFileName; 1321 1321 private CopyOnWriteArrayList<CellEditorListener> listeners; 1322 1322 private String value; 1323 1323 private boolean isFile; … … 1333 1333 gc.fill = GridBagConstraints.BOTH; 1334 1334 gc.weightx = 1.0; 1335 1335 gc.weighty = 1.0; 1336 add(tfFileName = new J TextField(), gc);1336 add(tfFileName = new JosmTextField(), gc); 1337 1337 1338 1338 gc.gridx = 1; 1339 1339 gc.gridy = 0; -
src/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanel.java
10 10 11 11 import javax.swing.JLabel; 12 12 import javax.swing.JTextArea; 13 import javax.swing.JTextField;14 13 import javax.swing.text.View; 15 14 16 15 import org.openstreetmap.josm.data.imagery.ImageryInfo; 17 16 import org.openstreetmap.josm.tools.GBC; 18 17 import org.openstreetmap.josm.tools.Utils; 18 import org.openstreetmap.josm.gui.widgets.JosmTextField; 19 19 20 20 public class AddTMSLayerPanel extends AddImageryPanel { 21 21 22 private final J TextField tmsZoom = new JTextField();22 private final JosmTextField tmsZoom = new JosmTextField(); 23 23 private final JTextArea tmsUrl = new JTextArea(3, 40); 24 24 private final KeyAdapter keyAdapter = new KeyAdapter() { 25 25 @Override -
src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java
9 9 import javax.swing.JLabel; 10 10 import javax.swing.JPanel; 11 11 import javax.swing.JSpinner; 12 import javax.swing.JTextField;13 12 import javax.swing.SpinnerNumberModel; 14 13 15 14 import org.openstreetmap.josm.gui.layer.TMSLayer; 16 15 import org.openstreetmap.josm.tools.GBC; 16 import org.openstreetmap.josm.gui.widgets.JosmTextField; 17 17 18 18 /** 19 19 * {@code JPanel} giving access to TMS settings. … … 27 27 private final JSpinner minZoomLvl; 28 28 private final JSpinner maxZoomLvl; 29 29 private final JCheckBox addToSlippyMapChosser = new JCheckBox(); 30 private final J TextField tilecacheDir = new JTextField();30 private final JosmTextField tilecacheDir = new JosmTextField(); 31 31 32 32 /** 33 33 * Constructs a new {@code TMSSettingsPanel}. -
src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java
9 9 import javax.swing.AbstractButton; 10 10 import javax.swing.JPanel; 11 11 import javax.swing.JTextArea; 12 import javax.swing.JTextField;13 12 import javax.swing.event.ChangeEvent; 14 13 import javax.swing.event.ChangeListener; 15 14 import javax.swing.event.DocumentEvent; … … 17 16 import javax.swing.text.JTextComponent; 18 17 19 18 import org.openstreetmap.josm.data.imagery.ImageryInfo; 19 import org.openstreetmap.josm.gui.widgets.JosmTextField; 20 20 21 21 /** 22 22 * An abstract imagery panel used to add WMS/TMS imagery sources. See implementations. … … 27 27 public abstract class AddImageryPanel extends JPanel { 28 28 29 29 protected final JTextArea rawUrl = new JTextArea(3, 40); 30 protected final J TextField name = new JTextField();30 protected final JosmTextField name = new JosmTextField(); 31 31 32 32 protected final Collection<ContentValidationListener> listeners = new ArrayList<ContentValidationListener>(); 33 33 -
src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
14 14 import javax.swing.JLabel; 15 15 import javax.swing.JPanel; 16 16 import javax.swing.JRadioButton; 17 import javax.swing.JTextField;18 17 import javax.swing.event.ChangeEvent; 19 18 import javax.swing.event.ChangeListener; 20 19 … … 22 21 import org.openstreetmap.josm.gui.JMultilineLabel; 23 22 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 24 23 import org.openstreetmap.josm.plugins.PluginHandler; 24 import org.openstreetmap.josm.gui.widgets.JosmTextField; 25 25 26 26 /** 27 27 * A panel for configuring whether JOSM shall update plugins at startup. … … 58 58 private ButtonGroup bgTimeBasedUpdatePolicy; 59 59 private Map<Policy, JRadioButton> rbVersionBasedUpatePolicy; 60 60 private Map<Policy, JRadioButton> rbTimeBasedUpatePolicy; 61 private J TextField tfUpdateInterval;61 private JosmTextField tfUpdateInterval; 62 62 private JLabel lblUpdateInterval; 63 63 64 64 protected JPanel buildVersionBasedUpdatePolicyPanel() { … … 95 95 protected JPanel buildUpdateIntervalPanel() { 96 96 JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT)); 97 97 pnl.add(lblUpdateInterval = new JLabel(tr("Update interval (in days):"))); 98 pnl.add(tfUpdateInterval = new J TextField(5));98 pnl.add(tfUpdateInterval = new JosmTextField(5)); 99 99 SelectAllOnFocusGainedDecorator.decorate(tfUpdateInterval); 100 100 return pnl; 101 101 } -
src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java
7 7 8 8 import javax.swing.JLabel; 9 9 import javax.swing.JPanel; 10 import javax.swing.JTextField;11 10 12 11 import org.openstreetmap.josm.data.Preferences.StringSetting; 13 12 import org.openstreetmap.josm.gui.ExtendedDialog; 14 13 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 15 14 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry; 16 15 import org.openstreetmap.josm.tools.GBC; 16 import org.openstreetmap.josm.gui.widgets.JosmTextField; 17 17 18 18 public class StringEditor extends ExtendedDialog { 19 19 20 20 PrefEntry entry; 21 J TextField tvalue;21 JosmTextField tvalue; 22 22 23 23 public StringEditor(final PreferenceTabbedPane gui, PrefEntry entry, StringSetting setting) { 24 24 super(gui, tr("Change string setting"), new String[] {tr("OK"), tr("Cancel")}); … … 36 36 p.add(new JLabel(tr("Key: {0}", entry.getKey())), GBC.eol().insets(0,0,5,0)); 37 37 38 38 p.add(new JLabel(tr("Value: ")), GBC.std()); 39 tvalue = new J TextField(orig, 50);39 tvalue = new JosmTextField(orig, 50); 40 40 p.add(tvalue, GBC.eop().insets(5,0,0,0).fill(GBC.HORIZONTAL)); 41 41 42 42 return p; -
src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java
18 18 import javax.swing.JPanel; 19 19 import javax.swing.JScrollPane; 20 20 import javax.swing.JTable; 21 import javax.swing.JTextField;22 21 import javax.swing.JToolBar; 23 22 import javax.swing.event.ListSelectionEvent; 24 23 import javax.swing.event.ListSelectionListener; … … 32 31 import org.openstreetmap.josm.tools.GBC; 33 32 import org.openstreetmap.josm.tools.ImageProvider; 34 33 import org.openstreetmap.josm.tools.WindowGeometry; 34 import org.openstreetmap.josm.gui.widgets.JosmTextField; 35 35 36 36 public class ListListEditor extends ExtendedDialog { 37 37 … … 94 94 table.putClientProperty("terminateEditOnFocusLost", true); 95 95 table.setTableHeader(null); 96 96 97 DefaultCellEditor editor = new DefaultCellEditor(new J TextField());97 DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField()); 98 98 editor.setClickCountToStart(1); 99 99 table.setDefaultEditor(table.getColumnClass(0), editor); 100 100 -
src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java
22 22 import javax.swing.JPanel; 23 23 import javax.swing.JScrollPane; 24 24 import javax.swing.JTable; 25 import javax.swing.JTextField;26 25 import javax.swing.JToolBar; 27 26 import javax.swing.event.ListSelectionEvent; 28 27 import javax.swing.event.ListSelectionListener; … … 36 35 import org.openstreetmap.josm.tools.GBC; 37 36 import org.openstreetmap.josm.tools.ImageProvider; 38 37 import org.openstreetmap.josm.tools.WindowGeometry; 38 import org.openstreetmap.josm.gui.widgets.JosmTextField; 39 39 40 40 public class MapListEditor extends ExtendedDialog { 41 41 … … 116 116 table.putClientProperty("terminateEditOnFocusLost", true); 117 117 table.getTableHeader().getColumnModel().getColumn(0).setHeaderValue(tr("Key")); 118 118 table.getTableHeader().getColumnModel().getColumn(1).setHeaderValue(tr("Value")); 119 DefaultCellEditor editor = new DefaultCellEditor(new J TextField());119 DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField()); 120 120 editor.setClickCountToStart(1); 121 121 table.setDefaultEditor(table.getColumnClass(0), editor); 122 122 -
src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java
13 13 import javax.swing.JPanel; 14 14 import javax.swing.JScrollPane; 15 15 import javax.swing.JTable; 16 import javax.swing.JTextField;17 16 import javax.swing.table.AbstractTableModel; 18 17 19 18 import org.openstreetmap.josm.data.Preferences.ListSetting; … … 22 21 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry; 23 22 import org.openstreetmap.josm.tools.GBC; 24 23 import org.openstreetmap.josm.tools.WindowGeometry; 24 import org.openstreetmap.josm.gui.widgets.JosmTextField; 25 25 26 26 public class ListEditor extends ExtendedDialog { 27 27 … … 54 54 table.putClientProperty("terminateEditOnFocusLost", true); 55 55 table.setTableHeader(null); 56 56 57 DefaultCellEditor editor = new DefaultCellEditor(new J TextField());57 DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField()); 58 58 editor.setClickCountToStart(1); 59 59 table.setDefaultEditor(table.getColumnClass(0), editor); 60 60 -
src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
33 33 import javax.swing.JRadioButton; 34 34 import javax.swing.JScrollPane; 35 35 import javax.swing.JTable; 36 import javax.swing.JTextField;37 36 import javax.swing.event.DocumentEvent; 38 37 import javax.swing.event.DocumentListener; 39 38 import javax.swing.filechooser.FileFilter; … … 58 57 import org.openstreetmap.josm.tools.CheckParameterUtil; 59 58 import org.openstreetmap.josm.tools.GBC; 60 59 import org.openstreetmap.josm.tools.Utils; 60 import org.openstreetmap.josm.gui.widgets.JosmTextField; 61 61 62 62 public class AdvancedPreference extends DefaultTabPreferenceSetting { 63 63 … … 143 143 private AllSettingsTableModel model; 144 144 protected List<PrefEntry> data; 145 145 protected List<PrefEntry> displayData; 146 protected J TextField txtFilter;146 protected JosmTextField txtFilter; 147 147 148 148 public void addGui(final PreferenceTabbedPane gui) { 149 149 JPanel p = gui.createPreferenceTab(this); 150 150 151 txtFilter = new J TextField();151 txtFilter = new JosmTextField(); 152 152 JLabel lbFilter = new JLabel(tr("Search: ")); 153 153 lbFilter.setLabelFor(txtFilter); 154 154 p.add(lbFilter); … … 452 452 453 453 private static class SettingCellEditor extends DefaultCellEditor { 454 454 public SettingCellEditor() { 455 super(new J TextField());455 super(new JosmTextField()); 456 456 } 457 457 458 458 @Override … … 522 522 private void addPreference(final PreferenceTabbedPane gui) { 523 523 JPanel p = new JPanel(new GridBagLayout()); 524 524 p.add(new JLabel(tr("Key")), GBC.std().insets(0,0,5,0)); 525 J TextField tkey = new JTextField("", 50);525 JosmTextField tkey = new JosmTextField("", 50); 526 526 p.add(tkey, GBC.eop().insets(5,0,0,0).fill(GBC.HORIZONTAL)); 527 527 528 528 p.add(new JLabel(tr("Select Setting Type:")), GBC.eol().insets(5,15,5,0)); -
src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.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 import javax.swing.event.ChangeEvent; 21 20 import javax.swing.event.ChangeListener; 22 21 … … 29 28 import org.openstreetmap.josm.tools.GBC; 30 29 import org.openstreetmap.josm.tools.template_engine.ParseError; 31 30 import org.openstreetmap.josm.tools.template_engine.TemplateParser; 31 import org.openstreetmap.josm.gui.widgets.JosmTextField; 32 32 33 33 public class GPXSettingsPanel extends JPanel implements ValidationListener { 34 34 … … 44 44 private JRadioButton drawRawGpsLinesLocal = new JRadioButton(tr("Local files")); 45 45 private JRadioButton drawRawGpsLinesNone = new JRadioButton(tr("None")); 46 46 private ActionListener drawRawGpsLinesActionListener; 47 private J TextField drawRawGpsMaxLineLength = new JTextField(8);48 private J TextField drawRawGpsMaxLineLengthLocal = new JTextField(8);49 private J TextField drawLineWidth = new JTextField(2);47 private JosmTextField drawRawGpsMaxLineLength = new JosmTextField(8); 48 private JosmTextField drawRawGpsMaxLineLengthLocal = new JosmTextField(8); 49 private JosmTextField drawLineWidth = new JosmTextField(2); 50 50 private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported")); 51 51 private JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points")); 52 52 private JCheckBox hdopCircleGpsPoints = new JCheckBox(tr("Draw a circle from HDOP value")); … … 61 61 private JCheckBox makeAutoMarkers = new JCheckBox(tr("Create markers when reading GPX")); 62 62 private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows")); 63 63 private JCheckBox drawGpsArrowsFast = new JCheckBox(tr("Fast drawing (looks uglier)")); 64 private J TextField drawGpsArrowsMinDist = new JTextField(8);64 private JosmTextField drawGpsArrowsMinDist = new JosmTextField(8); 65 65 private JCheckBox colorDynamic = new JCheckBox(tr("Dynamic color range based on data limits")); 66 66 private JosmComboBox waypointLabel = new JosmComboBox(LABEL_PATTERN_DESC); 67 private J TextField waypointLabelPattern = new JTextField();67 private JosmTextField waypointLabelPattern = new JosmTextField(); 68 68 private JosmComboBox audioWaypointLabel = new JosmComboBox(LABEL_PATTERN_DESC); 69 private J TextField audioWaypointLabelPattern = new JTextField();69 private JosmTextField audioWaypointLabelPattern = new JosmTextField(); 70 70 private JCheckBox useGpsAntialiasing = new JCheckBox(tr("Smooth GPX graphics (antialiasing)")); 71 71 72 72 private String layerName; … … 421 421 savePreferences(null, false); 422 422 } 423 423 424 private void updateWaypointLabelCombobox(JosmComboBox cb, J TextField tf, TemplateEntryProperty property) {424 private void updateWaypointLabelCombobox(JosmComboBox cb, JosmTextField tf, TemplateEntryProperty property) { 425 425 String labelPattern = property.getAsString(); 426 426 boolean found = false; 427 427 for (int i=0; i<LABEL_PATTERN_TEMPLATE.length; i++) { … … 438 438 } 439 439 } 440 440 441 private void updateWaypointPattern(JosmComboBox cb, J TextField tf) {441 private void updateWaypointPattern(JosmComboBox cb, JosmTextField tf) { 442 442 if (cb.getSelectedIndex() == WAYPOINT_LABEL_CUSTOM) { 443 443 tf.setEnabled(true); 444 444 } else { -
src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
20 20 import javax.swing.JCheckBox; 21 21 import javax.swing.JLabel; 22 22 import javax.swing.JPanel; 23 import javax.swing.JTextField;24 23 import javax.swing.SwingUtilities; 25 24 import javax.swing.event.DocumentEvent; 26 25 import javax.swing.event.DocumentListener; … … 33 32 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 34 33 import org.openstreetmap.josm.io.OsmApi; 35 34 import org.openstreetmap.josm.tools.ImageProvider; 35 import org.openstreetmap.josm.gui.widgets.JosmTextField; 36 36 37 37 public class OsmApiUrlInputPanel extends JPanel { 38 38 static public final String API_URL_PROP = OsmApiUrlInputPanel.class.getName() + ".apiUrl"; 39 39 40 40 private JLabel lblValid; 41 41 private JLabel lblApiUrl; 42 private J TextField tfOsmServerUrl;42 private JosmTextField tfOsmServerUrl; 43 43 private ApiUrlValidator valOsmServerUrl; 44 44 private SideButton btnTest; 45 45 /** indicates whether to use the default OSM URL or not */ … … 89 89 90 90 gc.gridx = 1; 91 91 gc.weightx = 1.0; 92 add(tfOsmServerUrl = new J TextField(), gc);92 add(tfOsmServerUrl = new JosmTextField(), gc); 93 93 SelectAllOnFocusGainedDecorator.decorate(tfOsmServerUrl); 94 94 valOsmServerUrl = new ApiUrlValidator(tfOsmServerUrl); 95 95 valOsmServerUrl.validate(); -
src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
21 21 import javax.swing.JCheckBox; 22 22 import javax.swing.JLabel; 23 23 import javax.swing.JPanel; 24 import javax.swing.JTextField;25 24 26 25 import org.openstreetmap.josm.Main; 27 26 import org.openstreetmap.josm.data.oauth.OAuthParameters; … … 33 32 import org.openstreetmap.josm.gui.oauth.TestAccessTokenTask; 34 33 import org.openstreetmap.josm.io.auth.CredentialsManager; 35 34 import org.openstreetmap.josm.tools.ImageProvider; 35 import org.openstreetmap.josm.gui.widgets.JosmTextField; 36 36 37 37 /** 38 38 * The preferences panel for the OAuth preferences. This just a summary panel … … 213 213 * 214 214 */ 215 215 private class AlreadyAuthorisedPanel extends JPanel { 216 private J TextField tfAccessTokenKey;217 private J TextField tfAccessTokenSecret;216 private JosmTextField tfAccessTokenKey; 217 private JosmTextField tfAccessTokenSecret; 218 218 219 219 protected void build() { 220 220 setLayout(new GridBagLayout()); … … 237 237 238 238 gc.gridx = 1; 239 239 gc.weightx = 1.0; 240 add(tfAccessTokenKey = new J TextField(), gc);240 add(tfAccessTokenKey = new JosmTextField(), gc); 241 241 tfAccessTokenKey.setEditable(false); 242 242 243 243 // -- access token secret … … 249 249 250 250 gc.gridx = 1; 251 251 gc.weightx = 1.0; 252 add(tfAccessTokenSecret = new J TextField(), gc);252 add(tfAccessTokenSecret = new JosmTextField(), gc); 253 253 tfAccessTokenSecret.setEditable(false); 254 254 255 255 // -- access token secret -
src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
14 14 import javax.swing.JLabel; 15 15 import javax.swing.JPanel; 16 16 import javax.swing.JPasswordField; 17 import javax.swing.JTextField;18 17 19 18 import org.openstreetmap.josm.gui.widgets.JosmPasswordField; 20 19 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; … … 22 21 import org.openstreetmap.josm.io.auth.CredentialsAgentException; 23 22 import org.openstreetmap.josm.io.auth.CredentialsManager; 24 23 import org.openstreetmap.josm.io.OsmApi; 24 import org.openstreetmap.josm.gui.widgets.JosmTextField; 25 25 26 26 /** 27 27 * The preferences panel for parameters necessary for the Basic Authentication … … 31 31 public class BasicAuthenticationPreferencesPanel extends JPanel { 32 32 33 33 /** the OSM user name */ 34 private J TextField tfOsmUserName;34 private JosmTextField tfOsmUserName; 35 35 private UserNameValidator valUserName; 36 36 /** the OSM password */ 37 37 private JPasswordField tfOsmPassword; … … 55 55 56 56 gc.gridx = 1; 57 57 gc.weightx = 1.0; 58 add(tfOsmUserName = new J TextField(), gc);58 add(tfOsmUserName = new JosmTextField(), gc); 59 59 SelectAllOnFocusGainedDecorator.decorate(tfOsmUserName); 60 60 valUserName = new UserNameValidator(tfOsmUserName); 61 61 valUserName.validate(); -
src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
23 23 import javax.swing.JPanel; 24 24 import javax.swing.JPasswordField; 25 25 import javax.swing.JRadioButton; 26 import javax.swing.JTextField;27 26 27 import org.openstreetmap.josm.gui.widgets.JosmTextField; 28 28 import org.openstreetmap.josm.Main; 29 29 import org.openstreetmap.josm.gui.JMultilineLabel; 30 30 import org.openstreetmap.josm.gui.help.HelpUtil; … … 74 74 75 75 private ButtonGroup bgProxyPolicy; 76 76 private Map<ProxyPolicy, JRadioButton> rbProxyPolicy; 77 private J TextField tfProxyHttpHost;78 private J TextField tfProxyHttpPort;79 private J TextField tfProxySocksHost;80 private J TextField tfProxySocksPort;81 private J TextField tfProxyHttpUser;77 private JosmTextField tfProxyHttpHost; 78 private JosmTextField tfProxyHttpPort; 79 private JosmTextField tfProxySocksHost; 80 private JosmTextField tfProxySocksPort; 81 private JosmTextField tfProxyHttpUser; 82 82 private JPasswordField tfProxyHttpPassword; 83 83 84 84 private JPanel pnlHttpProxyConfigurationPanel; … … 106 106 107 107 gc.gridx = 1; 108 108 gc.weightx = 1.0; 109 pnl.add(tfProxyHttpHost = new J TextField(),gc);109 pnl.add(tfProxyHttpHost = new JosmTextField(),gc); 110 110 111 111 gc.gridy = 1; 112 112 gc.gridx = 0; … … 116 116 117 117 gc.gridx = 1; 118 118 gc.weightx = 1.0; 119 pnl.add(tfProxyHttpPort = new J TextField(5),gc);119 pnl.add(tfProxyHttpPort = new JosmTextField(5),gc); 120 120 tfProxyHttpPort.setMinimumSize(tfProxyHttpPort.getPreferredSize()); 121 121 122 122 gc.gridy = 2; … … 136 136 gc.gridy = 3; 137 137 gc.gridx = 1; 138 138 gc.weightx = 1.0; 139 pnl.add(tfProxyHttpUser = new J TextField(20),gc);139 pnl.add(tfProxyHttpUser = new JosmTextField(20),gc); 140 140 tfProxyHttpUser.setMinimumSize(tfProxyHttpUser.getPreferredSize()); 141 141 142 142 gc.gridy = 4; … … 181 181 182 182 gc.gridx = 1; 183 183 gc.weightx = 1.0; 184 pnl.add(tfProxySocksHost = new J TextField(20),gc);184 pnl.add(tfProxySocksHost = new JosmTextField(20),gc); 185 185 186 186 gc.gridy = 1; 187 187 gc.gridx = 0; … … 191 191 192 192 gc.gridx = 1; 193 193 gc.weightx = 1.0; 194 pnl.add(tfProxySocksPort = new J TextField(5), gc);194 pnl.add(tfProxySocksPort = new JosmTextField(5), gc); 195 195 tfProxySocksPort.setMinimumSize(tfProxySocksPort.getPreferredSize()); 196 196 197 197 // add an extra spacer, otherwise the layout is broken -
src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
28 28 import javax.swing.JPanel; 29 29 import javax.swing.JScrollPane; 30 30 import javax.swing.JTable; 31 import javax.swing.JTextField;32 31 import javax.swing.KeyStroke; 33 32 import javax.swing.ListSelectionModel; 34 33 import javax.swing.RowFilter; … … 47 46 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 48 47 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 49 48 import org.openstreetmap.josm.tools.Shortcut; 49 import org.openstreetmap.josm.gui.widgets.JosmTextField; 50 50 51 51 /** 52 52 * This is the keyboard preferences content. … … 137 137 138 138 JTable shortcutTable = new JTable(); 139 139 140 private J TextField filterField = new JTextField();140 private JosmTextField filterField = new JosmTextField(); 141 141 142 142 /** Creates new form prefJPanel */ 143 143 // Ain't those auto-generated comments helpful or what? <g> -
src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
18 18 import javax.swing.JList; 19 19 import javax.swing.JPanel; 20 20 import javax.swing.JScrollPane; 21 import javax.swing.JTextField;22 21 import javax.swing.event.DocumentEvent; 23 22 import javax.swing.event.DocumentListener; 24 23 import javax.swing.event.ListSelectionEvent; … … 27 26 import org.openstreetmap.josm.data.projection.Projection; 28 27 import org.openstreetmap.josm.data.projection.Projections; 29 28 import org.openstreetmap.josm.tools.GBC; 29 import org.openstreetmap.josm.gui.widgets.JosmTextField; 30 30 31 31 /** 32 32 * Projection choice that lists all known projects by code. … … 41 41 42 42 private class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener { 43 43 44 public J TextField filter;44 public JosmTextField filter; 45 45 private ProjectionCodeListModel model; 46 46 public JList selectionList; 47 47 List<String> data; … … 107 107 } 108 108 109 109 private void build() { 110 filter = new J TextField(30);110 filter = new JosmTextField(30); 111 111 filter.setColumns(10); 112 112 filter.getDocument().addDocumentListener(this); 113 113 -
src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
20 20 import javax.swing.JComponent; 21 21 import javax.swing.JLabel; 22 22 import javax.swing.JPanel; 23 import javax.swing.JTextField;24 23 import javax.swing.plaf.basic.BasicComboBoxEditor; 25 24 26 25 import org.openstreetmap.josm.Main; … … 36 35 import org.openstreetmap.josm.tools.GBC; 37 36 import org.openstreetmap.josm.tools.ImageProvider; 38 37 import org.openstreetmap.josm.tools.Utils; 38 import org.openstreetmap.josm.gui.widgets.JosmTextField; 39 39 40 40 public class CustomProjectionChoice extends AbstractProjectionChoice implements SubPrefsOptions { 41 41 … … 47 47 48 48 private static class PreferencePanel extends JPanel { 49 49 50 public J TextField input;50 public JosmTextField input; 51 51 private HistoryComboBox cbInput; 52 52 53 53 public PreferencePanel(String initialText, ActionListener listener) { … … 55 55 } 56 56 57 57 private void build(String initialText, final ActionListener listener) { 58 input = new J TextField(30);58 input = new JosmTextField(30); 59 59 cbInput = new HistoryComboBox(); 60 60 cbInput.setPrototypeDisplayValue(new AutoCompletionListItem("xxxx")); 61 61 cbInput.setEditor(new BasicComboBoxEditor() { 62 62 @Override 63 protected J TextField createEditorComponent() {63 protected JosmTextField createEditorComponent() { 64 64 return input; 65 65 } 66 66 }); -
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/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/HistoryComboBox.java
8 8 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 9 9 import org.openstreetmap.josm.Main; 10 10 11 import java.awt.*; 12 import java.awt.event.*; 13 14 import javax.swing.*; 15 import javax.swing.event.*; 16 import javax.swing.text.*; 17 import javax.swing.undo.*; 18 import static org.openstreetmap.josm.tools.I18n.tr; 19 11 20 public class HistoryComboBox extends AutoCompletingComboBox { 12 21 private ComboBoxHistory model; 22 private JPopupMenu contextMenu; 23 private UndoManager undoManager; 13 24 25 14 26 public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15; 15 27 16 28 public HistoryComboBox() { 17 29 int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE); 18 30 setModel(model = new ComboBoxHistory(maxsize)); 19 31 setEditable(true); 32 initContext(); 20 33 } 21 34 35 private void initContext(){ 36 undoManager = new UndoManager(); 37 contextMenu = new JPopupMenu(); 38 UndoAction undoAction = new UndoAction(); 39 addToContextMenu(tr("Paste"), DefaultEditorKit.pasteAction); 40 contextMenu.addSeparator(); 41 addToContextMenu(tr("Cut"), DefaultEditorKit.cutAction); 42 addToContextMenu(tr("Copy"), DefaultEditorKit.copyAction); 43 addToContextMenu(tr("Delete"), DefaultEditorKit.deleteNextCharAction); 44 contextMenu.addSeparator(); 45 addToContextMenu(tr("Select All"), DefaultEditorKit.selectAllAction); 46 contextMenu.addSeparator(); 47 contextMenu.add(new JMenuItem(undoAction)); 48 ((JTextComponent)getEditor().getEditorComponent()).getDocument().addUndoableEditListener(undoAction); 49 50 addMouseListener(new MouseAdapter() { 51 public void mousePressed(MouseEvent e) { 52 if (e.getButton() == MouseEvent.BUTTON3) { 53 contextMenu.show(HistoryComboBox.this, e.getX(), e.getY()); 54 } 55 } 56 }); 57 } 58 59 private void addToContextMenu(String label, String actionName) { 60 Action action = getActionMap().get(actionName); 61 if (action != null) { 62 JMenuItem mi = new JMenuItem(action); 63 mi.setText(label); 64 contextMenu.add(mi); 65 } 66 } 67 68 69 class UndoAction extends AbstractAction implements UndoableEditListener { 70 public UndoAction() { 71 super(tr("Undo")); 72 setEnabled(false); 73 } 74 75 public void undoableEditHappened(UndoableEditEvent e) { 76 undoManager.addEdit(e.getEdit()); 77 setEnabled(undoManager.canUndo()); 78 } 79 80 public void actionPerformed(ActionEvent e) { 81 try { 82 undoManager.undo(); 83 } catch (CannotUndoException ex) { 84 } 85 setEnabled(undoManager.canUndo()); 86 } 87 } 88 22 89 public String getText() { 23 90 return ((JTextComponent)getEditor().getEditorComponent()).getText(); 24 91 } -
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/JosmComboBox.java
13 13 import javax.swing.ComboBoxModel; 14 14 import javax.swing.DefaultComboBoxModel; 15 15 import javax.swing.JComboBox; 16 import javax.swing.JPopupMenu; 16 17 import javax.swing.JList; 17 18 import javax.swing.plaf.basic.ComboPopup; 18 19 20 21 19 22 /** 20 23 * Class overriding each {@link JComboBox} in JOSM to control consistently the number of displayed items at once.<br/> 21 24 * This is needed because of the default Java behaviour that may display the top-down list off the screen (see #7917). … … 23 26 * @since 5429 24 27 */ 25 28 public class JosmComboBox extends JComboBox { 26 27 29 /** 28 30 * The default prototype value used to compute the maximum number of elements to be displayed at once before 29 31 * displaying a scroll bar … … 105 107 public JosmComboBox(Vector<?> items) { 106 108 super(items); 107 109 init(findPrototypeDisplayValue(items)); 110 108 111 } 109 112 113 114 115 110 116 /** 111 117 * Finds the prototype display value to use among the given possible candidates. 112 118 * @param possibleValues The possible candidates that will be iterated. -
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/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/io/FilenameCellEditor.java
17 17 import javax.swing.JButton; 18 18 import javax.swing.JPanel; 19 19 import javax.swing.JTable; 20 import javax.swing.JTextField;21 20 import javax.swing.event.CellEditorListener; 22 21 import javax.swing.event.ChangeEvent; 23 22 import javax.swing.table.TableCellEditor; 24 23 25 24 import org.openstreetmap.josm.actions.SaveActionBase; 25 import org.openstreetmap.josm.gui.widgets.JosmTextField; 26 26 27 27 /** 28 28 * This is a {@link TableCellEditor} for filenames. It provides a text input field and … … 31 31 * 32 32 */ 33 33 class FilenameCellEditor extends JPanel implements TableCellEditor { 34 private J TextField tfFileName;34 private JosmTextField tfFileName; 35 35 private CopyOnWriteArrayList<CellEditorListener> listeners; 36 36 private File value; 37 37 … … 46 46 gc.fill = GridBagConstraints.BOTH; 47 47 gc.weightx = 1.0; 48 48 gc.weighty = 1.0; 49 add(tfFileName = new J TextField(), gc);49 add(tfFileName = new JosmTextField(), gc); 50 50 51 51 gc.gridx = 1; 52 52 gc.gridy = 0; -
src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
24 24 import javax.swing.JLabel; 25 25 import javax.swing.JPanel; 26 26 import javax.swing.JRadioButton; 27 import javax.swing.JTextField;28 27 import javax.swing.UIManager; 29 28 import javax.swing.event.DocumentEvent; 30 29 import javax.swing.event.DocumentListener; … … 33 32 import org.openstreetmap.josm.gui.JMultilineLabel; 34 33 import org.openstreetmap.josm.io.OsmApi; 35 34 import org.openstreetmap.josm.tools.ImageProvider; 35 import org.openstreetmap.josm.gui.widgets.JosmTextField; 36 36 37 37 /** 38 38 * UploadStrategySelectionPanel is a panel for selecting an upload strategy. … … 55 55 private Map<UploadStrategy, JRadioButton> rbStrategy; 56 56 private Map<UploadStrategy, JLabel> lblNumRequests; 57 57 private Map<UploadStrategy, JMultilineLabel> lblStrategies; 58 private J TextField tfChunkSize;58 private JosmTextField tfChunkSize; 59 59 private JPanel pnlMultiChangesetPolicyPanel; 60 60 private JRadioButton rbFillOneChangeset; 61 61 private JRadioButton rbUseMultipleChangesets; … … 135 135 gc.weightx = 0.0; 136 136 gc.weighty = 0.0; 137 137 gc.gridwidth = 1; 138 pnl.add(tfChunkSize = new J TextField(4), gc);138 pnl.add(tfChunkSize = new JosmTextField(4), gc); 139 139 gc.gridx = 3; 140 140 gc.gridy = 2; 141 141 gc.weightx = 1.0; … … 382 382 static class TextFieldFocusHandler implements FocusListener { 383 383 public void focusGained(FocusEvent e) { 384 384 Component c = e.getComponent(); 385 if (c instanceof J TextField) {386 J TextField tf = (JTextField)c;385 if (c instanceof JosmTextField) { 386 JosmTextField tf = (JosmTextField)c; 387 387 tf.selectAll(); 388 388 } 389 389 } … … 391 391 } 392 392 393 393 class ChunkSizeInputVerifier implements DocumentListener, PropertyChangeListener { 394 protected void setErrorFeedback(J TextField tf, String message) {394 protected void setErrorFeedback(JosmTextField tf, String message) { 395 395 tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1)); 396 396 tf.setToolTipText(message); 397 397 tf.setBackground(BG_COLOR_ERROR); 398 398 } 399 399 400 protected void clearErrorFeedback(J TextField tf, String message) {400 protected void clearErrorFeedback(JosmTextField tf, String message) { 401 401 tf.setBorder(UIManager.getBorder("TextField.border")); 402 402 tf.setToolTipText(message); 403 403 tf.setBackground(UIManager.getColor("TextField.background")); -
src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
21 21 import javax.swing.JLabel; 22 22 import javax.swing.JPanel; 23 23 import javax.swing.JTable; 24 import javax.swing.JTextField;25 24 import javax.swing.event.CellEditorListener; 26 25 import javax.swing.event.ChangeEvent; 27 26 import javax.swing.table.TableCellEditor; … … 29 28 30 29 import org.openstreetmap.josm.actions.SaveActionBase; 31 30 import org.openstreetmap.josm.tools.GBC; 31 import org.openstreetmap.josm.gui.widgets.JosmTextField; 32 32 33 34 33 class LayerNameAndFilePathTableCell extends JPanel implements TableCellRenderer, TableCellEditor { 35 34 private final static Color colorError = new Color(255,197,197); 36 35 private final static String separator = System.getProperty("file.separator"); … … 38 37 39 38 private final JLabel lblLayerName = new JLabel(); 40 39 private final JLabel lblFilename = new JLabel(""); 41 private final J TextField tfFilename = new JTextField();40 private final JosmTextField tfFilename = new JosmTextField(); 42 41 private final JButton btnFileChooser = new JButton(new LaunchFileChooserAction()); 43 42 44 43 private final static GBC defaultCellStyle = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0); -
src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
14 14 import javax.swing.JCheckBox; 15 15 import javax.swing.JLabel; 16 16 import javax.swing.JOptionPane; 17 import javax.swing.JTextField;18 17 19 18 import org.openstreetmap.josm.data.Preferences; 20 19 import org.openstreetmap.josm.data.oauth.OAuthParameters; … … 25 24 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 26 25 import org.openstreetmap.josm.tools.CheckParameterUtil; 27 26 import org.openstreetmap.josm.tools.ImageProvider; 27 import org.openstreetmap.josm.gui.widgets.JosmTextField; 28 28 29 29 /** 30 30 * Panel allowing the user to setup advanced OAuth parameters: … … 40 40 public class AdvancedOAuthPropertiesPanel extends VerticallyScrollablePanel { 41 41 42 42 private JCheckBox cbUseDefaults; 43 private J TextField tfConsumerKey;44 private J TextField tfConsumerSecret;45 private J TextField tfRequestTokenURL;46 private J TextField tfAccessTokenURL;47 private J TextField tfAuthoriseURL;43 private JosmTextField tfConsumerKey; 44 private JosmTextField tfConsumerSecret; 45 private JosmTextField tfRequestTokenURL; 46 private JosmTextField tfAccessTokenURL; 47 private JosmTextField tfAuthoriseURL; 48 48 private UseDefaultItemListener ilUseDefault; 49 49 private String apiUrl; 50 50 … … 69 69 70 70 gc.gridx = 1; 71 71 gc.weightx = 1.0; 72 add(tfConsumerKey = new J TextField(), gc);72 add(tfConsumerKey = new JosmTextField(), gc); 73 73 SelectAllOnFocusGainedDecorator.decorate(tfConsumerKey); 74 74 75 75 // -- consumer secret … … 80 80 81 81 gc.gridx = 1; 82 82 gc.weightx = 1.0; 83 add(tfConsumerSecret = new J TextField(), gc);83 add(tfConsumerSecret = new JosmTextField(), gc); 84 84 SelectAllOnFocusGainedDecorator.decorate(tfConsumerSecret); 85 85 86 86 // -- request token URL … … 91 91 92 92 gc.gridx = 1; 93 93 gc.weightx = 1.0; 94 add(tfRequestTokenURL = new J TextField(), gc);94 add(tfRequestTokenURL = new JosmTextField(), gc); 95 95 SelectAllOnFocusGainedDecorator.decorate(tfRequestTokenURL); 96 96 97 97 // -- access token URL … … 102 102 103 103 gc.gridx = 1; 104 104 gc.weightx = 1.0; 105 add(tfAccessTokenURL = new J TextField(), gc);105 add(tfAccessTokenURL = new JosmTextField(), gc); 106 106 SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenURL); 107 107 108 108 … … 114 114 115 115 gc.gridx = 1; 116 116 gc.weightx = 1.0; 117 add(tfAuthoriseURL = new J TextField(), gc);117 add(tfAuthoriseURL = new JosmTextField(), gc); 118 118 SelectAllOnFocusGainedDecorator.decorate(tfAuthoriseURL); 119 119 120 120 cbUseDefaults.addItemListener(ilUseDefault = new UseDefaultItemListener()); … … 176 176 177 177 protected void setChildComponentsEnabled(boolean enabled){ 178 178 for (Component c: getComponents()) { 179 if (c instanceof J TextField || c instanceof JLabel) {179 if (c instanceof JosmTextField || c instanceof JLabel) { 180 180 c.setEnabled(enabled); 181 181 } 182 182 } -
src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
22 22 import javax.swing.JPanel; 23 23 import javax.swing.JPasswordField; 24 24 import javax.swing.JTabbedPane; 25 import javax.swing.JTextField;26 25 import javax.swing.event.DocumentEvent; 27 26 import javax.swing.event.DocumentListener; 28 27 import javax.swing.text.JTextComponent; … … 42 41 import org.openstreetmap.josm.gui.widgets.JosmPasswordField; 43 42 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 44 43 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 44 import org.openstreetmap.josm.gui.widgets.JosmTextField; 45 45 import org.openstreetmap.josm.io.OsmApi; 46 46 import org.openstreetmap.josm.io.OsmTransferException; 47 47 import org.openstreetmap.josm.io.auth.CredentialsAgent; … … 58 58 */ 59 59 public class FullyAutomaticAuthorizationUI extends AbstractAuthorizationUI { 60 60 61 private J TextField tfUserName;61 private JosmTextField tfUserName; 62 62 private JPasswordField tfPassword; 63 63 private UserNameValidator valUserName; 64 64 private PasswordValidator valPassword; … … 115 115 116 116 gc.gridx = 1; 117 117 gc.weightx = 1.0; 118 pnl.add(tfUserName = new J TextField(), gc);118 pnl.add(tfUserName = new JosmTextField(), gc); 119 119 SelectAllOnFocusGainedDecorator.decorate(tfUserName); 120 120 valUserName = new UserNameValidator(tfUserName); 121 121 valUserName.validate(); -
src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java
19 19 import javax.swing.JCheckBox; 20 20 import javax.swing.JLabel; 21 21 import javax.swing.JPanel; 22 import javax.swing.JTextField;23 22 import javax.swing.SwingUtilities; 24 23 25 24 import org.openstreetmap.josm.Main; … … 30 29 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 31 30 import org.openstreetmap.josm.tools.ImageProvider; 32 31 import org.openstreetmap.josm.tools.OpenBrowser; 32 import org.openstreetmap.josm.gui.widgets.JosmTextField; 33 33 34 34 /** 35 35 * This is the UI for running a semic-automic authorisation procedure. … … 206 206 */ 207 207 private class RetrieveAccessTokenPanel extends JPanel { 208 208 209 private J TextField tfAuthoriseUrl;209 private JosmTextField tfAuthoriseUrl; 210 210 211 211 protected JPanel buildTitlePanel() { 212 212 JPanel pnl = new JPanel(new BorderLayout()); … … 245 245 246 246 gc.gridx = 1; 247 247 gc.weightx = 1.0; 248 pnl.add(tfAuthoriseUrl = new J TextField(), gc);248 pnl.add(tfAuthoriseUrl = new JosmTextField(), gc); 249 249 tfAuthoriseUrl.setEditable(false); 250 250 251 251 return pnl; -
src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java
18 18 import javax.swing.JLabel; 19 19 import javax.swing.JPanel; 20 20 import javax.swing.JTabbedPane; 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.gui.widgets.HtmlPanel; 32 31 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 33 32 import org.openstreetmap.josm.tools.ImageProvider; 33 import org.openstreetmap.josm.gui.widgets.JosmTextField; 34 34 35 35 /** 36 36 * This is an UI which supports a JOSM user to get an OAuth Access Token in a fully … … 40 40 */ 41 41 public class ManualAuthorizationUI extends AbstractAuthorizationUI{ 42 42 43 private J TextField tfAccessTokenKey;43 private JosmTextField tfAccessTokenKey; 44 44 private AccessTokenKeyValidator valAccessTokenKey; 45 private J TextField tfAccessTokenSecret;45 private JosmTextField tfAccessTokenSecret; 46 46 private AccessTokenSecretValidator valAccessTokenSecret; 47 47 private JCheckBox cbSaveToPreferences; 48 48 private HtmlPanel pnlMessage; … … 75 75 76 76 gc.gridx = 1; 77 77 gc.weightx = 1.0; 78 pnl.add(tfAccessTokenKey = new J TextField(), gc);78 pnl.add(tfAccessTokenKey = new JosmTextField(), gc); 79 79 SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenKey); 80 80 valAccessTokenKey = new AccessTokenKeyValidator(tfAccessTokenKey); 81 81 valAccessTokenKey.validate(); … … 89 89 90 90 gc.gridx = 1; 91 91 gc.weightx = 1.0; 92 pnl.add(tfAccessTokenSecret = new J TextField(), gc);92 pnl.add(tfAccessTokenSecret = new JosmTextField(), gc); 93 93 SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenSecret); 94 94 valAccessTokenSecret = new AccessTokenSecretValidator(tfAccessTokenSecret); 95 95 valAccessTokenSecret.validate(); -
src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java
10 10 import javax.swing.JCheckBox; 11 11 import javax.swing.JLabel; 12 12 import javax.swing.JPanel; 13 import javax.swing.JTextField;14 13 15 14 import org.openstreetmap.josm.data.oauth.OAuthToken; 16 15 import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder; 16 import org.openstreetmap.josm.gui.widgets.JosmTextField; 17 17 18 18 /** 19 19 * Displays the key and the secret of an OAuth Access Token. … … 21 21 */ 22 22 public class AccessTokenInfoPanel extends JPanel { 23 23 24 private J TextField tfAccessTokenKey;25 private J TextField tfAccessTokenSecret;24 private JosmTextField tfAccessTokenKey; 25 private JosmTextField tfAccessTokenSecret; 26 26 private JCheckBox cbSaveAccessTokenInPreferences; 27 27 28 28 protected void build() { … … 38 38 39 39 gc.gridx = 1; 40 40 gc.weightx = 1.0; 41 add(tfAccessTokenKey = new J TextField(), gc);41 add(tfAccessTokenKey = new JosmTextField(), gc); 42 42 tfAccessTokenKey.setEditable(false); 43 43 44 44 // the access token secret … … 50 50 51 51 gc.gridx = 1; 52 52 gc.weightx = 1.0; 53 add(tfAccessTokenSecret = new J TextField(), gc);53 add(tfAccessTokenSecret = new JosmTextField(), gc); 54 54 tfAccessTokenSecret.setEditable(false); 55 55 56 56 // the checkbox -
src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java
12 12 import javax.swing.JLabel; 13 13 import javax.swing.JPanel; 14 14 import javax.swing.JPasswordField; 15 import javax.swing.JTextField;16 15 import javax.swing.text.JTextComponent; 17 16 18 17 import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator; 19 18 import org.openstreetmap.josm.gui.widgets.JosmPasswordField; 20 19 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 20 import org.openstreetmap.josm.gui.widgets.JosmTextField; 21 21 22 22 public class FullyAutomaticPropertiesPanel extends JPanel { 23 23 24 private J TextField tfUserName;24 private JosmTextField tfUserName; 25 25 private JPasswordField tfPassword; 26 26 private UserNameValidator valUserName; 27 27 … … 42 42 43 43 gc.gridx = 1; 44 44 gc.weightx = 1.0; 45 pnl.add(tfUserName = new J TextField(), gc);45 pnl.add(tfUserName = new JosmTextField(), gc); 46 46 SelectAllOnFocusGainedDecorator.decorate(tfUserName); 47 47 valUserName = new UserNameValidator(tfUserName); 48 48 valUserName.validate(); -
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/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/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"; … … 72 73 private DownloadDialog parent; 73 74 private final static Server[] servers = new Server[]{ 74 75 new Server("Nominatim","http://nominatim.openstreetmap.org/search?format=xml&q=",tr("Class Type"),tr("Bounds")), 75 //new Server("Namefinder","http://gazetteer.openstreetmap.org/namefinder/search.xml?find=",tr("Near"),trc("placeselection", "Zoom")) 76 new Server("MapQuest","http://open.mapquestapi.com/nominatim/v1/search.php?format=xml&limit=50&q=",tr("Class Type"),tr("Bounds")), 77 //new Server("Namefinder","http://gazetteer.openstreetmap.org/namefinder/search.xml?find=",tr("Near"),tr("placeselection", "Zoom")), 76 78 }; 77 79 private final JosmComboBox server = new JosmComboBox(servers); 78 80 -
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 }); -
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 … … 113 113 JPanel p = new JPanel(new GridBagLayout()); 114 114 p.add(new JLabel(tr(e.realm)), GBC.eol().fill(GBC.HORIZONTAL)); 115 115 p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,20,0)); 116 J TextField user = new JTextField(username == null ? "" : username);116 JosmTextField user = new JosmTextField(username == null ? "" : username); 117 117 p.add(user, GBC.eol().fill(GBC.HORIZONTAL)); 118 118 p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,20,0)); 119 119 JPasswordField pass = new JosmPasswordField(password == null ? "" : password); -
src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
52 52 import javax.swing.JScrollPane; 53 53 import javax.swing.JSeparator; 54 54 import javax.swing.JSlider; 55 import javax.swing.JTextField;56 55 import javax.swing.ListSelectionModel; 57 56 import javax.swing.SwingConstants; 58 57 import javax.swing.event.ChangeEvent; … … 80 79 import org.openstreetmap.josm.tools.ImageProvider; 81 80 import org.openstreetmap.josm.tools.PrimaryDateParser; 82 81 import org.xml.sax.SAXException; 82 import org.openstreetmap.josm.gui.widgets.JosmTextField; 83 83 84 84 /** This class displays the window to select the GPX file and the offset (timezone + delta). 85 85 * Then it correlates the images of the layer with that GPX file. … … 118 118 Vector<GpxDataWrapper> gpxLst = new Vector<GpxDataWrapper>(); 119 119 JPanel outerPanel; 120 120 JosmComboBox cbGpx; 121 J TextField tfTimezone;122 J TextField tfOffset;121 JosmTextField tfTimezone; 122 JosmTextField tfOffset; 123 123 JCheckBox cbExifImg; 124 124 JCheckBox cbTaggedImg; 125 125 JCheckBox cbShowThumbs; … … 223 223 private class SetOffsetActionListener implements ActionListener { 224 224 JPanel panel; 225 225 JLabel lbExifTime; 226 J TextField tfGpsTime;226 JosmTextField tfGpsTime; 227 227 JosmComboBox cbTimezones; 228 228 ImageDisplay imgDisp; 229 229 JList imgList; … … 268 268 gc.anchor = GridBagConstraints.WEST; 269 269 panelTf.add(new JLabel(tr("Gps time (read from the above photo): ")), gc); 270 270 271 tfGpsTime = new J TextField(12);271 tfGpsTime = new JosmTextField(12); 272 272 tfGpsTime.setEnabled(false); 273 273 tfGpsTime.setMinimumSize(new Dimension(155, tfGpsTime.getMinimumSize().height)); 274 274 gc.gridx = 1; … … 494 494 timezone = 0; 495 495 } 496 496 497 tfTimezone = new J TextField(10);497 tfTimezone = new JosmTextField(10); 498 498 tfTimezone.setText(formatTimezone(timezone)); 499 499 500 500 try { … … 504 504 } 505 505 delta = delta / 1000; // milliseconds -> seconds 506 506 507 tfOffset = new J TextField(10);507 tfOffset = new JosmTextField(10); 508 508 tfOffset.setText(Long.toString(delta)); 509 509 510 510 JButton buttonViewGpsPhoto = new JButton(tr("<html>Use photo of an accurate clock,<br>" -
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/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/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/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/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/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/io/GpxExporter.java
22 22 import javax.swing.JPanel; 23 23 import javax.swing.JScrollPane; 24 24 import javax.swing.JTextArea; 25 import javax.swing.JTextField;26 25 import javax.swing.ListSelectionModel; 27 26 28 27 import org.openstreetmap.josm.Main; … … 33 32 import org.openstreetmap.josm.gui.layer.GpxLayer; 34 33 import org.openstreetmap.josm.gui.layer.Layer; 35 34 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 35 import org.openstreetmap.josm.gui.widgets.JosmTextField; 36 36 import org.openstreetmap.josm.tools.CheckParameterUtil; 37 37 import org.openstreetmap.josm.tools.GBC; 38 38 import org.openstreetmap.josm.tools.Utils; … … 90 90 p.add(author, GBC.eol()); 91 91 JLabel nameLabel = new JLabel(tr("Real name")); 92 92 p.add(nameLabel, GBC.std().insets(10, 0, 5, 0)); 93 J TextField authorName = new JTextField();93 JosmTextField authorName = new JosmTextField(); 94 94 p.add(authorName, GBC.eol().fill(GBC.HORIZONTAL)); 95 95 JLabel emailLabel = new JLabel(tr("E-Mail")); 96 96 p.add(emailLabel, GBC.std().insets(10, 0, 5, 0)); 97 J TextField email = new JTextField();97 JosmTextField email = new JosmTextField(); 98 98 p.add(email, GBC.eol().fill(GBC.HORIZONTAL)); 99 99 JLabel copyrightLabel = new JLabel(tr("Copyright (URL)")); 100 100 p.add(copyrightLabel, GBC.std().insets(10, 0, 5, 0)); 101 J TextField copyright = new JTextField();101 JosmTextField copyright = new JosmTextField(); 102 102 p.add(copyright, GBC.std().fill(GBC.HORIZONTAL)); 103 103 JButton predefined = new JButton(tr("Predefined")); 104 104 p.add(predefined, GBC.eol().insets(5, 0, 0, 0)); 105 105 JLabel copyrightYearLabel = new JLabel(tr("Copyright year")); 106 106 p.add(copyrightYearLabel, GBC.std().insets(10, 0, 5, 5)); 107 J TextField copyrightYear = new JTextField("");107 JosmTextField copyrightYear = new JosmTextField(""); 108 108 p.add(copyrightYear, GBC.eol().fill(GBC.HORIZONTAL)); 109 109 JLabel warning = new JLabel("<html><font size='-2'> </html"); 110 110 p.add(warning, GBC.eol().fill(GBC.HORIZONTAL).insets(15, 0, 0, 0)); … … 112 112 copyrightLabel, copyrightYearLabel, warning); 113 113 114 114 p.add(new JLabel(tr("Keywords")), GBC.eol()); 115 J TextField keywords = new JTextField();115 JosmTextField keywords = new JosmTextField(); 116 116 keywords.setText((String) gpxData.attr.get(META_KEYWORDS)); 117 117 p.add(keywords, GBC.eop().fill(GBC.HORIZONTAL)); 118 118 … … 183 183 } 184 184 } 185 185 186 private static void enableCopyright(final GpxData data, final J TextField copyright, final JButton predefined,187 final J TextField copyrightYear, final JLabel copyrightLabel, final JLabel copyrightYearLabel,186 private static void enableCopyright(final GpxData data, final JosmTextField copyright, final JButton predefined, 187 final JosmTextField copyrightYear, final JLabel copyrightLabel, final JLabel copyrightYearLabel, 188 188 final JLabel warning, boolean enable) { 189 189 copyright.setEnabled(enable); 190 190 predefined.setEnabled(enable); … … 226 226 private static void addDependencies( 227 227 final GpxData data, 228 228 final JCheckBox author, 229 final J TextField authorName,230 final J TextField email,231 final J TextField copyright,229 final JosmTextField authorName, 230 final JosmTextField email, 231 final JosmTextField copyright, 232 232 final JButton predefined, 233 final J TextField copyrightYear,233 final JosmTextField copyrightYear, 234 234 final JLabel nameLabel, 235 235 final JLabel emailLabel, 236 236 final JLabel copyrightLabel, -
src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java
31 31 import javax.swing.JLabel; 32 32 import javax.swing.JPanel; 33 33 import javax.swing.JRadioButton; 34 import javax.swing.JTextField;35 34 import javax.swing.SwingConstants; 36 35 37 36 import org.w3c.dom.Element; … … 40 39 import org.openstreetmap.josm.gui.layer.Layer; 41 40 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 42 41 import org.openstreetmap.josm.gui.util.GuiHelper; 42 import org.openstreetmap.josm.gui.widgets.JosmTextField; 43 43 import org.openstreetmap.josm.io.OsmWriter; 44 44 import org.openstreetmap.josm.io.OsmWriterFactory; 45 45 import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport; … … 108 108 final LayerSaveAction saveAction = new LayerSaveAction(); 109 109 final JButton save = new JButton(saveAction); 110 110 if (file != null) { 111 J TextField tf = new JTextField();111 JosmTextField tf = new JosmTextField(); 112 112 tf.setText(file.getPath()); 113 113 tf.setEditable(false); 114 114 cardLink.add(tf, GBC.std()); -
src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java
29 29 import javax.swing.JLabel; 30 30 import javax.swing.JPanel; 31 31 import javax.swing.JRadioButton; 32 import javax.swing.JTextField;33 32 import javax.swing.SwingConstants; 34 33 35 34 import org.openstreetmap.josm.gui.layer.GpxLayer; 36 35 import org.openstreetmap.josm.gui.layer.Layer; 37 36 import org.openstreetmap.josm.gui.util.GuiHelper; 37 import org.openstreetmap.josm.gui.widgets.JosmTextField; 38 38 import org.openstreetmap.josm.io.GpxWriter; 39 39 import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport; 40 40 import org.openstreetmap.josm.tools.GBC; … … 78 78 JPanel cardLink = new JPanel(new GridBagLayout()); 79 79 final File file = layer.getAssociatedFile(); 80 80 if (file != null) { 81 J TextField tf = new JTextField();81 JosmTextField tf = new JosmTextField(); 82 82 tf.setText(file.getPath()); 83 83 tf.setEditable(false); 84 84 cardLink.add(tf, GBC.std()); -
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/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/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/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();
