Changeset 1053 in josm for trunk/src/org
- Timestamp:
- 2008-10-23T17:27:57+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PreferencesAction.java
r1042 r1053 38 38 public void actionPerformed(ActionEvent e) { 39 39 PreferenceDialog prefDlg = new PreferenceDialog(); 40 prefDlg.setMinimumSize(new Dimension( 300,200));40 prefDlg.setMinimumSize(new Dimension(400,300)); 41 41 JPanel prefPanel = new JPanel(new GridBagLayout()); 42 42 prefPanel.add(prefDlg, GBC.eol().fill(GBC.BOTH)); … … 45 45 JDialog dlg = pane.createDialog(Main.parent, tr("Preferences")); 46 46 dlg.setResizable(true); 47 dlg.setMinimumSize(new Dimension( 400,300));47 dlg.setMinimumSize(new Dimension(500,400)); 48 48 49 49 // if (dlg.getWidth() > 600) -
trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java
r1032 r1053 36 36 37 37 public void addGui(final PreferenceDialog gui) { 38 JPanel p = gui.createPreferenceTab("advanced", tr("Advanced Preferences"), tr("Setting Preference entries directly. Use with caution!")); 38 JPanel p = gui.createPreferenceTab("advanced", tr("Advanced Preferences"), 39 tr("Setting Preference entries directly. Use with caution!"), false); 39 40 40 41 model = new DefaultTableModel(new String[]{tr("Key"), tr("Value")},0) { -
trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
r804 r1053 2 2 package org.openstreetmap.josm.gui.preferences; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.marktr;6 6 7 7 import java.awt.Color; … … 104 104 } 105 105 }; 106 colors.setPreferredSize(new Dimension(200,200)); 106 107 colors.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 107 108 final TableCellRenderer oldColorsRenderer = colors.getDefaultRenderer(Object.class); -
trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
r1048 r1053 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Dimension; 6 7 import java.awt.event.ActionEvent; 7 8 import java.awt.event.ActionListener; … … 33 34 34 35 public void addGui(PreferenceDialog gui) { 35 // drawRawGpsLines 36 gui.display.setPreferredSize(new Dimension(400,600)); 37 // drawRawGpsLines 36 38 drawRawGpsLines.addActionListener(new ActionListener(){ 37 39 public void actionPerformed(ActionEvent e) { -
trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java
r1047 r1053 29 29 // let's try to load additional LookAndFeels and put them into the list 30 30 try { 31 Class Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel"); 31 Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel"); 32 32 Object Oquaqua = Cquaqua.getConstructor((Class[])null).newInstance((Object[])null); 33 33 // no exception? Then Go! -
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r1028 r1053 74 74 if(n instanceof PluginDescription) 75 75 return name.compareToIgnoreCase(((PluginDescription)n).name); 76 else 77 return -1; 76 return -1; 78 77 } 79 78 } … … 107 106 public void addGui(final PreferenceDialog gui) { 108 107 this.gui = gui; 109 plugin = gui.createPreferenceTab("plugin", tr("Plugins"), tr("Configure available plugins.")); 108 plugin = gui.createPreferenceTab("plugin", tr("Plugins"), tr("Configure available plugins."), false); 110 109 JScrollPane pluginPane = new JScrollPane(pluginPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); 111 110 pluginPane.setBorder(null); -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r1042 r1053 6 6 import java.awt.Font; 7 7 import java.awt.GridBagLayout; 8 import java.awt.ScrollPane; 8 9 import java.awt.event.ActionEvent; 9 10 import java.awt.event.ActionListener; … … 13 14 14 15 import javax.swing.BorderFactory; 16 import javax.swing.JComponent; 15 17 import javax.swing.JLabel; 16 18 import javax.swing.JOptionPane; … … 45 47 /** 46 48 * Construct a JPanel for the preference settings. Layout is GridBagLayout 47 * and a centered title label and the description are added. 49 * and a centered title label and the description are added. The panel 50 * will be shown inside a {@link ScrollPane} 48 51 * @param icon The name of the icon. 49 52 * @param title The title of this preference tab. … … 53 56 */ 54 57 public JPanel createPreferenceTab(String icon, String title, String desc) { 55 JPanel p = new JPanel(new GridBagLayout()); 56 p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 57 p.add(new JLabel(title), GBC.eol().anchor(GBC.CENTER).insets(0,5,0,10)); 58 59 JLabel descLabel = new JLabel("<html>"+desc+"</html>"); 60 descLabel.setFont(descLabel.getFont().deriveFont(Font.ITALIC)); 61 p.add(descLabel, GBC.eol().insets(5,0,5,20).fill(GBC.HORIZONTAL)); 62 63 JScrollPane sp = new JScrollPane(p); 64 addTab(null, ImageProvider.get("preferences", icon), sp); 65 setToolTipTextAt(getTabCount()-1, "<html>"+desc+"</html>"); 66 return p; 58 return createPreferenceTab(icon, title, desc, true); 67 59 } 68 60 61 /** 62 * Construct a JPanel for the preference settings. Layout is GridBagLayout 63 * and a centered title label and the description are added. 64 * @param icon The name of the icon. 65 * @param title The title of this preference tab. 66 * @param desc A description in one sentence for this tab. Will be displayed 67 * italic under the title. 68 * @param inScrollPane if <code>true</code> the added tab will show scroll bars 69 * if the panel content is larger than the available space 70 * @return The created panel ready to add other controls. 71 */ 72 public JPanel createPreferenceTab(String icon, String title, String desc, boolean inScrollPane) { 73 JPanel p = new JPanel(new GridBagLayout()); 74 p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 75 p.add(new JLabel(title), GBC.eol().anchor(GBC.CENTER).insets(0,5,0,10)); 76 77 JLabel descLabel = new JLabel("<html>"+desc+"</html>"); 78 descLabel.setFont(descLabel.getFont().deriveFont(Font.ITALIC)); 79 p.add(descLabel, GBC.eol().insets(5,0,5,20).fill(GBC.HORIZONTAL)); 80 81 JComponent tab = p; 82 if (inScrollPane) { 83 JScrollPane sp = new JScrollPane(p); 84 tab = sp; 85 } 86 addTab(null, ImageProvider.get("preferences", icon), tab); 87 setToolTipTextAt(getTabCount()-1, "<html>"+desc+"</html>"); 88 return p; 89 } 69 90 70 91 -
trunk/src/org/openstreetmap/josm/gui/preferences/ProxyPreferences.java
r995 r1053 28 28 29 29 private JCheckBox proxyEnable = new JCheckBox(tr("Enable proxy server")); 30 private JTextField proxyHost = new JTextField( 50);30 private JTextField proxyHost = new JTextField(20); 31 31 private JTextField proxyPort = new JTextField(5); 32 32 private JCheckBox proxyAnonymous = new JCheckBox(tr("Anonymous")); 33 private JTextField proxyUser = new JTextField( 50);34 private JPasswordField proxyPass = new JPasswordField( 50);33 private JTextField proxyUser = new JTextField(20); 34 private JPasswordField proxyPass = new JPasswordField(20); 35 35 36 36 public void addGui(PreferenceDialog gui) { -
trunk/src/org/openstreetmap/josm/gui/preferences/ShortcutPreference.java
r1046 r1053 22 22 // icon original size: 128x128 23 23 // modifications: icon was cropped, then resized 24 JPanel p = gui.createPreferenceTab("shortcuts", tr("Shortcut Preferences"), tr("Changing keyboard shortcuts manually.")); 24 JPanel p = gui.createPreferenceTab("shortcuts", tr("Shortcut Preferences"), 25 tr("Changing keyboard shortcuts manually."), false); 25 26 26 27 prefJPanel prefpanel = new prefJPanel(new scListModel()); -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r999 r1053 197 197 p.add(right); 198 198 199 JPanel panel = gui.createPreferenceTab("toolbar", tr("Toolbar customization"), tr("Customize the elements on the toolbar.")); 199 JPanel panel = gui.createPreferenceTab("toolbar", tr("Toolbar customization"), 200 tr("Customize the elements on the toolbar."), false); 200 201 panel.add(p, GBC.eol().fill(GBC.BOTH)); 201 202 -
trunk/src/org/openstreetmap/josm/gui/preferences/prefJPanel.java
r1047 r1053 8 8 9 9 import static org.openstreetmap.josm.tools.I18n.tr; 10 import javax.swing.table.TableModel; 10 11 11 import java.awt.event.KeyEvent; 12 import java.util.LinkedHashMap; 12 13 import java.util.Map; 13 import java.util.LinkedHashMap; 14 import javax.swing.event.ListSelectionListener; 15 import javax.swing.event.ListSelectionEvent; 16 import javax.swing.ListSelectionModel; 17 import org.openstreetmap.josm.tools.ShortCut; 14 18 15 import javax.swing.JEditorPane; 19 16 import javax.swing.JScrollPane; 17 import javax.swing.ListSelectionModel; 18 import javax.swing.event.ListSelectionEvent; 19 import javax.swing.event.ListSelectionListener; 20 import javax.swing.table.TableModel; 21 20 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.tools.ShortCut; 21 24 22 25 /** … … 247 250 // Would be a nice array if I had done it by hand. But then, it would be finished next year or so... 248 251 modifierTab.setLayout(new java.awt.GridLayout(0, 1)); 252 JScrollPane modifierScroller = new JScrollPane(modifierTab); 249 253 250 254 editGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Edit Shortcuts"))); … … 352 356 bxTer4.setAction(action2); 353 357 354 355 356 prefTabPane.addTab(tr("Modifier Groups"), modifier Tab);358 modifierTab.add(subwindowGroupPane); 359 360 prefTabPane.addTab(tr("Modifier Groups"), modifierScroller); 357 361 358 362 add(prefTabPane);
Note:
See TracChangeset
for help on using the changeset viewer.