🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12618

Re: Making a ScalingPane...

#12618
From: Carl Hewitt
Date: Wed, 02 Dec 1998 00:00
43 lines
2363 bytes
what layout manager are you using?  Are you just talking maximize the
screen?  If so, do not use XY layout . . . if you need XY functionality, get
a scaling layout manager (you can find one at developer.com)

Johan Forsberg wrote in message
<01be1df7$a2f14100$6bcc79c0@pc4107.stmf.se>...
>My company is in the process of recoding all our old VB apps in Java.
>The major app (member db application) has a very popular feature:
>the "blow up" option. When this is selected, the window is expanded
>to fill the screen. Not in the normal fashion, however, but by increasing
>the size/fontsize of the components.
>
>I'm now trying to replicate this in Java, and trying to find a Better Way
>(TM) to implement this than actually walking through every single component
>in the window and fiddling with their size.
>I'm using JDK1.2, Swing lightweight components only.
>
>My bright idea was creating a ScalingPane which overrides the
>paintChilden()
>method. In this method I change the AffineTransform of the input
>Graphics2d,
>do a super.paintChildren() and then change back. The end result is very
>pretty
>indeed, and without having to change a single line of code in the rest of
>the
>application.
>
>Unfortunately there are two problems.
>
>1) In some situations (when clicking in them for instance) subcomponents
>are
>repainted directly without going through my paintChildren() method, and so
>they are redrawn unscaled in their 'real' positions.
>
>2) MouseEvents are passed directly to the subcomponents, even if my Pane
>is set to receive MouseEvents. I've looked everywhere, but found no way to
>intercept them.
>
>Theese two problems seem to make the use of AffineTransform to scale
>the window impossible, but it *looked* so pretty I'm loath to dismiss the
>concept yet.
>
>Suggestions/ideas would be very welcome...
Technical Details
Message-ID: <743s0u$qh77@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01be1df7$a2f14100$6bcc79c0@pc4107.stmf.se>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,835f9c1b9550c0fb
X-Google-Attributes: gid111d45,public
From: "Carl Hewitt" <carl@oop.com>
Subject: Re: Making a ScalingPane...
Date: 1998/12/02
Message-ID: <743s0u$qh77@forums.borland.com>
X-Deja-AN: 417904432
References: <01be1df7$a2f14100$6bcc79c0@pc4107.stmf.se>
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing