Change Log:
- Downgrade to JAVA 1.4
- Add new button "Save Page as HTML", you can save the page to html now.
- Add new package "app", put class "BookDisplayer" inside.
- Add new package "layout", use Strategy pattern inside.
- There are two layout generator:
- PlainTextLayoutGenerator
- HTMLLayoutGenerator
- Add new package "factory"
- class "FormatterFactory" can provide different formatter to component, use Singleton Pattern.
- Add new class "BookHTMLPrinter" into control package, which can create a html file.
Implementation:- layout package
- Interface "Composition"
- method "dolayout" will use the current layout generator to generate the component's layout.
- Interface "Page"
- defined the basic method for page
- setPageWidth( int w )
- setPageHeight( int w )
- getPageWidth()
- getPageHeight()
- getPageId()
- insertline(String line)
- getContent()
- Interface "LayoutGenerator"
- method "compose" will use the formatter to construct the pages, and return a list the page.
- Class "BookComposition"
- implemented interface "Composition".
- have a list of compoenets.
- have a LayoutGenerator's reference which point to the current layout. generator.
- Class "HTMLPage"
- implemented interface "Page".
- generate page in html formate.
- Class "PlainTextPage"
- implemented interface "Page".
- generate page in plain text foramt.
- Class "PlainTextLayoutGenerator"
- implemented interface "LayoutGenerator".
- generate pages with fixed line width, and page height.
- Class "HTMLLayoutGenerator"
- implemented interface "LayoutGenerator"
- generate pages with html tag.
No comments:
Post a Comment