001    package de.deepamehta.plugins.topicmaps.service;
002    
003    import de.deepamehta.plugins.topicmaps.ClusterCoords;
004    import de.deepamehta.plugins.topicmaps.TopicmapRenderer;
005    import de.deepamehta.plugins.topicmaps.ViewmodelCustomizer;
006    import de.deepamehta.plugins.topicmaps.model.TopicmapViewmodel;
007    import de.deepamehta.plugins.topicmaps.model.ViewProperties;
008    
009    import de.deepamehta.core.Topic;
010    import de.deepamehta.core.service.PluginService;
011    
012    
013    
014    public interface TopicmapsService extends PluginService {
015    
016        // ------------------------------------------------------------------------------------------------------- Constants
017    
018        static final String DEFAULT_TOPICMAP_NAME     = "untitled";
019        static final String DEFAULT_TOPICMAP_RENDERER = "dm4.webclient.default_topicmap_renderer";
020    
021        // -------------------------------------------------------------------------------------------------- Public Methods
022    
023        Topic createTopicmap(String name, String topicmapRendererUri);
024    
025        // ---
026    
027        /**
028         * @param   includeChilds   if true the topics contained in the topicmap will include their child topics.
029         */
030        TopicmapViewmodel getTopicmap(long topicmapId, boolean includeChilds);
031    
032        boolean isTopicInTopicmap(long topicmapId, long topicId);
033    
034        // ---
035    
036        void addTopicToTopicmap(long topicmapId, long topicId, ViewProperties viewProps);
037    
038        /**
039         * Convenience method to add a topic with the standard view properties.
040         */
041        void addTopicToTopicmap(long topicmapId, long topicId, int x, int y, boolean visibility);
042    
043        void addAssociationToTopicmap(long topicmapId, long assocId);
044    
045        // ---
046    
047        void setViewProperties(long topicmapId, long topicId, ViewProperties viewProps);
048    
049        /**
050         * Convenience method to update the "dm4.topicmaps.x" and "dm4.topicmaps.y" standard view properties.
051         */
052        void setTopicPosition(long topicmapId, long topicId, int x, int y);
053    
054        /**
055         * Convenience method to update the "dm4.topicmaps.visibility" standard view property.
056         */
057        void setTopicVisibility(long topicmapId, long topicId, boolean visibility);
058    
059        void removeAssociationFromTopicmap(long topicmapId, long assocId);
060    
061        // ---
062    
063        void setClusterPosition(long topicmapId, ClusterCoords coords);
064    
065        void setTopicmapTranslation(long topicmapId, int trans_x, int trans_y);
066    
067        // ---
068    
069        void registerTopicmapRenderer(TopicmapRenderer renderer);
070    
071        // ### TODO: unregister needed? Might a renderer hold a stale dms instance?
072    
073        // ---
074    
075        void registerViewmodelCustomizer(ViewmodelCustomizer customizer);
076    
077        void unregisterViewmodelCustomizer(ViewmodelCustomizer customizer);
078    }