Changeset 6501 in josm


Ignore:
Timestamp:
2013-12-19T21:01:44+01:00 (8 years ago)
Author:
simon04
Message:

Revert accidentally committed r6499 (to be committed after the stabilization phase)

Location:
trunk/src/org/openstreetmap/josm
Files:
1 deleted
3 edited

Legend:

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

    r6499 r6501  
    77import org.openstreetmap.josm.data.Preferences;
    88import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    9 import org.openstreetmap.josm.data.preferences.BooleanProperty;
    10 import org.openstreetmap.josm.tools.CheckParameterUtil;
    119
    1210public class PreferenceToggleAction extends JosmAction implements PreferenceChangedListener {
    1311
    14     protected final JCheckBoxMenuItem checkbox;
    15     protected final BooleanProperty property;
     12    private final JCheckBoxMenuItem checkbox;
     13    private final String prefKey;
     14    private final boolean prefDefault;
    1615
    1716    public PreferenceToggleAction(String name, String tooltip, String prefKey, boolean prefDefault) {
    18         this(name, tooltip, new BooleanProperty(prefKey, prefDefault));
    19     }
    20 
    21     public PreferenceToggleAction(String name, String tooltip, BooleanProperty property) {
    2217        super(name, null, tooltip, null, false);
    23         CheckParameterUtil.ensureParameterNotNull(property, "property");
    24         putValue("toolbar", "toggle-" + property.getKey());
    25         this.property = property;
     18        putValue("toolbar", "toggle-" + prefKey);
     19        this.prefKey = prefKey;
     20        this.prefDefault = prefDefault;
    2621        this.checkbox = new JCheckBoxMenuItem(this);
    27         this.checkbox.setSelected(property.get());
     22        this.checkbox.setSelected(Main.pref.getBoolean(prefKey, prefDefault));
    2823        Main.pref.addPreferenceChangeListener(this);
    2924    }
     
    3126    @Override
    3227    public void actionPerformed(ActionEvent e) {
    33         property.put(checkbox.isSelected());
     28        Main.pref.put(prefKey, checkbox.isSelected());
    3429    }
    3530
     
    4035    @Override
    4136    public void preferenceChanged(Preferences.PreferenceChangeEvent e) {
    42         if (property.getKey().equals(e.getKey())) {
    43             checkbox.setSelected(property.get());
     37        if (prefKey.equals(e.getKey())) {
     38            checkbox.setSelected(Main.pref.getBoolean(prefKey, prefDefault));
    4439        }
    4540    }
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r6499 r6501  
    4747import org.openstreetmap.josm.actions.FullscreenToggleAction;
    4848import org.openstreetmap.josm.actions.GpxExportAction;
    49 import org.openstreetmap.josm.actions.HatchAreaOutsideDownloadAction;
    5049import org.openstreetmap.josm.actions.HelpAction;
    5150import org.openstreetmap.josm.actions.HistoryInfoAction;
     
    200199    /** View -> Wireframe View */
    201200    public final WireframeToggleAction wireFrameToggleAction = new WireframeToggleAction();
    202     public final HatchAreaOutsideDownloadAction hatchAreaOutsideDownloadAction = new HatchAreaOutsideDownloadAction();
    203201    public final JosmAction toggleGPXLines = new ToggleGPXLinesAction();
    204202    /** View -> Advanced info */
     
    645643        wireframe.setAccelerator(wireFrameToggleAction.getShortcut().getKeyStroke());
    646644        wireFrameToggleAction.addButtonModel(wireframe.getModel());
    647         final JCheckBoxMenuItem hatchAreaOutsideDownloadMenuItem = hatchAreaOutsideDownloadAction.getCheckbox();
    648         viewMenu.add(hatchAreaOutsideDownloadMenuItem);
    649         ExpertToggleAction.addVisibilitySwitcher(hatchAreaOutsideDownloadMenuItem);
    650645
    651646        viewMenu.add(new MapPaintMenu());
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r6499 r6501  
    4141import org.openstreetmap.josm.Main;
    4242import org.openstreetmap.josm.actions.ExpertToggleAction;
    43 import org.openstreetmap.josm.actions.HatchAreaOutsideDownloadAction;
    4443import org.openstreetmap.josm.actions.RenameLayerAction;
    4544import org.openstreetmap.josm.actions.SaveActionBase;
     
    318317
    319318            // paint remainder
    320             if (HatchAreaOutsideDownloadAction.isHatchEnabled()) {
    321                 g.setPaint(hatched);
    322                 g.fill(a);
    323             }
     319            g.setPaint(hatched);
     320            g.fill(a);
    324321        }
    325322
Note: See TracChangeset for help on using the changeset viewer.