Changeset 4474 in josm


Ignore:
Timestamp:
Sep 28, 2011 11:13:06 PM (20 months ago)
Author:
Don-vip
Message:

fix #6794 - download dialog slippymap: mouseup on licence text instead of click

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java

    r4195 r4474  
    5656    private SizeButton iSizeButton = null; 
    5757    private SourceButton iSourceButton = null; 
     58     
     59    private boolean isSelecting; 
    5860 
    5961    /** 
     
    7779        iSizeButton = sizeButton; 
    7880        iSourceButton = sourceButton; 
     81         
     82        isSelecting = false; 
    7983 
    8084        InputMap inputMap = navComp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); 
     
    132136                iEndSelectionPoint = e.getPoint(); 
    133137                iSlippyMapChooser.setSelection(iStartSelectionPoint, iEndSelectionPoint); 
     138                isSelecting = true; 
    134139            } 
    135140        } 
     
    144149        if (e.getButton() == MouseEvent.BUTTON1) { 
    145150 
    146             int sourceButton = iSourceButton.hit(e.getPoint()); 
    147  
    148             if (iSizeButton.hit(e.getPoint())) { 
    149                 iSizeButton.toggle(); 
    150                 iSlippyMapChooser.resizeSlippyMap(); 
    151             } else if (iSlippyMapChooser.handleAttribution(e.getPoint(), true)) { 
    152                 /* do nothing, handleAttribution() already did the work */ 
    153             } else if (sourceButton == SourceButton.HIDE_OR_SHOW) { 
    154                 iSourceButton.toggle(); 
    155                 iSlippyMapChooser.repaint(); 
    156             } else if (sourceButton != 0) { 
    157                 iSlippyMapChooser.toggleMapSource(iSourceButton.hitToTileSource(sourceButton)); 
    158             } else { 
    159                 if (e.getClickCount() == 1) { 
    160                     iSlippyMapChooser.setSelection(iStartSelectionPoint, e.getPoint()); 
    161  
    162                     // reset the selections start and end 
    163                     iEndSelectionPoint = null; 
    164                     iStartSelectionPoint = null; 
    165                 } 
    166             } 
    167  
     151                if (isSelecting && e.getClickCount() == 1) { 
     152                iSlippyMapChooser.setSelection(iStartSelectionPoint, e.getPoint()); 
     153 
     154                // reset the selections start and end 
     155                iEndSelectionPoint = null; 
     156                iStartSelectionPoint = null; 
     157                isSelecting = false; 
     158                 
     159                } else { 
     160                int sourceButton = iSourceButton.hit(e.getPoint()); 
     161 
     162                if (iSizeButton.hit(e.getPoint())) { 
     163                    iSizeButton.toggle(); 
     164                    iSlippyMapChooser.resizeSlippyMap(); 
     165                } else if (iSlippyMapChooser.handleAttribution(e.getPoint(), true)) { 
     166                    /* do nothing, handleAttribution() already did the work */ 
     167                } else if (sourceButton == SourceButton.HIDE_OR_SHOW) { 
     168                    iSourceButton.toggle(); 
     169                    iSlippyMapChooser.repaint(); 
     170                } else if (sourceButton != 0) { 
     171                    iSlippyMapChooser.toggleMapSource(iSourceButton.hitToTileSource(sourceButton)); 
     172                } 
     173                } 
    168174        } 
    169175    } 
Note: See TracChangeset for help on using the changeset viewer.