aspose file tools*
The moose likes JavaFX and the fly likes GUI components freeze after animation; path transition issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "GUI components freeze after animation; path transition issues" Watch "GUI components freeze after animation; path transition issues" New topic
Author

GUI components freeze after animation; path transition issues

Ghansham Bhagwandin
Greenhorn

Joined: Jun 11, 2013
Posts: 5
Hi Guys,
I am a newbie to javafx and been having lots of issues in developing an application to animate multiplication and division with negative and positive numbers.
I hope you guys would go easy on me.

This is what I aim to achieve.
There are two text box that accept negative and positive numbers. When you enter X number in the first text box, X circles would animate with a green for positive and red for negative. Next you select an operation (multiplication or division). If multiplication, the second textbox accepts the number to be multiply Y. Y circles with respective color is then added to the set of X circles earlier. Then you will click on the answer button; the circles will then move in groups of Y units to a rectangle until there are no circles left. When the circles cross the border of the rectangle it would change the circles colors into the color representation of the result of the said operation (multiplication).
The process for division is the opposite, where the circles are first drop into the the rectangle and then remove by units based on the number being divided by. Also no circles are drop when its division for the second text box.

Currently when you enter a positive number in the first textbox green circles would drop down and negative numbers would give red.

Find attached of what it would look like.
The problems I am having are,
1. After entering a number in the text box the other components seem to freeze and you can't click on it

2. In the second text box I want to add X amount of balls to the existing set from the first text box. I tried storing the coordinates in a array and update the coordinates and draw it back but only the last set gets drawn.

3. I am not able to move the balls from the existing position to move them by units into the rectangle. i tried the same array idea in number 2 but same problem.

In summary I am not able to move the balls again after its drawn, along with updating it with more balls to the panel and the other components freeze after entering a number in the textbox.

Also pathTransition.setDuration() does not exist or I don't know how that is not working. I am using Netbeans IDE 7.3

Any ideas would be great of what else to try am out of ideas of what else to try and research online.
Thank you if anyone can guide me in what steps to take to resolve the issues I am facing.

Ghansham.


[Thumbnail for pic 1.png]

[Thumbnail for pic 2.png]

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1089
    
  10

Hi Ghansham,
Welcome to the Ranch!

You have provided good amount of details, but, you also need to show us the code.
Specifically, create a small runnable program that replicates your issue and post it. This is called SSCCE.
What that does is, whoever is trying to help you can then simply paste your code, run it and then provide you ideas/hints/solutions.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Ghansham Bhagwandin
Greenhorn

Joined: Jun 11, 2013
Posts: 5
Ranganathan Kaliyur Mannar wrote:Hi Ghansham,
Welcome to the Ranch!

You have provided good amount of details, but, you also need to show us the code.
Specifically, create a small runnable program that replicates your issue and post it. This is called SSCCE.
What that does is, whoever is trying to help you can then simply paste your code, run it and then provide you ideas/hints/solutions.


Thanks for your response.
I will reduce my code that depict my issue.
But in the meantime does this code work here javafx.animation.PathTransition
These especially


For some reasons they do not work in Netbeans IDE 7.3.

Thanks for your prompt response as I am press for time. I feel a lot less frustrated someone reply.
Ghansham.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1089
    
  10

Ghansham Bhagwandin wrote:
But in the meantime does this code work here javafx.animation.PathTransition
These especially

In the code that you have posted, we have no idea about 'rect' and 'path' variables, so, it is hard for me to tell just by looking at the code.

Ghansham Bhagwandin wrote:Thanks for your prompt response as I am press for time. I feel a lot less frustrated someone reply.

Remember that people here are volunteers spending their time to try & help...you should EaseUp
Ghansham Bhagwandin
Greenhorn

Joined: Jun 11, 2013
Posts: 5
Ranganathan Kaliyur Mannar wrote:Remember that people here are volunteers spending their time to try & help...you should EaseUp

My apologies for giving that perception.

Ranganathan Kaliyur Mannar wrote:In the code that you have posted, we have no idea about 'rect' and 'path' variables, so, it is hard for me to tell just by looking at the code.

Path variables are really a prescribe path that you would like a object to move through with a span duration.
My aim is to move an existing circle from its current location to a new location. I did some research and found Path Transition from Javadocs and other places but when I try the sample code pathTransition.setNode(), pathTransition.setPath() and the others, they do not exist. So I am stuck and not sure what other route to take.
Ghansham Bhagwandin
Greenhorn

Joined: Jun 11, 2013
Posts: 5
Ranganathan Kaliyur Mannar wrote:Specifically, create a small runnable program that replicates your issue and post it. This is called SSCCE.

I follow your instructions and I found the problem by just eliminating parts of my code. It was a translation was freezing everything up.
Thanks a lot Mannar.

But I am still stuck with the path transitions.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1089
    
  10

Ghansham Bhagwandin wrote:
I follow your instructions and I found the problem by just eliminating parts of my code. It was a translation was freezing everything up.

Yes, that is one of the perks of creating a SSCCE.

Ghansham Bhagwandin wrote:
But I am still stuck with the path transitions.

Ok, so, you should post a SSCCE that replicates this problem now. Without that, we would hardly be able to help you.
Ghansham Bhagwandin
Greenhorn

Joined: Jun 11, 2013
Posts: 5
I want to move a circle along the path in the pic, but the height of the path would be dynamic. Also along a specific point (the green dot) in the path I would like to change the circle color as it pass that point.

The number of circles that would move would be dynamic as well. When the circle moves in the rectangle it should be in rows of four.
Any ideas of what to use to do this would be helpful.

This is what I have so far but the circle do not move in the same path it moves the same path design but a different translation.


[path.png]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GUI components freeze after animation; path transition issues