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
11 * Oliver Kopp - initial API and implementation and/or initial documentation
12 *******************************************************************************/
14 <%@tag description="Generates style element for node types and relationship types" pageEncoding="UTF-8" %>
16 <%@attribute name="nodeTypes" required="true" type="java.util.Collection" %>
17 <%@attribute name="relationshipTypes" required="true" type="java.util.Collection" %>
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"%>
28 for (TNodeType nt: (Collection<TNodeType>) nodeTypes) {
29 String borderColor = ModelUtilities.getBorderColor(nt);
30 String cssName = Util.makeCSSName(nt.getTargetNamespace(), nt.getName());
32 div.NodeTemplateShape.<%=cssName%> {
33 border-color: <%=borderColor%>;
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";
45 background: <%=color%>;