1df2d82b5b38871fd4cf13c4177ef15d5cf3fad6
[vfc/nfvo/wfengine.git] /
1 <%--
2 /*******************************************************************************
3  * Copyright (c) 2013 University of Stuttgart.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * and the Apache License 2.0 which both accompany this distribution,
7  * and are available at http://www.eclipse.org/legal/epl-v10.html
8  * and http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Contributors:
11  *    Oliver Kopp - initial API and implementation and/or initial documentation
12  *******************************************************************************/
13 --%>
14 <%@tag description="Generates style element for node types and relationship types" pageEncoding="UTF-8" %>
15
16 <%@attribute name="nodeTypes" required="true" type="java.util.Collection" %>
17 <%@attribute name="relationshipTypes" required="true" type="java.util.Collection" %>
18
19 <%@tag import="java.util.Collection"%>
20 <%@tag import="javax.xml.namespace.QName"%>
21 <%@tag import="org.eclipse.winery.common.ModelUtilities"%>
22 <%@tag import="org.eclipse.winery.common.Util"%>
23 <%@tag import="org.eclipse.winery.model.tosca.TNodeType"%>
24 <%@tag import="org.eclipse.winery.model.tosca.TRelationshipType"%>
25
26 <style>
27 <%
28         for (TNodeType nt: (Collection<TNodeType>) nodeTypes) {
29                 String borderColor = ModelUtilities.getBorderColor(nt);
30                 String cssName = Util.makeCSSName(nt.getTargetNamespace(), nt.getName());
31 %>
32                 div.NodeTemplateShape.<%=cssName%> {
33                         border-color: <%=borderColor%>;
34                 }
35 <%
36         }
37
38         // relationship types CSS
39         for (TRelationshipType rt: (Collection<TRelationshipType>) relationshipTypes) {
40                 String color = ModelUtilities.getColor(rt);
41                 QName qname = new QName(rt.getTargetNamespace(), rt.getName());
42                 String cssName = Util.makeCSSName(qname) + "_box";
43 %>
44                 div.<%=cssName%> {
45                         background: <%=color%>;
46                 }
47 <%
48         }
49 %>
50 </style>