Changeset 4203 in josm


Ignore:
Timestamp:
Jul 6, 2011 5:10:23 PM (2 years ago)
Author:
stoecker
Message:

fix #6544 - fix NPE

Location:
trunk/src/org/openstreetmap/josm
Files:
7 edited

Legend:

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

    r4139 r4203  
    4545        selected = Main.pref.getBoolean("draw.fullscreen", false); 
    4646        notifySelectedState(); 
    47     } 
    48  
    49     public boolean canFullscreen() { 
    50         /* We only support fullscreen, see 
    51          * http://lists.openstreetmap.org/pipermail/josm-dev/2009-March/002659.html 
    52          * for why 
    53          */ 
    54         return Main.platform instanceof PlatformHookUnixoid && gd.isFullScreenSupported(); 
    5547    } 
    5648 
     
    10597            frame.setBounds(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())); 
    10698        } 
    107          
     99 
    108100        // we cannot use hw-exclusive fullscreen mode in MS-Win, as long 
    109101        // as josm throws out modal dialogs, see here: 
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r4198 r4203  
    4242                Collections.<Collection<String>>emptySet())) { 
    4343            ImageryInfo i = new ImageryInfo(c); 
    44             /* FIXME: Remove the attribution copy stuff end of 2011 */ 
    45             if(!i.hasAttribution()) { 
    46                 String url = i.getUrl(); 
    47                 for(ImageryInfo d : defaultLayers) { 
    48                     if(url.equals(d.getUrl())) { 
    49                         i.copyAttribution(d); 
    50                         i.setBounds(d.getBounds()); 
    51                         break; 
     44            String url = i.getUrl(); 
     45            if(url != null) { 
     46                /* FIXME: Remove the attribution copy stuff end of 2011 */ 
     47                if(!i.hasAttribution()) { 
     48                    for(ImageryInfo d : defaultLayers) { 
     49                        if(url.equals(d.getUrl())) { 
     50                            i.copyAttribution(d); 
     51                            i.setBounds(d.getBounds()); 
     52                            break; 
     53                        } 
    5254                    } 
    5355                } 
     56                add(i); 
    5457            } 
    55             add(i); 
    5658        } 
    5759        Collections.sort(layers); 
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r4175 r4203  
    306306            // -- fullscreen toggle action 
    307307            fullscreenToggleAction = new FullscreenToggleAction(); 
    308             if (fullscreenToggleAction.canFullscreen()) { 
     308            if (Main.platform.canFullscreen()) { 
    309309                final JCheckBoxMenuItem fullscreen = new JCheckBoxMenuItem(fullscreenToggleAction); 
    310310                viewMenu.addSeparator(); 
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r4153 r4203  
    104104    public String getDefaultStyle(); 
    105105 
     106    public boolean canFullscreen(); 
     107 
    106108    public boolean rename(File from, File to); 
    107109} 
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r4153 r4203  
    272272 
    273273    @Override 
     274    public boolean canFullscreen() 
     275    { 
     276        return false; 
     277    } 
     278 
     279    @Override 
    274280    public boolean rename(File from, File to) 
    275281    { 
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r4153 r4203  
    22package org.openstreetmap.josm.tools; 
    33 
     4import java.awt.GraphicsEnvironment; 
    45import java.awt.event.KeyEvent; 
    56import java.io.File; 
     
    8182 
    8283    @Override 
     84    public boolean canFullscreen() 
     85    { 
     86        return GraphicsEnvironment.getLocalGraphicsEnvironment() 
     87        .getDefaultScreenDevice().isFullScreenSupported(); 
     88    } 
     89 
     90    @Override 
    8391    public boolean rename(File from, File to) 
    8492    { 
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r4153 r4203  
    6363 
    6464    @Override 
     65    public boolean canFullscreen() 
     66    { 
     67        return false; 
     68    } 
     69 
     70    @Override 
    6571    public boolean rename(File from, File to) 
    6672    { 
Note: See TracChangeset for help on using the changeset viewer.