Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+20 votes

We're using a ComboBox to store the UnassignedTracks, and want to have the given track to show on the canvas when we select it in the ComboBox. Also trying to get it to skip to the last frame of that track, but it doesn't seem to be doing that. It seems to me that the method isn't being called at all even though I set it for onAction for that method.

edit: access doesn't seem to be the issue becuase when I use it it does actually get the track and now it will skip to that frame I want, but the points still will not draw even when I loop through each element in the track with

for(int i = 0; i < track.size(); i++) {
GraphicsContext drawingPen = canvasView.getGraphicsContext2D();
drawingPen.setFill(Color.TOMATO);
drawingPen.fillOval(track.getTimePointAtIndex(i).getX(), track.getTimePointAtIndex(i).getY(), 5, 5);
System.out.println(track.getTimePointAtIndex(i));
}

asked in CSC285_Fall2018 by (100 points)
edited by

1 Answer

+3 votes

One possibility -- are you drawing points with X,Y values outside the dimensions of the canvas?

If so, this could be because:
a) your canvas might be the wrong size,
or more likely --
b) you need to re-scale your points tracking points before drawing them, by multiplying them by the appropriate ratio (because your your canvas is a different size than your video image)?

Anther possibility: is your canvas in a stack frame, but it's behind something else (e.g. an imageview), so none of it is showing?

answered by (1.4k points)
...