Bug 355347 - Added creator methods for text and multitext objects that
additionally receive a font description
diff --git a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/CreateServiceImpl.java b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/CreateServiceImpl.java
index 9e58b9a..30fac37 100644
--- a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/CreateServiceImpl.java
+++ b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/CreateServiceImpl.java
@@ -1,7 +1,7 @@
 /*******************************************************************************
  * <copyright>
  *
- * Copyright (c) 2005, 2010 SAP AG.
+ * Copyright (c) 2005, 2011 SAP AG.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
  *    SAP AG - initial API, implementation and documentation
  *    Patch 184530 from Bug 331829 contributed by Henrik Rentz-Reichert
  *    mwenz - Bug 331715: Support for rectangular grids in diagrams
+ *    mwenz - Bug 355347 - Remove setters of Graphiti's Font Interface
  *
  * </copyright>
  *
@@ -171,6 +172,35 @@
 	/*
 	 * (non-Javadoc)
 	 * 
+	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createMultiText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int)
+	 */
+	@Override
+	public MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize) {
+		return getGaService().createMultiText(diagram, gaContainer, value, fontName, fontSize);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createMultiText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int, boolean, boolean)
+	 */
+	@Override
+	public MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize,
+			boolean isFontItalic, boolean isFontBold) {
+		return getGaService().createMultiText(diagram, gaContainer, value, fontName, fontSize, isFontItalic, isFontBold);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @seeorg.eclipse.graphiti.services.IGaCreateService#
 	 * createPlatformGraphicsAlgorithm
 	 * (org.eclipse.graphiti.mm.pictograms.GraphicsAlgorithmContainer,
@@ -414,6 +444,35 @@
 	 * (non-Javadoc)
 	 * 
 	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int)
+	 */
+	@Override
+	public Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize) {
+		return getGaService().createText(diagram, gaContainer, value, fontName, fontSize);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int, boolean, boolean)
+	 */
+	@Override
+	public Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize,
+			boolean isFontItalic, boolean isFontBold) {
+		return getGaService().createText(diagram, gaContainer, value, fontName, fontSize, isFontItalic, isFontBold);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
 	 * org.eclipse.graphiti.services.IPeCreateService#createBoxRelativeAnchor
 	 * (org.eclipse.graphiti.mm.pictograms.AnchorContainer)
 	 */
diff --git a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/GaServiceImpl.java b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/GaServiceImpl.java
index f580500..5e7c189 100644
--- a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/GaServiceImpl.java
+++ b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/internal/services/impl/GaServiceImpl.java
@@ -545,6 +545,38 @@
 	/*
 	 * (non-Javadoc)
 	 * 
+	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createMultiText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int)
+	 */
+	@Override
+	public MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize) {
+		return createMultiText(diagram, gaContainer, value, fontName, fontSize, false, false);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createMultiText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int, boolean, boolean)
+	 */
+	@Override
+	public MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize,
+			boolean isFontItalic, boolean isFontBold) {
+		MultiText text = createMultiText(gaContainer, value);
+		Font font = manageFont(diagram, fontName, fontSize, isFontItalic, isFontBold);
+		text.setFont(font);
+		return text;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @seeorg.eclipse.graphiti.services.IGaCreateService#
 	 * createPlatformGraphicsAlgorithm
 	 * (org.eclipse.graphiti.mm.pictograms.GraphicsAlgorithmContainer,
@@ -862,6 +894,38 @@
 	 * 
 	 * @see
 	 * org.eclipse.graphiti.services.IGaCreateService#createText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int)
+	 */
+	@Override
+	public Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize) {
+		return createText(diagram, gaContainer, value, fontName, fontSize, false, false);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createText(org.eclipse
+	 * .graphiti.mm.pictograms.Diagram,
+	 * org.eclipse.graphiti.mm.GraphicsAlgorithmContainer, java.lang.String,
+	 * java.lang.String, int, boolean, boolean)
+	 */
+	@Override
+	public Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize,
+			boolean isFontItalic, boolean isFontBold) {
+		Text text = createText(gaContainer, value);
+		Font font = manageFont(diagram, fontName, fontSize, isFontItalic, isFontBold);
+		text.setFont(font);
+		return text;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.graphiti.services.IGaCreateService#createText(org.eclipse
 	 * .graphiti.mm.pictograms.GraphicsAlgorithmContainer, java.lang.String)
 	 */
 	@Override
@@ -1571,5 +1635,4 @@
 			throw new IllegalArgumentException("Object AdaptedGradientColoredAreas or its attributes must not be null or empty"); //$NON-NLS-1$
 		}
 	}
-
 }
