Changeset 17314 in josm for trunk/src/org
- Timestamp:
- 2020-11-16T16:45:58+01:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r17237 r17314 2 2 package org.openstreetmap.josm.gui.preferences.display; 3 3 4 import static java.awt.GridBagConstraints.BOTH; 5 import static java.awt.GridBagConstraints.HORIZONTAL; 4 6 import static org.openstreetmap.josm.tools.I18n.tr; 5 7 … … 48 50 import org.openstreetmap.josm.gui.layer.gpx.GpxDrawHelper; 49 51 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 50 import org.openstreetmap.josm.gui.preferences. DefaultTabPreferenceSetting;52 import org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting; 51 53 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 52 54 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; … … 59 61 import org.openstreetmap.josm.tools.ColorHelper; 60 62 import org.openstreetmap.josm.tools.GBC; 63 import org.openstreetmap.josm.tools.I18n; 61 64 import org.openstreetmap.josm.tools.ImageProvider; 62 import org.openstreetmap.josm.tools.I18n;63 65 64 66 /** … … 68 70 * @see NamedColorProperty 69 71 */ 70 public class ColorPreference extends DefaultTabPreferenceSetting implements ListSelectionListener, TableModelListener {72 public class ColorPreference extends ExtensibleTabPreferenceSetting implements ListSelectionListener, TableModelListener { 71 73 72 74 /** … … 370 372 JPanel panel = new JPanel(new GridBagLayout()); 371 373 panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 372 panel.add(colorFilter, GBC.eol().fill( GBC.HORIZONTAL));374 panel.add(colorFilter, GBC.eol().fill(HORIZONTAL)); 373 375 JScrollPane scrollpane = new JScrollPane(colors); 374 376 scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 375 panel.add(scrollpane, GBC.eol().fill( GBC.BOTH));377 panel.add(scrollpane, GBC.eol().fill(BOTH)); 376 378 JPanel buttonPanel = new JPanel(new GridBagLayout()); 377 panel.add(buttonPanel, GBC.eol().insets(5, 0, 5, 5).fill( GBC.HORIZONTAL));378 buttonPanel.add(Box.createHorizontalGlue(), GBC.std().fill( GBC.HORIZONTAL));379 panel.add(buttonPanel, GBC.eol().insets(5, 0, 5, 5).fill(HORIZONTAL)); 380 buttonPanel.add(Box.createHorizontalGlue(), GBC.std().fill(HORIZONTAL)); 379 381 buttonPanel.add(colorEdit, GBC.std().insets(0, 5, 0, 0)); 380 382 buttonPanel.add(defaultSet, GBC.std().insets(5, 5, 5, 0)); … … 382 384 buttonPanel.add(remove, GBC.std().insets(0, 5, 0, 0)); 383 385 384 createPreferenceTabWithScrollPane(gui, panel); 386 getTabPane().addTab(tr("Colors"), panel); 387 super.addGui(gui); 385 388 } 386 389 -
trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java
r17311 r17314 5 5 import static org.openstreetmap.josm.tools.I18n.trc; 6 6 7 import javax.swing.JTabbedPane;8 9 7 import org.openstreetmap.josm.gui.help.HelpUtil; 10 import org.openstreetmap.josm.gui.preferences. DefaultTabPreferenceSetting;8 import org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting; 11 9 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 12 10 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 13 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;14 import org.openstreetmap.josm.tools.GBC;15 11 16 12 /** … … 18 14 * @since 4969 19 15 */ 20 public final class DisplayPreference extends DefaultTabPreferenceSetting {16 public final class DisplayPreference extends ExtensibleTabPreferenceSetting { 21 17 22 18 /** … … 32 28 private DisplayPreference() { 33 29 super(/* ICON(preferences/) */ "display", trc("gui", "Display"), 34 tr("Various settings that influence the visual representation of the whole program."), false , new JTabbedPane());30 tr("Various settings that influence the visual representation of the whole program."), false); 35 31 } 36 32 … … 38 34 public boolean ok() { 39 35 return false; 40 }41 42 @Override43 public void addGui(PreferenceTabbedPane gui) {44 gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH));45 36 } 46 37 -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r17227 r17314 2 2 package org.openstreetmap.josm.gui.preferences.imagery; 3 3 4 import static java.awt.GridBagConstraints.BOTH; 5 import static java.awt.GridBagConstraints.HORIZONTAL; 4 6 import static org.openstreetmap.josm.tools.I18n.tr; 5 7 … … 9 11 import java.awt.Font; 10 12 import java.awt.GraphicsEnvironment; 11 import java.awt.GridBagConstraints;12 13 import java.awt.GridBagLayout; 13 14 import java.awt.event.MouseEvent; … … 36 37 import org.openstreetmap.josm.gui.download.DownloadDialog; 37 38 import org.openstreetmap.josm.gui.help.HelpUtil; 38 import org.openstreetmap.josm.gui.preferences. DefaultTabPreferenceSetting;39 import org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting; 39 40 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 40 41 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; … … 50 51 * @since 3715 51 52 */ 52 public final class ImageryPreference extends DefaultTabPreferenceSetting {53 public final class ImageryPreference extends ExtensibleTabPreferenceSetting { 53 54 54 55 private ImageryProvidersPanel imageryProviders; … … 72 73 private ImageryPreference() { 73 74 super(/* ICON(preferences/) */ "imagery", tr("Imagery"), 74 tr("Modify list of imagery layers displayed in the Imagery menu"), 75 false, new JTabbedPane()); 75 tr("Modify list of imagery layers displayed in the Imagery menu"), false); 76 76 } 77 77 … … 85 85 lbl.setLabelFor(section); 86 86 p.add(lbl, GBC.std()); 87 p.add(new JSeparator(), GBC.eol().fill( GBC.HORIZONTAL).insets(5, 0, 0, 0));87 p.add(new JSeparator(), GBC.eol().fill(HORIZONTAL).insets(5, 0, 0, 0)); 88 88 p.add(section, gbc.insets(20, 5, 0, 10)); 89 89 } … … 94 94 95 95 addSettingsSection(p, tr("Common Settings"), commonSettings); 96 addSettingsSection(p, tr("WMS Settings"), wmsSettings, 97 GBC.eol().fill(GBC.HORIZONTAL)); 98 addSettingsSection(p, tr("TMS Settings"), tmsSettings, 99 GBC.eol().fill(GBC.HORIZONTAL)); 100 101 p.add(new JPanel(), GBC.eol().fill(GBC.BOTH)); 96 addSettingsSection(p, tr("WMS Settings"), wmsSettings, GBC.eol().fill(HORIZONTAL)); 97 addSettingsSection(p, tr("TMS Settings"), tmsSettings, GBC.eol().fill(HORIZONTAL)); 98 99 p.add(new JPanel(), GBC.eol().fill(BOTH)); 102 100 return GuiHelper.setDefaultIncrement(new JScrollPane(p)); 103 101 } 104 102 105 103 @Override 106 public void addGui(final PreferenceTabbedPane gui) { 107 JPanel p = gui.createPreferenceTab(this); 104 public void addGui(PreferenceTabbedPane gui) { 108 105 JTabbedPane pane = getTabPane(); 109 106 layerInfo = new ImageryLayerInfo(ImageryLayerInfo.instance); … … 114 111 pane.addTab(tr("Cache"), cacheSettingsPanel); 115 112 loadSettings(); 116 p.add(pane, GBC.std().fill(GBC.BOTH));113 super.addGui(gui); 117 114 } 118 115 … … 202 199 TableHelper.setFont(list, getClass()); 203 200 JScrollPane scroll = new JScrollPane(list); 204 add(scroll, GBC.eol().fill( GridBagConstraints.BOTH));201 add(scroll, GBC.eol().fill(BOTH)); 205 202 scroll.setPreferredSize(new Dimension(200, 200)); 206 203 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java
r17229 r17314 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import javax.swing.JTabbedPane;7 8 6 import org.openstreetmap.josm.gui.help.HelpUtil; 9 import org.openstreetmap.josm.gui.preferences. DefaultTabPreferenceSetting;7 import org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting; 10 8 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 11 9 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 12 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;13 import org.openstreetmap.josm.tools.GBC;14 10 15 11 /** 16 12 * Map preferences, including map paint styles, tagging presets and autosave sub-preferences. 17 13 */ 18 public final class MapPreference extends DefaultTabPreferenceSetting {14 public final class MapPreference extends ExtensibleTabPreferenceSetting { 19 15 20 16 /** … … 30 26 private MapPreference() { 31 27 super(/* ICON(preferences/) */ "map", tr("Map"), 32 tr("Settings for the map projection and data interpretation."), false , new JTabbedPane());28 tr("Settings for the map projection and data interpretation."), false); 33 29 } 34 30 … … 36 32 public boolean ok() { 37 33 return false; 38 }39 40 @Override41 public void addGui(PreferenceTabbedPane gui) {42 gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH));43 34 } 44 35 -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r17036 r17314 2 2 package org.openstreetmap.josm.gui.preferences.plugin; 3 3 4 import static java.awt.GridBagConstraints.HORIZONTAL; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import static org.openstreetmap.josm.tools.I18n.trc; … … 50 51 import org.openstreetmap.josm.gui.MainApplication; 51 52 import org.openstreetmap.josm.gui.help.HelpUtil; 52 import org.openstreetmap.josm.gui.preferences. DefaultTabPreferenceSetting;53 import org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting; 53 54 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 54 55 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 55 56 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 56 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.PreferencePanel;57 57 import org.openstreetmap.josm.gui.util.GuiHelper; 58 58 import org.openstreetmap.josm.gui.widgets.FilterField; … … 71 71 * @since 168 72 72 */ 73 public final class PluginPreference extends DefaultTabPreferenceSetting {73 public final class PluginPreference extends ExtensibleTabPreferenceSetting { 74 74 75 75 /** … … 94 94 95 95 private PluginPreference() { 96 super(/* ICON(preferences/) */ "plugin", tr("Plugins"), tr("Configure available plugins."), false , new JTabbedPane());96 super(/* ICON(preferences/) */ "plugin", tr("Plugins"), tr("Configure available plugins."), false); 97 97 } 98 98 … … 247 247 } 248 248 249 private JTabbedPane buildContentPane() { 249 @Override 250 public void addGui(final PreferenceTabbedPane gui) { 250 251 JTabbedPane pane = getTabPane(); 251 252 pnlPluginUpdatePolicy = new PluginUpdatePolicyPanel(); 252 253 pane.addTab(tr("Plugins"), buildPluginListPanel()); 253 254 pane.addTab(tr("Plugin update policy"), pnlPluginUpdatePolicy); 254 return pane; 255 } 256 257 @Override 258 public void addGui(final PreferenceTabbedPane gui) { 259 GridBagConstraints gc = new GridBagConstraints(); 260 gc.weightx = 1.0; 261 gc.weighty = 1.0; 262 gc.anchor = GridBagConstraints.NORTHWEST; 263 gc.fill = GridBagConstraints.BOTH; 264 PreferencePanel plugins = gui.createPreferenceTab(this); 265 plugins.add(buildContentPane(), gc); 255 super.addGui(gui); 266 256 readLocalPluginInformation(); 267 257 pluginPreferencesActivated = true; … … 585 575 } 586 576 } 587 }), GBC.eol().fill( GBC.HORIZONTAL));577 }), GBC.eol().fill(HORIZONTAL)); 588 578 buttons.add(new JButton(new AbstractAction(tr("Edit")) { 589 579 @Override … … 611 601 } 612 602 } 613 }), GBC.eol().fill( GBC.HORIZONTAL));603 }), GBC.eol().fill(HORIZONTAL)); 614 604 buttons.add(new JButton(new AbstractAction(tr("Delete")) { 615 605 @Override … … 626 616 model.removeElement(list.getSelectedValue()); 627 617 } 628 }), GBC.eol().fill( GBC.HORIZONTAL));618 }), GBC.eol().fill(HORIZONTAL)); 629 619 add(buttons, GBC.eol()); 630 620 } -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreference.java
r13431 r17314 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import javax.swing.JTabbedPane;7 8 6 import org.openstreetmap.josm.gui.help.HelpUtil; 9 import org.openstreetmap.josm.gui.preferences. DefaultTabPreferenceSetting;7 import org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting; 10 8 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 11 9 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 12 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;13 import org.openstreetmap.josm.tools.GBC;14 10 15 11 /** … … 18 14 * @author frsantos 19 15 */ 20 public final class ValidatorPreference extends DefaultTabPreferenceSetting {16 public final class ValidatorPreference extends ExtensibleTabPreferenceSetting { 21 17 22 18 /** … … 32 28 private ValidatorPreference() { 33 29 super(/* ICON(preferences/) */ "validator", tr("Data validator"), 34 tr("An OSM data validator that checks for common errors made by users and editor programs."), 35 false, new JTabbedPane()); 36 } 37 38 @Override 39 public void addGui(PreferenceTabbedPane gui) { 40 gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH)); 30 tr("An OSM data validator that checks for common errors made by users and editor programs."), false); 41 31 } 42 32
Note:
See TracChangeset
for help on using the changeset viewer.