Changeset 10179 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
- Timestamp:
- 2016-05-11T02:44:10+02:00 (8 years ago)
- File:
-
- 1 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);
Note:
See TracChangeset
for help on using the changeset viewer.