Changeset 5429 in josm
- Timestamp:
- 2012-08-11T23:03:55+02:00 (12 years ago)
- 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 11 11 import javax.swing.DefaultListCellRenderer; 12 12 import javax.swing.Icon; 13 import javax.swing.JComboBox;14 13 import javax.swing.JLabel; 15 14 import javax.swing.JList; … … 20 19 import org.openstreetmap.josm.gui.ExtendedDialog; 21 20 import org.openstreetmap.josm.gui.layer.Layer; 21 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 22 22 import org.openstreetmap.josm.tools.GBC; 23 23 import org.openstreetmap.josm.tools.Shortcut; … … 58 58 59 59 protected Layer askTargetLayer(List<Layer> targetLayers) { 60 J ComboBox layerList = new JComboBox();60 JosmComboBox layerList = new JosmComboBox(); 61 61 layerList.setRenderer(new LayerListCellRenderer()); 62 62 layerList.setModel(new DefaultComboBoxModel(targetLayers.toArray())); -
trunk/src/org/openstreetmap/josm/data/projection/Lambert.java
r5236 r5429 3 3 4 4 import 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;14 5 15 6 import org.openstreetmap.josm.data.Bounds; … … 19 10 import org.openstreetmap.josm.data.projection.proj.LambertConformalConic; 20 11 import org.openstreetmap.josm.data.projection.proj.ProjParameters; 21 import org.openstreetmap.josm.tools.GBC;22 import org.openstreetmap.josm.tools.ImageProvider;23 12 24 13 /** -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r5335 r5429 29 29 import javax.swing.JButton; 30 30 import javax.swing.JCheckBox; 31 import javax.swing.JComboBox;32 31 import javax.swing.JLabel; 33 32 import javax.swing.JPanel; … … 44 43 import org.openstreetmap.josm.data.osm.Way; 45 44 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 45 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 46 46 import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTable; 47 47 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 252 252 p.setLayout(new FlowLayout(FlowLayout.LEFT)); 253 253 p.add(new JLabel(tr("Compare "))); 254 J ComboBox cbComparePair =new JComboBox(model.getComparePairListModel());254 JosmComboBox cbComparePair = new JosmComboBox(model.getComparePairListModel()); 255 255 cbComparePair.setRenderer(new ComparePairListCellRenderer()); 256 256 p.add(cbComparePair); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
r5266 r5429 13 13 import javax.swing.AbstractCellEditor; 14 14 import javax.swing.DefaultComboBoxModel; 15 import javax.swing.JComboBox;16 15 import javax.swing.JLabel; 17 16 import javax.swing.JList; … … 20 19 import javax.swing.UIManager; 21 20 import javax.swing.table.TableCellEditor; 21 22 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 22 23 23 24 /** … … 40 41 41 42 /** the combo box used as editor */ 42 private J ComboBox editor;43 private JosmComboBox editor; 43 44 private DefaultComboBoxModel editorModel; 44 45 private CopyOnWriteArrayList<NavigationListener> listeners; … … 68 69 public MultiValueCellEditor() { 69 70 editorModel = new DefaultComboBoxModel(); 70 editor = new J ComboBox(editorModel) {71 editor = new JosmComboBox(editorModel) { 71 72 @Override 72 73 public void processKeyEvent(KeyEvent e) { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRenderer.java
r5266 r5429 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Color;7 6 import java.awt.Component; 8 7 import java.awt.Font; … … 10 9 import javax.swing.DefaultComboBoxModel; 11 10 import javax.swing.ImageIcon; 12 import javax.swing.JComboBox;13 11 import javax.swing.JLabel; 14 12 import javax.swing.JTable; … … 17 15 18 16 import org.openstreetmap.josm.gui.conflict.ConflictColors; 17 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 19 18 import org.openstreetmap.josm.tools.ImageProvider; 20 19 … … 28 27 private ImageIcon iconUndecided; 29 28 private DefaultComboBoxModel model; 30 private J ComboBox cbDecisionRenderer;29 private JosmComboBox cbDecisionRenderer; 31 30 32 31 public MultiValueCellRenderer() { … … 34 33 iconDecided = ImageProvider.get("dialogs/conflict", "tagconflictresolved"); 35 34 iconUndecided = ImageProvider.get("dialogs/conflict", "tagconflictunresolved"); 36 cbDecisionRenderer = new J ComboBox(model = new DefaultComboBoxModel());35 cbDecisionRenderer = new JosmComboBox(model = new DefaultComboBoxModel()); 37 36 } 38 37 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java
r3083 r5429 6 6 7 7 import javax.swing.DefaultComboBoxModel; 8 import javax.swing.JComboBox;9 8 import javax.swing.JTable; 10 9 import javax.swing.event.CellEditorListener; … … 12 11 13 12 import org.openstreetmap.josm.gui.util.TableCellEditorSupport; 13 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 14 14 15 public class RelationMemberConflictDecisionEditor extends J ComboBox implements TableCellEditor {15 public class RelationMemberConflictDecisionEditor extends JosmComboBox implements TableCellEditor { 16 16 17 17 public RelationMemberConflictDecisionEditor() { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionRenderer.java
r4072 r5429 6 6 7 7 import javax.swing.DefaultComboBoxModel; 8 import javax.swing.JComboBox;9 8 import javax.swing.JLabel; 10 9 import javax.swing.JList; … … 14 13 import javax.swing.table.TableCellRenderer; 15 14 15 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 16 16 17 public class RelationMemberConflictDecisionRenderer extends JLabel implements TableCellRenderer, ListCellRenderer{ 17 18 18 private J ComboBox cbDecisionTypes;19 private JosmComboBox cbDecisionTypes; 19 20 20 21 protected void resetTableRenderer() { … … 34 35 public RelationMemberConflictDecisionRenderer() { 35 36 DefaultComboBoxModel model = new DefaultComboBoxModel(); 36 cbDecisionTypes = new J ComboBox(model);37 cbDecisionTypes = new JosmComboBox(model); 37 38 model.addElement(RelationMemberConflictDecisionType.KEEP); 38 39 model.addElement(RelationMemberConflictDecisionType.REMOVE); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTable.java
r3083 r5429 6 6 7 7 import javax.swing.AbstractAction; 8 import javax.swing.JComboBox;9 8 import javax.swing.JComponent; 10 9 import javax.swing.JTable; 11 10 import javax.swing.KeyStroke; 12 11 import javax.swing.ListSelectionModel; 12 13 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 13 14 14 15 public class RelationMemberConflictResolverTable extends JTable implements MultiValueCellEditor.NavigationListener { … … 39 40 getActionMap().put("selectPreviousColumnCell", selectPreviousColumnCellAction); 40 41 41 setRowHeight((int)new J ComboBox().getPreferredSize().getHeight());42 setRowHeight((int)new JosmComboBox().getPreferredSize().getHeight()); 42 43 } 43 44 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverTable.java
r3083 r5429 6 6 7 7 import javax.swing.AbstractAction; 8 import javax.swing.JComboBox;9 8 import javax.swing.JComponent; 10 9 import javax.swing.JTable; 11 10 import javax.swing.KeyStroke; 12 11 import javax.swing.ListSelectionModel; 12 13 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 13 14 14 15 public class TagConflictResolverTable extends JTable implements MultiValueCellEditor.NavigationListener { … … 41 42 ((MultiValueCellEditor)getColumnModel().getColumn(2).getCellEditor()).addNavigationListeners(this); 42 43 43 setRowHeight((int)new J ComboBox().getPreferredSize().getHeight());44 setRowHeight((int)new JosmComboBox().getPreferredSize().getHeight()); 44 45 } 45 46 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r5428 r5429 53 53 import javax.swing.DefaultListCellRenderer; 54 54 import javax.swing.ImageIcon; 55 import javax.swing.JComboBox;56 55 import javax.swing.JComponent; 57 56 import javax.swing.JDialog; … … 114 113 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem; 115 114 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 115 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 116 116 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 117 117 import org.openstreetmap.josm.tools.GBC; … … 711 711 private final JTable membershipTable = new JTable(membershipData); 712 712 713 public J ComboBox taggingPresets = new JComboBox();713 public JosmComboBox taggingPresets = new JosmComboBox(); 714 714 715 715 /** -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r4422 r5429 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.trc;6 5 7 6 import java.awt.BorderLayout; … … 29 28 import javax.swing.DefaultListSelectionModel; 30 29 import javax.swing.JButton; 31 import javax.swing.JComboBox;32 30 import javax.swing.JLabel; 33 31 import javax.swing.JPanel; … … 53 51 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 54 52 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 53 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 55 54 import org.openstreetmap.josm.io.OsmTransferException; 56 55 import org.openstreetmap.josm.tools.GBC; … … 75 74 //new Server("Namefinder","http://gazetteer.openstreetmap.org/namefinder/search.xml?find=",tr("Near"),trc("placeselection", "Zoom")) 76 75 }; 77 private final J ComboBox server = new JComboBox(servers);76 private final JosmComboBox server = new JosmComboBox(servers); 78 77 79 78 private static class Server { … … 103 102 lpanel.add(server); 104 103 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)) { 107 106 server.setSelectedIndex(i); 108 107 } -
trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java
r5266 r5429 18 18 import javax.swing.JButton; 19 19 import javax.swing.JCheckBox; 20 import javax.swing.JComboBox;21 20 import javax.swing.JPanel; 22 21 import javax.swing.JRadioButton; … … 28 27 import org.openstreetmap.josm.data.osm.ChangesetCache; 29 28 import org.openstreetmap.josm.gui.JMultilineLabel; 29 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 30 30 import org.openstreetmap.josm.tools.CheckParameterUtil; 31 31 import org.openstreetmap.josm.tools.ImageProvider; … … 54 54 private JRadioButton rbUseNew; 55 55 private JRadioButton rbExisting; 56 private J ComboBox cbOpenChangesets;56 private JosmComboBox cbOpenChangesets; 57 57 private JButton btnRefresh; 58 58 private JButton btnClose; … … 108 108 model = new OpenChangesetComboBoxModel(); 109 109 ChangesetCache.getInstance().addChangesetCacheListener(model); 110 cbOpenChangesets = new J ComboBox(model);110 cbOpenChangesets = new JosmComboBox(model); 111 111 cbOpenChangesets.setToolTipText(tr("Select an open changeset")); 112 112 cbOpenChangesets.setRenderer(new ChangesetCellRenderer()); -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r5395 r5429 44 44 import javax.swing.DefaultComboBoxModel; 45 45 import javax.swing.Icon; 46 import javax.swing.JComboBox;47 46 import javax.swing.JComponent; 48 47 import javax.swing.JFileChooser; … … 96 95 import org.openstreetmap.josm.gui.progress.ProgressTaskIds; 97 96 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 97 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 98 98 import org.openstreetmap.josm.io.JpgImporter; 99 99 import org.openstreetmap.josm.io.OsmTransferException; … … 1396 1396 } 1397 1397 1398 J ComboBox layerList = new JComboBox();1398 JosmComboBox layerList = new JosmComboBox(); 1399 1399 layerList.setRenderer(new LayerListCellRenderer()); 1400 1400 layerList.setModel(new DefaultComboBoxModel(targetLayers.toArray())); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r5242 r5429 45 45 import javax.swing.JButton; 46 46 import javax.swing.JCheckBox; 47 import javax.swing.JComboBox;48 47 import javax.swing.JFileChooser; 49 48 import javax.swing.JLabel; … … 74 73 import org.openstreetmap.josm.gui.layer.GpxLayer; 75 74 import org.openstreetmap.josm.gui.layer.Layer; 75 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 76 76 import org.openstreetmap.josm.io.GpxReader; 77 77 import org.openstreetmap.josm.tools.ExifReader; … … 117 117 Vector<GpxDataWrapper> gpxLst = new Vector<GpxDataWrapper>(); 118 118 JPanel outerPanel; 119 J ComboBox cbGpx;119 JosmComboBox cbGpx; 120 120 JTextField tfTimezone; 121 121 JTextField tfOffset; … … 231 231 JLabel lbExifTime; 232 232 JTextField tfGpsTime; 233 J ComboBox cbTimezones;233 JosmComboBox cbTimezones; 234 234 ImageDisplay imgDisp; 235 235 JList imgList; … … 309 309 Collections.sort(vtTimezones); 310 310 311 cbTimezones = new J ComboBox(vtTimezones);311 cbTimezones = new JosmComboBox(vtTimezones); 312 312 313 313 String tzId = Main.pref.get("geoimage.timezoneid", ""); … … 482 482 panelCb.add(new JLabel(tr("GPX track: "))); 483 483 484 cbGpx = new J ComboBox(gpxLst);484 cbGpx = new JosmComboBox(gpxLst); 485 485 if (defaultItem != null) { 486 486 cbGpx.setSelectedItem(defaultItem); -
trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java
r3083 r5429 7 7 8 8 import javax.swing.DefaultComboBoxModel; 9 import javax.swing.JComboBox;10 9 import javax.swing.JLabel; 11 10 import javax.swing.JList; … … 13 12 import javax.swing.UIManager; 14 13 15 public class AuthorizationProcedureComboBox extends JComboBox { 14 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 15 16 public class AuthorizationProcedureComboBox extends JosmComboBox { 16 17 17 18 public AuthorizationProcedureComboBox() { -
trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
r4968 r5429 13 13 import javax.swing.ButtonGroup; 14 14 import javax.swing.JCheckBox; 15 import javax.swing.JComboBox;16 15 import javax.swing.JLabel; 17 16 import javax.swing.JOptionPane; … … 27 26 import org.openstreetmap.josm.gui.layer.markerlayer.Marker.TemplateEntryProperty; 28 27 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener; 28 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 29 29 import org.openstreetmap.josm.tools.GBC; 30 30 import org.openstreetmap.josm.tools.template_engine.ParseError; … … 58 58 private JRadioButton colorTypeNone = new JRadioButton(tr("Single Color (can be customized for named layers)")); 59 59 private JRadioButton colorTypeGlobal = new JRadioButton(tr("Use global settings")); 60 private J ComboBox 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")}); 61 61 private JCheckBox makeAutoMarkers = new JCheckBox(tr("Create markers when reading GPX")); 62 62 private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows")); … … 64 64 private JTextField drawGpsArrowsMinDist = new JTextField(8); 65 65 private JCheckBox colorDynamic = new JCheckBox(tr("Dynamic color range based on data limits")); 66 private J ComboBox waypointLabel = new JComboBox(LABEL_PATTERN_DESC);66 private JosmComboBox waypointLabel = new JosmComboBox(LABEL_PATTERN_DESC); 67 67 private JTextField waypointLabelPattern = new JTextField(); 68 private J ComboBox audioWaypointLabel = new JComboBox(LABEL_PATTERN_DESC);68 private JosmComboBox audioWaypointLabel = new JosmComboBox(LABEL_PATTERN_DESC); 69 69 private JTextField audioWaypointLabelPattern = new JTextField(); 70 70 … … 414 414 } 415 415 416 private void updateWaypointLabelCombobox(J ComboBox cb, JTextField tf, TemplateEntryProperty property) {416 private void updateWaypointLabelCombobox(JosmComboBox cb, JTextField tf, TemplateEntryProperty property) { 417 417 String labelPattern = property.getAsString(); 418 418 boolean found = false; … … 431 431 } 432 432 433 private void updateWaypointPattern(J ComboBox cb, JTextField tf) {433 private void updateWaypointPattern(JosmComboBox cb, JTextField tf) { 434 434 if (cb.getSelectedIndex() == WAYPOINT_LABEL_CUSTOM) { 435 435 tf.setEnabled(true); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r4968 r5429 11 11 import javax.swing.DefaultListCellRenderer; 12 12 import javax.swing.JCheckBox; 13 import javax.swing.JComboBox;14 13 import javax.swing.JLabel; 15 14 import javax.swing.JList; … … 27 26 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 28 27 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 28 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 29 29 import org.openstreetmap.josm.tools.GBC; 30 30 … … 40 40 * ComboBox with all look and feels. 41 41 */ 42 private J ComboBox lafCombo;42 private JosmComboBox lafCombo; 43 43 public JPanel panel; 44 44 private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup")); … … 49 49 50 50 public void addGui(PreferenceTabbedPane gui) { 51 lafCombo = new J ComboBox(UIManager.getInstalledLookAndFeels());51 lafCombo = new JosmComboBox(UIManager.getInstalledLookAndFeels()); 52 52 53 53 // 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 13 13 import javax.swing.DefaultComboBoxModel; 14 14 import javax.swing.DefaultListCellRenderer; 15 import javax.swing.JComboBox;16 15 import javax.swing.JLabel; 17 16 import javax.swing.JList; … … 25 24 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 26 25 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 26 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 27 27 import org.openstreetmap.josm.tools.GBC; 28 28 import org.openstreetmap.josm.tools.I18n; … … 36 36 37 37 /** the combo box with the available locales */ 38 private J ComboBox langCombo;38 private JosmComboBox langCombo; 39 39 /** the model for the combo box */ 40 40 private LanguageComboBoxModel model; … … 45 45 // See http://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui 46 46 model.selectLanguage(Main.pref.get("language")); 47 langCombo = new J ComboBox(model);47 langCombo = new JosmComboBox(model); 48 48 langCombo.setRenderer(new LanguageCellRenderer(langCombo.getRenderer())); 49 49 -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r5368 r5429 36 36 import javax.swing.JCheckBox; 37 37 import javax.swing.JColorChooser; 38 import javax.swing.JComboBox;39 38 import javax.swing.JEditorPane; 40 39 import javax.swing.JLabel; … … 80 79 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 81 80 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 81 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 82 82 import org.openstreetmap.josm.io.imagery.HTMLGrabber; 83 83 import org.openstreetmap.josm.io.imagery.OffsetServer; … … 107 107 private JButton btnFadeColor; 108 108 private JSlider fadeAmount = new JSlider(0, 100); 109 private J ComboBox sharpen;109 private JosmComboBox sharpen; 110 110 private JCheckBox useOffsetServer; 111 111 private JTextField offsetServerUrl; 112 112 113 113 // WMS Settings 114 private J ComboBox browser;114 private JosmComboBox browser; 115 115 private JCheckBox overlapCheckBox; 116 116 private JSpinner spinEast; … … 157 157 p.add(this.fadeAmount, GBC.eol().fill(GBC.HORIZONTAL)); 158 158 159 this.sharpen = new J ComboBox(new String[] {159 this.sharpen = new JosmComboBox(new String[] { 160 160 tr("None"), 161 161 tr("Soft"), … … 181 181 private JPanel buildWMSSettingsPanel() { 182 182 final JPanel p = new JPanel(new GridBagLayout()); 183 browser = new J ComboBox(new String[] {183 browser = new JosmComboBox(new String[] { 184 184 "webkit-image {0}", 185 185 "gnome-web-photo --mode=photo --format=png {0} /dev/stdout", -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java
r5236 r5429 7 7 import java.util.Collections; 8 8 9 import javax.swing.JComboBox;10 9 import javax.swing.JLabel; 11 10 import javax.swing.JPanel; 12 11 12 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 13 13 import org.openstreetmap.josm.tools.GBC; 14 14 … … 72 72 73 73 protected class CBPanel extends JPanel { 74 public J ComboBox prefcb;74 public JosmComboBox prefcb; 75 75 76 76 public CBPanel(Object[] entries, int initialIndex, String label, final ActionListener listener) { 77 prefcb = new J ComboBox(entries);77 prefcb = new JosmComboBox(entries); 78 78 79 79 prefcb.setSelectedIndex(initialIndex); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r5235 r5429 16 16 17 17 import javax.swing.BorderFactory; 18 import javax.swing.JComboBox;19 18 import javax.swing.JLabel; 20 19 import javax.swing.JOptionPane; … … 43 42 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 44 43 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 44 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 45 45 import org.openstreetmap.josm.tools.GBC; 46 46 … … 113 113 * Combobox with all projections available 114 114 */ 115 private J ComboBox projectionCombo = new JComboBox(projectionChoices.toArray());115 private JosmComboBox projectionCombo = new JosmComboBox(projectionChoices.toArray()); 116 116 117 117 /** 118 118 * Combobox with all coordinate display possibilities 119 119 */ 120 private J ComboBox coordinatesCombo = new JComboBox(CoordinateFormat.values());121 122 private J ComboBox unitsCombo = new JComboBox(unitsValuesTr);120 private JosmComboBox coordinatesCombo = new JosmComboBox(CoordinateFormat.values()); 121 122 private JosmComboBox unitsCombo = new JosmComboBox(unitsValuesTr); 123 123 124 124 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r5254 r5429 25 25 import javax.swing.DefaultComboBoxModel; 26 26 import javax.swing.JCheckBox; 27 import javax.swing.JComboBox;28 27 import javax.swing.JLabel; 29 28 import javax.swing.JPanel; … … 46 45 import javax.swing.table.TableRowSorter; 47 46 import org.openstreetmap.josm.Main; 47 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 48 48 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 49 49 import org.openstreetmap.josm.tools.Shortcut; … … 134 134 private JCheckBox cbDefault = new JCheckBox(); 135 135 private JCheckBox cbDisable = new JCheckBox(); 136 private J ComboBox tfKey = new JComboBox();136 private JosmComboBox tfKey = new JosmComboBox(); 137 137 138 138 JTable shortcutTable = new JTable(); -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5405 r5429 10 10 import java.awt.Font; 11 11 import java.awt.GridBagLayout; 12 import java.awt.Image;13 12 import java.awt.Insets; 14 13 import java.awt.event.ActionEvent; … … 36 35 import javax.swing.Action; 37 36 import javax.swing.ImageIcon; 38 import javax.swing.JComboBox;39 37 import javax.swing.JComponent; 40 38 import javax.swing.JLabel; … … 74 72 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 75 73 import org.openstreetmap.josm.gui.util.GuiHelper; 74 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 76 75 import org.openstreetmap.josm.io.MirroredInputStream; 77 76 import org.openstreetmap.josm.tools.GBC; … … 396 395 } else { 397 396 // the objects have different values 398 J ComboBox comboBox = new JComboBox(usage.values.toArray());397 JosmComboBox comboBox = new JosmComboBox(usage.values.toArray()); 399 398 comboBox.setEditable(true); 400 399 comboBox.setEditor(textField); … … 421 420 422 421 // return if unchanged 423 String v = (value instanceof J ComboBox)424 ? ((J ComboBox) value).getEditor().getItem().toString()422 String v = (value instanceof JosmComboBox) 423 ? ((JosmComboBox) value).getEditor().getItem().toString() 425 424 : ((JTextField) value).getText(); 426 425 v = v.trim(); … … 800 799 801 800 public boolean editable = true; 802 protected J ComboBox combo;801 protected JosmComboBox combo; 803 802 804 803 public Combo() { … … 820 819 lhm.put("", new PresetListEntry("")); 821 820 822 combo = new J ComboBox(lhm.values().toArray());821 combo = new JosmComboBox(lhm.values().toArray()); 823 822 component = combo; 824 823 combo.setRenderer(getListCellRenderer()); 825 824 combo.setEditable(editable); 826 combo.setMaximumRowCount(13);825 //combo.setMaximumRowCount(13); 827 826 AutoCompletingTextField tf = new AutoCompletingTextField(); 828 827 initAutoCompletionField(tf, key); -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r4949 r5429 13 13 import javax.swing.ComboBoxModel; 14 14 import javax.swing.DefaultComboBoxModel; 15 import javax.swing.JComboBox;16 15 import javax.swing.JLabel; 17 16 import javax.swing.JList; … … 24 23 25 24 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 26 26 27 27 /** 28 28 * @author guilhem.bonnefille@gmail.com 29 29 */ 30 public class AutoCompletingComboBox extends J ComboBox {30 public class AutoCompletingComboBox extends JosmComboBox { 31 31 32 32 private boolean autocompleteEnabled = true; … … 35 35 36 36 /** 37 * Auto-complete a J ComboBox.37 * Auto-complete a JosmComboBox. 38 38 * 39 39 * Inspired by http://www.orbital-computer.de/JComboBox/ 40 40 */ 41 41 class AutoCompletingComboBoxDocument extends PlainDocument { 42 private J ComboBox comboBox;42 private JosmComboBox comboBox; 43 43 private boolean selecting = false; 44 44 45 public AutoCompletingComboBoxDocument(final J ComboBox comboBox) {45 public AutoCompletingComboBoxDocument(final JosmComboBox comboBox) { 46 46 this.comboBox = comboBox; 47 47 } … … 167 167 } 168 168 ); 169 int maxsize=Math.max(getMaximumRowCount(),java.awt.Toolkit.getDefaultToolkit().getScreenSize().height/getPreferredSize().height - 1);170 setMaximumRowCount(maxsize);171 169 } 172 170 -
trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitiveTypesComboBox.java
r4081 r5429 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.widgets; 3 4 import javax.swing.JComboBox;5 3 6 4 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 9 7 * @author Matthias Julius 10 8 */ 11 public class OsmPrimitiveTypesComboBox extends J ComboBox {9 public class OsmPrimitiveTypesComboBox extends JosmComboBox { 12 10 13 11 public OsmPrimitiveTypesComboBox() {
Note:
See TracChangeset
for help on using the changeset viewer.