Changes between Version 18 and Version 19 of RESOURCES_EXPORT_IMPORT_R0


Ignore:
Timestamp:
10/26/09 05:05:47 (16 years ago)
Author:
meddle
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RESOURCES_EXPORT_IMPORT_R0

    v18 v19  
    7878 * We need to enable the FileDialog to use the mode JFileChooser.FILES_AND_DIRECTORIES when the dialog is shown with multy-select enabled. Every time the dialog is shown with enabled multy select we will be able to choose both directories and multiple files. Another change is that FileDialogInput.FileContainer should return list of all files in the directoriy trees choosed flatten. Importing of all kind of resources from files will be done with FileDialogs with multiple selection enabled. 
    7979 * Importing resources: Importing of resources has to have one centralized logic. There are three kinds of import - importing resource, importing resource and inserting frame for it and inserting frame for already imported resource. 
     80  * The import interfaces and base implementations will be in the {{{org.sophie2.main.func.resources module}}} in a packqge called 'imports'. It can not be 'import' because this is a key word in java. 
     81  * ResourceImportProvider. In the {{{org.sophie2.main.func.resources}}} module there will be an extension points for resource import providers. The providers will have to be easy to find and have to provide many different ways for that. For example we want to find provider by the import role of some insert menu item, or by the FileFilter of some dialog or by the resource kind... So there will be such providers that can provide something called ResourceImportManager which is used for the import itself. I divided the manager into a manager and provider, because I wanted to take out the extension registering and searching logic from the huge manager. 
     82   * SimpleResourceImportProvider : Added for easy registering of import providers. Default implementation and have method {{{register}}} that registers provider by it's import manager and file filter. The filter can be null if the ImportManager don't use files to import. This implementation also has method {{{getProvider}}} that takes instance of class called ProviderMatcher as parameter. This matcher has abstract method can be used to match a provider by one or more different characteristics... Used for easy matching the right provider when needed. 
    8083  * ResourceImportManager. The manager will handle importing of resources. Some of the routines while importing are the same so the manager will be abstract class with default implementations for them. Every importable resource will have implementation of the manager. The implementations will provide some meta data needed for the import and methods for creating the resource and retrieving its data from different sources like files for example. The managers are immutable and generic for the resource data type (For example ImmImage for image resource). Methods of the ResourceImportManager are: 
    8184   * {{{String getImportRole()}}} : Abstract method which provides import role, these roles are used for retrieving the right manager for the right resource  import. For example when we import image we have something like import image role. 
    8285   * {{{String getResourceKind()}}} : Abstract method that provides the kind of the resource of the manager. 
    8386   * {{{ResourceRefR4 generateChildRef()}}} : Method using generics to create good child reference for the right resource kind... Not needed but helps a lot for readable refs. 
    84    * {{{List<ResourceImportInfo> retrieveResourceInfo(ResourceImportProvider provider)}}} : That method have default implementation. 
     87   * {{{List<ResourceImportInfo> retrieveResourceInfo(ResourceImportProvider provider)}}} : That method have default implementation. The ResourrceImportInfo is container for the sata needed to create given resource. For example the image resource have ImmImmage as a data, some title and import origin URI... The default implementation of the method brings up FileDialog with filter, the provided filter by the provider and the creates the ResourceImportInfos for every chosen file. 
     88   * {{{D getResourceData}}} methods : they are three and only one of them is mandatory to write in the implementations. The mandatory one is with parameter File, the other two with parameters ResourceAccess and DndTransferable. The data for the resource can be received from a file or from a resource access from file in Sophie Format, memory resource, server resource, etc.. or from dropping a transferable, and that is the purpose of these methods. 
     89   * {{{String getFrameKind()}}} : Gives the kind of the frame that the manager can insert for it's resource. Abstract. 
     90   * {{{ImmSize computeFrameSize(D data)}}} : Many resources compute their frames size in different ways so that methods is necessary, by default it returns the default frame size. 
     91   * {{{void insertFrame(...)}}} Inserts frame, and because the logic for inserting frames is the same for every resource it is implemented in the base class. 
    8592 
    8693= Implementation =