]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/correlate/MediaPreviewTableRow.java
Version 14, October 2012
[GpsPrune.git] / tim / prune / correlate / MediaPreviewTableRow.java
1 package tim.prune.correlate;
2
3 import tim.prune.data.Distance;
4 import tim.prune.data.Unit;
5
6 /**
7  * Class to hold the contents of a single row in the correlation preview table
8  */
9 public class MediaPreviewTableRow extends MediaSelectionTableRow
10 {
11         private PointMediaPair _pointPair = null;
12         private double _distance = 0.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                 _correlate = (inPointPair.getMedia().getDataPoint() == null);
26         }
27
28         /**
29          * @param inUnits units to use
30          * @return distance in selected format
31          */
32         public double getDistance(Unit inUnits)
33         {
34                 return Distance.convertRadiansToDistance(_distance, inUnits);
35         }
36
37         /**
38          * @return point pair object
39          */
40         public PointMediaPair getPointPair()
41         {
42                 return _pointPair;
43         }
44
45         /**
46          * @return flag to set whether to correlate or not
47          */
48         public Boolean getCorrelateFlag()
49         {
50                 return Boolean.valueOf(_correlate);
51         }
52
53         /**
54          * @param inFlag true to correlate, false to ignore
55          */
56         public void setCorrelateFlag(boolean inFlag)
57         {
58                 _correlate = inFlag;
59         }
60 }