This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!

Vinicius Moreira

Greenhorn
+ Follow
since Jan 18, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vinicius Moreira

Hello everybody.
I am developing Java software that performs the drawing of maps.
But when I have to draw a very large map and perform operations such as zoom and move the map, the application is extremely slow when I have to redraw the screen.
I wonder if it is to increase the performace of my application.
I'm using the class GeneralPath for drawing graphic objects in the map.
Thanks.
8 years ago
I implemented here but failed.
I'll post the code below.
Figure yet is not correctly centered. What could be wrong?

8 years ago

Jayesh A Lalwani wrote:To zoom into a particular point, you need to first move the point clicked on to the center and then zoom into the center. Moving a particular point to the center is called translation and zooming is achieved using a transformation called scaling. So, what you need to do is first translate, then scale. AffineTransform contains methods that apply both the transformations. SOmething like this



The distance that you want to translate is calculated from the center, so x and y above are the distance of the clicked point from the center.



Thanks for responding.
For example, if I want to zoom into a point at coordinate x = 30 and y = 50 and my screen is 800 px wide and 600 high should I calculate the distance should I move this way: xCenter = 30 - 400 and yCenter = 50 - 300?
8 years ago
Hello everybody, I am developing an application which will be necessary to implement the zoom on a particular map.
The Zoom I could implement using the AffineTransform class, but I would like the location where the user clicked the mouse to perform the zoom is centered on the screen.
How could I perform the calculation of the translation of the site click so it can be centered on the screen.
Thank you.

Vinícius
8 years ago
Sorry friend, but I see no problem posting the same question in different forums, because with more people that can help me.
This is common in the country where I live, but I'm sorry if you have bothered with it.
10 years ago
Hello, I am trying to zoom on a shape object with the AffineTransform class, and would like to know how to zoom from the center of my object graph, and this graphic object can be a circle, rectangle, polygon, etc. .. .
I'm lost in logic to perform the transformation.
Thanks.
10 years ago
After much discussion, I applied the SwingWorker in my application and the results were satisfactory, thank you Jim for your help!
Hello Jim, thank you for help, but I am not able to understand , is there any tutorial that can help me!
Or you could give me some small code example?
Thanks
Hello everybody, I looked at some tutorials on SwingWorker, does in my case it can be applied to replace the threads?
Alright Jim!
Thank you for your help!
Basically in my gui I want you to be a JProgressBar indicating the actual process of entering information in the database.
To avoid problems in the performance of my GUI I think a thread that runs parallel process in the database and update my progress bar and it worked properly.
But my question is how to integrate it to the MVC model, the code below I demonstrate a reduced form as I developed, I will not put all the code because it is too long but if you prefer I lay.

Jim Thanks for the compliment!
When I refer to "interface freeze" I am referring to my form GUI
For example, in the case of my system I would like my form data entry inform the user the progress of the registration information in the database, for this I thought of using a JProgressBar.
But to do that I have to create a form so that when the process runs, will not occur in the GUI locking my form because I have to insert a large amount of data
My idea at first was to create a parallel process (another thread) and in it I would perform the actions in the database and would upgrading my GUI form in case my progress bar!
This is my problem and I have several questions on how to fix it!
In my application I have to load data from a dbf file and insert into a MySQL database, using threads will be necessary to avoid the interface freezes.
The use of SwingWorker is a good solution?

PS: Sorry for my vocabulary because I'm Brazilian and have difficulties in English language.
Mercs Hello Sam thanks for the help, really questions about the code development is very complicated has many different opnion hint that I'm using is to develop programs more intuitive, my big concern is escape of good programming practices.
Thanks for your help!
Hello Jim, really was premature to discuss the code, but as the code above is not a good practice, how I could implement Threads in the specific case of my system to handle large volume of data?
Because in my system I'll have to insert a large amount of data in the database and I would like to use threads to prevent interface freezes in time the system is performing operations on the database.
Could you pass me a tutorial example showing how to work with database and threads?
Thanks for your help!