In this assignment you will be making some tools to be used by graphic designers to automate placing
of graphical overlays on images.
You will need to make the following classes.
- Rectangle.java
- Oval.java
- Triangle.java
- ShapeDriver.java
The first three classes MUST ALL have:
1) A constructor that takes 5 arguments (int x, int y, int sizex, int sizey, Colour colour)
2) A method public void draw(BufferedImage img);
Only the ShapeDriver class should have a void main()
The driver program will take user input from the command line arguments.
You must not use the Scanner class!
Please read the “how to use command line arguments” section below.
The shape classes will all operate in a similar manor as described below.
The user will provide the following data via command line arguments:
1) The name of an input image. (optional)
2) The name of the shape (one of “rectangle”, “oval”, “triangle”)
3) The X (horizontal from the left edge) position of where the shape will sit on the image (in pixels)
4) The Y (vertical from the top edge) position of where the shape will sit on the image (in pixels)
5) The width of the shape
6) The height of the shape.
7) The name of a colour.
8) The name of the output image
If the image file exists, try to load it.
If not, show an error.
If the user did not provide an input file name then make a new image the size of the new image will be
the same size as the shape.
The shape is then drawn onto the image.
The image is saved as the same file name.
Your program is only expected to support png or jpg output files.
If the output file name provided is not one of these file types, then show an error.
If the user enters a shape name other than “rectangle”, “oval”, “triangle” show and error and list what
the valid shapes are.
The post You will be making some tools to be used by graphic appeared first on My Assignment Online.
Plagiarism Free Assignment Help
Expert Help With This Assignment — On Your Terms
✓ Native UK, USA & Australia writers
✓ Deadline from 3 hours
✓ 100% Plagiarism-Free — Turnitin included
✓ Unlimited free revisions
✓ Free to submit — compare quotes