Changeset 17768 in josm for trunk/src/org/openstreetmap/josm/gui/preferences
- Timestamp:
- 2021-04-13T18:05:39+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences
- Files:
-
- 5 edited
-
advanced/AdvancedPreference.java (modified) (3 diffs)
-
display/ColorPreference.java (modified) (1 diff)
-
plugin/PluginPreference.java (modified) (3 diffs)
-
projection/CodeSelectionPanel.java (modified) (3 diffs)
-
shortcut/PrefJPanel.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r17713 r17768 27 27 import javax.swing.JButton; 28 28 import javax.swing.JFileChooser; 29 import javax.swing.JLabel;30 29 import javax.swing.JMenu; 31 30 import javax.swing.JOptionPane; … … 54 53 import org.openstreetmap.josm.gui.util.GuiHelper; 55 54 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser; 55 import org.openstreetmap.josm.gui.widgets.FilterField; 56 56 import org.openstreetmap.josm.gui.widgets.JosmTextField; 57 57 import org.openstreetmap.josm.spi.preferences.Config; … … 168 168 final JPanel txtFilterPanel = new JPanel(new GridBagLayout()); 169 169 p.add(txtFilterPanel, GBC.eol().fill(GBC.HORIZONTAL)); 170 txtFilter = new JosmTextField(); 171 JLabel lbFilter = new JLabel(tr("Search:")); 172 lbFilter.setLabelFor(txtFilter); 173 txtFilterPanel.add(lbFilter, GBC.std().insets(0, 0, 5, 0)); 174 txtFilterPanel.add(txtFilter, GBC.eol().fill(GBC.HORIZONTAL)); 170 txtFilter = new FilterField(); 171 txtFilterPanel.add(txtFilter, GBC.eol().insets(0, 0, 0, 5).fill(GBC.HORIZONTAL)); 175 172 txtFilter.getDocument().addDocumentListener(DocumentAdapter.create(ignore -> applyFilter())); 176 173 readPreferences(Preferences.main()); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r17648 r17768 373 373 JPanel panel = new JPanel(new GridBagLayout()); 374 374 panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 375 panel.add(colorFilter, GBC.eol().fill(HORIZONTAL)); 375 panel.add(colorFilter, GBC.eol().insets(0, 0, 0, 5).fill(HORIZONTAL)); 376 376 JScrollPane scrollpane = new JScrollPane(colors); 377 377 scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r17332 r17768 9 9 import java.awt.BorderLayout; 10 10 import java.awt.Component; 11 import java.awt.GridBagConstraints;12 11 import java.awt.GridBagLayout; 13 12 import java.awt.GridLayout; 14 import java.awt.Insets;15 13 import java.awt.event.ActionEvent; 16 14 import java.awt.event.ComponentAdapter; … … 28 26 29 27 import javax.swing.AbstractAction; 30 import javax.swing.BorderFactory;31 28 import javax.swing.ButtonGroup; 32 29 import javax.swing.DefaultListModel; … … 167 164 private JPanel buildSearchFieldPanel() { 168 165 JPanel pnl = new JPanel(new GridBagLayout()); 169 pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));170 GridBagConstraints gc = new GridBagConstraints();171 172 gc.anchor = GridBagConstraints.NORTHWEST;173 gc.fill = HORIZONTAL;174 gc.weightx = 0.0;175 gc.insets = new Insets(0, 0, 0, 3);176 166 pnl.add(GBC.glue(0, 0)); 177 167 178 gc.weightx = 1.0;179 168 ButtonGroup bg = new ButtonGroup(); 180 169 JPanel radios = new JPanel(); 181 addRadioButton(bg, radios, new JRadioButton(trc("plugins", "All"), true), gc, PluginInstallation.ALL); 182 addRadioButton(bg, radios, new JRadioButton(trc("plugins", "Installed")), gc, PluginInstallation.INSTALLED); 183 addRadioButton(bg, radios, new JRadioButton(trc("plugins", "Available")), gc, PluginInstallation.AVAILABLE); 184 pnl.add(radios, gc); 185 186 gc.gridx = 0; 187 gc.weightx = 0.0; 188 pnl.add(new JLabel(tr("Search:")), gc); 189 190 gc.gridx = 1; 191 gc.weightx = 1.0; 170 addRadioButton(bg, radios, new JRadioButton(trc("plugins", "All"), true), PluginInstallation.ALL); 171 addRadioButton(bg, radios, new JRadioButton(trc("plugins", "Installed")), PluginInstallation.INSTALLED); 172 addRadioButton(bg, radios, new JRadioButton(trc("plugins", "Available")), PluginInstallation.AVAILABLE); 173 pnl.add(radios, GBC.eol().fill(HORIZONTAL)); 174 192 175 pnl.add(new FilterField().filter(expr -> { 193 176 model.filterDisplayedPlugins(expr); 194 177 pnlPluginPreferences.refreshView(); 195 }), gc);178 }), GBC.eol().insets(0, 0, 0, 5).fill(HORIZONTAL)); 196 179 return pnl; 197 180 } 198 181 199 private void addRadioButton(ButtonGroup bg, JPanel pnl, JRadioButton rb, GridBagConstraints gc,PluginInstallation value) {182 private void addRadioButton(ButtonGroup bg, JPanel pnl, JRadioButton rb, PluginInstallation value) { 200 183 bg.add(rb); 201 pnl.add(rb, gc);184 pnl.add(rb, GBC.std()); 202 185 rb.addActionListener(e -> { 203 186 model.filterDisplayedPlugins(value); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeSelectionPanel.java
r16960 r17768 23 23 import org.openstreetmap.josm.gui.preferences.projection.CodeProjectionChoice.CodeComparator; 24 24 import org.openstreetmap.josm.gui.util.TableHelper; 25 import org.openstreetmap.josm.gui.widgets.FilterField; 25 26 import org.openstreetmap.josm.gui.widgets.JosmTextField; 26 27 import org.openstreetmap.josm.tools.GBC; … … 32 33 public class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener { 33 34 34 private final JosmTextField filter = new JosmTextField(30);35 private final JosmTextField filter = new FilterField(); 35 36 private final ProjectionCodeModel model = new ProjectionCodeModel(); 36 37 private JTable table; … … 104 105 105 106 this.setLayout(new GridBagLayout()); 106 this.add(filter, GBC.eol().weight(1.0, 0.0)); 107 this.add(filter, GBC.eol().fill(GBC.HORIZONTAL).weight(1.0, 0.0)); 107 108 this.add(scroll, GBC.eol().fill(GBC.HORIZONTAL)); 108 109 } -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r17733 r17768 8 8 import java.awt.Component; 9 9 import java.awt.Dimension; 10 import java.awt.GridBagConstraints;11 10 import java.awt.GridBagLayout; 12 11 import java.awt.GridLayout; 13 import java.awt.Insets;14 12 import java.awt.Toolkit; 15 13 import java.awt.event.KeyEvent; … … 21 19 22 20 import javax.swing.AbstractAction; 23 import javax.swing.BorderFactory;24 21 import javax.swing.BoxLayout; 25 22 import javax.swing.DefaultComboBoxModel; … … 44 41 import org.openstreetmap.josm.gui.widgets.FilterField; 45 42 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 43 import org.openstreetmap.josm.tools.GBC; 46 44 import org.openstreetmap.josm.tools.KeyboardUtils; 47 45 import org.openstreetmap.josm.tools.Logging; … … 251 249 // copied from PluginPreference 252 250 JPanel pnl = new JPanel(new GridBagLayout()); 253 pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 254 GridBagConstraints gc = new GridBagConstraints(); 255 256 gc.anchor = GridBagConstraints.NORTHWEST; 257 gc.fill = GridBagConstraints.HORIZONTAL; 258 gc.weightx = 0.0; 259 gc.insets = new Insets(0, 0, 0, 5); 260 pnl.add(new JLabel(tr("Search:")), gc); 261 262 gc.gridx = 1; 263 gc.weightx = 1.0; 264 pnl.add(filterField, gc); 265 pnl.setMaximumSize(new Dimension(300, 10)); 251 pnl.add(filterField, GBC.eol().insets(0, 0, 0, 5).fill(GBC.HORIZONTAL)); 252 pnl.setMaximumSize(new Dimension(Integer.MAX_VALUE, 10)); 266 253 return pnl; 267 254 }
Note:
See TracChangeset
for help on using the changeset viewer.
