]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/correlate/MediaPreviewTableRow.java
cadede31b39613e5512fc6a98be0d284e8cb814d
[GpsPrune.git] / tim / prune / correlate / MediaPreviewTableRow.java
1 package tim.prune.correlate;
2
3 import tim.prune.data.Distance;
4
5 /**
6  * Class to hold the contents of a single row in the correlation preview table
7  */
8 public class MediaPreviewTableRow extends MediaSelectionTableRow
9 {
10         private PointMediaPair _pointPair = null;
11         private double _distance = 0.0;
12         private int _status = 0;
13         private boolean _correlate = false;
14
15
16         /**
17          * Constructor
18          * @param inPointPair point pair object
19          */
20         public MediaPreviewTableRow(PointMediaPair inPointPair)
21         {
22                 super(inPointPair.getMedia(), inPointPair.getMinSeconds());
23                 _pointPair = inPointPair;
24                 _distance = inPointPair.getMinRadians();
25                 _status = 0;
26                 _correlate = (inPointPair.getMedia().getDataPoint() == null);
27         }
28
29         /**
30          * @param inUnits units to use
31          * @return distance in selected format
32          */
33         public double getDistance(Distance.Units inUnits)
34         {
35                 return Distance.convertRadiansToDistance(_distance, inUnits);
36         }
37
38         /**
39          * @return point status
40          */
41         public int getStatus()
42         {
43                 return _status;
44         }
45
46         /**
47          * @return point pair object
48          */
49         public PointMediaPair getPointPair()
50         {
51                 return _pointPair;
52         }
53
54         /**
55          * @return flag to set whether to correlate or not
56          */
57         public Boolean getCorrelateFlag()
58         {
59                 return Boolean.valueOf(_correlate);
60         }
61
62         /**
63          * @param inFlag true to correlate, false to ignore
64          */
65         public void setCorrelateFlag(boolean inFlag)
66         {
67                 _correlate = inFlag;
68         }
69 }