Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3639962200e36acfee70e77fe0a5843f8faa711f (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="InitGridLayoutDataGenerator"
	imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.*"%>
<%
GraphDefDispatcher.LayoutArgs argsBundle = (GraphDefDispatcher.LayoutArgs) argument;
final GridLayoutData gmfLayoutData = (GridLayoutData) 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%>();
			<%=layoutConstraintVarName%>.verticalAlignment = <%=layoutImplClassName%>.<%=gmfLayoutData.getVerticalAlignment().getName()%>;
			<%=layoutConstraintVarName%>.horizontalAlignment = <%=layoutImplClassName%>.<%=gmfLayoutData.getHorizontalAlignment().getName()%>;
<%
Dimension sizeHint = gmfLayoutData.getSizeHint();
if (sizeHint != null){
%>
			<%=layoutConstraintVarName%>.widthHint = <%=sizeHint.getDx()%>;
			<%=layoutConstraintVarName%>.heightHint = <%=sizeHint.getDy()%>;
<%
}
%>
			<%=layoutConstraintVarName%>.horizontalIndent = <%=gmfLayoutData.getHorizontalIndent()%>;
			<%=layoutConstraintVarName%>.horizontalSpan = <%=gmfLayoutData.getHorizontalSpan()%>;
			<%=layoutConstraintVarName%>.verticalSpan = <%=gmfLayoutData.getVerticalSpan()%>;
			<%=layoutConstraintVarName%>.grabExcessHorizontalSpace = <%=gmfLayoutData.isGrabExcessHorizontalSpace()%>;
			<%=layoutConstraintVarName%>.grabExcessVerticalSpace = <%=gmfLayoutData.isGrabExcessVerticalSpace()%>;

Back to the top