Drawing Ellipses
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(); ...
Get Java™ After Hours: 10 Projects You'll Never Do at Work now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.