Actually, having a quick look at the source code no automatic translator will do a good job on the conversion. The code is based on too many library functions that I have never heard of.
And you should also decide if you want to have Java or JavaScript code. Despite their similar names these two languages have not very much in common. Maybe you could tell us about the background of your problem, so that we can figure out if you are even looking for the right solution.
Naga, are you already using any GUI library, like SWT or Swing? Otherwise there are too many possibilities how you could do drawing in Java. There is no one right way included in the language itself.
These conversion softwares are not able to change code effectively because their are few functions like malloc() which is used for memory management in C,C++....
To my experience, there is no satisfying automatic methods, Converters work well for very simple codes, when it gets to real software, you have to do the engineering work yourself, furthermore if you want your code to use all the specifics and accelerations of the language.
Before suggesting a solution, I'd just like to make clear the actual definition of JavaScript and Java.
Java is an OOPL that may be perceived as an extension to C++ with cross-platform support developed by Sun Microsystems. It is a programming language.
JavaScript was originally called ECMA Script used to integrate clent side scripting usually in conjunction with HTML files. It is developed by Netscape and Mozilla. It is a scripting language.
Your code looks what seems to look like a graphics code with some aspect of time included in it. I doubt there would be a standard language converter for such a code. So, in my opinion, it would be better for you to take a look at the graphics methods in Java along with multithreading.
Automated conversion is only possible (and has some sense) for .NET languages (VB.NETC# )as they share the same classes. You will have to manually convert C++ code to Java, but it would be easier to write Java program from the scratch.