Changes between Version 18 and Version 19 of TEXT_VIEW_MODEL
- Timestamp:
- 04/19/10 15:31:23 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TEXT_VIEW_MODEL
v18 v19 43 43 * Interface '''Effect'''. This consists of the resulting text after a processing and the change that is generated from it (the change that if applied to the raw text, the processed one will be the result). An Effect is actually an instruction for the next processor in a processing chain. 44 44 * '''public ImmText getText();''' 45 * '''public Text StyleChange getChange();''' Note that the result is a Style change, that is, the processors will not e able to modify the text itself, but only its styles. Otherwise, weird navigation problems could occur with the current implementation :)46 * '''ImmText process(ImmText sourceText, T procOptions);''' You give the processor a text and the rules for processing, then it returns the processed text. For example: TextSelectionProcessor, which has text 'abc' and options 'caret: 2, mark:1, color: red' will return 'abc' with colored in green 'b' and 'c', as well as a caret afterthe 'c'.45 * '''public TextChange getChange();''' The TextChange this text processing has caused. 46 * '''ImmText process(ImmText sourceText, T procOptions);''' You give the processor a text and the rules for processing, then it returns the processed text. For example: TextSelectionProcessor, which has text 'abc' and options 'caret: 2, mark:1, color: red' will return 'abc' with colored in green 'b' and 'c', as well as a caret before the 'c'. 47 47 * '''Effect applyChange(Effect prevEffect, ImmText oldSource, T procOptions);''' Processes the text again after a TextChange has been applied to it. You could actually use ''process'' in this case, but it will do a whole processing of the text, which will be slow. So, this method's purpose is to be effective. 48 48 * '''Effect setOptions(ImmText source, ImmText oldProcessed, T oldOptions, T newOptions);''' If the text is not modified itself, but only the options are changed, then it could perform even faster. This method should implement this idea.