I've done the fading thing before by drawing the display into an
image but going through before every frame multiplying every pixel
by, say, 0.9. That way the drawing fades out, leaving a trail behind
just like you need. For a monochrome display like radar, you can use
an indexed color model which means you only have one integer to
multiply per pixel.
This is a general Java question, rather than anything Apple
specific, although I develop on an Apple out of choice.
I'm fairly new to Java, so I'm just seeking some general guidance
here of what approach to take. I am writing a Swing application
that is meant to emulate a classical radar display. The
application will be displaying real radar data - but I want to give
it a classic radar display look. Something like http://www.jica-
itumf.itu.edu.tr/Display of RADAR 2.jpg (a random image I
found on Google).
So, what I want is a basically a black circle on which I can
optionally display different layers. One layer would be a
graticule displaying the range-rings and radial lines of constant
bearing. This can be switched on or off. Then, on top of the
display, I want to be able to display a "dot" or maybe a little arc
that represents the location of each aircraft echo. As the radar
scans over time, I'd like the older "dots" to gradually fade out
(emulating the decay of a phosphor display) by, presumably,
gradually increasing the alpha transparency of the plots as their
age increases.
Thus, in concept at least, I'm thinking I need to be able to
display a number of layers. One layer for the background and one
for the graticule. Then I'm not sure how to achieve the fading
plots idea. Perhaps a series of layers, one for each radar scan,
where I can gradually change the alpha transparency of a layer as
time increases, until the point where the transparency is total,
when I delete the layer from the display altogether.
So, that's the concept.
What's the best way of achieving this? Can anyone point out some
appropriate Java classes I should be considering? JLayeredPane
sounds like a possible starting point, but I'm not sure how I add
layers and then adjust their transparency with time. If anyone can
provide some clues (possibly with some simple skeleton code) I'd
much appreciate it! I'm a total Swing novice - so far I've used
NetBeans to build a working GUI and played with creating a circle
in a frame. That's the sum total of my experience of Swing
(although I have done quite a lot of algorithmic Java development,
so I understand Java OK, just not the Swing stuff).
Thanks in advance for your help!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden