package tim.prune.gui.colour; import java.awt.Color; import java.util.ArrayList; import tim.prune.data.DataPoint; import tim.prune.data.FileInfo; import tim.prune.data.SourceInfo; import tim.prune.data.TrackInfo; /** * Colours points according to which file (or source) they came from */ public class FileColourer extends DiscretePointColourer { /** * Constructor * @param inStartColour start colour of scale * @param inEndColour end colour of scale * @param inWrapLength number of unique colours before wrap */ public FileColourer(Color inStartColour, Color inEndColour, int inWrapLength) { super(inStartColour, inEndColour, inWrapLength); } /** * Calculate the colours for each of the points in the given track * @param inTrackInfo track info object */ @Override public void calculateColours(TrackInfo inTrackInfo) { // initialise the array to the right size final int numPoints = inTrackInfo.getTrack().getNumPoints(); init(numPoints); // loop over track points FileInfo fInfo = inTrackInfo.getFileInfo(); ArrayList sourceList = new ArrayList(); for (int i=0; i