Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Acrobat Reader File Edit View Window Help * 95% 95% a Thu 7:28 PM QE - A2.pdf Home Tools A2.pdf X Sign In Q 1
Acrobat Reader File Edit View Window Help * 95% 95% a Thu 7:28 PM QE - A2.pdf Home Tools A2.pdf X Sign In Q 1 / 4 75% *** Task Description: Please complete a Java application to draw different shapes with the specified color and size, subject to the following requirements. 1. GUI requirements: O Shape Drawing Tool File Selection Area Shape circle rectangle Color RED YELLOW Draw Area Size Big Big Medium Small 1) The GUI should be designed as above and all the components in it should be included. Do NOT add other components. 2) The layout should be consistent with the above screenshot. 3) The sizes of the frame and each panel can be decided by yourself, as long as they are reasonable. 4) The "File" menu should contain two items: Save and Load. Shape Drawing Tool File n Area Save Load A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 OF WA Acrobat Reader File Edit View Window Help 95% a Thu 7:28 PM Q A2.pdf Home Tools A2.pdf Sign In 2 4 75% *** a 2. Functional requirements: 1) Users can start with selecting the shape, color, and size in the "Selection Area". Then, they can use the mouse to click any position in the Draw Area" to draw a selected shape with the specified color and size. The position clicked is used as the center of the shape. 2) At any time, only up to 5 shapes can be shown on the Draw Area. As shown in the pictures below, after finishing the 5 shapes (Shapes 1 to 5), if the user draws another shape (Shape 6), the first shape (Shape 1) will be discarded and not shown any more. The same rule applies to the subsequent shapes (with Shape 7 replacing Shape 2, 8 replacing 3, and so on). (Hint: you can use an array to store these 5 shapes and an index to identify the position in the array for the current shape.) Shape Drawing Tool She CC rectangle YELLOW A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 10 WA Acrobat Reader File Edit View Window Help 95% a Thu 7:28 PM Q A2.pdf Home Tools A2.pdf Sign In 3 4 75% *** a Shape Drawing BAR S che rectangle Die 10 3) The sizes of Big, Medium, Small for each shape can be arbitrarily specified as long as they look reasonable. 4) The shapes are drawn in the order they are added. That is, if there is an overlap between Shapes 2 and 3, then Shape 3 is drawn over Shape 2. 5) When selecting File->Save, the properties of the current drawn shape (including the type, colors, size and center) should be written to a file (named "shape Drawing.txt") in text format and have a pop-up window showing the message Drawing successfully saved!" like the picture below. After that, the Draw Area should be cleared. Message Drawing successfully saved! OK 6) When selecting File->Load, the last file you saved will be read and the shape should be shown in the "Draw Area". At the same time, pop up a window to show the message Drawing successfully loaded!" If there is no saved drawing, pop up a window to show the message "No saved drawing!" A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 9 Wod Acrobat Reader File Edit View Window Help 95% O Thu 7:29 PM Q A2.pdf Home Tools A2.pdf Sign In 1 4 4 75% a 7) Please properly handle the checked exceptions (e.g., I/O exceptions) during the whole process. What to submit: Please complete the application according to the requirements and document them properly using JavaDoc. You have to design your own classes, keeping the OOP design principles in mind. Name your driver class (the class with the main method) DrawingTool. Compile and test your code under the command line environment (e.g., by executing Terminal under macos or cmd under Windows). Submit a single zipped archive named A2.zip containing all your source files. Nothing else (e.g., the shape Drawing.txt file) should be submitted. DO NOT submit class files! java files ONLY. DO NOT use other archival formats such as .RAR or .7z. Important Note: (1) Your assignment will be given a zero mark if only the compiled files (.class files) are submitted. Please make sure to submit the source files (java files). (2) Please make sure your code compiles under the command line (i.e., without an IDE). Do not put any package statement at the beginning of your source file. If you are using an IDE, this is especially important because some IDEs put your code under a particular package for your project. Any code that does not compile under the command line can only receive 20/100. Remarking requests like "...but the code works on my computer/in my IDE" will not be entertained. A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 o wod Acrobat Reader File Edit View Window Help * 95% 95% a Thu 7:28 PM QE - A2.pdf Home Tools A2.pdf X Sign In Q 1 / 4 75% *** Task Description: Please complete a Java application to draw different shapes with the specified color and size, subject to the following requirements. 1. GUI requirements: O Shape Drawing Tool File Selection Area Shape circle rectangle Color RED YELLOW Draw Area Size Big Big Medium Small 1) The GUI should be designed as above and all the components in it should be included. Do NOT add other components. 2) The layout should be consistent with the above screenshot. 3) The sizes of the frame and each panel can be decided by yourself, as long as they are reasonable. 4) The "File" menu should contain two items: Save and Load. Shape Drawing Tool File n Area Save Load A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 OF WA Acrobat Reader File Edit View Window Help 95% a Thu 7:28 PM Q A2.pdf Home Tools A2.pdf Sign In 2 4 75% *** a 2. Functional requirements: 1) Users can start with selecting the shape, color, and size in the "Selection Area". Then, they can use the mouse to click any position in the Draw Area" to draw a selected shape with the specified color and size. The position clicked is used as the center of the shape. 2) At any time, only up to 5 shapes can be shown on the Draw Area. As shown in the pictures below, after finishing the 5 shapes (Shapes 1 to 5), if the user draws another shape (Shape 6), the first shape (Shape 1) will be discarded and not shown any more. The same rule applies to the subsequent shapes (with Shape 7 replacing Shape 2, 8 replacing 3, and so on). (Hint: you can use an array to store these 5 shapes and an index to identify the position in the array for the current shape.) Shape Drawing Tool She CC rectangle YELLOW A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 10 WA Acrobat Reader File Edit View Window Help 95% a Thu 7:28 PM Q A2.pdf Home Tools A2.pdf Sign In 3 4 75% *** a Shape Drawing BAR S che rectangle Die 10 3) The sizes of Big, Medium, Small for each shape can be arbitrarily specified as long as they look reasonable. 4) The shapes are drawn in the order they are added. That is, if there is an overlap between Shapes 2 and 3, then Shape 3 is drawn over Shape 2. 5) When selecting File->Save, the properties of the current drawn shape (including the type, colors, size and center) should be written to a file (named "shape Drawing.txt") in text format and have a pop-up window showing the message Drawing successfully saved!" like the picture below. After that, the Draw Area should be cleared. Message Drawing successfully saved! OK 6) When selecting File->Load, the last file you saved will be read and the shape should be shown in the "Draw Area". At the same time, pop up a window to show the message Drawing successfully loaded!" If there is no saved drawing, pop up a window to show the message "No saved drawing!" A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 9 Wod Acrobat Reader File Edit View Window Help 95% O Thu 7:29 PM Q A2.pdf Home Tools A2.pdf Sign In 1 4 4 75% a 7) Please properly handle the checked exceptions (e.g., I/O exceptions) during the whole process. What to submit: Please complete the application according to the requirements and document them properly using JavaDoc. You have to design your own classes, keeping the OOP design principles in mind. Name your driver class (the class with the main method) DrawingTool. Compile and test your code under the command line environment (e.g., by executing Terminal under macos or cmd under Windows). Submit a single zipped archive named A2.zip containing all your source files. Nothing else (e.g., the shape Drawing.txt file) should be submitted. DO NOT submit class files! java files ONLY. DO NOT use other archival formats such as .RAR or .7z. Important Note: (1) Your assignment will be given a zero mark if only the compiled files (.class files) are submitted. Please make sure to submit the source files (java files). (2) Please make sure your code compiles under the command line (i.e., without an IDE). Do not put any package statement at the beginning of your source file. If you are using an IDE, this is especially important because some IDEs put your code under a particular package for your project. Any code that does not compile under the command line can only receive 20/100. Remarking requests like "...but the code works on my computer/in my IDE" will not be entertained. A2.pdf ireless Diagnoci 1010 final tics-C....tar.gz 2 18143) law 29 o wod
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started