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