Ignore:
Timestamp:
2014-06-10T00:04:18+02:00 (12 years ago)
Author:
zverik
Message:

wow, it works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogEntry.java

    r27939 r30491  
    11package nanolog;
    22
    3 import java.util.Date;
     3import java.awt.*;
     4import java.util.*;
     5import org.openstreetmap.josm.Main;
     6import org.openstreetmap.josm.data.Bounds;
    47import org.openstreetmap.josm.data.coor.LatLon;
     8import org.openstreetmap.josm.gui.MapView;
    59
    610/**
     
    913 * @author zverik
    1014 */
    11 public class NanoLogEntry {
     15public class NanoLogEntry implements Comparable<NanoLogEntry> {
    1216    private LatLon pos;
    1317    private Date time;
    1418    private String message;
    15     private int direction;
    16     private LatLon tmpPos;
     19    private Integer direction;
     20    private Integer baseDir;
     21    private LatLon basePos;
    1722
    18     public int getDirection() {
     23    public NanoLogEntry( Date time, String message, LatLon basePos, Integer baseDir ) {
     24        this.basePos = basePos;
     25        this.baseDir = baseDir;
     26        this.pos = basePos;
     27        this.direction = baseDir;
     28        this.time = time;
     29        this.message = message;
     30        this.direction = direction;
     31    }
     32
     33    public NanoLogEntry( Date time, String message ) {
     34        this(time, message, null, null);
     35    }
     36   
     37    public Integer getDirection() {
    1938        return direction;
    2039    }
     
    2544
    2645    public LatLon getPos() {
    27         return tmpPos == null ? pos : tmpPos;
     46        return pos;
     47    }
     48
     49    public void setPos( LatLon pos ) {
     50        this.pos = pos;
     51    }
     52
     53    public void setDirection( Integer direction ) {
     54        this.direction = direction;
     55    }
     56
     57    public LatLon getBasePos() {
     58        return basePos;
     59    }
     60
     61    public Integer getBaseDir() {
     62        return baseDir;
    2863    }
    2964
     
    3166        return time;
    3267    }
     68
     69    @Override
     70    public int compareTo( NanoLogEntry t ) {
     71        return time.compareTo(t.time);
     72    }
    3373}
Note: See TracChangeset for help on using the changeset viewer.