Changeset 4976 in josm for trunk


Ignore:
Timestamp:
2012-02-18T01:17:18+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #7396 - no scroll bar in remote control and audio preferences dialogs

Location:
trunk/src/org/openstreetmap/josm/gui/preferences
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java

    r4968 r4976  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.awt.GridBagLayout;
     7
    68import javax.swing.Box;
    79import javax.swing.JCheckBox;
    810import javax.swing.JLabel;
     11import javax.swing.JPanel;
    912import javax.swing.JTextField;
    1013
    1114import org.openstreetmap.josm.Main;
    12 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.PreferencePanel;
    1315import org.openstreetmap.josm.tools.GBC;
    1416
     
    5456
    5557    public void addGui(PreferenceTabbedPane gui) {
    56         PreferencePanel audio = gui.createPreferenceTab(this);
     58        JPanel audio = new JPanel(new GridBagLayout());
    5759       
    5860        // audioMenuVisible
     
    119121
    120122        audio.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
     123
     124        createPreferenceTabWithScrollPane(gui, audio);
    121125    }
    122126
  • trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java

    r4968 r4976  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.preferences;
     3
     4import javax.swing.JPanel;
     5import javax.swing.JScrollPane;
     6
     7import org.openstreetmap.josm.tools.GBC;
    38
    49public abstract class DefaultTabPreferenceSetting extends DefaultPreferenceSetting implements TabPreferenceSetting {
     
    4651        return title;
    4752    }
     53   
     54    protected final void createPreferenceTabWithScrollPane(PreferenceTabbedPane gui, JPanel panel) {
     55        GBC a = GBC.eol().insets(-5,0,0,0);
     56        a.anchor = GBC.EAST;
     57       
     58        JScrollPane scrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
     59        scrollPane.setBorder(null);
     60
     61        JPanel tab = gui.createPreferenceTab(this);
     62        tab.add(scrollPane, GBC.eol().fill(GBC.BOTH));
     63        tab.add(GBC.glue(0,10), a);
     64    }
    4865}
  • trunk/src/org/openstreetmap/josm/gui/preferences/RemoteControlPreference.java

    r4968 r4976  
    6161    public void addGui(final PreferenceTabbedPane gui) {
    6262
    63         JPanel remote = gui.createPreferenceTab(this);
     63        JPanel remote = new JPanel(new GridBagLayout());
    6464
    6565        remote.add(enableRemoteControl = new JCheckBox(tr("Enable remote control"), RemoteControl.PROP_REMOTECONTROL_ENABLED.get()), GBC.eol());
     
    123123        enableRemoteControl.addActionListener(remoteControlEnabled);
    124124        remoteControlEnabled.actionPerformed(null);
     125        createPreferenceTabWithScrollPane(gui, remote);
    125126    }
    126127
  • trunk/src/org/openstreetmap/josm/gui/preferences/ValidatorPreference.java

    r4968 r4976  
    1313import javax.swing.JLabel;
    1414import javax.swing.JPanel;
    15 import javax.swing.JScrollPane;
    1615
    1716import org.openstreetmap.josm.Main;
     
    114113        }
    115114
    116         JScrollPane testPane = new JScrollPane(testPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    117         testPane.setBorder(null);
    118 
    119         JPanel tab = gui.createPreferenceTab(this);
    120         tab.add(testPane, GBC.eol().fill(GBC.BOTH));
    121         tab.add(GBC.glue(0,10), a);
     115        createPreferenceTabWithScrollPane(gui, testPanel);
    122116    }
    123117
Note: See TracChangeset for help on using the changeset viewer.