June 2005
Beginner to intermediate
336 pages
6h 29m
English
If the ellipse flag is true, the user is drawing ellipses. Ellipses are a little more complex, because they can be filled in with color, texture, gradients, and so on. You can start by defining the ellipse the user wants to draw:
if(ellipse && width != 0 && height != 0){
Ellipse2D.Double ellipse =
new Ellipse2D.Double(tempStart.x, tempStart.y,
width, height);
.
.
.
If the shadow flag is set to true, the user wants to draw drop shadows, which you can do like this (note that if the ellipse is filled in, which means one of the solid, shade, transparent, or texture flags will be set to true, you should draw the shadow to match, which you do with the gImage context's fill method, not the draw method):
if(shadow){ paint = gImage.getPaint(); ...
Read now
Unlock full access