[2727] in java-interest
Re: JDK clipping bug(s)
daemon@ATHENA.MIT.EDU (Jim Graham)
Thu Oct 12 00:10:38 1995
Date: Wed, 11 Oct 1995 19:20:34 -0700
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
To: java-interest@java.Eng.Sun.COM, julie@world.std.com
> Note that I also can't seem to find the Alpha3 method clearClip() anywhere
> in the API for the Graphics object in the JDK documentation... so...my
> question for the JAVA experts out there is:
>
> "How does one expand (make larger)the current clipping rectangle
> within a paint or update method?"
You can no longer clear the clipping rectangle. That way applets can't
paint outside their bounds. If you want multiple clipping rectangles
within your applet, then use the Graphics.create(x, y, w, h) method to
create a "sub-Graphics" object...
What you want to do is to take the graphics that was handed in and do:
public void paint(Graphics g) {
Graphics ng = g.create(10, 10, 30, 30);
ng.drawSomething();
ng.dispose();
ng = g.create(50, 50, 30, 30);
ng.drawSomethingElse();
ng.dispose();
}
...jim
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com