001    package de.deepamehta.plugins.webclient.migrations;
002    
003    import de.deepamehta.core.service.Migration;
004    
005    
006    
007    public class Migration2 extends Migration {
008    
009        // -------------------------------------------------------------------------------------------------- Public Methods
010    
011        @Override
012        public void run() {
013            addIconToTopicType("dm4.core.meta_type",   "box-gray.png");
014            addIconToTopicType("dm4.core.topic_type",  "box-blue.png");
015            addIconToTopicType("dm4.core.assoc_type",  "box-red.png");
016            addIconToTopicType("dm4.core.data_type",   "box-green.png");
017            addIconToTopicType("dm4.core.cardinality", "box-yellow.png");
018            addIconToTopicType("dm4.core.index_mode",  "box-orange.png");
019            addIconToTopicType("dm4.core.plugin",      "puzzle.png");
020            //
021            // Note: on the canvas HSL-specified colors are rendered pale (Safari and Firefox)
022            addColorToAssociationType("dm4.core.association",     "rgb(178, 178, 178)" /*"hsl(  0,  0%, 75%)"*/);
023            addColorToAssociationType("dm4.core.aggregation",     "rgb( 53, 223,  59)" /*"hsl(120, 65%, 90%)"*/);
024            addColorToAssociationType("dm4.core.composition",     "rgb(231,  62,  60)" /*"hsl(  0, 65%, 90%)"*/);
025            addColorToAssociationType("dm4.core.aggregation_def", "rgb( 44, 178,  48)" /*"hsl(120, 65%, 75%)"*/);
026            addColorToAssociationType("dm4.core.composition_def", "rgb(184,  51,  49)" /*"hsl(  0, 65%, 75%)"*/);
027            addColorToAssociationType("dm4.core.instantiation",   "rgb( 41, 194, 225)" /*"hsl(190, 65%, 90%)"*/);
028            addColorToAssociationType("dm4.core.sequence",        "rgb(228, 223,  55)" /*"hsl( 60, 65%, 90%)"*/);
029        }
030    
031        // ------------------------------------------------------------------------------------------------- Private Methods
032    
033        private void addIconToTopicType(String topicTypeUri, String iconfile) {
034            addTopicTypeSetting(topicTypeUri, "icon", "/de.deepamehta.webclient/images/" + iconfile);
035        }
036    
037        private void addColorToAssociationType(String assocTypeUri, String color) {
038            addAssociationTypeSetting(assocTypeUri, "color", color);
039        }
040    }