- 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
Oval
orRectangle
on 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
Snapshot
of the canvas at any time. EachSnapshot
contains the basic information of itself and the information of all shapes on canvas at that time. - The Model could save as many
Snapshot
s as possible. - The Model could search for a specific
Snapshot
by 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
IShape
s in anISnapshot
on the canvas at one time. - The Graphical View provides 4 buttons of operations:
- Prev: Display the previous
ISnapshot
and make a warning when meeting the first one. - Select: Print out a
InputMessageBox
for selecting aISnapshot
from the list ofISnapshot
s' IDs to display. - Next: Display the next
ISnapshot
and 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
ISnapshot
displaying area according to user's input. (Default Size:1000 x 1000
) - The Graphical View could print out the detailed information of a specific
Snapshot
on 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
HTML
format. - The Web View set the size of each
ISnapshot
displaying area as1000 x 1000
in default. - The Web View displays all
ISnapshots
in a list. - The Web View draws each
ISnapshots
by usingSVG
. - The Web View could print out the detailed information of a specific
Snapshot
on 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 ofISnapshot
displaying area. Optional for Graphical View