Ignore:
Timestamp:
2009-07-25T18:17:36+02:00 (15 years ago)
Author:
Gubaer
Message:

removed global static variable
replaced usage of JOptionPane by OptionPaneUtil

Location:
trunk/src/org/openstreetmap/josm/actions/mapmode
Files:
2 edited

Legend:

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

    r1838 r1842  
    5050import org.openstreetmap.josm.gui.MapFrame;
    5151import org.openstreetmap.josm.gui.MapView;
     52import org.openstreetmap.josm.gui.OptionPaneUtil;
    5253import org.openstreetmap.josm.gui.layer.Layer;
    5354import org.openstreetmap.josm.gui.layer.MapViewPaintable;
     
    338339            n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY()));
    339340            if (n.getCoor().isOutSideWorld()) {
    340                 JOptionPane.showMessageDialog(Main.parent,
    341                         tr("Cannot add a node outside of the world."));
     341                OptionPaneUtil.showMessageDialog(
     342                        Main.parent,
     343                        tr("Cannot add a node outside of the world."),
     344                        tr("Warning"),
     345                        JOptionPane.WARNING_MESSAGE
     346                );
    342347                return;
    343348            }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r1814 r1842  
    4545import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    4646import org.openstreetmap.josm.tools.ImageProvider;
     47import org.openstreetmap.josm.tools.PlatformHookOsx;
    4748import org.openstreetmap.josm.tools.Shortcut;
    4849
     
    5859 */
    5960public class SelectAction extends MapMode implements SelectionEnded {
    60     public static boolean needMouseMove = false;
     61
     62    /**
     63     * Replies true if we are currently running on OSX
     64     *
     65     * @return true if we are currently running on OSX
     66     */
     67    public static boolean isPlatformOsx() {
     68        return Main.platform != null
     69        && Main.platform instanceof PlatformHookOsx;
     70    }
     71
    6172    enum Mode { move, rotate, select }
    6273    private Mode mode = null;
     
    254265    }
    255266
    256     /**
    257      * Mac OSX simulates with  ctrl + mouse 1  the second mouse button hence no dragging events get fired.
    258      *
    259      */
     267
    260268    @Override public void mouseMoved(MouseEvent e) {
    261         if (needMouseMove && mode == Mode.rotate) {
     269        // Mac OSX simulates with  ctrl + mouse 1  the second mouse button hence no dragging events get fired.
     270        //
     271        if (isPlatformOsx() && mode == Mode.rotate) {
    262272            mouseDragged(e);
    263273        }
Note: See TracChangeset for help on using the changeset viewer.