X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=src%2Ftim%2Fprune%2Fcorrelate%2FMediaPreviewTableRow.java;fp=src%2Ftim%2Fprune%2Fcorrelate%2FMediaPreviewTableRow.java;h=700336f7d1b928ecf5d5370100226e3435782ec9;hp=0000000000000000000000000000000000000000;hb=ce6f2161b8596f7018d6a76bff79bc9e571f35fd;hpb=2d8cb72e84d5cc1089ce77baf1e34ea3ea2f8465 diff --git a/src/tim/prune/correlate/MediaPreviewTableRow.java b/src/tim/prune/correlate/MediaPreviewTableRow.java new file mode 100644 index 0000000..700336f --- /dev/null +++ b/src/tim/prune/correlate/MediaPreviewTableRow.java @@ -0,0 +1,60 @@ +package tim.prune.correlate; + +import tim.prune.data.Distance; +import tim.prune.data.Unit; + +/** + * Class to hold the contents of a single row in the correlation preview table + */ +public class MediaPreviewTableRow extends MediaSelectionTableRow +{ + private PointMediaPair _pointPair = null; + private double _distance = 0.0; + private boolean _correlate = false; + + + /** + * Constructor + * @param inPointPair point pair object + */ + public MediaPreviewTableRow(PointMediaPair inPointPair) + { + super(inPointPair.getMedia(), inPointPair.getMinSeconds()); + _pointPair = inPointPair; + _distance = inPointPair.getMinRadians(); + _correlate = (inPointPair.getMedia().getDataPoint() == null); + } + + /** + * @param inUnits units to use + * @return distance in selected format + */ + public double getDistance(Unit inUnits) + { + return Distance.convertRadiansToDistance(_distance, inUnits); + } + + /** + * @return point pair object + */ + public PointMediaPair getPointPair() + { + return _pointPair; + } + + /** + * @return flag to set whether to correlate or not + */ + public Boolean getCorrelateFlag() + { + return Boolean.valueOf(_correlate); + } + + /** + * @param inFlag true to correlate, false to ignore + */ + public void setCorrelateFlag(boolean inFlag) + { + _correlate = inFlag; + } +}