Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 24b12f7cd98f102524198173941db22d92400b9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="InitXYLayoutDataGenerator"
	imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.*"%>
<%
GraphDefDispatcher.LayoutArgs argsBundle = (GraphDefDispatcher.LayoutArgs) argument;
final XYLayoutData gmfLayoutData = (XYLayoutData) argsBundle.getData();
final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
final String layoutConstraintVarName = argsBundle.getConstraintVariableName();

final String layoutImplClassName = dispatcher.getFQNSwitch().get(gmfLayoutData, dispatcher.getImportManager());
%>
			<%=layoutImplClassName%> <%=layoutConstraintVarName%> = new <%=layoutImplClassName%>();
<%
Point topLeft = gmfLayoutData.getTopLeft();
if (topLeft != null){
%>
			<%=layoutConstraintVarName%>.x = <%=topLeft.getX()%>;
			<%=layoutConstraintVarName%>.y = <%=topLeft.getY()%>;
<%
}
%>
<%
Dimension size = gmfLayoutData.getSize();
if (size != null){
%>
			<%=layoutConstraintVarName%>.width = <%=size.getDx()%>;
			<%=layoutConstraintVarName%>.height = <%=size.getDy()%>;
<%
}
%>

Back to the top