Click here to Skip to main content
16,019,768 members
Home / Discussions / Java
   

Java

 
AnswerRe: how to open a website when i press a button in Java Pin
DaveAuld26-Mar-11 22:41
professionalDaveAuld26-Mar-11 22:41 
GeneralRe: how to open a website when i press a button in Java Pin
Richard MacCutchan27-Mar-11 0:52
mveRichard MacCutchan27-Mar-11 0:52 
AnswerRe: how to open a website when i press a button in Java Pin
TorstenH.28-Mar-11 1:19
TorstenH.28-Mar-11 1:19 
QuestionSwing JDialog bug? [modified] Pin
amit ofer26-Mar-11 1:03
amit ofer26-Mar-11 1:03 
AnswerRe: Swing JDialog bug? Pin
TorstenH.28-Mar-11 1:25
TorstenH.28-Mar-11 1:25 
QuestionCrash in java.exe Pin
schki0225-Mar-11 13:31
schki0225-Mar-11 13:31 
AnswerRe: Crash in java.exe Pin
TorstenH.28-Mar-11 1:16
TorstenH.28-Mar-11 1:16 
Questioncolor fade animation for grid cells in swing Pin
amit ofer25-Mar-11 5:30
amit ofer25-Mar-11 5:30 
hi, I'm doing a path-finding project as part of my 4th year software engineering degree.
we're suppose to give visual representation to a bunch of multi-agent pathfinding algorithm.
the simplest one is A* adapted for multiagents.
anyway our environment is a grid map where every cell can be either blocked or used as part of an agent's path.
what i wanna do is use animation to give a good representation of the final movement of the agent, but animating color change in my grid.
i.e paint every step in the path for a second or so with some color to show how the agent moves.
and the other thing i wanna do is to represent the way the algorithm works by painting the changes in the open list and closed list of the A* algorithm while its doing its calculation.
I'm using an adapted version of the observer design pattern to send events from my algorithm layer to my controller and gui layer.
what i wanna do in the gui layer is everytime a tile is added to the open list, i want to have that cell painted in some color and then have it fade away according to a predefined timer or maybe later add a slider to control this timer.
I looked at the code here: http://www.java2s.com/Code/Java/2D-Graphics-GUI/Colorfadinganimation.htm.
it seems pretty simple, the problem is that every tile animation has to be independent of the others to allow the algorithm and everything to keep running and different animations to start.
so whats the best way to achieve the results i'm looking for? should i just open a different thread for each animation or have a pre-made thread for each cell.
would that be an over kill for the application, since there can be up to 1000 cells and therfore close to 1000 threads performing animation.
another issue i think i might encounter is the fact that it might happen that a cell will start its color fading animation and then will have to restart and i don't want the two animations to go at the same time (only one thread performing animation for the same cell at the same time).

I hope i was clear enough with what i'm trying to achieve, if someone has any ideas or thought it could really help me with my project.

thanks in advanced

Amit Ofer
QuestionGluing JLabels to a contentPane Pin
kurt124-Mar-11 12:30
kurt124-Mar-11 12:30 
AnswerRe: Gluing JLabels to a contentPane Pin
JP_Rocks27-Mar-11 1:07
JP_Rocks27-Mar-11 1:07 
Questionusing scroll in java GUI Pin
williamroma23-Mar-11 2:23
williamroma23-Mar-11 2:23 
AnswerRe: using scroll in java GUI Pin
TorstenH.23-Mar-11 3:46
TorstenH.23-Mar-11 3:46 
QuestionHow can we call c++ functions by using java code Pin
sankardunga21-Mar-11 1:09
sankardunga21-Mar-11 1:09 
AnswerRe: How can we call c++ functions by using java code Pin
Richard MacCutchan21-Mar-11 2:59
mveRichard MacCutchan21-Mar-11 2:59 
AnswerRe: How can we call c++ functions by using java code Pin
jschell21-Mar-11 7:52
jschell21-Mar-11 7:52 
GeneralRe: How can we call c++ functions by using java code Pin
Richard MacCutchan21-Mar-11 8:51
mveRichard MacCutchan21-Mar-11 8:51 
GeneralRe: How can we call c++ functions by using java code Pin
jschell22-Mar-11 8:04
jschell22-Mar-11 8:04 
GeneralRe: How can we call c++ functions by using java code Pin
Richard MacCutchan22-Mar-11 8:21
mveRichard MacCutchan22-Mar-11 8:21 
QuestionTIME in java Pin
williamroma20-Mar-11 0:38
williamroma20-Mar-11 0:38 
AnswerRe: TIME in java Pin
Richard MacCutchan20-Mar-11 5:04
mveRichard MacCutchan20-Mar-11 5:04 
AnswerRe: TIME in java Pin
TorstenH.20-Mar-11 7:39
TorstenH.20-Mar-11 7:39 
AnswerRe: TIME in java Pin
Luc Pattyn20-Mar-11 11:31
sitebuilderLuc Pattyn20-Mar-11 11:31 
GeneralRe: TIME in java Pin
shi-fj31-Mar-11 4:34
shi-fj31-Mar-11 4:34 
AnswerRe: TIME in java Pin
CodingLover22-Mar-11 18:38
CodingLover22-Mar-11 18:38 
GeneralRe: TIME in java Pin
williamroma23-Mar-11 2:20
williamroma23-Mar-11 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.