Changeset 5429 in josm


Ignore:
Timestamp:
2012-08-11T23:03:55+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #7917 - Control the number of items displayed at once in all comboboxes (20 by default, configurable with gui.combobox.maximum-row-count)

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    r5233 r5429  
    1111import javax.swing.DefaultListCellRenderer;
    1212import javax.swing.Icon;
    13 import javax.swing.JComboBox;
    1413import javax.swing.JLabel;
    1514import javax.swing.JList;
     
    2019import org.openstreetmap.josm.gui.ExtendedDialog;
    2120import org.openstreetmap.josm.gui.layer.Layer;
     21import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2222import org.openstreetmap.josm.tools.GBC;
    2323import org.openstreetmap.josm.tools.Shortcut;
     
    5858
    5959    protected Layer askTargetLayer(List<Layer> targetLayers) {
    60         JComboBox layerList = new JComboBox();
     60        JosmComboBox layerList = new JosmComboBox();
    6161        layerList.setRenderer(new LayerListCellRenderer());
    6262        layerList.setModel(new DefaultComboBoxModel(targetLayers.toArray()));
  • trunk/src/org/openstreetmap/josm/data/projection/Lambert.java

    r5236 r5429  
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
    5 
    6 import java.awt.GridBagLayout;
    7 import java.awt.event.ActionListener;
    8 import java.util.Collection;
    9 import java.util.Collections;
    10 
    11 import javax.swing.JComboBox;
    12 import javax.swing.JLabel;
    13 import javax.swing.JPanel;
    145
    156import org.openstreetmap.josm.data.Bounds;
     
    1910import org.openstreetmap.josm.data.projection.proj.LambertConformalConic;
    2011import org.openstreetmap.josm.data.projection.proj.ProjParameters;
    21 import org.openstreetmap.josm.tools.GBC;
    22 import org.openstreetmap.josm.tools.ImageProvider;
    2312
    2413/**
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r5335 r5429  
    2929import javax.swing.JButton;
    3030import javax.swing.JCheckBox;
    31 import javax.swing.JComboBox;
    3231import javax.swing.JLabel;
    3332import javax.swing.JPanel;
     
    4443import org.openstreetmap.josm.data.osm.Way;
    4544import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     45import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    4646import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTable;
    4747import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    252252        p.setLayout(new FlowLayout(FlowLayout.LEFT));
    253253        p.add(new JLabel(tr("Compare ")));
    254         JComboBox cbComparePair =new JComboBox(model.getComparePairListModel());
     254        JosmComboBox cbComparePair = new JosmComboBox(model.getComparePairListModel());
    255255        cbComparePair.setRenderer(new ComparePairListCellRenderer());
    256256        p.add(cbComparePair);
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java

    r5266 r5429  
    1313import javax.swing.AbstractCellEditor;
    1414import javax.swing.DefaultComboBoxModel;
    15 import javax.swing.JComboBox;
    1615import javax.swing.JLabel;
    1716import javax.swing.JList;
     
    2019import javax.swing.UIManager;
    2120import javax.swing.table.TableCellEditor;
     21
     22import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2223
    2324/**
     
    4041
    4142    /** the combo box used as editor */
    42     private JComboBox editor;
     43    private JosmComboBox editor;
    4344    private DefaultComboBoxModel editorModel;
    4445    private CopyOnWriteArrayList<NavigationListener> listeners;
     
    6869    public MultiValueCellEditor() {
    6970        editorModel = new DefaultComboBoxModel();
    70         editor = new JComboBox(editorModel) {
     71        editor = new JosmComboBox(editorModel) {
    7172            @Override
    7273            public void processKeyEvent(KeyEvent e) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRenderer.java

    r5266 r5429  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.Color;
    76import java.awt.Component;
    87import java.awt.Font;
     
    109import javax.swing.DefaultComboBoxModel;
    1110import javax.swing.ImageIcon;
    12 import javax.swing.JComboBox;
    1311import javax.swing.JLabel;
    1412import javax.swing.JTable;
     
    1715
    1816import org.openstreetmap.josm.gui.conflict.ConflictColors;
     17import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    1918import org.openstreetmap.josm.tools.ImageProvider;
    2019
     
    2827    private ImageIcon iconUndecided;
    2928    private DefaultComboBoxModel model;
    30     private JComboBox cbDecisionRenderer;
     29    private JosmComboBox cbDecisionRenderer;
    3130
    3231    public MultiValueCellRenderer() {
     
    3433        iconDecided = ImageProvider.get("dialogs/conflict", "tagconflictresolved");
    3534        iconUndecided = ImageProvider.get("dialogs/conflict", "tagconflictunresolved");
    36         cbDecisionRenderer = new JComboBox(model = new DefaultComboBoxModel());
     35        cbDecisionRenderer = new JosmComboBox(model = new DefaultComboBoxModel());
    3736    }
    3837
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java

    r3083 r5429  
    66
    77import javax.swing.DefaultComboBoxModel;
    8 import javax.swing.JComboBox;
    98import javax.swing.JTable;
    109import javax.swing.event.CellEditorListener;
     
    1211
    1312import org.openstreetmap.josm.gui.util.TableCellEditorSupport;
     13import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    1414
    15 public class RelationMemberConflictDecisionEditor extends JComboBox implements TableCellEditor {
     15public class RelationMemberConflictDecisionEditor extends JosmComboBox implements TableCellEditor {
    1616
    1717    public RelationMemberConflictDecisionEditor() {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionRenderer.java

    r4072 r5429  
    66
    77import javax.swing.DefaultComboBoxModel;
    8 import javax.swing.JComboBox;
    98import javax.swing.JLabel;
    109import javax.swing.JList;
     
    1413import javax.swing.table.TableCellRenderer;
    1514
     15import org.openstreetmap.josm.gui.widgets.JosmComboBox;
     16
    1617public class RelationMemberConflictDecisionRenderer extends JLabel implements TableCellRenderer, ListCellRenderer{
    1718
    18     private JComboBox cbDecisionTypes;
     19    private JosmComboBox cbDecisionTypes;
    1920
    2021    protected void resetTableRenderer() {
     
    3435    public RelationMemberConflictDecisionRenderer() {
    3536        DefaultComboBoxModel model = new DefaultComboBoxModel();
    36         cbDecisionTypes = new JComboBox(model);
     37        cbDecisionTypes = new JosmComboBox(model);
    3738        model.addElement(RelationMemberConflictDecisionType.KEEP);
    3839        model.addElement(RelationMemberConflictDecisionType.REMOVE);
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTable.java

    r3083 r5429  
    66
    77import javax.swing.AbstractAction;
    8 import javax.swing.JComboBox;
    98import javax.swing.JComponent;
    109import javax.swing.JTable;
    1110import javax.swing.KeyStroke;
    1211import javax.swing.ListSelectionModel;
     12
     13import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    1314
    1415public class RelationMemberConflictResolverTable extends JTable implements MultiValueCellEditor.NavigationListener {
     
    3940        getActionMap().put("selectPreviousColumnCell", selectPreviousColumnCellAction);
    4041
    41         setRowHeight((int)new JComboBox().getPreferredSize().getHeight());
     42        setRowHeight((int)new JosmComboBox().getPreferredSize().getHeight());
    4243    }
    4344
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverTable.java

    r3083 r5429  
    66
    77import javax.swing.AbstractAction;
    8 import javax.swing.JComboBox;
    98import javax.swing.JComponent;
    109import javax.swing.JTable;
    1110import javax.swing.KeyStroke;
    1211import javax.swing.ListSelectionModel;
     12
     13import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    1314
    1415public class TagConflictResolverTable extends JTable implements MultiValueCellEditor.NavigationListener {
     
    4142        ((MultiValueCellEditor)getColumnModel().getColumn(2).getCellEditor()).addNavigationListeners(this);
    4243
    43         setRowHeight((int)new JComboBox().getPreferredSize().getHeight());
     44        setRowHeight((int)new JosmComboBox().getPreferredSize().getHeight());
    4445    }
    4546
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r5428 r5429  
    5353import javax.swing.DefaultListCellRenderer;
    5454import javax.swing.ImageIcon;
    55 import javax.swing.JComboBox;
    5655import javax.swing.JComponent;
    5756import javax.swing.JDialog;
     
    114113import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
    115114import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
     115import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    116116import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
    117117import org.openstreetmap.josm.tools.GBC;
     
    711711    private final JTable membershipTable = new JTable(membershipData);
    712712
    713     public JComboBox taggingPresets = new JComboBox();
     713    public JosmComboBox taggingPresets = new JosmComboBox();
    714714
    715715    /**
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r4422 r5429  
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.tools.I18n.trc;
    65
    76import java.awt.BorderLayout;
     
    2928import javax.swing.DefaultListSelectionModel;
    3029import javax.swing.JButton;
    31 import javax.swing.JComboBox;
    3230import javax.swing.JLabel;
    3331import javax.swing.JPanel;
     
    5351import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    5452import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
     53import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    5554import org.openstreetmap.josm.io.OsmTransferException;
    5655import org.openstreetmap.josm.tools.GBC;
     
    7574        //new Server("Namefinder","http://gazetteer.openstreetmap.org/namefinder/search.xml?find=",tr("Near"),trc("placeselection", "Zoom"))
    7675    };
    77     private final JComboBox server = new JComboBox(servers);
     76    private final JosmComboBox server = new JosmComboBox(servers);
    7877
    7978    private static class Server {
     
    103102        lpanel.add(server);
    104103        String s = Main.pref.get("namefinder.server", servers[0].name);
    105         for(int i = 0; i < servers.length; ++i) {
    106             if(servers[i].name.equals(s)) {
     104        for (int i = 0; i < servers.length; ++i) {
     105            if (servers[i].name.equals(s)) {
    107106                server.setSelectedIndex(i);
    108107            }
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    r5266 r5429  
    1818import javax.swing.JButton;
    1919import javax.swing.JCheckBox;
    20 import javax.swing.JComboBox;
    2120import javax.swing.JPanel;
    2221import javax.swing.JRadioButton;
     
    2827import org.openstreetmap.josm.data.osm.ChangesetCache;
    2928import org.openstreetmap.josm.gui.JMultilineLabel;
     29import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    3030import org.openstreetmap.josm.tools.CheckParameterUtil;
    3131import org.openstreetmap.josm.tools.ImageProvider;
     
    5454    private JRadioButton rbUseNew;
    5555    private JRadioButton rbExisting;
    56     private JComboBox cbOpenChangesets;
     56    private JosmComboBox cbOpenChangesets;
    5757    private JButton btnRefresh;
    5858    private JButton btnClose;
     
    108108        model = new OpenChangesetComboBoxModel();
    109109        ChangesetCache.getInstance().addChangesetCacheListener(model);
    110         cbOpenChangesets = new JComboBox(model);
     110        cbOpenChangesets = new JosmComboBox(model);
    111111        cbOpenChangesets.setToolTipText(tr("Select an open changeset"));
    112112        cbOpenChangesets.setRenderer(new ChangesetCellRenderer());
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r5395 r5429  
    4444import javax.swing.DefaultComboBoxModel;
    4545import javax.swing.Icon;
    46 import javax.swing.JComboBox;
    4746import javax.swing.JComponent;
    4847import javax.swing.JFileChooser;
     
    9695import org.openstreetmap.josm.gui.progress.ProgressTaskIds;
    9796import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     97import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    9898import org.openstreetmap.josm.io.JpgImporter;
    9999import org.openstreetmap.josm.io.OsmTransferException;
     
    13961396            }
    13971397
    1398             JComboBox layerList = new JComboBox();
     1398            JosmComboBox layerList = new JosmComboBox();
    13991399            layerList.setRenderer(new LayerListCellRenderer());
    14001400            layerList.setModel(new DefaultComboBoxModel(targetLayers.toArray()));
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r5242 r5429  
    4545import javax.swing.JButton;
    4646import javax.swing.JCheckBox;
    47 import javax.swing.JComboBox;
    4847import javax.swing.JFileChooser;
    4948import javax.swing.JLabel;
     
    7473import org.openstreetmap.josm.gui.layer.GpxLayer;
    7574import org.openstreetmap.josm.gui.layer.Layer;
     75import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    7676import org.openstreetmap.josm.io.GpxReader;
    7777import org.openstreetmap.josm.tools.ExifReader;
     
    117117    Vector<GpxDataWrapper> gpxLst = new Vector<GpxDataWrapper>();
    118118    JPanel outerPanel;
    119     JComboBox cbGpx;
     119    JosmComboBox cbGpx;
    120120    JTextField tfTimezone;
    121121    JTextField tfOffset;
     
    231231        JLabel lbExifTime;
    232232        JTextField tfGpsTime;
    233         JComboBox cbTimezones;
     233        JosmComboBox cbTimezones;
    234234        ImageDisplay imgDisp;
    235235        JList imgList;
     
    309309            Collections.sort(vtTimezones);
    310310
    311             cbTimezones = new JComboBox(vtTimezones);
     311            cbTimezones = new JosmComboBox(vtTimezones);
    312312
    313313            String tzId = Main.pref.get("geoimage.timezoneid", "");
     
    482482        panelCb.add(new JLabel(tr("GPX track: ")));
    483483
    484         cbGpx = new JComboBox(gpxLst);
     484        cbGpx = new JosmComboBox(gpxLst);
    485485        if (defaultItem != null) {
    486486            cbGpx.setSelectedItem(defaultItem);
  • trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java

    r3083 r5429  
    77
    88import javax.swing.DefaultComboBoxModel;
    9 import javax.swing.JComboBox;
    109import javax.swing.JLabel;
    1110import javax.swing.JList;
     
    1312import javax.swing.UIManager;
    1413
    15 public class AuthorizationProcedureComboBox extends JComboBox {
     14import org.openstreetmap.josm.gui.widgets.JosmComboBox;
     15
     16public class AuthorizationProcedureComboBox extends JosmComboBox {
    1617
    1718    public AuthorizationProcedureComboBox() {
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r4968 r5429  
    1313import javax.swing.ButtonGroup;
    1414import javax.swing.JCheckBox;
    15 import javax.swing.JComboBox;
    1615import javax.swing.JLabel;
    1716import javax.swing.JOptionPane;
     
    2726import org.openstreetmap.josm.gui.layer.markerlayer.Marker.TemplateEntryProperty;
    2827import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener;
     28import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2929import org.openstreetmap.josm.tools.GBC;
    3030import org.openstreetmap.josm.tools.template_engine.ParseError;
     
    5858    private JRadioButton colorTypeNone = new JRadioButton(tr("Single Color (can be customized for named layers)"));
    5959    private JRadioButton colorTypeGlobal  = new JRadioButton(tr("Use global settings"));
    60     private JComboBox colorTypeVelocityTune = new JComboBox(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")});
     60    private JosmComboBox colorTypeVelocityTune = new JosmComboBox(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")});
    6161    private JCheckBox makeAutoMarkers = new JCheckBox(tr("Create markers when reading GPX"));
    6262    private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows"));
     
    6464    private JTextField drawGpsArrowsMinDist = new JTextField(8);
    6565    private JCheckBox colorDynamic = new JCheckBox(tr("Dynamic color range based on data limits"));
    66     private JComboBox waypointLabel = new JComboBox(LABEL_PATTERN_DESC);
     66    private JosmComboBox waypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
    6767    private JTextField waypointLabelPattern = new JTextField();
    68     private JComboBox audioWaypointLabel = new JComboBox(LABEL_PATTERN_DESC);
     68    private JosmComboBox audioWaypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
    6969    private JTextField audioWaypointLabelPattern = new JTextField();
    7070
     
    414414    }
    415415
    416     private void updateWaypointLabelCombobox(JComboBox cb, JTextField tf, TemplateEntryProperty property) {
     416    private void updateWaypointLabelCombobox(JosmComboBox cb, JTextField tf, TemplateEntryProperty property) {
    417417        String labelPattern = property.getAsString();
    418418        boolean found = false;
     
    431431    }
    432432
    433     private void updateWaypointPattern(JComboBox cb, JTextField tf) {
     433    private void updateWaypointPattern(JosmComboBox cb, JTextField tf) {
    434434        if (cb.getSelectedIndex() == WAYPOINT_LABEL_CUSTOM) {
    435435            tf.setEnabled(true);
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r4968 r5429  
    1111import javax.swing.DefaultListCellRenderer;
    1212import javax.swing.JCheckBox;
    13 import javax.swing.JComboBox;
    1413import javax.swing.JLabel;
    1514import javax.swing.JList;
     
    2726import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
    2827import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
     28import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2929import org.openstreetmap.josm.tools.GBC;
    3030
     
    4040     * ComboBox with all look and feels.
    4141     */
    42     private JComboBox lafCombo;
     42    private JosmComboBox lafCombo;
    4343    public JPanel panel;
    4444    private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup"));
     
    4949
    5050    public void addGui(PreferenceTabbedPane gui) {
    51         lafCombo = new JComboBox(UIManager.getInstalledLookAndFeels());
     51        lafCombo = new JosmComboBox(UIManager.getInstalledLookAndFeels());
    5252
    5353        // let's try to load additional LookAndFeels and put them into the list
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java

    r4968 r5429  
    1313import javax.swing.DefaultComboBoxModel;
    1414import javax.swing.DefaultListCellRenderer;
    15 import javax.swing.JComboBox;
    1615import javax.swing.JLabel;
    1716import javax.swing.JList;
     
    2524import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
    2625import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
     26import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2727import org.openstreetmap.josm.tools.GBC;
    2828import org.openstreetmap.josm.tools.I18n;
     
    3636
    3737    /** the combo box with the available locales */
    38     private JComboBox langCombo;
     38    private JosmComboBox langCombo;
    3939    /** the model for the combo box */
    4040    private LanguageComboBoxModel model;
     
    4545        // See http://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui
    4646        model.selectLanguage(Main.pref.get("language"));
    47         langCombo = new JComboBox(model);
     47        langCombo = new JosmComboBox(model);
    4848        langCombo.setRenderer(new LanguageCellRenderer(langCombo.getRenderer()));
    4949
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r5368 r5429  
    3636import javax.swing.JCheckBox;
    3737import javax.swing.JColorChooser;
    38 import javax.swing.JComboBox;
    3938import javax.swing.JEditorPane;
    4039import javax.swing.JLabel;
     
    8079import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
    8180import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     81import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    8282import org.openstreetmap.josm.io.imagery.HTMLGrabber;
    8383import org.openstreetmap.josm.io.imagery.OffsetServer;
     
    107107    private JButton btnFadeColor;
    108108    private JSlider fadeAmount = new JSlider(0, 100);
    109     private JComboBox sharpen;
     109    private JosmComboBox sharpen;
    110110    private JCheckBox useOffsetServer;
    111111    private JTextField offsetServerUrl;
    112112
    113113    // WMS Settings
    114     private JComboBox browser;
     114    private JosmComboBox browser;
    115115    private JCheckBox overlapCheckBox;
    116116    private JSpinner spinEast;
     
    157157        p.add(this.fadeAmount, GBC.eol().fill(GBC.HORIZONTAL));
    158158
    159         this.sharpen = new JComboBox(new String[] {
     159        this.sharpen = new JosmComboBox(new String[] {
    160160                tr("None"),
    161161                tr("Soft"),
     
    181181    private JPanel buildWMSSettingsPanel() {
    182182        final JPanel p = new JPanel(new GridBagLayout());
    183         browser = new JComboBox(new String[] {
     183        browser = new JosmComboBox(new String[] {
    184184                "webkit-image {0}",
    185185                "gnome-web-photo --mode=photo --format=png {0} /dev/stdout",
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java

    r5236 r5429  
    77import java.util.Collections;
    88
    9 import javax.swing.JComboBox;
    109import javax.swing.JLabel;
    1110import javax.swing.JPanel;
    1211
     12import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    1313import org.openstreetmap.josm.tools.GBC;
    1414
     
    7272
    7373    protected class CBPanel extends JPanel {
    74         public JComboBox prefcb;
     74        public JosmComboBox prefcb;
    7575
    7676        public CBPanel(Object[] entries, int initialIndex, String label, final ActionListener listener) {
    77             prefcb = new JComboBox(entries);
     77            prefcb = new JosmComboBox(entries);
    7878
    7979            prefcb.setSelectedIndex(initialIndex);
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r5235 r5429  
    1616
    1717import javax.swing.BorderFactory;
    18 import javax.swing.JComboBox;
    1918import javax.swing.JLabel;
    2019import javax.swing.JOptionPane;
     
    4342import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
    4443import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
     44import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    4545import org.openstreetmap.josm.tools.GBC;
    4646
     
    113113     * Combobox with all projections available
    114114     */
    115     private JComboBox projectionCombo = new JComboBox(projectionChoices.toArray());
     115    private JosmComboBox projectionCombo = new JosmComboBox(projectionChoices.toArray());
    116116
    117117    /**
    118118     * Combobox with all coordinate display possibilities
    119119     */
    120     private JComboBox coordinatesCombo = new JComboBox(CoordinateFormat.values());
    121 
    122     private JComboBox unitsCombo = new JComboBox(unitsValuesTr);
     120    private JosmComboBox coordinatesCombo = new JosmComboBox(CoordinateFormat.values());
     121
     122    private JosmComboBox unitsCombo = new JosmComboBox(unitsValuesTr);
    123123
    124124    /**
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java

    r5254 r5429  
    2525import javax.swing.DefaultComboBoxModel;
    2626import javax.swing.JCheckBox;
    27 import javax.swing.JComboBox;
    2827import javax.swing.JLabel;
    2928import javax.swing.JPanel;
     
    4645import javax.swing.table.TableRowSorter;
    4746import org.openstreetmap.josm.Main;
     47import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    4848import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    4949import org.openstreetmap.josm.tools.Shortcut;
     
    134134    private JCheckBox cbDefault = new JCheckBox();
    135135    private JCheckBox cbDisable = new JCheckBox();
    136     private JComboBox tfKey = new JComboBox();
     136    private JosmComboBox tfKey = new JosmComboBox();
    137137
    138138    JTable shortcutTable = new JTable();
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r5405 r5429  
    1010import java.awt.Font;
    1111import java.awt.GridBagLayout;
    12 import java.awt.Image;
    1312import java.awt.Insets;
    1413import java.awt.event.ActionEvent;
     
    3635import javax.swing.Action;
    3736import javax.swing.ImageIcon;
    38 import javax.swing.JComboBox;
    3937import javax.swing.JComponent;
    4038import javax.swing.JLabel;
     
    7472import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
    7573import org.openstreetmap.josm.gui.util.GuiHelper;
     74import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    7675import org.openstreetmap.josm.io.MirroredInputStream;
    7776import org.openstreetmap.josm.tools.GBC;
     
    396395            } else {
    397396                // the objects have different values
    398                 JComboBox comboBox = new JComboBox(usage.values.toArray());
     397                JosmComboBox comboBox = new JosmComboBox(usage.values.toArray());
    399398                comboBox.setEditable(true);
    400399                comboBox.setEditor(textField);
     
    421420
    422421            // return if unchanged
    423             String v = (value instanceof JComboBox)
    424                     ? ((JComboBox) value).getEditor().getItem().toString()
     422            String v = (value instanceof JosmComboBox)
     423                    ? ((JosmComboBox) value).getEditor().getItem().toString()
    425424                            : ((JTextField) value).getText();
    426425                    v = v.trim();
     
    800799
    801800        public boolean editable = true;
    802         protected JComboBox combo;
     801        protected JosmComboBox combo;
    803802
    804803        public Combo() {
     
    820819            lhm.put("", new PresetListEntry(""));
    821820
    822             combo = new JComboBox(lhm.values().toArray());
     821            combo = new JosmComboBox(lhm.values().toArray());
    823822            component = combo;
    824823            combo.setRenderer(getListCellRenderer());
    825824            combo.setEditable(editable);
    826             combo.setMaximumRowCount(13);
     825            //combo.setMaximumRowCount(13);
    827826            AutoCompletingTextField tf = new AutoCompletingTextField();
    828827            initAutoCompletionField(tf, key);
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r4949 r5429  
    1313import javax.swing.ComboBoxModel;
    1414import javax.swing.DefaultComboBoxModel;
    15 import javax.swing.JComboBox;
    1615import javax.swing.JLabel;
    1716import javax.swing.JList;
     
    2423
    2524import org.openstreetmap.josm.Main;
     25import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2626
    2727/**
    2828 * @author guilhem.bonnefille@gmail.com
    2929 */
    30 public class AutoCompletingComboBox extends JComboBox {
     30public class AutoCompletingComboBox extends JosmComboBox {
    3131
    3232    private boolean autocompleteEnabled = true;
     
    3535
    3636    /**
    37      * Auto-complete a JComboBox.
     37     * Auto-complete a JosmComboBox.
    3838     *
    3939     * Inspired by http://www.orbital-computer.de/JComboBox/
    4040     */
    4141    class AutoCompletingComboBoxDocument extends PlainDocument {
    42         private JComboBox comboBox;
     42        private JosmComboBox comboBox;
    4343        private boolean selecting = false;
    4444
    45         public AutoCompletingComboBoxDocument(final JComboBox comboBox) {
     45        public AutoCompletingComboBoxDocument(final JosmComboBox comboBox) {
    4646            this.comboBox = comboBox;
    4747        }
     
    167167                }
    168168        );
    169         int maxsize=Math.max(getMaximumRowCount(),java.awt.Toolkit.getDefaultToolkit().getScreenSize().height/getPreferredSize().height - 1);
    170         setMaximumRowCount(maxsize);
    171169    }
    172170
  • trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitiveTypesComboBox.java

    r4081 r5429  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.widgets;
    3 
    4 import javax.swing.JComboBox;
    53
    64import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    97 * @author Matthias Julius
    108 */
    11 public class OsmPrimitiveTypesComboBox extends JComboBox {
     9public class OsmPrimitiveTypesComboBox extends JosmComboBox {
    1210
    1311    public OsmPrimitiveTypesComboBox() {
Note: See TracChangeset for help on using the changeset viewer.