Ignore:
Timestamp:
2009-09-20T10:10:18+02:00 (15 years ago)
Author:
stoecker
Message:

fixed typos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java

    r17534 r17703  
    11/* Copyright (c) 2008, Henrik Niehaus
    22 * All rights reserved.
    3  * 
     3 *
    44 * Redistribution and use in source and binary forms, with or without
    55 * modification, are permitted provided that the following conditions are met:
    6  * 
     6 *
    77 * 1. Redistributions of source code must retain the above copyright notice,
    88 *    this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright notice, 
    10  *    this list of conditions and the following disclaimer in the documentation 
     9 * 2. Redistributions in binary form must reproduce the above copyright notice,
     10 *    this list of conditions and the following disclaimer in the documentation
    1111 *    and/or other materials provided with the distribution.
    12  * 3. Neither the name of the project nor the names of its 
    13  *    contributors may be used to endorse or promote products derived from this 
     12 * 3. Neither the name of the project nor the names of its
     13 *    contributors may be used to endorse or promote products derived from this
    1414 *    software without specific prior written permission.
    15  * 
     15 *
    1616 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1717 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     
    5151
    5252/**
    53  * Shows issues from OpenStreetBugs 
     53 * Shows issues from OpenStreetBugs
    5454 *
    5555 * @author Henrik Niehaus (henrik dot niehaus at gmx dot de)
     
    5858
    5959    private DataSet dataSet;
    60    
     60
    6161    private UploadHook uploadHook;
    62    
     62
    6363    private OsbDialog dialog;
    64    
     64
    6565    private OsbLayer layer;
    66    
     66
    6767    public static boolean active = false;
    68    
     68
    6969    private DownloadAction download = new DownloadAction();
    70    
     70
    7171    public OsbPlugin() {
    7272        super();
     
    7878        OsbLayer.listeners.add(this);
    7979    }
    80    
     80
    8181    private void initConfig() {
    8282        String debug = Main.pref.get(ConfigKeys.OSB_API_DISABLED);
     
    8585            Main.pref.put(ConfigKeys.OSB_API_DISABLED, debug);
    8686        }
    87        
     87
    8888        // check, which api is used
    8989        String uriNew = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
     
    9191        boolean switchApi = true;
    9292        if(oldApi) {
    93             int choice = JOptionPane.showConfirmDialog(Main.parent, 
    94                     tr("<html>The openstreetbus plugin is using the old server at appspot.com.<br>" +
    95                                 "A new server is available at schokokeks.org.<br>" +
    96                                 "Do you want to switch to the new server? (Strongly recommended)</html>"),
     93            int choice = JOptionPane.showConfirmDialog(Main.parent,
     94                    tr("<html>The openstreetbugs plugin is using the old server at appspot.com.<br>" +
     95                            "A new server is available at schokokeks.org.<br>" +
     96                            "Do you want to switch to the new server? (Strongly recommended)</html>"),
    9797                    tr("Switch to new openstreetbugs server?"),
    9898                    JOptionPane.YES_NO_OPTION);
    9999            switchApi = choice == JOptionPane.YES_OPTION;
    100100        }
    101                
     101
    102102        String uri = Main.pref.get(ConfigKeys.OSB_API_URI_EDIT);
    103103        if(uri == null || uri.length() == 0 || switchApi) {
     
    105105            Main.pref.put(ConfigKeys.OSB_API_URI_EDIT, uri);
    106106        }
    107        
     107
    108108        uri = Main.pref.get(ConfigKeys.OSB_API_URI_CLOSE);
    109109        if(uri == null || uri.length() == 0 || switchApi) {
     
    111111            Main.pref.put(ConfigKeys.OSB_API_URI_CLOSE, uri);
    112112        }
    113        
     113
    114114        uri = Main.pref.get(ConfigKeys.OSB_API_URI_DOWNLOAD);
    115115        if(uri == null || uri.length() == 0 || switchApi) {
     
    117117            Main.pref.put(ConfigKeys.OSB_API_URI_DOWNLOAD, uri);
    118118        }
    119        
     119
    120120        uri = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
    121121        if(uri == null || uri.length() == 0 || switchApi) {
     
    123123            Main.pref.put(ConfigKeys.OSB_API_URI_NEW, uri);
    124124        }
    125        
     125
    126126        String auto_download = Main.pref.get(ConfigKeys.OSB_AUTO_DOWNLOAD);
    127127        if(auto_download == null || auto_download.length() == 0) {
     
    129129            Main.pref.put(ConfigKeys.OSB_AUTO_DOWNLOAD, auto_download);
    130130        }
    131        
     131
    132132        String include_date = Main.pref.get(ConfigKeys.OSB_INCLUDE_DATE);
    133133        if(include_date == null || include_date.length() == 0) {
     
    147147            mv.getLatLon(mv.getWidth(), 0));
    148148    }
    149    
     149
    150150    public void updateData() {
    151151        // determine the bounds of the currently visible area
     
    158158            return;
    159159        }
    160        
     160
    161161        try {
    162162            // download the data
     
    177177        }
    178178    }
    179    
     179
    180180    public void updateGui() {
    181181        // update dialog
    182182        dialog.update(dataSet);
    183        
     183
    184184        // create a new layer if necessary
    185185        updateLayer(dataSet);
    186        
     186
    187187        // repaint view, so that changes get visible
    188188        Main.map.mapView.repaint();
    189189    }
    190    
     190
    191191    private void updateLayer(DataSet osbData) {
    192192        if(layer == null) {
     
    201201            // add the dialog
    202202            newFrame.addToggleDialog(dialog);
    203            
     203
    204204            // add the upload hook
    205             UploadAction.registerUploadHook(uploadHook);           
     205            UploadAction.registerUploadHook(uploadHook);
    206206        } else if (oldFrame!=null && newFrame==null ) { // map frame removed
    207            
    208         }
    209     }
    210    
     207
     208        }
     209    }
     210
    211211    public static ImageIcon loadIcon(String name) {
    212212        URL url = OsbPlugin.class.getResource("/images/".concat(name));
     
    219219        if(newLayer instanceof OsmDataLayer) {
    220220            active = dialog.isDialogShowing();
    221            
     221
    222222            // start the auto download loop
    223223            OsbDownloadLoop.getInstance().setPlugin(this);
Note: See TracChangeset for help on using the changeset viewer.