Changeset 23954 in osm for applications


Ignore:
Timestamp:
2010-10-31T11:45:55+01:00 (14 years ago)
Author:
guardian
Message:

fixed videotime display bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java

    r23529 r23954  
    22import java.awt.Adjustable;
    33import org.apache.log4j.Logger;
     4import org.apache.log4j.helpers.DateTimeDateFormat;
    45
    56import java.awt.BorderLayout;
     
    1314import java.beans.PropertyChangeListener;
    1415import java.io.File;
     16import java.sql.Time;
     17import java.text.DateFormat;
    1518import java.text.SimpleDateFormat;
    1619import java.util.Date;
     
    1821import java.util.Hashtable ;
    1922import java.util.Set;
     23import java.util.TimeZone;
    2024import java.util.Timer;
    2125import java.util.TimerTask;
     
    340344        if(mp.isPlaying())
    341345        {
    342             setTitle(ms.format(new Date(mp.getTime())));
     346                long millis=mp.getTime();
     347                String s = String.format("%02d:%02d:%02d", //dont know why normal Java date utils doesn't format the time right
     348                      TimeUnit.MILLISECONDS.toHours(millis),
     349                      TimeUnit.MILLISECONDS.toMinutes(millis) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(millis)),
     350                      TimeUnit.MILLISECONDS.toSeconds(millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))
     351                    );
     352            //setTitle(ms.format(new Time(sec)));
     353                setTitle(s);
    343354            syncTimeline=true;
    344355            timeline.setValue(Math.round(mp.getPosition()*100));
Note: See TracChangeset for help on using the changeset viewer.