Changeset 4056 in josm
- Timestamp:
- 2011-04-23T00:32:55+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r4050 r4056 683 683 public boolean use_last_as_default = false; 684 684 public boolean required = false; 685 public long rows = -1; 685 686 686 687 private List<String> short_description_list; … … 752 753 753 754 list = new ConcatenatingJList(delimiter, lhm.values().toArray()); 754 list.setCellRenderer(new PresetListCellRenderer()); 755 PresetListCellRenderer renderer = new PresetListCellRenderer(); 756 list.setCellRenderer(renderer); 755 757 756 758 if (usage.hasUniqueValue() && !usage.unused()) { … … 776 778 } 777 779 p.add(new JLabel(locale_text+":"), GBC.std().insets(0,0,10,0)); 778 p.add(new JScrollPane(list), GBC.eol().fill(GBC.HORIZONTAL)); 780 JScrollPane sp = new JScrollPane(list); 781 // if a number of rows has been specified in the preset, 782 // modify preferred height of scroll pane to match that row count. 783 if (rows != -1) 784 { 785 double height = renderer.getListCellRendererComponent(list, 786 new PresetListEntry("x"), 0, false, false).getPreferredSize().getHeight() * rows; 787 sp.setPreferredSize(new Dimension((int) sp.getPreferredSize().getWidth(), (int) height)); 788 } 789 p.add(sp, GBC.eol().fill(GBC.HORIZONTAL)); 779 790 return true; 780 791 }
Note:
See TracChangeset
for help on using the changeset viewer.