Changeset 9840 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-02-19T23:41:45+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r9818 r9840 1656 1656 break; 1657 1657 case 1: 1658 if (Main.map.mapView.getNativeScaleLayer() == l) { 1658 NativeScaleLayer oldLayer = Main.map.mapView.getNativeScaleLayer(); 1659 if (oldLayer == l) { 1659 1660 Main.map.mapView.setNativeScaleLayer(null); 1660 1661 } else if (l instanceof NativeScaleLayer) { 1661 1662 Main.map.mapView.setNativeScaleLayer((NativeScaleLayer) l); 1663 if (oldLayer != null) { 1664 int idx = getLayers().indexOf(oldLayer); 1665 if (idx >= 0) { 1666 fireTableCellUpdated(idx, col); 1667 } 1668 } 1662 1669 } 1663 1670 break; -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r9824 r9840 13 13 import javax.swing.DefaultListCellRenderer; 14 14 import javax.swing.JCheckBox; 15 import javax.swing.JFormattedTextField; 15 16 import javax.swing.JLabel; 16 17 import javax.swing.JList; 17 18 import javax.swing.JScrollPane; 19 import javax.swing.JSpinner; 18 20 import javax.swing.ListCellRenderer; 19 21 import javax.swing.LookAndFeel; 22 import javax.swing.SpinnerNumberModel; 20 23 import javax.swing.UIManager; 21 24 import javax.swing.UIManager.LookAndFeelInfo; … … 24 27 import org.openstreetmap.josm.actions.ExpertToggleAction; 25 28 import org.openstreetmap.josm.gui.MapMover; 29 import org.openstreetmap.josm.gui.NavigatableComponent; 26 30 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 27 31 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 64 68 private final JCheckBox nativeFileChoosers = new JCheckBox(tr("Use native file choosers (nicer, but do not support file filters)")); 65 69 private final JCheckBox zoomReverseWheel = new JCheckBox(tr("Reverse zoom with mouse wheel")); 70 private final JCheckBox zoomIntermediateSteps = new JCheckBox(tr("Intermediate steps between native resolutions")); 71 private JSpinner spinZoomRatio; 66 72 67 73 @Override … … 148 154 panel.add(zoomReverseWheel, GBC.eop().insets(20, 0, 0, 0)); 149 155 150 panel.add(Box.createVerticalGlue(), GBC.eol().insets(0, 20, 0, 0)); 156 zoomIntermediateSteps.setToolTipText( 157 tr("Divide intervals between native resolution levels to smaller steps if they are much larger than zoom ratio")); 158 zoomIntermediateSteps.setSelected(NavigatableComponent.PROP_ZOOM_INTERMEDIATE_STEPS.get()); 159 ExpertToggleAction.addVisibilitySwitcher(zoomIntermediateSteps); 160 panel.add(zoomIntermediateSteps, GBC.eop().insets(20, 0, 0, 0)); 161 162 panel.add(Box.createVerticalGlue(), GBC.eol().insets(0, 10, 0, 0)); 163 164 double logZoomLevel = Math.log(2) / Math.log(NavigatableComponent.PROP_ZOOM_RATIO.get()); 165 logZoomLevel = Math.max(1, logZoomLevel); 166 logZoomLevel = Math.min(5, logZoomLevel); 167 JLabel labelZoomRatio = new JLabel(tr("Zoom steps to get double scale")); 168 spinZoomRatio = new JSpinner(new SpinnerNumberModel(logZoomLevel, 1, 5, 1)); 169 Component spinZoomRatioEditor = spinZoomRatio.getEditor(); 170 JFormattedTextField jftf = ((JSpinner.DefaultEditor) spinZoomRatioEditor).getTextField(); 171 jftf.setColumns(2); 172 String zoomRatioToolTipText = tr("Higher value means more steps needed, therefore zoom steps will be smaller"); 173 spinZoomRatio.setToolTipText(zoomRatioToolTipText); 174 labelZoomRatio.setToolTipText(zoomRatioToolTipText); 175 labelZoomRatio.setLabelFor(spinZoomRatio); 176 panel.add(labelZoomRatio, GBC.std().insets(20, 0, 0, 0)); 177 panel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL)); 178 panel.add(spinZoomRatio, GBC.eol()); 151 179 152 180 panel.add(new JLabel(tr("Look and Feel")), GBC.std().insets(20, 0, 0, 0)); … … 169 197 Main.pref.put(DateUtils.PROP_ISO_DATES.getKey(), isoDates.isSelected()); 170 198 Main.pref.put(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.getKey(), nativeFileChoosers.isSelected()); 171 Main.pref.put(MapMover.PROP_ZOOM_REVERSE_WHEEL.getKey(), zoomReverseWheel.isSelected()); 199 MapMover.PROP_ZOOM_REVERSE_WHEEL.put(zoomReverseWheel.isSelected()); 200 NavigatableComponent.PROP_ZOOM_INTERMEDIATE_STEPS.put(zoomIntermediateSteps.isSelected()); 201 NavigatableComponent.PROP_ZOOM_RATIO.put(Math.pow(2, 1/(double) spinZoomRatio.getModel().getValue())); 172 202 mod |= Main.pref.put("laf", ((LookAndFeelInfo) lafCombo.getSelectedItem()).getClassName()); 173 203 return mod;
Note:
See TracChangeset
for help on using the changeset viewer.