Ignore:
Timestamp:
2009-06-17T09:01:52+02:00 (16 years ago)
Author:
stoecker
Message:

fixed typos

Location:
applications/editors/josm/plugins
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java

    r14916 r15960  
    559559                new String[] { tr("Correlate"), tr("Auto-Guess"), tr("Cancel") },
    560560                new String[] { "ok.png", "dialogs/gpx2imgManual.png", "cancel.png" }).getValue();
    561            
     561
    562562            if(answer != 1 && answer != 2)
    563563                return;
    564                
     564
    565565            // Check the selected values
    566566            Object item = cbGpx.getSelectedItem();
     
    572572            }
    573573            selectedGpx = ((GpxDataWrapper) item);
    574            
     574
    575575            if (answer == 2) {
    576576                autoGuess(selectedGpx.data);
     
    643643
    644644    }
    645    
     645
    646646    // These variables all belong to "auto guess" but need to be accessible
    647647    // from the slider change listener
     
    659659    private long firstGPXDate = -1;
    660660    private long firstExifDate = -1;
    661    
     661
    662662    /**
    663663     * Tries to automatically match opened photos to a given GPX track. Changes are applied
     
    669669        autoImgs = getSortedImgList(true, false);
    670670        PrimaryDateParser dateParser = new PrimaryDateParser();
    671        
     671
    672672        // no images found, exit
    673673        if(autoImgs.size() <= 0) {
     
    677677            return;
    678678        }
    679        
     679
    680680        // Free the user's vision
    681681        Main.pleaseWaitDlg.setVisible(false);
    682682        AgpifojDialog dialog = AgpifojDialog.getInstance();
    683683        dialog.action.button.setSelected(true);
    684         dialog.action.actionPerformed(null); 
     684        dialog.action.actionPerformed(null);
    685685        // Will show first photo if none is selected yet
    686686        if(!dialog.hasImage())
    687687            yLayer.showNextPhoto();
    688688        // FIXME: If the dialog is minimized it will not be maximized. ToggleDialog is
    689         // in need of a complete re-write to allow this in a reasonable way. 
     689        // in need of a complete re-write to allow this in a reasonable way.
    690690
    691691        // Init variables
    692692        firstExifDate = autoImgs.get(0).time.getTime()/1000;
    693        
    694        
     693
     694
    695695        // Finds first GPX point
    696696        outer: for (GpxTrack trk : gpx.tracks) {
     
    699699                    String curDateWpStr = (String) curWp.attr.get("time");
    700700                    if (curDateWpStr == null) continue;
    701                    
     701
    702702                    try {
    703703                        firstGPXDate = dateParser.parse(curDateWpStr).getTime()/1000;
     
    707707            }
    708708        }
    709        
     709
    710710        // No GPX timestamps found, exit
    711711        if(firstGPXDate < 0) {
     
    715715            return;
    716716        }
    717        
     717
    718718        // seconds
    719719        long diff = (yLayer.hasTimeoffset)
    720720            ? yLayer.timeoffset
    721             : firstExifDate - firstGPXDate;         
     721            : firstExifDate - firstGPXDate;
    722722        yLayer.timeoffset = diff;
    723723        yLayer.hasTimeoffset = true;
    724        
     724
    725725        double diffInH = (double)diff/(60*60);    // hours
    726726
     
    728728        dayOffset = (int)Math.round(diffInH / 24); // days
    729729        double timezone = diff - dayOffset*24*60*60;  // seconds
    730        
     730
    731731        // In hours, rounded to two decimal places
    732732        timezone = (double)Math.round(timezone*100/(60*60)) / 100;
     
    736736        double fixTimezone = (double)Math.round(timezone * 2)/2; // hours, rounded to one decimal place
    737737        int offset = (int)Math.round(diff - fixTimezone*60*60) - dayOffset*24*60*60; // seconds
    738        
     738
    739739        /*System.out.println("phto " + firstExifDate);
    740740        System.out.println("gpx  " + firstGPXDate);
     
    745745        System.out.println("fix  " + fixTimezone);
    746746        System.out.println("offt " + offset);*/
    747        
     747
    748748        // This is called whenever one of the sliders is moved.
    749749        // It updates the labels and also calls the "match photos" code
     
    756756                    : (int)Math.floor(tz/2) + ":30";
    757757                if(sldTimezone.getValue() < 0) zone = "-" + zone;
    758                
     758
    759759                lblTimezone.setText(tr("Timezone: {0}", zone));
    760760                lblMinutes.setText(tr("Minutes: {0}", sldMinutes.getValue()));
    761761                lblSeconds.setText(tr("Seconds: {0}", sldSeconds.getValue()));
    762                
     762
    763763                float gpstimezone = parseTimezone(zone).floatValue();
    764                
     764
    765765                // Reset previous position
    766766                for(ImageEntry x : autoImgs) {
     
    768768                    x.pos = null;
    769769                }
    770                
     770
    771771                long timediff = (long) (gpstimezone * 3600)
    772772                        + dayOffset*24*60*60
    773773                        + sldMinutes.getValue()*60
    774774                        + sldSeconds.getValue();
    775                
     775
    776776                int matched = matchGpxTrack(autoImgs, autoGpx, timediff);
    777777
     
    783783                      )
    784784                );
    785                
     785
    786786                int offset = (int)(firstGPXDate+timediff-firstExifDate);
    787787                int o = Math.abs(offset);
     
    797797            }
    798798        }
    799        
     799
    800800        // Info Labels
    801801        lblMatches = new JLabel();
     
    807807        lblTimezone = new JLabel();
    808808        sldTimezone = new JSlider(-24, 24, 0);
    809         sldTimezone.setPaintLabels(true);       
     809        sldTimezone.setPaintLabels(true);
    810810        Hashtable labelTable = new Hashtable();
    811811        labelTable.put(-24, new JLabel("-12:00"));
     
    815815        labelTable.put( 24, new JLabel( "12:00"));
    816816        sldTimezone.setLabelTable(labelTable);
    817        
     817
    818818        // Minutes Slider
    819819        lblMinutes = new JLabel();
    820         sldMinutes = new JSlider(-15, 15, 0);       
    821         sldMinutes.setPaintLabels(true);   
    822         sldMinutes.setMajorTickSpacing(5); 
    823        
     820        sldMinutes = new JSlider(-15, 15, 0);
     821        sldMinutes.setPaintLabels(true);
     822        sldMinutes.setMajorTickSpacing(5);
     823
    824824        // Seconds slider
    825825        lblSeconds = new JLabel();
    826         sldSeconds = new JSlider(-60, 60, 0);       
    827         sldSeconds.setPaintLabels(true);   
    828         sldSeconds.setMajorTickSpacing(30); 
    829        
     826        sldSeconds = new JSlider(-60, 60, 0);
     827        sldSeconds.setPaintLabels(true);
     828        sldSeconds.setMajorTickSpacing(30);
     829
    830830        // Put everything together
    831831        JPanel p = new JPanel(new GridBagLayout());
     
    839839        p.add(lblSeconds, GBC.eol().fill());
    840840        p.add(sldSeconds, GBC.eol().fill());
    841        
     841
    842842        // If there's an error in the calculation the found values
    843843        // will be off range for the sliders. Catch this error
     
    849849        } catch(Exception e) {
    850850            JOptionPane.showMessageDialog(Main.parent,
    851                 tr("An error occured while trying to match the photos to the GPX track."
     851                tr("An error occurred while trying to match the photos to the GPX track."
    852852                    +" You can adjust the sliders to manually match the photos."),
    853853                tr("Matching photos to track failed"),
    854854                JOptionPane.WARNING_MESSAGE);
    855855        }
    856        
     856
    857857        // Call the sliderListener once manually so labels get adjusted
    858858        new sliderListener().stateChanged(null);
     
    862862        sldMinutes.addChangeListener(new sliderListener());
    863863        sldSeconds.addChangeListener(new sliderListener());
    864        
     864
    865865        // There is no way to cancel this dialog, all changes get applied
    866866        // immediately. Therefore "Close" is marked with an "OK" icon.
    867         // Settings are only saved temporarily to the layer. 
     867        // Settings are only saved temporarily to the layer.
    868868        int answer = new ExtendedDialog(Main.parent,
    869869            tr("Adjust timezone and offset"),
     
    872872            new String[] { "ok.png", "dialogs/refresh.png"}
    873873        ).getValue();
    874        
     874
    875875        // User wants default values; discard old result and re-open dialog
    876876        if(answer == 2) {
     
    879879        }
    880880    }
    881    
     881
    882882    /**
    883883     * Returns a list of images that fulfill the given criteria.
     
    913913            }
    914914        }
    915        
     915
    916916        Collections.sort(dateImgLst, new Comparator<ImageEntry>() {
    917917            public int compare(ImageEntry arg0, ImageEntry arg1) {
     
    919919            }
    920920        });
    921        
     921
    922922        return dateImgLst;
    923923    }
     
    966966        // Time between the track point and the previous one, 5 sec if first point, i.e. photos take
    967967        // 5 sec before the first track point can be assumed to be take at the starting position
    968         long interval = prevDateWp > 0 ? ((int)Math.abs(curDateWp - prevDateWp)) : 5; 
     968        long interval = prevDateWp > 0 ? ((int)Math.abs(curDateWp - prevDateWp)) : 5;
    969969        int ret = 0;
    970        
    971         // i is the index of the timewise last photo that has the same or earlier EXIF time 
     970
     971        // i is the index of the timewise last photo that has the same or earlier EXIF time
    972972        int i = getLastIndexOfListBefore(dateImgLst, curDateWp);
    973973
    974974        // no photos match
    975         if (i < 0)           
    976             return 0;       
    977            
     975        if (i < 0)
     976            return 0;
     977
    978978        Double speed = null;
    979979        Double prevElevation = null;
    980980        Double curElevation = null;
    981        
     981
    982982        if (prevWp != null) {
    983983            double distance = getDistance(prevWp, curWp);
    984984            // This is in km/h, 3.6 * m/s
    985985            if (curDateWp > prevDateWp)
    986                 speed = 3.6 * distance / (curDateWp - prevDateWp);   
     986                speed = 3.6 * distance / (curDateWp - prevDateWp);
    987987            try {
    988988                prevElevation = new Double((String) prevWp.attr.get("ele"));
    989989            } catch(Exception e) {}
    990990        }
    991        
     991
    992992        try {
    993993            curElevation = new Double((String) curWp.attr.get("ele"));
    994994        } catch (Exception e) {}
    995        
    996         // First trackpoint, then interval is set to five seconds, i.e. photos up to five seconds 
    997         // before the first point will be geotagged with the starting point       
     995
     996        // First trackpoint, then interval is set to five seconds, i.e. photos up to five seconds
     997        // before the first point will be geotagged with the starting point
    998998        if(prevDateWp == 0 || curDateWp <= prevDateWp) {
    999999            while(i >= 0 && (dateImgLst.get(i).time.getTime()/1000) <= curDateWp
    10001000                        && (dateImgLst.get(i).time.getTime()/1000) >= (curDateWp - interval)) {
    1001                 if(dateImgLst.get(i).coor == null) {               
     1001                if(dateImgLst.get(i).coor == null) {
    10021002                    dateImgLst.get(i).pos = curWp.eastNorth;
    10031003                    dateImgLst.get(i).coor = Main.proj.eastNorth2latlon(dateImgLst.get(i).pos);
     
    10251025                dateImgLst.get(i).coor = Main.proj.eastNorth2latlon(dateImgLst.get(i).pos);
    10261026                dateImgLst.get(i).speed = speed;
    1027            
     1027
    10281028                if (curElevation != null && prevElevation != null)
    10291029                    dateImgLst.get(i).elevation = interpolate(prevElevation, curElevation, timeDiff);
    1030            
     1030
    10311031                ret++;
    10321032            }
     
    10461046        if(lstSize == 0 || searchedDate < dateImgLst.get(0).time.getTime()/1000)
    10471047            return -1;
    1048            
     1048
    10491049        // The search period is later than the last photo
    10501050        if (searchedDate > dateImgLst.get(lstSize - 1).time.getTime() / 1000)
    1051             return lstSize-1;   
     1051            return lstSize-1;
    10521052
    10531053        // The searched index is somewhere in the middle, do a binary search from the beginning
     
    10551055        int startIndex= 0;
    10561056        int endIndex= lstSize-1;
    1057         while (endIndex - startIndex > 1) {           
     1057        while (endIndex - startIndex > 1) {
    10581058            curIndex= (int) Math.round((double)(endIndex + startIndex)/2);
    10591059            if (searchedDate > dateImgLst.get(curIndex).time.getTime()/1000)
     
    10641064        if (searchedDate < dateImgLst.get(endIndex).time.getTime()/1000)
    10651065            return startIndex;
    1066  
    1067         // This final loop is to check if photos with the exact same EXIF time follows 
     1066
     1067        // This final loop is to check if photos with the exact same EXIF time follows
    10681068        while ((endIndex < (lstSize-1)) && (dateImgLst.get(endIndex).time.getTime()
    10691069                                                == dateImgLst.get(endIndex + 1).time.getTime()))
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r15707 r15960  
    496496        if (this.lambertZone != currentLambertZone) {
    497497            JOptionPane.showMessageDialog(Main.parent, tr("Lambert zone {0} in cache "+
    498                     " incompatible with current Lambert zone {1}",
     498                    "incompatible with current Lambert zone {1}",
    499499                    this.lambertZone+1, currentLambertZone), tr("Cache Lambert Zone Error"), JOptionPane.ERROR_MESSAGE);
    500500            return false;
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java

    r13497 r15960  
    9494    public OsbDialog(final OsbPlugin plugin) {
    9595        super(tr("Open OpenStreetBugs"), "icon_error22",
    96                 tr("Open the OpenStreetBugs window and activate the automatic download"), Shortcut.registerShortcut(
     96                tr("Opens the OpenStreetBugs window and activates the automatic download"), Shortcut.registerShortcut(
    9797                        "view:openstreetbugs", tr("Toggle: {0}", tr("Open OpenStreetBugs")), KeyEvent.VK_O,
    9898                        Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT), 150);
  • applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/JoinAreasAction.java

    r14356 r15960  
    193193            DataSet.fireSelectionChanged(Main.ds.getSelected());
    194194        } else
    195             JOptionPane.showMessageDialog(Main.parent, tr("No intersections found. Nothing was changed."));
     195            JOptionPane.showMessageDialog(Main.parent, tr("No intersection found. Nothing was changed."));
    196196    }
    197197
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Help_WMSmenuAction.java

    r13497 r15960  
    1212
    1313    /**
    14      * 
     14     *
    1515     */
    16    
     16
    1717
    1818    public Help_WMSmenuAction() {
    1919        //super("Help / About");
    2020        super(tr("help"), "help", tr("Help / About"), null, false);
    21        
     21
    2222    }
    23    
     23
    2424    public void actionPerformed(ActionEvent e) {
    25         //todo - put this into a txt file? 
    26           String helptext = 
     25        //todo - put this into a txt file?
     26          String helptext =
    2727            tr("You can add, edit and delete WMS entries in the WMSplugin Preference Tab - "  +
    2828            "these will then show up in the WMS menu.\n\n"+
    29            
     29
    3030            "You can also do this manually in the Advanced Preferences, using the following schema:\n"+
    3131            "wmsplugin.url.1.name=Landsat\n"+
    3232            "wmsplugin.url.1.url=http://onearth.jpl.nasa.gov....\n"+
    3333            "wmsplugin.url.2.name=NPE Maps... etc\n\n"+
    34                    
     34
    3535            "Full WMS URL input format example (landsat)\n"+
    3636            "http://onearth.jpl.nasa.gov/wms.cgi?request=GetMap&\n"+
    37             "layers=global_mosaic&styles=&srs=EPSG:4326&\n"+
    38             "format=image/jpeg \n\n"+
    39            
     37            "layers=global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg\n\n"+
     38
    4039            "For Metacarta's Map Rectifier http://labs.metacarta.com/rectifier/ , you only need to input the relevant 'id'.\n" +
    41             "To add a Metacarta Map Rectifier menu item, manually create the URL like in this example," +
    42             "replacing 73 with your image id: \n" +
     40            "To add a Metacarta Map Rectifier menu item, manually create the URL like in this example, " +
     41            "replacing 73 with your image id:\n" +
    4342            "http://labs.metacarta.com/rectifier/wms.cgi?id=73\n" +
    44             "&srs=EPSG:4326&Service=WMS&Version=1.1.0&Request=GetMap&format=image/png\n" +
    45             " \n" +
     43            "&srs=EPSG:4326&Service=WMS&Version=1.1.0&Request=GetMap&format=image/png\n\n" +
     44
    4645            "Note: Make sure the image is suitable, copyright-wise, if in doubt, don't use.");
    47        
     46
    4847        JTextPane tp = new JTextPane();
    4948          JScrollPane js = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
    5049                  JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    51          
    52          
     50
     51
    5352          js.getViewport().add(tp);
    5453          JFrame jf = new JFrame(tr("WMS Plugin Help"));
     
    5655          jf.pack();
    5756          jf.setSize(400,500);
    58           jf.setVisible(true); 
     57          jf.setVisible(true);
    5958          tp.setText(helptext);
    6059    }
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java

    r13584 r15960  
    1 package wmsplugin; 
     1package wmsplugin;
    22
    33import static org.openstreetmap.josm.tools.I18n.tr;
     
    2525
    2626    public WMSAdjustAction(MapFrame mapFrame) {
    27         super(tr("Adjust WMS"), "adjustwms", 
    28                         tr("Adjust the position of the selected WMS layer"), mapFrame, 
     27        super(tr("Adjust WMS"), "adjustwms",
     28                        tr("Adjust the position of the selected WMS layer"), mapFrame,
    2929                        ImageProvider.getCursor("normal", "move"));
    3030    }
     
    4545        if (e.getButton() != MouseEvent.BUTTON1)
    4646            return;
    47        
     47
    4848        Layer layer=Main.map.mapView.getActiveLayer();
    4949        if (layer.visible && layer instanceof WMSLayer) {
     
    6363                    Main.map.mapView.getEastNorth(e.getX(),e.getY());
    6464            selectedLayer.displace(
    65                 eastNorth.east()-prevEastNorth.east(), 
     65                eastNorth.east()-prevEastNorth.east(),
    6666                eastNorth.north()-prevEastNorth.north()
    6767            );
     
    7474        Main.map.mapView.repaint();
    7575        Main.map.mapView.setCursor(Cursor.getDefaultCursor());
    76         selectedImage = null;   
     76        selectedImage = null;
    7777        prevEastNorth = null;
    7878        selectedLayer = null;
     
    8888    @Override public void mouseClicked(MouseEvent e) {
    8989    }
    90    
     90
    9191    // This only makes the buttons look disabled, but since no keyboard shortcut is
    9292    // provided there aren't any other means to activate this tool
Note: See TracChangeset for help on using the changeset viewer.