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    
008    import de.deepamehta.core.Topic;
009    import de.deepamehta.core.model.CompositeValueModel;
010    import de.deepamehta.core.service.ClientState;
011    import de.deepamehta.core.service.PluginService;
012    
013    
014    
015    public interface TopicmapsService extends PluginService {
016    
017        TopicmapViewmodel getTopicmap(long topicmapId);
018    
019        // ---
020    
021        Topic createTopicmap(String name,             String topicmapRendererUri, ClientState clientState);
022        Topic createTopicmap(String name, String uri, String topicmapRendererUri, ClientState clientState);
023    
024        // ---
025    
026        void addTopicToTopicmap(long topicmapId, long topicId, CompositeValueModel viewProps);
027    
028        /**
029         * Convenience method to add a topic with the standard view properties.
030         */
031        void addTopicToTopicmap(long topicmapId, long topicId, int x, int y, boolean visibility);
032    
033        void addAssociationToTopicmap(long topicmapId, long assocId);
034    
035        // ---
036    
037        boolean isTopicInTopicmap(long topicmapId, long topicId);
038    
039        // ---
040    
041        void setViewProperties(long topicmapId, long topicId, CompositeValueModel viewProps);
042    
043        /**
044         * Convenience method to update the "dm4.topicmaps.x" and "dm4.topicmaps.y" standard view properties.
045         */
046        void setTopicPosition(long topicmapId, long topicId, int x, int y);
047    
048        /**
049         * Convenience method to update the "dm4.topicmaps.visibility" standard view property.
050         */
051        void setTopicVisibility(long topicmapId, long topicId, boolean visibility);
052    
053        void removeAssociationFromTopicmap(long topicmapId, long assocId);
054    
055        // ---
056    
057        void setClusterPosition(long topicmapId, ClusterCoords coords);
058    
059        void setTopicmapTranslation(long topicmapId, int trans_x, int trans_y);
060    
061        // ---
062    
063        void registerTopicmapRenderer(TopicmapRenderer renderer);
064        // ### TODO: unregister needed? Might a renderer hold a stale dms instance?
065    
066        void registerViewmodelCustomizer(ViewmodelCustomizer customizer);
067        void unregisterViewmodelCustomizer(ViewmodelCustomizer customizer);
068    }