Changes between Version 23 and Version 24 of TEXT_VIEW_MODEL
- Timestamp:
- 04/21/10 11:15:00 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TEXT_VIEW_MODEL
v23 v24 39 39 40 40 = Design = 41 41 42 * Make interface '''TextProcessor'''. 42 43 * Usage: Gets a text on its input and gives another text as a result. Processors get the model text of an element and make it ready for drawing, that is, they may put decorations, colors, may even change the text itself. … … 59 60 * TextLinkOptions - contains a map of strings to ImmColors. Nothing special here. 60 61 61 * In org.sophie2.base.model.text.mvc package add new class public static class '''SelectionOptions<T>''' implements TextProcessor.Options - a class representing the options of the selection processor. This class has private final HotAttr<T> attribute, private final T value, private final HotTextInterval selectionInterval. The first one holds the attribute of the selection (CommonAttr.BACKGROUND_COLOR), the second one holds it's value (Ex: ImmColor.Blue) and the third one holds the selection interval.62 * In org.sophie2.base.model.text.mvc package add new class public static class '''SelectionOptions<T>''' implements TextProcessor.Options - a class representing the options of the selection processor. This class has private final HotAttr<T> attribute, private final T value, private final HotTextInterval selectionInterval. The first one holds the attribute of the selection (CommonAttr.BACKGROUND_COLOR), the second one holds it's value (Ex: ImmColor.Blue) and the third one holds the selection interval. 62 63 * In org.sophie2.base.model.text.mvc package add new class '''SelectionProcessor''' implements TextProcessor<SelectionOptions, DefaultTextEffect> - Processes text selection and caret.Its work consists of modifying some of the the color attributes for the selected chars, as well as to put a LayoutAttr#CARET_ATTR somewhere. 63 64 64 65 65 -----------------------TEXT_VIEW part--------------------------------------- 66 === TEXT_VIEW part === 67 66 68 * In org.sophie2.base.model.text package add new abstract class '''TextChange''' that represents 67 69 the base model of a text change (applying styles ot text, replacing existing text in some interval). … … 94 96 * In HotLayout, HotTextLayout, HotAreaLayout, HotLineLayout, HotSegmentLayout:draw method add another parameter : isEditable that is true if the book is not preview mode (this is used to show if the caret should be drawn). 95 97 98 99 Tests : [browser:branches/private/diana/2384/modules/org.sophie2.base.model.text/src/test/java/org/sophie2/base/model/text/mvc/SelectionProcessorTest.java SelectionProcessorTest], [browser: branches/private/diana/2384/modules/org.sophie2.main.func.text/src/test/java/org/sophie2/main/func/text/links/TextLinkProcessorTest.java LinkProcessorTest] 100 101 102 96 103 = Implementation = 97 104 ^(Describe and link the implementation results here (from the wiki or the repository).)^