代写Homework 8: Shapes Photo Album Part 1代写Java程序

Homework 8: Shapes Photo Album Part 1

Shapes Photo Album Part 1: The Model

The Shapes Photo Album: Part 1

This assignment starts with a context of the application, followed by an outline of what you must achieve. It is a relatively open-ended assignment and does not spell out explicitly which interfaces, classes, methods and variables you need. Spend time understanding what the application must do, and then design your solution accordingly. This "open ended" approach is intentional, and allowing you freedom in your design decisions is important part of this assignment.

Context

Many of us use our phones (and cameras) to take pictures of friends and family members, and then share those pictures in photo albums - either online or in-person (with actual "photo books").

Pictures can be used to succinctly and effectively illustrate many things. For example, a stationary histogram visually depicts the distribution of some data points. A histogram with moving bar heights visually depicts music (e.g. a music equalizer).

In the next two assignments, we will build an application that helps to create a simple "photo album" from shapes. One of our main goals will be to practice the "separation of concerns" we've covered during lecture. We will support the description of data we want visualized and then have an application that renders the descriptive text properly in a variety of ways.

Concept

Informally using English, we could provide a description for one page of our photo album in a way similar to this:

Create red rectangle R with corner at (200,200), width 50 and height 100

Create blue oval C with center at (500,100), radius 60 and 30

R moves to (300,300)

C moves to (500,400)

C changes from blue to green

Take a Snapshot

R changes width from 50 to 25

These are descriptive commands that tell us, in sequence what things (shapes) to place on a logical canvas, where to place them, how to color (or resize) them, and when to "take a selfie" (snapshot) of the system.

Our application may then use such a description to:

• "Show" the photo album in various ways. Perhaps we simply want to view the sequence of changes in a spreadsheet, or perhaps we want to see each "snapshot" as a visual rendition of the shapes, on different pages of an electronic album.

• Produce a verbose description for what the photo album will look like (for the visually impaired).

• Other possibilities...

The Shapes Photo Album

We will build this application progressively using the classic Model-View-Controller architecture. In this assignment (Part 1) we will focus on the model of this application. There is no starter code for this assignment: you must use the above description and broad ideas to design the interface and implementation of the model. You are deliberately not being told about the specific details of what the controller and views will need or do. You are also not being told about how exactly the application will receive a description from the user (it would not be relevant to the model).

Here are some aspects to think about:

• What does the model represent? Remember: this is a shapes application, so think "application model" here.

• The model should be able to support various kinds of 2D shapes, although currently we have described only rectangles and ovals.

• The model should support adding various kinds of transformations to shapes, such as moving, changing color and scaling.

• As you implement, remember to consider the client perspective (the person or class that is using the model).

How is the photo album seen?

One way the application may show the progression of creating the photo album is to produce a text description of the commands and the model state changes. Here is what a description might look like:

Name: R

Type: rectangle

Min corner: (200.0,200.0), Width: 50.0, Height: 100.0, Color:

(1.0,0.0,0.0)

Name: O

Type: oval

Center: (500.0,100.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)

(NB: After moving and resizing and changing color of rectangle)

Name: R

Type: rectangle

Min corner: (100.0,300.0), Width: 25.0, Height: 100.0, Color:

(0.0,1.0,0.0)

Name: O

Type: oval

Center: (500.0,100.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)(NB: After moving Oval)

Name: R

Type: rectangle

Min corner: (100.0,300.0), Width: 25.0, Height: 100.0, Color:

(0.0,1.0,1.0)

Name: O

Type: oval

Center: (500.0,400.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)

(NB: After removing the rectangle)

Name: O

Type: oval

Center: (500.0,400.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)

(NB: Snapshots are similar to "still pictures" or selfies of the shape system)

List of snapshots taken before reset: [2022-03-

30T11:51:02.174193, 2022-03-30T11:51:02.246661, 2022-03-

30T11:51:02.247210, 2022-03-30T11:51:02.247794]

(NB: Snapshot details)

Printing Snapshots

Snapshot ID: 2022-03-30T11:51:02.174193

Timestamp: 30-03-2022 11:51:02

Description: After first selfie

Shape Information:

Name: R

Type: rectangle

Min corner: (200.0,200.0), Width: 50.0, Height: 100.0, Color:

(1.0,0.0,0.0)

Name: O

Type: oval

Center: (500.0,100.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)

Snapshot ID: 2022-03-30T11:51:02.246661

Timestamp: 30-03-2022 11:51:02

Description: 2nd selfie

Shape Information:

Name: R

Type: rectangle

Min corner: (100.0,300.0), Width: 25.0, Height: 100.0, Color:

(0.0,1.0,0.0)

Name: O

Type: oval

Center: (500.0,100.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)

Snapshot ID: 2022-03-30T11:51:02.247210

Timestamp: 30-03-2022 11:51:02

Description:

Shape Information:

Name: R

Type: rectangle

Min corner: (100.0,300.0), Width: 25.0, Height: 100.0, Color:

(0.0,1.0,1.0)

Name: O

Type: oval

Center: (500.0,400.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)

Snapshot ID: 2022-03-30T11:51:02.247794

Timestamp: 30-03-2022 11:51:02

Description: Selfie after removing the rectangle from the picture

Shape Information:

Name: O

Type: oval

Center: (500.0,400.0), X radius: 60.0, Y radius: 30.0, Color:

(0.0,0.0,1.0)

In short, it first describes the shapes that are part of the photo album and their details. Next it describes model state changes as the shapes are transformed/moved/removed. Each snapshot is a "freeze frame" of the model state - think of it as a "system selfie" - the picture captured is that of the shapes in their then-current locations (and state) and is analogous to a "page" in a photo album. You may think of the first part of this output as a “read-back” of the model state changes, perhaps for devices that cannot show the photo album visually, or for users who are visually impaired who have screen readers. The snapshots are historical "save points" that can be retrieved irrespective of the model state.

What to do

1. Design a model to represent a shapes photo album. This model may consist of one or more interfaces, abstract classes, concrete classes, enums, etc. Consider carefully what operations it should support. Create a high-level UML class diagram to represent your design.

2. Think about and include in the model interface operations that you think are relevant and the model should offer.

3. Document your model well. Be sure to document clearly what each method does, what purpose it serves and why it belongs in the model.

4. Implement your model.

5. Test your model.

6. Implement the text output rendering of your model according to the format given in the previous section (How is the photo album seen?), so we can visualize your data.

What to submit

Submit any files created in this assignment, along with a text README file explaining your design, and your UML class diagram. Your README file and UML should give the graders quick insight into the purposes are for every class, interface, etc. that you include in your model. Verbosity is not a virtue here, so clear, concise documentation is better than reams of verbiage. Think of your graders as your users; help them so that they can quickly get a high-level overview of your solution and code.

NB: The UML diagram and README do not replace the need for proper Javadoc!

Grading

Since this is an open-ended assignment with you making design trade-off decisions, there are no server-side tests. For this assignment, you will be graded on

• the design of your model interface(s), in terms of clarity, flexibility, and how plausibly it will support needed functionality;

• the appropriateness of your representation choices for the data (please comment on why you chose the representation you did in the code);

• the forward thinking in your design, in terms of its flexibility, use of abstraction, etc.

• the correctness and style. of your implementation, and

• the comprehensiveness and relevance of your test coverage.



热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图