- Interface:
IShapesAlbum - Concrete Class:
ShapesAlbumModel - Aggregation
- Shape
- Interface:
IShape - Abstract Class:
AbstractShape - Concrete Class:
Oval,Rectangle
- Interface:
- Snapshot
- Interface:
ISnapshot - Concrete Class:
Snapshot
- Interface:
- Shape
- The Model of Shapes Album makes sure that the canvas is unique.
- The Model could make different operations according to the formatted inputs.
- The Model could create
OvalorRectangleon the canvas. - The Model could save all shapes and modify the attributes of each shape by searching for the name.
- The Model could move each
IShape. - The Model could resize each
IShape. - The Model could recolor each
IShape. - The Model could remove each
IShape.
- The Model could move each
- The Model could take a
Snapshotof the canvas at any time. EachSnapshotcontains the basic information of itself and the information of all shapes on canvas at that time. - The Model could save as many
Snapshots as possible. - The Model could search for a specific
Snapshotby its ID.
- Interface:
IShapesAlbumController - Concrete Class:
ShapesAlbumController - I/O:
Readable,Appendable
- The Controller could read formatted input source by lines.
- The Controller could throw exceptions when trying to make an illegal operation on model.
- The Controller could provide formatted input as arguments to the Model.
- The Controller could tell Model to make different operations according to user's input.
- The Controller could get different outputs from the View according user's input.
- The Controller provide the only public function -
run()to interact with user.
- Interface:
IShapesAlbumGraphicalView - Concrete Class:
ShapesAlbumGraphicalView - Aggregation
- GraphicsFrame: extended from
JFrame - SnapshotPanel: extended from
JPanel
- GraphicsFrame: extended from
- The Graphical View makes sure that the view is Singleton.
- The Graphical View could print out all
IShapes in anISnapshoton the canvas at one time. - The Graphical View provides 4 buttons of operations:
- Prev: Display the previous
ISnapshotand make a warning when meeting the first one. - Select: Print out a
InputMessageBoxfor selecting aISnapshotfrom the list ofISnapshots' IDs to display. - Next: Display the next
ISnapshotand make a warning when meeting the last one. - Quit: Quit the Shapes Photos Album Application.
- Prev: Display the previous
- The Graphical View could set the size of the
ISnapshotdisplaying area according to user's input. (Default Size:1000 x 1000) - The Graphical View could print out the detailed information of a specific
Snapshoton the top:- ID: The ID (CreatedTimestamp && Identification Number) of the
ISnapshot. - Description: The description of the
ISnapshot. Invisible when there is no description
- ID: The ID (CreatedTimestamp && Identification Number) of the
- Interface:
IShapesAlbumWebView - Concrete Class:
ShapesAlbumWebView
- The Web View makes sure that the view is Singleton.
- The Web View outputs a file in
HTMLformat. - The Web View set the size of each
ISnapshotdisplaying area as1000 x 1000in default. - The Web View displays all
ISnapshotsin a list. - The Web View draws each
ISnapshotsby usingSVG. - The Web View could print out the detailed information of a specific
Snapshoton the top:- ID: The ID (CreatedTimestamp && Identification Number) of the
ISnapshot. - Description: The description of the
ISnapshot. Invisible when there is no description
- ID: The ID (CreatedTimestamp && Identification Number) of the
The Entry function of running the whole program.
-in $INPUT_FILENAME$: The filename or path + filename of the input source filename. Required-out $OUTPUT_HTML_FILENAME$: The filename or path + filename of the output HTML filename. Required for Web View-v $VIEW_MODE$or-view $VIEW_MODE$: Set the mode of the View. There are two options: Requiredgraphical: Uss the Swing Graphical Viewweb: Use the HTML & SVG Web View
$X_MAX_SIZE$ $Y_MAX_SIZE$: Set the xMax and yMax value of the size ofISnapshotdisplaying area. Optional for Graphical View