Changeset 10179 in josm for trunk/src/org/openstreetmap/josm/gui/preferences
- Timestamp:
- 2016-05-11T02:44:10+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r10035 r10179 37 37 public class PreferenceDialog extends JDialog { 38 38 39 private PreferenceTabbedPane tpPreferences;39 private final PreferenceTabbedPane tpPreferences = new PreferenceTabbedPane(); 40 40 private boolean canceled; 41 42 /** 43 * Constructs a new {@code PreferenceDialog}. 44 * @param parent parent component 45 */ 46 public PreferenceDialog(Component parent) { 47 super(GuiHelper.getFrameForComponent(parent), tr("Preferences"), ModalityType.DOCUMENT_MODAL); 48 build(); 49 this.setMinimumSize(new Dimension(600, 350)); 50 // set the maximum width to the current screen. If the dialog is opened on a 51 // smaller screen than before, this will reset the stored preference. 52 this.setMaximumSize(GuiHelper.getScreenSize()); 53 } 41 54 42 55 protected JPanel buildActionPanel() { … … 65 78 Container c = getContentPane(); 66 79 c.setLayout(new BorderLayout()); 67 c.add(tpPreferences = new PreferenceTabbedPane(), BorderLayout.CENTER);80 c.add(tpPreferences, BorderLayout.CENTER); 68 81 tpPreferences.buildGui(); 69 82 tpPreferences.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); … … 75 88 getRootPane().getActionMap().put("cancel", new CancelAction()); 76 89 HelpUtil.setHelpContext(getRootPane(), HelpUtil.ht("/Action/Preferences")); 77 }78 79 public PreferenceDialog(Component parent) {80 super(GuiHelper.getFrameForComponent(parent), tr("Preferences"), ModalityType.DOCUMENT_MODAL);81 build();82 this.setMinimumSize(new Dimension(600, 350));83 // set the maximum width to the current screen. If the dialog is opened on a84 // smaller screen than before, this will reset the stored preference.85 this.setMaximumSize(GuiHelper.getScreenSize());86 90 } 87 91 … … 126 130 } 127 131 132 /** 133 * Select preferences tab by name. 134 * @param name preferences tab name (icon) 135 */ 128 136 public void selectPreferencesTabByName(String name) { 129 137 tpPreferences.selectTabByName(name); 130 138 } 131 139 140 /** 141 * Select preferences tab by class. 142 * @param clazz preferences tab class 143 */ 132 144 public void selectPreferencesTabByClass(Class<? extends TabPreferenceSetting> clazz) { 133 145 tpPreferences.selectTabByPref(clazz); 134 146 } 135 147 148 /** 149 * Select preferences sub-tab by class. 150 * @param clazz preferences sub-tab class 151 */ 136 152 public void selectSubPreferencesTabByClass(Class<? extends SubPreferenceSetting> clazz) { 137 153 tpPreferences.selectSubTabByPref(clazz); -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r10114 r10179 1486 1486 Matcher m = Pattern.compile("^(.+);(.+)$").matcher(line); 1487 1487 if (m.matches()) { 1488 sources.add(last = new ExtendedSourceEntry(m.group(1), m.group(2))); 1488 last = new ExtendedSourceEntry(m.group(1), m.group(2)); 1489 sources.add(last); 1489 1490 } else { 1490 1491 Main.error(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line)); … … 1528 1529 1529 1530 class FileOrUrlCellEditor extends JPanel implements TableCellEditor { 1530 private JosmTextField tfFileName;1531 private final JosmTextField tfFileName = new JosmTextField(); 1531 1532 private final CopyOnWriteArrayList<CellEditorListener> listeners; 1532 1533 private String value; … … 1544 1545 gc.weightx = 1.0; 1545 1546 gc.weighty = 1.0; 1546 add(tfFileName = new JosmTextField(), gc);1547 add(tfFileName, gc); 1547 1548 1548 1549 gc.gridx = 1; -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r10173 r10179 682 682 private JPanel actionParametersPanel; 683 683 684 private JButton upButton;685 private JButton downButton;686 private JButton removeButton;687 private JButton addButton;684 private final JButton upButton = createButton("up"); 685 private final JButton downButton = createButton("down"); 686 private final JButton removeButton = createButton(">"); 687 private final JButton addButton = createButton("<"); 688 688 689 689 private String movingComponent; 690 690 691 /** 692 * Constructs a new {@code Settings}. 693 * @param rootActionsNode root actions node 694 */ 691 695 public Settings(DefaultMutableTreeNode rootActionsNode) { 692 696 super(/* ICON(preferences/) */ "toolbar", tr("Toolbar customization"), tr("Customize the elements on the toolbar.")); … … 815 819 816 820 final JPanel buttons = new JPanel(new GridLayout(6, 1)); 817 buttons.add(upButton = createButton("up"));818 buttons.add(addButton = createButton("<"));819 buttons.add(removeButton = createButton(">"));820 buttons.add(downButton = createButton("down"));821 buttons.add(upButton); 822 buttons.add(addButton); 823 buttons.add(removeButton); 824 buttons.add(downButton); 821 825 updateEnabledState(); 822 826 -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
r9778 r10179 66 66 add(formats, GBC.eol().fill()); 67 67 68 add(wmsInstruction = new JLabel(tr("4. Verify generated WMS URL")), GBC.eol()); 68 wmsInstruction = new JLabel(tr("4. Verify generated WMS URL")); 69 add(wmsInstruction, GBC.eol()); 69 70 wmsInstruction.setLabelFor(wmsUrl); 70 71 add(wmsUrl, GBC.eop().fill()); -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r10134 r10179 79 79 private ImageryLayerInfo layerInfo; 80 80 81 private CommonSettingsPanel commonSettings;82 private WMSSettingsPanel wmsSettings;83 private TMSSettingsPanel tmsSettings;81 private final CommonSettingsPanel commonSettings = new CommonSettingsPanel(); 82 private final WMSSettingsPanel wmsSettings = new WMSSettingsPanel(); 83 private final TMSSettingsPanel tmsSettings = new TMSSettingsPanel(); 84 84 85 85 /** … … 115 115 p.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 116 116 117 addSettingsSection(p, tr("Common Settings"), commonSettings = new CommonSettingsPanel());118 addSettingsSection(p, tr("WMS Settings"), wmsSettings = new WMSSettingsPanel(),117 addSettingsSection(p, tr("Common Settings"), commonSettings); 118 addSettingsSection(p, tr("WMS Settings"), wmsSettings, 119 119 GBC.eol().fill(GBC.HORIZONTAL)); 120 addSettingsSection(p, tr("TMS Settings"), tmsSettings = new TMSSettingsPanel(),120 addSettingsSection(p, tr("TMS Settings"), tmsSettings, 121 121 GBC.eol().fill(GBC.HORIZONTAL)); 122 122 -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
r9212 r10179 46 46 47 47 static Policy fromPreferenceValue(String preferenceValue) { 48 if (preferenceValue == null) return null; 49 preferenceValue = preferenceValue.trim().toLowerCase(Locale.ENGLISH); 48 if (preferenceValue == null) 49 return null; 50 String prefValue = preferenceValue.trim().toLowerCase(Locale.ENGLISH); 50 51 for (Policy p: Policy.values()) { 51 if (p.getPreferencesValue().equals(pref erenceValue))52 if (p.getPreferencesValue().equals(prefValue)) 52 53 return p; 53 54 } … … 58 59 private transient Map<Policy, JRadioButton> rbVersionBasedUpatePolicy; 59 60 private transient Map<Policy, JRadioButton> rbTimeBasedUpatePolicy; 60 private JosmTextField tfUpdateInterval; 61 private JLabel lblUpdateInterval; 61 private final JosmTextField tfUpdateInterval = new JosmTextField(5); 62 private final JLabel lblUpdateInterval = new JLabel(tr("Update interval (in days):")); 63 64 /** 65 * Constructs a new {@code PluginUpdatePolicyPanel}. 66 */ 67 public PluginUpdatePolicyPanel() { 68 build(); 69 initFromPreferences(); 70 } 62 71 63 72 protected JPanel buildVersionBasedUpdatePolicyPanel() { … … 95 104 protected JPanel buildUpdateIntervalPanel() { 96 105 JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT)); 97 pnl.add(lblUpdateInterval = new JLabel(tr("Update interval (in days):")));98 pnl.add(tfUpdateInterval = new JosmTextField(5));106 pnl.add(lblUpdateInterval); 107 pnl.add(tfUpdateInterval); 99 108 lblUpdateInterval.setLabelFor(tfUpdateInterval); 100 109 SelectAllOnFocusGainedDecorator.decorate(tfUpdateInterval); … … 160 169 161 170 /** 162 * Constructs a new {@code PluginUpdatePolicyPanel}.163 */164 public PluginUpdatePolicyPanel() {165 build();166 initFromPreferences();167 }168 169 /**170 171 * Loads the relevant preference values from the JOSM preferences 171 *172 172 */ 173 173 public final void initFromPreferences() { -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
r9609 r10179 47 47 private static class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener { 48 48 49 public JosmTextField filter;50 private ProjectionCodeListModel model;49 public final JosmTextField filter = new JosmTextField(30); 50 private final ProjectionCodeListModel model = new ProjectionCodeListModel(); 51 51 public JList<String> selectionList; 52 52 private final List<String> data; … … 89 89 90 90 private void build() { 91 filter = new JosmTextField(30);92 91 filter.setColumns(10); 93 92 filter.getDocument().addDocumentListener(this); 94 93 95 94 selectionList = new JList<>(data.toArray(new String[0])); 96 selectionList.setModel(model = new ProjectionCodeListModel());95 selectionList.setModel(model); 97 96 JScrollPane scroll = new JScrollPane(selectionList); 98 97 scroll.setPreferredSize(new Dimension(200, 214)); … … 105 104 public String getCode() { 106 105 int idx = selectionList.getSelectedIndex(); 107 if (idx == -1) return lastCode; 106 if (idx == -1) 107 return lastCode; 108 108 return filteredData.get(selectionList.getSelectedIndex()); 109 109 } … … 174 174 if (matcher2.matches()) { 175 175 int cmp1 = matcher1.group(1).compareTo(matcher2.group(1)); 176 if (cmp1 != 0) return cmp1; 176 if (cmp1 != 0) 177 return cmp1; 177 178 int num1 = Integer.parseInt(matcher1.group(2)); 178 179 int num2 = Integer.parseInt(matcher2.group(2)); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r9783 r10179 69 69 private static Map<String, ProjectionChoice> projectionChoicesById = new HashMap<>(); 70 70 71 // some ProjectionChoices that are referenced from other parts of the code 72 public static final ProjectionChoice wgs84, mercator, lambert, utm_france_dom, lambert_cc9; 71 /** 72 * WGS84: Directly use latitude / longitude values as x/y. 73 */ 74 public static final ProjectionChoice wgs84 = registerProjectionChoice(tr("WGS84 Geographic"), "core:wgs84", 4326, "epsg4326"); 75 76 /** 77 * Mercator Projection. 78 * 79 * The center of the mercator projection is always the 0 grad coordinate. 80 * 81 * See also USGS Bulletin 1532 (http://pubs.usgs.gov/bul/1532/report.pdf) 82 * initially EPSG used 3785 but that has been superseded by 3857, see https://www.epsg-registry.org/ 83 */ 84 public static final ProjectionChoice mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857); 85 86 /** 87 * Lambert conic conform 4 zones using the French geodetic system NTF. 88 * 89 * This newer version uses the grid translation NTF<->RGF93 provided by IGN for a submillimetric accuracy. 90 * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal) 91 * 92 * Source: http://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf 93 */ 94 public static final ProjectionChoice lambert = new LambertProjectionChoice(); 95 96 /** 97 * French departements in the Caribbean Sea and Indian Ocean. 98 * 99 * Using the UTM transvers Mercator projection and specific geodesic settings. 100 */ 101 public static final ProjectionChoice utm_france_dom = new UTMFranceDOMProjectionChoice(); 102 103 /** 104 * Lambert Conic Conform 9 Zones projection. 105 * 106 * As specified by the IGN in this document 107 * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf 108 */ 109 public static final ProjectionChoice lambert_cc9 = new LambertCC9ZonesProjectionChoice(); 73 110 74 111 static { … … 77 114 * Global projections. 78 115 */ 79 80 /**81 * WGS84: Directly use latitude / longitude values as x/y.82 */83 wgs84 = registerProjectionChoice(tr("WGS84 Geographic"), "core:wgs84", 4326, "epsg4326");84 85 /**86 * Mercator Projection.87 *88 * The center of the mercator projection is always the 0 grad89 * coordinate.90 *91 * See also USGS Bulletin 153292 * (http://pubs.usgs.gov/bul/1532/report.pdf)93 * initially EPSG used 3785 but that has been superseded by 3857,94 * see https://www.epsg-registry.org/95 */96 mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857);97 116 98 117 /** … … 156 175 * @author Pieren 157 176 */ 158 registerProjectionChoice(lambert = new LambertProjectionChoice());// FR177 registerProjectionChoice(lambert); // FR 159 178 160 179 /** … … 174 193 * @author Pieren 175 194 */ 176 registerProjectionChoice(lambert_cc9 = new LambertCC9ZonesProjectionChoice());// FR195 registerProjectionChoice(lambert_cc9); // FR 177 196 178 197 /** … … 181 200 * Using the UTM transvers Mercator projection and specific geodesic settings. 182 201 */ 183 registerProjectionChoice(utm_france_dom = new UTMFranceDOMProjectionChoice());// FR202 registerProjectionChoice(utm_france_dom); // FR 184 203 185 204 /** … … 281 300 private final JPanel projSubPrefPanelWrapper = new JPanel(new GridBagLayout()); 282 301 283 private JLabel projectionCodeLabel ;284 private Component projectionCodeGlue ;302 private JLabel projectionCodeLabel = new JLabel(tr("Projection code")); 303 private Component projectionCodeGlue = GBC.glue(5, 0); 285 304 private final JLabel projectionCode = new JLabel(); 286 private JLabel projectionNameLabel;287 private Component projectionNameGlue;305 private final JLabel projectionNameLabel = new JLabel(tr("Projection name")); 306 private final Component projectionNameGlue = GBC.glue(5, 0); 288 307 private final JLabel projectionName = new JLabel(); 289 308 private final JLabel bounds = new JLabel(); … … 323 342 projPanel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL)); 324 343 projPanel.add(projectionCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5)); 325 projPanel.add(projectionCodeLabel = new JLabel(tr("Projection code")), GBC.std().insets(25, 5, 0, 5));326 projPanel.add(projectionCodeGlue = GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));344 projPanel.add(projectionCodeLabel, GBC.std().insets(25, 5, 0, 5)); 345 projPanel.add(projectionCodeGlue, GBC.std().fill(GBC.HORIZONTAL)); 327 346 projPanel.add(projectionCode, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5)); 328 projPanel.add(projectionNameLabel = new JLabel(tr("Projection name")), GBC.std().insets(25, 5, 0, 5));329 projPanel.add(projectionNameGlue = GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));347 projPanel.add(projectionNameLabel, GBC.std().insets(25, 5, 0, 5)); 348 projPanel.add(projectionNameGlue, GBC.std().fill(GBC.HORIZONTAL)); 330 349 projPanel.add(projectionName, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5)); 331 350 projPanel.add(new JLabel(tr("Bounds")), GBC.std().insets(25, 5, 0, 5)); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
r9543 r10179 25 25 26 26 /** 27 * This is the preference panel for the authentication method and the authentication 28 * parameters. 29 * 27 * This is the preference panel for the authentication method and the authentication parameters. 28 * @since 2745 30 29 */ 31 30 public class AuthenticationPreferencesPanel extends VerticallyScrollablePanel implements PropertyChangeListener { 32 31 33 32 /** indicates whether we use basic authentication */ 34 private JRadioButton rbBasicAuthentication;33 private final JRadioButton rbBasicAuthentication = new JRadioButton(); 35 34 /** indicates whether we use OAuth as authentication scheme */ 36 private JRadioButton rbOAuth; 37 /** the panel which contains the authentication parameters for the respective 38 * authentication scheme 39 */ 40 private JPanel pnlAuthenticationParameteters; 35 private final JRadioButton rbOAuth = new JRadioButton(); 36 /** the panel which contains the authentication parameters for the respective authentication scheme */ 37 private final JPanel pnlAuthenticationParameteters = new JPanel(new BorderLayout()); 41 38 /** the panel for the basic authentication parameters */ 42 39 private BasicAuthenticationPreferencesPanel pnlBasicAuthPreferences; … … 45 42 /** the panel for messages notifier preferences */ 46 43 private FeaturesPanel pnlFeaturesPreferences; 44 45 /** 46 * Constructs a new {@code AuthenticationPreferencesPanel}. 47 */ 48 public AuthenticationPreferencesPanel() { 49 build(); 50 initFromPreferences(); 51 HelpUtil.setHelpContext(this, HelpUtil.ht("/Preferences/Connection#AuthenticationSettings")); 52 } 47 53 48 54 /** … … 61 67 gc.weightx = 1.0; 62 68 gc.insets = new Insets(0, 0, 0, 3); 63 add(rbBasicAuthentication = new JRadioButton(), gc);69 add(rbBasicAuthentication, gc); 64 70 rbBasicAuthentication.setText(tr("Use Basic Authentication")); 65 71 rbBasicAuthentication.setToolTipText(tr("Select to use HTTP basic authentication with your OSM username and password")); … … 69 75 gc.gridx = 0; 70 76 gc.weightx = 0.0; 71 add(rbOAuth = new JRadioButton(), gc);77 add(rbOAuth, gc); 72 78 rbOAuth.setText(tr("Use OAuth")); 73 79 rbOAuth.setToolTipText(tr("Select to use OAuth as authentication mechanism")); … … 86 92 gc.weightx = 1.0; 87 93 gc.weighty = 1.0; 88 pnlAuthenticationParameteters = new JPanel(new BorderLayout());89 94 add(pnlAuthenticationParameteters, gc); 90 95 … … 104 109 pnlFeaturesPreferences = new FeaturesPanel(); 105 110 add(pnlFeaturesPreferences, gc); 106 }107 108 /**109 * Constructs a new {@code AuthenticationPreferencesPanel}.110 */111 public AuthenticationPreferencesPanel() {112 build();113 initFromPreferences();114 HelpUtil.setHelpContext(this, HelpUtil.ht("/Preferences/Connection#AuthenticationSettings"));115 111 } 116 112 -
trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
r8510 r10179 25 25 26 26 /** 27 * The preferences panel for parameters necessary for the Basic Authentication 28 * Scheme. 29 * 27 * The preferences panel for parameters necessary for the Basic Authentication Scheme. 28 * @since 2745 30 29 */ 31 30 public class BasicAuthenticationPreferencesPanel extends JPanel { 32 31 33 32 /** the OSM user name */ 34 private JosmTextField tfOsmUserName;33 private final JosmTextField tfOsmUserName = new JosmTextField(); 35 34 /** the OSM password */ 36 private JosmPasswordField tfOsmPassword;35 private final JosmPasswordField tfOsmPassword = new JosmPasswordField(); 37 36 /** a panel with further information, e.g. some warnings */ 38 37 private JPanel decorationPanel; 38 39 /** 40 * Constructs a new {@code BasicAuthenticationPreferencesPanel}. 41 */ 42 public BasicAuthenticationPreferencesPanel() { 43 build(); 44 } 39 45 40 46 /** … … 55 61 gc.gridx = 1; 56 62 gc.weightx = 1.0; 57 add(tfOsmUserName = new JosmTextField(), gc);63 add(tfOsmUserName, gc); 58 64 SelectAllOnFocusGainedDecorator.decorate(tfOsmUserName); 59 65 UserNameValidator valUserName = new UserNameValidator(tfOsmUserName); … … 68 74 gc.gridx = 1; 69 75 gc.weightx = 1.0; 70 add(tfOsmPassword = new JosmPasswordField(), gc);76 add(tfOsmPassword, gc); 71 77 SelectAllOnFocusGainedDecorator.decorate(tfOsmPassword); 72 78 tfOsmPassword.setToolTipText(tr("Please enter your OSM password")); … … 82 88 decorationPanel = new JPanel(new BorderLayout()); 83 89 add(decorationPanel, gc); 84 }85 86 /**87 * Constructs a new {@code BasicAuthenticationPreferencesPanel}.88 */89 public BasicAuthenticationPreferencesPanel() {90 build();91 90 } 92 91 -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
r10137 r10179 46 46 */ 47 47 public class OAuthAuthenticationPreferencesPanel extends JPanel implements PropertyChangeListener { 48 private JPanel pnlAuthorisationMessage;49 private NotYetAuthorisedPanel pnlNotYetAuthorised;50 private AlreadyAuthorisedPanel pnlAlreadyAuthorised;51 private AdvancedOAuthPropertiesPanel pnlAdvancedProperties;48 private final JPanel pnlAuthorisationMessage = new JPanel(new BorderLayout()); 49 private final NotYetAuthorisedPanel pnlNotYetAuthorised = new NotYetAuthorisedPanel(); 50 private final AlreadyAuthorisedPanel pnlAlreadyAuthorised = new AlreadyAuthorisedPanel(); 51 private final AdvancedOAuthPropertiesPanel pnlAdvancedProperties = new AdvancedOAuthPropertiesPanel(); 52 52 private String apiUrl; 53 private JCheckBox cbShowAdvancedParameters;54 private JCheckBox cbSaveToPreferences;53 private final JCheckBox cbShowAdvancedParameters = new JCheckBox(); 54 private final JCheckBox cbSaveToPreferences = new JCheckBox(tr("Save to preferences")); 55 55 56 56 /** … … 75 75 gc.weightx = 0.0; 76 76 gc.insets = new Insets(0, 0, 0, 3); 77 pnl.add(cbShowAdvancedParameters = new JCheckBox(), gc);77 pnl.add(cbShowAdvancedParameters, gc); 78 78 cbShowAdvancedParameters.setSelected(false); 79 79 cbShowAdvancedParameters.addItemListener( … … 98 98 gc.weightx = 1.0; 99 99 gc.weighty = 1.0; 100 pnl.add(pnlAdvancedProperties = new AdvancedOAuthPropertiesPanel(), gc);100 pnl.add(pnlAdvancedProperties, gc); 101 101 pnlAdvancedProperties.initFromPreferences(Main.pref); 102 102 pnlAdvancedProperties.setBorder( … … 126 126 gc.weightx = 1.0; 127 127 gc.insets = new Insets(10, 0, 0, 0); 128 add(pnlAuthorisationMessage = new JPanel(new BorderLayout()), gc); 129 130 // create these two panels, they are going to be used later in refreshView 131 // 132 pnlAlreadyAuthorised = new AlreadyAuthorisedPanel(); 133 pnlNotYetAuthorised = new NotYetAuthorisedPanel(); 128 add(pnlAuthorisationMessage, gc); 134 129 } 135 130 … … 196 191 gc.fill = GridBagConstraints.HORIZONTAL; 197 192 gc.weightx = 1.0; 198 JMultilineLabel lbl ;199 add(lbl = new JMultilineLabel(200 tr("You do not have an Access Token yet to access the OSM server using OAuth. Please authorize first.")), gc);193 JMultilineLabel lbl = new JMultilineLabel( 194 tr("You do not have an Access Token yet to access the OSM server using OAuth. Please authorize first.")); 195 add(lbl, gc); 201 196 lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN)); 202 197 … … 221 216 */ 222 217 private class AlreadyAuthorisedPanel extends JPanel { 223 private JosmTextField tfAccessTokenKey;224 private JosmTextField tfAccessTokenSecret;218 private final JosmTextField tfAccessTokenKey = new JosmTextField(); 219 private final JosmTextField tfAccessTokenSecret = new JosmTextField(); 225 220 226 221 /** … … 240 235 gc.weightx = 1.0; 241 236 gc.gridwidth = 2; 242 JMultilineLabel lbl ;243 add(lbl = new JMultilineLabel(tr("You already have an Access Token to access the OSM server using OAuth.")), gc);237 JMultilineLabel lbl = new JMultilineLabel(tr("You already have an Access Token to access the OSM server using OAuth.")); 238 add(lbl, gc); 244 239 lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN)); 245 240 … … 253 248 gc.gridx = 1; 254 249 gc.weightx = 1.0; 255 add(tfAccessTokenKey = new JosmTextField(), gc);250 add(tfAccessTokenKey, gc); 256 251 tfAccessTokenKey.setEditable(false); 257 252 … … 265 260 gc.gridx = 1; 266 261 gc.weightx = 1.0; 267 add(tfAccessTokenSecret = new JosmTextField(), gc);262 add(tfAccessTokenSecret, gc); 268 263 tfAccessTokenSecret.setEditable(false); 269 264 … … 273 268 gc.gridwidth = 2; 274 269 gc.weightx = 1.0; 275 add(cbSaveToPreferences = new JCheckBox(tr("Save to preferences")), gc);270 add(cbSaveToPreferences, gc); 276 271 cbSaveToPreferences.setSelected(OAuthAccessTokenHolder.getInstance().isSaveToPreferences()); 277 272 -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
r10137 r10179 49 49 public static final String API_URL_PROP = OsmApiUrlInputPanel.class.getName() + ".apiUrl"; 50 50 51 private JLabel lblValid;52 private JLabel lblApiUrl;53 private HistoryComboBox tfOsmServerUrl;51 private final JLabel lblValid = new JLabel(); 52 private final JLabel lblApiUrl = new JLabel(tr("OSM Server URL:")); 53 private final HistoryComboBox tfOsmServerUrl = new HistoryComboBox(); 54 54 private transient ApiUrlValidator valOsmServerUrl; 55 55 private SideButton btnTest; … … 95 95 gc.weightx = 0.0; 96 96 gc.insets = new Insets(0, 0, 0, 3); 97 add(lblApiUrl = new JLabel(tr("OSM Server URL:")), gc);97 add(lblApiUrl, gc); 98 98 99 99 gc.gridx = 1; 100 100 gc.weightx = 1.0; 101 add(tfOsmServerUrl = new HistoryComboBox(), gc);101 add(tfOsmServerUrl, gc); 102 102 lblApiUrl.setLabelFor(tfOsmServerUrl); 103 103 SelectAllOnFocusGainedDecorator.decorate(tfOsmServerUrl.getEditorComponent()); … … 110 110 gc.gridx = 2; 111 111 gc.weightx = 0.0; 112 add(lblValid = new JLabel(), gc);112 add(lblValid, gc); 113 113 114 114 gc.gridx = 3; … … 116 116 ValidateApiUrlAction actTest = new ValidateApiUrlAction(); 117 117 tfOsmServerUrl.getEditorComponent().getDocument().addDocumentListener(actTest); 118 add(btnTest = new SideButton(actTest), gc); 118 btnTest = new SideButton(actTest); 119 add(btnTest, gc); 119 120 } 120 121 -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
r8510 r10179 102 102 103 103 private transient Map<ProxyPolicy, JRadioButton> rbProxyPolicy; 104 private JosmTextField tfProxyHttpHost;105 private JosmTextField tfProxyHttpPort;106 private JosmTextField tfProxySocksHost;107 private JosmTextField tfProxySocksPort;108 private JosmTextField tfProxyHttpUser;109 private JosmPasswordField tfProxyHttpPassword;104 private final JosmTextField tfProxyHttpHost = new JosmTextField(); 105 private final JosmTextField tfProxyHttpPort = new JosmTextField(5); 106 private final JosmTextField tfProxySocksHost = new JosmTextField(20); 107 private final JosmTextField tfProxySocksPort = new JosmTextField(5); 108 private final JosmTextField tfProxyHttpUser = new JosmTextField(20); 109 private final JosmPasswordField tfProxyHttpPassword = new JosmPasswordField(20); 110 110 111 111 private JPanel pnlHttpProxyConfigurationPanel; … … 134 134 gc.gridx = 1; 135 135 gc.weightx = 1.0; 136 pnl.add(tfProxyHttpHost = new JosmTextField(), gc);136 pnl.add(tfProxyHttpHost, gc); 137 137 138 138 gc.gridy = 1; … … 144 144 gc.gridx = 1; 145 145 gc.weightx = 1.0; 146 pnl.add(tfProxyHttpPort = new JosmTextField(5), gc);146 pnl.add(tfProxyHttpPort, gc); 147 147 tfProxyHttpPort.setMinimumSize(tfProxyHttpPort.getPreferredSize()); 148 148 … … 164 164 gc.gridx = 1; 165 165 gc.weightx = 1.0; 166 pnl.add(tfProxyHttpUser = new JosmTextField(20), gc);166 pnl.add(tfProxyHttpUser, gc); 167 167 tfProxyHttpUser.setMinimumSize(tfProxyHttpUser.getPreferredSize()); 168 168 … … 174 174 gc.gridx = 1; 175 175 gc.weightx = 1.0; 176 pnl.add(tfProxyHttpPassword = new JosmPasswordField(20), gc);176 pnl.add(tfProxyHttpPassword, gc); 177 177 tfProxyHttpPassword.setMinimumSize(tfProxyHttpPassword.getPreferredSize()); 178 178 … … 209 209 gc.gridx = 1; 210 210 gc.weightx = 1.0; 211 pnl.add(tfProxySocksHost = new JosmTextField(20), gc);211 pnl.add(tfProxySocksHost, gc); 212 212 213 213 gc.gridy = 1; … … 219 219 gc.gridx = 1; 220 220 gc.weightx = 1.0; 221 pnl.add(tfProxySocksPort = new JosmTextField(5), gc);221 pnl.add(tfProxySocksPort, gc); 222 222 tfProxySocksPort.setMinimumSize(tfProxySocksPort.getPreferredSize()); 223 223 … … 290 290 gc.weightx = 1.0; 291 291 gc.weighty = 0.0; 292 pnl.add(pnlHttpProxyConfigurationPanel = buildHttpProxyConfigurationPanel(), gc); 292 pnlHttpProxyConfigurationPanel = buildHttpProxyConfigurationPanel(); 293 pnl.add(pnlHttpProxyConfigurationPanel, gc); 293 294 294 295 // radio button SOCKS proxy … … 309 310 gc.weightx = 1.0; 310 311 gc.weighty = 0.0; 311 pnl.add(pnlSocksProxyConfigurationPanel = buildSocksProxyConfigurationPanel(), gc); 312 pnlSocksProxyConfigurationPanel = buildSocksProxyConfigurationPanel(); 313 pnl.add(pnlSocksProxyConfigurationPanel, gc); 312 314 313 315 return pnl;
Note:
See TracChangeset
for help on using the changeset viewer.