diff --git a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/services/IGaCreateService.java b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/services/IGaCreateService.java
index bcdc206..ea71956 100644
--- a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/services/IGaCreateService.java
+++ b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/services/IGaCreateService.java
@@ -196,6 +196,81 @@
 	public MultiText createMultiText(GraphicsAlgorithmContainer gaContainer, String value);
 
 	/**
+	 * Creates a multitext graphics algorithm with the given text and font. The
+	 * font will be displayed in straight (no italics or bold) and will be
+	 * managed within the given diagram; in case the font already exists it will
+	 * be reused, otherwise the corresponding font instance will be created.
+	 * <p>
+	 * The following values are set by default:
+	 * <p>
+	 * graphicsAlgorithm.setFilled(true); <br>
+	 * graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID); <br>
+	 * graphicsAlgorithm.setLineVisible(true); <br>
+	 * graphicsAlgorithm.setLineWidth(1);<br>
+	 * graphicsAlgorithm.setTransparency(0);<br>
+	 * text.setAngle(0);<br>
+	 * text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);<br>
+	 * text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);<br>
+	 * text.setFont(<given font<);<br>
+	 * 
+	 * @param diagram
+	 *            the diagram that shall be used for managing the font for the
+	 *            new text field
+	 * @param gaContainer
+	 *            the container for the new graphics algorithm
+	 * @param value
+	 *            initial text
+	 * @param fontName
+	 *            the name of the font to use for the new text field
+	 * @param fontSize
+	 *            the size of the font to use for the new text field
+	 * @return the new multiline text
+	 * @since 0.9
+	 */
+	public MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize);
+
+	/**
+	 * Creates a multitext graphics algorithm with the given text and font. The
+	 * font will be managed within the given diagram; in case the font already
+	 * exists it will be reused, otherwise the corresponding font instance will
+	 * be created.
+	 * <p>
+	 * The following values are set by default:
+	 * <p>
+	 * graphicsAlgorithm.setFilled(true); <br>
+	 * graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID); <br>
+	 * graphicsAlgorithm.setLineVisible(true); <br>
+	 * graphicsAlgorithm.setLineWidth(1);<br>
+	 * graphicsAlgorithm.setTransparency(0);<br>
+	 * text.setAngle(0);<br>
+	 * text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);<br>
+	 * text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);<br>
+	 * text.setFont(<given font<);<br>
+	 * 
+	 * @param diagram
+	 *            the diagram that shall be used for managing the font for the
+	 *            new text field
+	 * @param gaContainer
+	 *            the container for the new graphics algorithm
+	 * @param value
+	 *            initial text
+	 * @param fontName
+	 *            the name of the font to use for the new text field
+	 * @param fontSize
+	 *            the size of the font to use for the new text field
+	 * @param isFontItalic
+	 *            flag if the font to use for the new text field should be
+	 *            italic or not
+	 * @param isFontBold
+	 *            flag if the font to use for the new text field should be bold
+	 *            or not
+	 * @return the new multiline text
+	 * @since 0.9
+	 */
+	public MultiText createMultiText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize,
+			boolean isFontItalic, boolean isFontBold);
+
+	/**
 	 * Creates a text graphics algorithm.
 	 * <p>
 	 * The following values are set by default:
@@ -238,6 +313,81 @@
 	public Text createText(GraphicsAlgorithmContainer gaContainer, String value);
 
 	/**
+	 * Creates a text graphics algorithm with the given text and font. The font
+	 * will be displayed in straight (no italics or bold) and will be managed
+	 * within the given diagram; in case the font already exists it will be
+	 * reused, otherwise the corresponding font instance will be created.
+	 * <p>
+	 * The following values are set by default:
+	 * <p>
+	 * graphicsAlgorithm.setFilled(true); <br>
+	 * graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID); <br>
+	 * graphicsAlgorithm.setLineVisible(true); <br>
+	 * graphicsAlgorithm.setLineWidth(1);<br>
+	 * graphicsAlgorithm.setTransparency(0);<br>
+	 * text.setAngle(0);<br>
+	 * text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);<br>
+	 * text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);<br>
+	 * text.setFont(<given font<);<br>
+	 * 
+	 * @param diagram
+	 *            the diagram that shall be used for managing the font for the
+	 *            new text field
+	 * @param gaContainer
+	 *            the container for the new graphics algorithm
+	 * @param value
+	 *            initial text
+	 * @param fontName
+	 *            the name of the font to use for the new text field
+	 * @param fontSize
+	 *            the size of the font to use for the new text field
+	 * @return the new text
+	 * @since 0.9
+	 */
+	public Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize);
+
+	/**
+	 * Creates a text graphics algorithm with the given text and font. The font
+	 * will be managed within the given diagram; in case the font already exists
+	 * it will be reused, otherwise the corresponding font instance will be
+	 * created.
+	 * <p>
+	 * The following values are set by default:
+	 * <p>
+	 * graphicsAlgorithm.setFilled(true); <br>
+	 * graphicsAlgorithm.setLineStyle(LineStyleEnum.SOLID); <br>
+	 * graphicsAlgorithm.setLineVisible(true); <br>
+	 * graphicsAlgorithm.setLineWidth(1);<br>
+	 * graphicsAlgorithm.setTransparency(0);<br>
+	 * text.setAngle(0);<br>
+	 * text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);<br>
+	 * text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);<br>
+	 * text.setFont(<given font<);<br>
+	 * 
+	 * @param diagram
+	 *            the diagram that shall be used for managing the font for the
+	 *            new text field
+	 * @param gaContainer
+	 *            the container for the new graphics algorithm
+	 * @param value
+	 *            initial text
+	 * @param fontName
+	 *            the name of the font to use for the new text field
+	 * @param fontSize
+	 *            the size of the font to use for the new text field
+	 * @param isFontItalic
+	 *            flag if the font to use for the new text field should be
+	 *            italic or not
+	 * @param isFontBold
+	 *            flag if the font to use for the new text field should be bold
+	 *            or not
+	 * @return the new text
+	 * @since 0.9
+	 */
+	public Text createText(Diagram diagram, GraphicsAlgorithmContainer gaContainer, String value, String fontName, int fontSize,
+			boolean isFontItalic, boolean isFontBold);
+
+	/**
 	 * Creates an ellipse graphics algorithm.
 	 * <p>
 	 * The following values are set by default: