Changeset 17598 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2021-03-20T14:00:10+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java
r14153 r17598 9 9 import java.awt.FlowLayout; 10 10 import java.awt.Font; 11 import java.awt.GridBagConstraints;12 11 import java.awt.GridBagLayout; 13 import java.awt.Insets;14 12 import java.awt.event.ActionEvent; 15 13 import java.awt.event.ComponentAdapter; … … 48 46 import org.openstreetmap.josm.spi.preferences.Config; 49 47 import org.openstreetmap.josm.tools.CheckParameterUtil; 48 import org.openstreetmap.josm.tools.GBC; 50 49 import org.openstreetmap.josm.tools.ImageProvider; 51 50 import org.openstreetmap.josm.tools.InputMapUtils; … … 112 111 JPanel pnl = new JPanel(new GridBagLayout()); 113 112 pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 114 GridBagConstraints gc = new GridBagConstraints();115 116 // the oauth logo in the header117 gc.anchor = GridBagConstraints.NORTHWEST;118 gc.fill = GridBagConstraints.HORIZONTAL;119 gc.weightx = 1.0;120 gc.gridwidth = 2;121 ImageProvider logoProv = new ImageProvider("oauth", "oauth-logo").setMaxHeight(100);122 JLabel lbl = new JLabel(logoProv.get());123 lbl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));124 lbl.setOpaque(true);125 pnl.add(lbl, gc);126 113 127 114 // OAuth in a nutshell ... 128 gc.gridy = 1;129 gc.insets = new Insets(5, 0, 0, 5);130 115 HtmlPanel pnlMessage = new HtmlPanel(); 131 116 pnlMessage.setText("<html><body>" … … 135 120 ); 136 121 pnlMessage.enableClickableHyperlinks(); 137 pnl.add(pnlMessage, gc);122 pnl.add(pnlMessage, GBC.eol().fill(GBC.HORIZONTAL)); 138 123 139 124 // the authorisation procedure 140 gc.gridy = 2; 141 gc.gridwidth = 1; 142 gc.weightx = 0.0; 143 lbl = new JLabel(tr("Please select an authorization procedure: ")); 125 JLabel lbl = new JLabel(tr("Please select an authorization procedure: ")); 144 126 lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN)); 145 pnl.add(lbl, gc); 146 147 gc.gridx = 1; 148 gc.gridwidth = 1; 149 gc.weightx = 1.0; 150 pnl.add(cbAuthorisationProcedure, gc); 127 pnl.add(lbl, GBC.std()); 128 129 pnl.add(cbAuthorisationProcedure, GBC.eol().fill(GBC.HORIZONTAL)); 151 130 cbAuthorisationProcedure.addItemListener(new AuthorisationProcedureChangeListener()); 152 131 lbl.setLabelFor(cbAuthorisationProcedure); 153 132 154 133 if (!Config.getUrls().getDefaultOsmApiUrl().equals(apiUrl)) { 155 gc.gridy = 3;156 gc.gridwidth = 2;157 gc.gridx = 0;158 134 final HtmlPanel pnlWarning = new HtmlPanel(); 159 135 final HTMLEditorKit kit = (HTMLEditorKit) pnlWarning.getEditorPane().getEditorKit(); … … 168 144 + "</p>" 169 145 + "</body></html>"); 170 pnl.add(pnlWarning, gc);146 pnl.add(pnlWarning, GBC.eop().fill()); 171 147 } 172 148 … … 206 182 207 183 setTitle(tr("Get an Access Token for ''{0}''", apiUrl)); 208 this.setMinimumSize(new Dimension(500, 400));184 this.setMinimumSize(new Dimension(500, 300)); 209 185 210 186 pnlFullyAutomaticAuthorisationUI = new FullyAutomaticAuthorizationUI(apiUrl, executor);
Note:
See TracChangeset
for help on using the changeset viewer.