Changes between Version 5 and Version 6 of GROUP_PLAIN_AND_RTF_RESOURCES_R0
- Timestamp:
- 07/05/09 13:51:44 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GROUP_PLAIN_AND_RTF_RESOURCES_R0
v5 v6 27 27 * Save and reload the book 28 28 = Design = 29 Two new modules are created: one for importing plain text documents and the other - for importing rtf documents. 30 The html modole is extended with functionality for importing html documents. 31 A new abstract class ImportUtil is created with the following methods: 29 Two new modules are created: one for importing plain text documents (org.sophie2.extra.func.plainText) and the other - 30 for importing rtf documents (org.sophie2.extra.func.rtfText). 31 The html module is extended with functionality for importing html documents. 32 A new abstract class HotTextImportUtil is created in org.sophie2.extra.func.html.util with the following methods: 32 33 * handleHelper - helper fo the handle function of each newly created modules. 33 34 * insertFrame - inserts a new Frame in the current book … … 37 38 newly added HotTextBookResource. 38 39 The module for importing rtf documents and the module for importing html documents have the following class: 39 * ApplyRtfStyles/ApplyHtmlStyles - use AttributedPair class to get the corresponding CommonAttr for each 40 * ApplyRtfStyles/ApplyHtmlStyles (in org.sophie2.extra.func.rtfText.util/org.sophie2.extra.func.html.util package) - 41 use AttributedPair class (in org.sophie2.main.app.commons.frame package) to get the corresponding CommonAttr for each 40 42 pair tag/attribute.Each one has the following methods: 41 43 * applyStyles - apply styles recurselively to its HotText parameter according to the html/rtf tags. … … 44 46 ApplyRtfStyles uses the root element of the created StyledDocument and javax.swing.text.rtf.RTFEditorKit to obtain the attributes of the StyledDocument. 45 47 ApplyHtmlStyles uses the root view of the created HTMLDocument and javax.swing.text.html.HTMLEditorKit to obtain the attributes of the HTMLDocument. 46 Tests can be found here: [3990][3975][3989][3991][3993][3984][3983] 48 Used library from javax.swing.text: 49 * javax.swing.text.StyledDocument - used in RtfImportUtil to convert the rtf document to attributed document. 50 * javax.swing.text.rtf.RTFEditorKit - used in RtfImportUtil to obtain the attributes of the StyledDocument. 51 * javax.swing.text.View - used in HtmlImportUtil to obtain the attributes with their values hrom the HTMLDocument. 52 * javax.swing.text.html.HTMLDocument - used in HtmlImportUtil to convert the html document to attributed html document. 53 * javax.swing.text.html.HTMLEditorKit - used in HtmlImportUtil to obtain the attributes of the StyledDocument. 54 55 Tests can be found here: [3975][3983][3984][3989][3990][3991][3993][4015][4016][4017][4018][4019] 47 56 = Implementation = 48 57 Done according to the design. 49 Source code: [3990][3975][3989][3991][3993][3984][3983]58 Source code: [3975][3983][3984][3989][3990][3991][3993][4015][4016][4017][4018][4019] 50 59 = Testing = 51 60 ^(Place the testing results here.)^