Changes between Version 12 and Version 13 of TEXT_LINK_MANIPULATION_R0


Ignore:
Timestamp:
11/02/09 11:49:02 (15 years ago)
Author:
deni
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TEXT_LINK_MANIPULATION_R0

    v12 v13  
    4343 * Model 
    4444   * ImmHotText will keep text links as attachments.  
    45    * create a marker interface for text attachmens in org.sophie2.base.model.text package - {{{ Attachment }}} 
    46    * add a private field in ImmHotText that contains all attachments of this text - {{{ private ImmMap<HotInterval, Attachment> links }}} 
     45   * create a marker interface for text attachments in org.sophie2.base.model.text package - {{{ Attachment }}} 
     46   * add a private field in ImmHotText that contains all attachments of this text - {{{ private ImmMap<HotInterval, Attachment> attachments }}} 
    4747     * add it as an argument to the private contructor 
    48      * make sure that all producer methods (such as applyStyle) keep this map 
    49    * create a new class {{{ LinkAttachment }}} implementing  in org.sophie2.main.func.text.model package 
     48     * add helper methods to add or remove attachments 
     49   * create a new class {{{ LinkAttachment }}} in org.sophie2.main.func.text.model package 
    5050     * it will implement {{{ Attachment }}} and have a {{{ Link }}} as private field. 
    51      * in addition, it will have 4 ImmColor private fields that are used for highlighting the link in its 4 different states - normal, hover, visited, pressed. 
     51     * in addition, it will have 4 {{{ ImmColor }}} private fields that are used for highlighting the link in its 4 different states - normal, hover, visited, pressed. 
    5252     * it will have producer methods that change a specific color. 
    53    * TODO: persistence 
     53   * make sure that text with link attachments is persisted correctly 
     54     * persist the attachments map in {{{ ImmHotTextPersister }}} 
     55     * create a new class {{{ LinkAttachmentPersister }}} extending RefToStoragePersister<LinkAttachment> to persist link attachments 
    5456  
    5557 * Highlights 
    56    * Highlights will be added in {{{HeadTextFrameView}}}. 
     58   * Highlights will be added in {{{ HeadTextFrameView }}}. 
    5759     * add a new property that contains a list of all hovered links - {{{ ListProp<TextLink> hoveredLinks() }}} 
    5860     * use this property to create the appropriate highlights in {{{ HeadTextFrameView.textView()...textFlow().getExtraHighlights() }}} 
    5961     * override {{{ void touch() }}} in {{{ HotTextElementHelper }}} to depend on the highlights, so that the scene gets repainted when the highlights change. 
    60    * A new logic will handle switching between the different states and firing InputR3Events related to text links.  
     62   * Swithing between the different states and changing highlights will be done in a new logic - {{{ TextFrameLogic }}} 
     63  
     64 * Executing links 
     65   * Evoking link triggers: 
    6166     * create a new class {{{ TextFrameLogic }}} in org.sophie2.main.func.text.view package with the following operations: 
    62        * ON_MOUSE_MOVED - takes care of highlighting hovered text links and firing an MOUSE_ENTERED and MOUSE_EXITED events. This operation does not cover the case when there are some hovered links and the mouse leaves the frame. 
    63        * ON_MOUSE_EXITED_FRAME - removes all text links highlights and if necessary fires MOUSE_EXITED events. 
    64        * ON_MOUSE_PRESSED, ON_MOUSE_RELEASED and ON_MOUSE_DOUBLE_CLICKED take care to fire MOUSE_PRESSED, MOUSE_RELEASED and MOUSE_CLICKED events connected with text links. 
     67       * ON_MOUSE_MOVED - takes care of highlighting hovered text links and firing LINK_ACTION_TRIGGERED event if the MOUSE_ENTER or MOUSE_LEAVE triggers have been evoked. This operation does not cover the case when there are some hovered text links and the mouse leaves the frame. 
     68       * ON_MOUSE_EXITED_FRAME - removes the highlights for hovered links when the mouse leaves the frame and fires LINK_ACTION_TRIGGERED event if the MOUSE_LEAVE trigger has been evoked. 
     69       * ON_MOUSE_PRESSED, ON_MOUSE_RELEASED and ON_MOUSE_DOUBLE_CLICKED - fire LINK_ACTION_TRIGGERED event if the MOUSE_PRESSED trigger has been evoked. 
     70     * add a resource access as a second parameter to the {{{ LinkProcessorLogic.LinkEvent#LINK_ACTION_TRIGGERED }}} event. If the LinkAction has a resource as target (for example a frame to show),  this access should be used to open an access to the target resource. 
     71   * Executing link actions should be done by already existing logics. 
     72     * they should be modified to use the resource access argument instead of the context resource view to open the target resources. 
    6573 
    66  * Executing links 
    67    * {{{ LinkProcessorLogic }}} will take care to fire LINK_ACTION_TRIGGERED events if appropriately. The following operations should be added: 
    68      * ON_TEXT_LINK_ENTERED 
    69      * ON_TEXT_LINK_EXITED 
    70      * ON_TEXT_LINK_PRESSED 
    71      * ON_TEXT_LINK_RELEASED 
    72      * ON_TEXT_LINK_DOUBLE_CLICKED 
    73      * All of them have TextFrameView as source and TextLink as context. 
    74    * Executing link actions should be done by already existing logics. 
    75      * If a link contains a resource ref, it will be relative to the text frame. 
    76      * Therefore, the ResourceView these logics use to open an access to the target will be TextFrameView. 
     74 * {{{ LinkHolder }}} - an interface that can be used by logics and huds to access and manipulate in the same way the links associated with different resources. In particular, it will be used in LinksHud to display and modify both frame and page links, and text link attachments. 
     75   * It has the following methods: 
     76     * Link getLink(); 
     77     * ResourceRefR4 getRef(); 
     78     * ResourceAccess getAccess(); 
     79     * List<LinkTrigger> getTriggers() - gets a list of all possible triggers for this holder's link. 
     80   * Add a nested class  {{{ SimpleLinkHolder }}} exdending LinkHolder in {{{ ElementView }}}. 
     81     * add a new property in ElementView - public Prop<SimpleLinkHolder> linkHolder() 
     82   * Add a nested class  {{{ TextLinkHolder }}} exdending LinkHolder in {{{ HeadTextFrameView }}}. 
     83     * it will need one additional method - public TextLink getTextLink(). 
     84     * add a new property in HeadTextFrameView - public Prop<TextLinkHolder> textLinkHolder() 
    7785 
    7886 * Huds - general 
    79    * The existing {{{ LinksHud }}} should be used for creating links for both elements (frames and pages) and for text attachments. 
    80    * The holder property's type will be changed from ElementH to LinkHolder. 
    81      * Create a new interface {{{ LinkHolder }}} in org.sophie2.main.app.commons.links with the following methods: 
    82        * Link getLink() - gets the link model of this holder. 
    83        * ResourceRefR4 getRef() - gets a reference to the owner of this holder. 
    84        * List<LinkTrigger> getTriggers() - gets a list of all possible triggers for this holder's link. 
    85      * A nested class {{{ SimpleLinkHolder }}} exdending LinkHolder will be added in {{{ ElementView }}}. 
    86        * It will need one additional method - ResourceAccess getAccess(). 
    87        * A new property will be added in ElementView - public Prop<SimpleLinkHolder> linkHolder() 
    88      * A nested class {{{ TextLinkHolder }}} exdending LinkHolder will be added in {{{ HeadTextFrameView }}}. 
    89        * It will need one additional method - public TextLink getTextLink(). 
    90        * A new property will be added in HeadTextFrameView - public Prop<TextLinkHolder> textLinkHolder() 
     87   * The existing {{{ LinksHud }}} should be used for creating links for both element links and for text link attachments. 
     88   * The holder property's type will be changed from ElementH to LinkHolder.  
    9189   * Two subclasses of LinksHud will be created: 
    9290     * ElementLinksHud with a SimpleLinkHolder 
    93      * TextLinksHud with a TextLinkHolder and additional controls for selecting link colours in {{{ org.sophie2.main.func.text.view package }}}. 
     91     * TextLinksHud with a TextLinkHolder and additional controls for selecting link colors in {{{ org.sophie2.main.func.text.view }}} package. 
    9492   * The operations in {{{ LinksHudLogic }}} should be modified to make the new link and to throw a new SET_LINK event instead of setting the link in the model. 
    9593   * A new operation ON_SET_ELEMENT_LINK in {{{ LinksHudLogic }}} will register an autoaction to set the link of ElementLinksHud's model. 
     
    110108     * ON_COLOR_SUBMIT changes the color of all link's states simultaneously 
    111109 
    112  * Source code: [7801], [7874]  
     110 * Source code:  
    113111 
    114112= Implementation =