June 2005
Beginner to intermediate
336 pages
6h 29m
English
If the rectangle flag is true, the user is drawing rectangles, and the code creates a Rectangle2D.Double rectangle to correspond to the ordered starting point, tempStart, and the figure's height and width. The Rectangle2D.Double constructor takes the same arguments as the Ellipse.Double constructor, so it works like this:
if(rectangle && width != 0 && height != 0){
Rectangle2D.Double rectangle =
new Rectangle2D.Double(tempStart.x, tempStart.y,
width, height);
.
.
.
If the user wants a drop shadow, you should draw that first, which the code does like this:
if(shadow){ paint = gImage.getPaint(); composite = gImage.getComposite(); gImage.setPaint(Color.black); gImage.setComposite(AlphaComposite.getInstance (AlphaComposite.SRC_OVER, ...Read now
Unlock full access