Changes between Version 23 and Version 24 of BASE_DND_R0


Ignore:
Timestamp:
05/29/09 13:19:20 (16 years ago)
Author:
peko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BASE_DND_R0

    v23 v24  
    103103   * [source:/branches/private/peko/sophie2-platform/modules/org.sophie2.base.dnd/src/main/java/org/sophie2/base/dnd/BaseDndTransferable.java BaseDndTransferable] is a class that implements most of DndTransferable. See the javadoc for more info. 
    104104  * [source:/branches/private/peko/sophie2-platform/modules/org.sophie2.base.dnd/src/main/java/org/sophie2/base/dnd/DnDProvider.java DnDProvider] is an interface that defines Sophie extension point for creation of DnDData objects. Every DndData would have a corresponding DnDProvider that creates the DndData. Extensions will be defined only for DndData that come from AWT. 
     105  * [source:/branches/private/peko/sophie2-platform/modules/org.sophie2.base.dnd/src/main/java/org/sophie2/base/dnd/AwtTransferable.java AwtTransferable] and [source:/branches/private/peko/sophie2-platform/modules/org.sophie2.base.dnd/src/main/java/org/sophie2/base/dnd/SophieTransferable.java SophieTransferable] are the BaseDndTransferable implementations. The AwtTransferable is a BaseDndTransferable for transferring data that comes from AWT to Sophie, as opposed to SophieTransferable which transfers that to Sophie and to Awt. This is needed since we need a way to convert transfers from awt to out own transfers. The AwtTransferable is not suppossed to be inherited. If one wants to provide support for additional DndData, they should implement is and implement a corresponding DndProvider. See [source:/branches/private/peko/sophie2-platform/modules/org.sophie2.base.dnd/src/main/java/org/sophie2/base/dnd/dnddata/ImageDndData.java ImageDndData] and [source:/branches/private/peko/sophie2-platform/modules/org.sophie2.base.dnd/src/main/java/org/sophie2/base/dnd/dnddata/StringDndData.java StringDndData] for more information. The SophieTransferable on the other hand should be implemented and should add the DndData that it supports. In addition the deleteOriginal method should be implemented in case the user performs CUT operation. 
     106   * The AwtTransferable is an adapter for awt Transferables. 
     107   * The SophieTransferable delegates to a awt Trasnferable and awt as a whole. 
     108  * DndData: 
     109   * The DndData implementations should differ in the way they are used. If a DndData is created inside Sophie2.0 in a SophieTransferable, it should override the exportToAwt method in order to provide the data needed for an AWT Transferable. If it is used inside Sophie2.0 and comes from awt one is not supposed to use this method and not implement it at all. Instead they will obtain data through a corresponding method typical for every DndData instance (for StringDndData it is the getContents method). This make the DndData class slightly dual, but will make easier implementing new transfers of data. 
    105110[[Image(source:/branches/private/peko/sophie2-platform/doc/uml-design-diagrams/base-dnd-uml.png)]] 
    106111 * Available transfers: http://spreadsheets.google.com/ccc?key=r4yyW_VIrTvloMDKwpfWtag 
    107112 * The following operations are supported: 
    108   * Copy 
    109    * Workflow 
    110     * A specific Logic receives Copy(or DragOut) notification. 
    111     * A List of DnDData is generated using the DnDDataProvider and the event data. 
    112     * A DnDTransferable is created and set as content to the ClipboardManager. 
    113     * It converts DnDTransferable to Transferable through the TransferableConverter class. 
    114     * The Java Transferable is sent to the Clipboard for serialization of the data. 
    115    * Usability.  
    116     * Can be initiated(fired) from: 
    117      * 'Edit' -> 'Copy' menu item 
    118      * Keyboard shortcuts as specified in '''Analysis''' 
    119     * Supported Copy locations 
    120      * Scene 
    121      * Right Flap -> Resources 
    122      * Left Flap -> Pages 
    123      * LeftFlap -> Books 
    124      * Outside Sophie2 
    125   * Paste 
    126    * Workflow 
    127     * A specific Logic receives Paste(or Drop) notification. 
    128     * Logic asks ClipboardManager for the current DnD contents (represented as DnDTransferable) 
    129     * ClipboardManager asks Clipboard for the current data contents (represented as Transferable) 
    130     * Transferable is acquired from the Clipboard after deserialization of the data. 
    131     * ClipboardManager converts Transferable to DnDTransferable through the TransferableConverter class. 
    132     * Logic receives DnDTransferable. 
    133     * DnDTransferable is asked for DnDData object corresponding to the first of the possible classes which the target of the Paste operation supports. 
    134     * Logic updates the model with the DnDData content. 
    135    * Usability. 
    136     * Can be initiated(fired) from: 
    137      * 'Edit' -> 'Paste' menu item 
    138      * Keyboard shortcuts as specified in '''Analysis''' 
    139     * Supported Copy locations 
    140      * Scene 
    141      * Right Flap -> Resources 
    142      * Left Flap -> Pages 
    143      * LeftFlap -> Books 
    144      * Outside Sophie2 
    145   * Cut - implemented as Copy + Delete (which is the typical behavior) 
    146  
    147  * Handling for Cut/Copy/Paste keyboard shortcuts should be added 
    148  * Menu items for Cut/copy/Paste surrounded by separators should be added to the Edit menu 
    149  * '''Note: The features specified in Task requirements section will be implemented for the current revision''' 
     113  * Cut - implemented as Copy + Delete (which is the typical behavior). The deleteOriginal method of SophieTransferable instances should be overridden. For AwtTrasferable we need NOT implement such, because it is handled by AWT or OS. 
     114 * Handling for Cut/Copy/Paste keyboard shortcuts should be added - interaction maps for VisualElements and using the already implemented interaction of the Scene. 
     115 * Menu items for Cut/copy/Paste surrounded by separators would be added in next revision. The ClipboardManager is already a BaseProObject but it is time consuming to provide implementations for menus here, since we do not have most of the interaction implemented. 
    150116 * Design related code:  
    151117  * [changeset:2819] 
    152118  * [changeset:2837] 
     119  * [changeset:2928] 
     120  * [changeset:2952] 
     121  * [changeset:2979] 
     122  * [changeset:2984] 
     123  * [source:/branches/private/peko/sophie2-platform/modules/org.sophie2.base.dnd/src/test/java/org/sophie2/base/dnd Tests]  
    153124 
    154125= Implementation =