displaying a HUD in 100% native Java

  • Follow


Hi everyone,

I need to make a HUD (Heads-up display) for an application.

http://en.wikipedia.org/wiki/Heads-up_display

Note that I do *really* need to make a HUD, it's a requirement,
so the question is not "how do I achieve the same result in
another way" but really "I need to make a HUD, can I do it
in 100% native Java?".

Imagine that our clients buy our solution exactly because we
provide them the ability to display a HUD on top of their
financial softwares and that if we have no HUD, we have no
clients.

So, is it possible, using 100% native Java, to create a window
that would always stay on top, without focus?

Basically I need several tiny "windows" (opaque is OK altough
transparent would be better) containing a few numbers, and I
need these to be always on top of the window of the application
I'm "attaching" the HUD to.

Ideally I'd like events (like mouse clicks) to be completely
ignored but, because the HUD is basically made of tiny
windows, it's not a big deal if the events are caught and
not passed back to the "real" application.

Up to this point I find the position of the window of the application
I need to attach the HUD to (using java.awt.Robot), I extract the
information I need (using OCR), I "compute/lookup" the infos I need
to display on the HUD and all this is working flawlessly, on three
different OSes (and on different versions of these OSes).

Now I need to display my infos using a HUD, really.

Can this be done in 100% native Java ?

Thanks in advance for any infos,

 Driss










0
Reply neuneudr (93) 1/11/2009 1:05:37 PM

In article 
<9dae786d-7591-48ab-b6d2-3985a3063166@d42g2000prb.googlegroups.com>,
 neuneudr@yahoo.fr wrote:

[...]
> I need to make a HUD (Heads-up display) for an application.
> 
> http://en.wikipedia.org/wiki/Heads-up_display
[...]
> Can this be done in 100% native Java ?

I'd use AlphaComposite:

<http://java.sun.com/javase/6/docs/api/java/awt/AlphaComposite.html>

But you could see what others are doing:

<http://sourceforge.net/search/?words=java+flight+sim>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
Reply nospam21 (11323) 1/11/2009 1:43:56 PM


neuneudr@yahoo.fr wrote on 11.01.2009 14:05:
> Imagine that our clients buy our solution exactly because we
> provide them the ability to display a HUD on top of their
> financial softwares and that if we have no HUD, we have no
> clients.

I'm not sure how a HUD relates to a financial application. For me a HUD is 
something that displays information on a secondary display (that is usually not 
a "regular" monitor).

But from your description it sounds like you simply want to display a window on 
the regular monitor.

> So, is it possible, using 100% native Java, to create a window
> that would always stay on top, without focus?

<http://java.sun.com/javase/6/docs/api/java/awt/Window.html#setAlwaysOnTop(boolean)>


Thomas
0
Reply FJIFALSDGVAF (76) 1/11/2009 1:53:42 PM

On Jan 11, 1:53 pm, Thomas Kellerer <FJIFALSDG...@spammotel.com>
wrote:
....
> For me a HUD is
> something that displays information on a secondary display (that is usually not
> a "regular" monitor).
>
> But from your description it sounds like you simply want to display a window on
> the regular monitor.

Ah... I tought that was what a HUD was, from Wikipedia:

"A head-up display, or HUD, is any transparent display that
" presents data without requiring the user to look away from
" his or her usual viewpoint.



> > So, is it possible, using 100% native Java, to create a window
> > that would always stay on top, without focus?
>
> <http://java.sun.com/javase/6/docs/api/java/awt/Window.html#setAlwaysO...)>

Thanks for that link, apparently a Window, not a Frame, is the way
to go in my case.  I'll check if I can use alpha compositing inside
that frame and obtain good performances on the various platforms
I want this to run on...

Thanks a lot,

  Driss
0
Reply neuneudr (93) 1/11/2009 3:02:19 PM

neuneudr@yahoo.fr wrote:
> Ah... I tought that was what a HUD was, from Wikipedia:
> 
> "A head-up display, or HUD, is any transparent display that
> presents data without requiring the user to look away from his or
> her usual viewpoint."

Which continues:
> The origin of the name stems from the user being able to view
> information with their head "up" and looking forward, instead of
> angled down looking at lower instruments.

The general idea is that the user can see both information and the real 
world in the same field of vision. I don't think I've really heard of it 
outside of military applications or gaming.

-- 
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
0
Reply Pidgeot18 (1399) 1/11/2009 3:18:11 PM

On Sun, 11 Jan 2009, Joshua Cranmer wrote:

> neuneudr@yahoo.fr wrote:
>> Ah... I tought that was what a HUD was, from Wikipedia:
>> 
>> "A head-up display, or HUD, is any transparent display that
>> presents data without requiring the user to look away from his or
>> her usual viewpoint."
>
> Which continues:
>> The origin of the name stems from the user being able to view
>> information with their head "up" and looking forward, instead of
>> angled down looking at lower instruments.
>
> The general idea is that the user can see both information and the real world 
> in the same field of vision. I don't think I've really heard of it outside of 
> military applications or gaming.

I've come across it in trendy UI design. For those familiar with OS X, i 
think both the Dashboard and the bezel you get when changing volume (and 
similar ones you see when command-tabbing, using Growl, etc) count as HUDs 
- they're semi-transparent overlays on stuff that's underneath. The volume 
bezel is particularly HUDdish, as it's transparent to clicks.

This is apparently some kind of HUD:

http://lipidity.com/plugins/quicksilver/bezel-pro/

tom

-- 
Throw bricks at lawyers if you can!
0
Reply twic (2083) 1/11/2009 3:45:26 PM

In article <gkd2jj$ftk$1@news-int.gatech.edu>,
 Joshua Cranmer <Pidgeot18@verizon.invalid> wrote:

> neuneudr@yahoo.fr wrote:
> > Ah... I tought that was what a HUD was, from Wikipedia:
> > 
> > "A head-up display, or HUD, is any transparent display that
> > presents data without requiring the user to look away from his or
> > her usual viewpoint."
> 
> Which continues:
> > The origin of the name stems from the user being able to view
> > information with their head "up" and looking forward, instead of
> > angled down looking at lower instruments.
> 
> The general idea is that the user can see both information and the real 
> world in the same field of vision. I don't think I've really heard of it 
> outside of military applications or gaming.

I first encountered it in avionics simulation, but it's use in medical 
imaging, particularly in endoscopy and interventional radiology, is 
evolving.

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
Reply nospam21 (11323) 1/11/2009 3:48:01 PM

On Sun, 11 Jan 2009 10:18:11 -0500, Joshua Cranmer wrote:

> neuneudr@yahoo.fr wrote:
>> Ah... I tought that was what a HUD was, from Wikipedia:
>> 
>> "A head-up display, or HUD, is any transparent display that presents
>> data without requiring the user to look away from his or her usual
>> viewpoint."
> 
> Which continues:
>> The origin of the name stems from the user being able to view
>> information with their head "up" and looking forward, instead of angled
>> down looking at lower instruments.
> 
> The general idea is that the user can see both information and the real
> world in the same field of vision. I don't think I've really heard of it
> outside of military applications or gaming.

We use the underlying technology but not the "always-on-top status 
window" idea in a couple of apps I help maintain and improve. It's really 
easy to do this stuff with Prototype and Script.aculo.us. In fact if the 
requirement wasn't there to be 100% pure Java I'd just say use that stuff 
off the shelf.

I know a couple of system admins that like having some of their "always 
open" windows set up this way...makes it easier for them to see what's 
going on. This is probably closest to the HUD idea.

AHS 
0
Reply dcest61 (384) 1/11/2009 6:18:15 PM

On 2009-01-11, Joshua Cranmer <Pidgeot18@verizon.invalid> wrote:
>
> The general idea is that the user can see both information and the real 
> world in the same field of vision. I don't think I've really heard of it 
> outside of military applications or gaming.

Same for me. I can see the concept gaining more ground, however, as
screens grow ever bigger and people start having more monitors around
them. Instead of putting some diagnostic display in a separate window,
on a screen decoration (task bar etc.) or on a separate screen
altogether you overlay it on the main application in use so that the
user doesn't have to shift focus from that app to some other UI
element. This coincides somewhat with the idea of a heads-up display
since it saves you from having to move your eyes elsewhere to get at
the information.

A couple of years down the line perhaps we will be seeing built-in
support for this kind of overlaying in window managers. (And then the
lawsuits would start, but I digress.)

Cheers,
	Bent D
-- 
Bent Dalager - bcd@pvv.org - http://www.pvv.org/~bcd
                                    powered by emacs
0
Reply bcd (635) 1/12/2009 1:41:47 AM

8 Replies
43 Views

(page loaded in 0.1 seconds)

Similiar Articles:












7/12/2012 4:00:58 PM


Reply: