Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/layout/FlowLayout.javajet')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/layout/FlowLayout.javajet71
1 files changed, 0 insertions, 71 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/layout/FlowLayout.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/layout/FlowLayout.javajet
deleted file mode 100644
index f6de3b9b1..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/layout/FlowLayout.javajet
+++ /dev/null
@@ -1,71 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="InitFlowLayoutGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.*"%>
-<%
-GraphDefDispatcher.LayoutArgs argsBundle = (GraphDefDispatcher.LayoutArgs) argument;
-final FlowLayout gmfLayout = (FlowLayout) argsBundle.getLayout();
-final String layouterVarName = argsBundle.getManagerVariableName();
-final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
-final String layouterClassName = dispatcher.getFQNSwitch().get(gmfLayout, dispatcher.getImportManager());
-
-class AlignmentConverter {
- private final String myBegin;
- private final String myCenter;
- private final String myEnd;
-
- public AlignmentConverter(String begin, String center, String end){
- myBegin = begin;
- myCenter = center;
- myEnd = end;
- }
-
- public String convert(Alignment alignment){
- if (alignment == null){
- alignment = Alignment.BEGINNING_LITERAL;
- }
- switch (alignment.getValue()){
- case Alignment.BEGINNING :
- return myBegin;
- case Alignment.END :
- return myEnd;
- case Alignment.FILL:
- case Alignment.CENTER:
- return myCenter;
- default:
- throw new IllegalArgumentException("Unknown alignment: " + alignment);
- }
- }
-}
-
-class AlignmentFacade {
- public String convert(FlowLayout layout, Alignment alignment){
- return getConverter(layout).convert(alignment);
- }
-
- private AlignmentConverter getConverter(FlowLayout layout){
- return layout.isForceSingleLine() ?
- new AlignmentConverter("ALIGN_TOPLEFT", "ALIGN_CENTER", "ALIGN_BOTTOMRIGHT") :
- new AlignmentConverter("ALIGN_LEFTTOP", "ALIGN_CENTER", "ALIGN_RIGHTBOTTOM");
- }
-}
-
-final AlignmentFacade alignmentFacade = new AlignmentFacade();
-%>
- <%=layouterVarName%>.setStretchMinorAxis(<%=gmfLayout.isMatchMinorSize()%>);
- <%=layouterVarName%>.setMinorAlignment(<%=layouterClassName%>.<%=alignmentFacade.convert(gmfLayout, gmfLayout.getMinorAlignment())%>);
-<%
-if (gmfLayout.isForceSingleLine()){
-%>
- <%=layouterVarName%>.setSpacing(<%=gmfLayout.getMajorSpacing()%>);
- <%=layouterVarName%>.setVertical(<%=gmfLayout.isVertical()%>);
-<%
-} else {
-%>
- <%=layouterVarName%>.setMajorAlignment(<%=layouterClassName%>.<%=alignmentFacade.convert(gmfLayout, gmfLayout.getMajorAlignment())%>);
- <%=layouterVarName%>.setMajorSpacing(<%=gmfLayout.getMajorSpacing()%>);
- <%=layouterVarName%>.setMinorSpacing(<%=gmfLayout.getMinorSpacing()%>);
- <%=layouterVarName%>.setHorizontal(<%=!gmfLayout.isVertical()%>);
-<%
-}
-%>
-
-

Back to the top