In this assignment, you will gain experience with the Model-View-Controller pattern and build an understanding of the inner workings of common user interactions
Overview
In this assignment, you will gain experience with the Model-View-Controller pattern and build an understanding of the inner workings of common user interactions. You will extend the provided SquareDrawerWithDragSelections class to create some basic and robust user interactions.
This assignment will consist of 4 distinct smaller parts that can be worked on individually. The other parts do not necessarily rely on one another, although completing Part 1 first, followed by part 2 will make it much easier for you to work on parts 3 and 4.
Part 1: Add a Toolbar
First, start by adding a simple toolbar. The toolbar should provide two sets of buttons that contain only icons (the images are provided in the images directory). Your ToolBar should provide two sets of buttons. The first set are ToggleButtons (representing shapes) that can be drawn in the application. ToggleButtons only allow one option to be selected at a time (when associated with a common ToggleGroup). The leftmost ToggleButton should be depressed by default.
Part 2: Draw Different Shapes
You should finish Part 1 before completing Part 2, to make it easy to select a shape to be drawn. You will extend the application and make it work with shapes of different types. A user will be able to select the button at the top of the app (Square, Circle or Button) and create the correct item. Creating items will work by simply depressing the desired shape button and clicking on an empty part of the canvas (which is the same way squares are created in the provided example).
Part 3: Simple Cutting and Pasting
In Part 3, you will implement simple cutting and pasting, by attaching actions to the “Cut” and ”Paste” buttons created in Part 1.
Drawn objects should be able to be selected in the same way as was provided in the starting example code. When the cut button is clicked, selected items are cut from the scene. Any operations can then continue with the interface. If the Paste button is clicked, the “cut” items are returned to their original place, and are the active selection. If additional objects are cut while there are already other objects cut, then the previously cut objects are discarded (similar to how normal cut-and-paste works). The Paste button only works once. That is if items are pasted once, clicking Paste again, won’t paste additional copies of the objects to the scene.
Part 4: Rubber-band Drag Selections from Multiple Directions
In Part 4, you will extend the rubber band rectangle selection technique so that drag selections can be done in any direction. In the current example, the Rectangle selection region is drawn from top-left to bottom right only. You will add code so that the region can resize when the mouse is dragged in any direction.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.