I'm trying to animate a chess piece on a board. First I created a java.util.Timer object, which "scheduleAtFixedRate" TimerTask is implemented as a proxy function. Thus, I saved the fragment record for moving (moving around the figure) and when it fits (when the user moves the piece with the mouse), the TimerTask proxy function should be a check if the record is non-zero, the mobile function. The blending function only updates the x and y coordinates of the shape according to a pre-calculated vector. I put the clock-clock on the record-move, so when it changes, he must repaint the board (canvas). The drawing method checks to see if this record with the movement of the workpiece is not null.
The problem is that the animation is not displayed. A piece simply jumps into fate, without movement between them. There is some problem with the animation scheme. Is there a better way to do this?
java clojure animation swing
Humberto pinheiro
source share