Changeset 3664 in josm for trunk/src/org
- Timestamp:
- 2010-11-20T20:26:30+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r3662 r3664 180 180 layerList.setShowGrid(false); 181 181 layerList.setIntercellSpacing(new Dimension(0, 0)); 182 final int ICON_WIDTH = 16;183 182 layerList.getColumnModel().getColumn(0).setCellRenderer(new ActiveLayerCellRenderer()); 184 183 layerList.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new ActiveLayerCheckBox())); 185 layerList.getColumnModel().getColumn(0).setMaxWidth( ICON_WIDTH);186 layerList.getColumnModel().getColumn(0).setPreferredWidth( ICON_WIDTH);184 layerList.getColumnModel().getColumn(0).setMaxWidth(12); 185 layerList.getColumnModel().getColumn(0).setPreferredWidth(12); 187 186 layerList.getColumnModel().getColumn(0).setResizable(false); 188 187 layerList.getColumnModel().getColumn(1).setCellRenderer(new LayerVisibleCellRenderer()); 189 188 layerList.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(new LayerVisibleCheckBox())); 190 layerList.getColumnModel().getColumn(1).setMaxWidth( ICON_WIDTH);191 layerList.getColumnModel().getColumn(1).setPreferredWidth( ICON_WIDTH);189 layerList.getColumnModel().getColumn(1).setMaxWidth(16); 190 layerList.getColumnModel().getColumn(1).setPreferredWidth(16); 192 191 layerList.getColumnModel().getColumn(1).setResizable(false); 193 192 layerList.getColumnModel().getColumn(2).setCellRenderer(new LayerNameCellRenderer()); … … 391 390 putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the selected layer.")); 392 391 putValue("help", HelpUtil.ht("/Dialog/LayerDialog#ShowHideLayer")); 393 putValue(NAME, tr("Show/Hide"));394 392 updateEnabledState(); 395 393 } … … 620 618 setRolloverIcon(blank); 621 619 setRolloverSelectedIcon(active); 622 setPressedIcon( active);620 setPressedIcon(ImageProvider.get("dialogs/layerlist", "active-pressed")); 623 621 } 624 622 } … … 626 624 private static class LayerVisibleCheckBox extends JCheckBox { 627 625 public LayerVisibleCheckBox() { 628 setHorizontalAlignment(javax.swing.SwingConstants. CENTER);626 setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 629 627 ImageIcon eye = ImageProvider.get("dialogs/layerlist", "eye"); 630 628 ImageIcon eye_off = ImageProvider.get("dialogs/layerlist", "eye-off"); … … 683 681 label.setFont(label.getFont().deriveFont(Font.BOLD)); 684 682 } 685 //label.setEnabled(layer.isVisible());686 683 label.setIcon(layer.getIcon()); 687 684 label.setToolTipText(layer.getToolTipText()); … … 786 783 * the properties {@see Layer#VISIBLE_PROP} and {@see Layer#NAME_PROP}. 787 784 */ 788 public staticclass LayerListModel extends AbstractTableModel implements MapView.LayerChangeListener, PropertyChangeListener {785 public class LayerListModel extends AbstractTableModel implements MapView.LayerChangeListener, PropertyChangeListener { 789 786 /** manages list selection state*/ 790 787 private DefaultListSelectionModel selectionModel; … … 939 936 fireTableDataChanged(); 940 937 int idx = getLayers().indexOf(layer); 938 layerList.setRowHeight(idx, Math.max(16, layer.getIcon().getIconHeight())); 941 939 selectionModel.setSelectionInterval(idx, idx); 942 940 ensureSelectedIsVisible();
Note:
See TracChangeset
for help on using the changeset viewer.