Article View: borland.public.jbuilder.java.language
Article #546best approach for transaprent boxes
From: Phil
Date: Tue, 05 Jul 2005 01:56
Date: Tue, 05 Jul 2005 01:56
10 lines
1929 bytes
1929 bytes
I'm hoping for some guidance on the best way to do the following, since I am fairly new to the Java language. I am building an applet that uses a canvas to show a map (awt only - no swing). I want to display semi-transaparent boxes over the top of the map to show things like status, or have options, and the boxes should be able to process mouse events. The canvas is using a double-buffered strategy and uses Graphics2D. My first thought was to simply design lightweight components - but they require a container, which the Canvas is not. So then I thought I would extend the Canvas class to work with another completely custom "decorator" class that would be able to buffer the area of the canvas it covers for quick updating if it changes, and draw it's own info on top - but I just can't figure out how to grab a part of the rendered parent canvas to store offscreen and paint again later. So my question is: Is the second method a good way to go about this, or is there a better "Java" way of doing this (I'm still probably thinking in a Delphi mindset)? And if the second way is ok, then how do I buffer just part of the parent canvas? Phil.
Technical Details
Message-ID:
<42c9e8d0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f74b3,eeaf70c6f6fe3cab,start X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Phil" <philm@here.there.com> Sender: "Phil" <philm@here.there.com> Reply-To: "Phil" <philm@here.there.com> Subject: best approach for transaprent boxes Newsgroups: borland.public.jbuilder.java.language X-User-Info: 219.88.172.20 NNTP-Posting-Host: 207.105.83.66 Message-ID: <42c9e8d0$1@newsgroups.borland.com> Date: 4 Jul 2005 18:56:32 -0700 X-Trace: newsgroups.borland.com 1120528592 207.105.83.66 (4 Jul 2005 18:56:32 -0700) Lines: 10 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail