Bug 355347 - Deprecated setter methods for attributes of Font and Color
and adapted framework and examples usages
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/compartment/CompartmentPattern.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/compartment/CompartmentPattern.java
index 1c0a470..58667d1 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/compartment/CompartmentPattern.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/compartment/CompartmentPattern.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
@@ -9,6 +9,7 @@
*
* Contributors:
* SAP AG - initial API, implementation and documentation
+ * mwenz - Bug 355347 - Deprecate setters of Graphiti's Font Interface
*
* </copyright>
*
@@ -74,6 +75,7 @@
// CONTAINER SHAPE WITH ROUNDED RECTANGLE
final IPeCreateService peCreateService = Graphiti.getPeCreateService();
IGaCreateService gaCreateService = Graphiti.getGaCreateService();
+ IGaService gaService = Graphiti.getGaService();
ContainerShape containerShape = peCreateService.createContainerShape(parentContainerShape, true);
getFeatureProvider().getDirectEditingInfo().setMainPictogramElement(containerShape);
@@ -112,19 +114,19 @@
gaCreateService.createImage(rectangle, IPlatformImageConstants.IMG_EDIT_EXPANDALL);
- text = gaCreateService.createDefaultText(getDiagram(), rectangle);
+ text = gaCreateService.createText(rectangle);
text.setForeground(manageColor(getConfiguration().getTextColor()));
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- text.getFont().setBold(true);
+ text.setFont(gaService.manageFont(getDiagram(), "Arial", 8, false, true)); //$NON-NLS-1$
} else { // just a text data mapping
- text = gaCreateService.createDefaultText(getDiagram(), shape);
+ text = gaCreateService.createText(shape);
text.setForeground(manageColor(getConfiguration().getTextColor()));
text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- text.getFont().setBold(true);
+ text.setFont(gaService.manageFont(getDiagram(), "Arial", 8, false, true)); //$NON-NLS-1$
}
IDirectEditingInfo dei = getFeatureProvider().getDirectEditingInfo();
@@ -357,6 +359,7 @@
private void createShapesInCompartment(ContainerShape compartmentContainerShape, List<ILinkCreationInfo> linkCreationInfos) {
IGaCreateService gaCreateService = Graphiti.getGaCreateService();
+ IGaService gaService = Graphiti.getGaService();
// add multi text shapes
for (ILinkCreationInfo linkCreationInfo : linkCreationInfos) {
@@ -369,11 +372,11 @@
gaCreateService.createImage(rectangle, IPlatformImageConstants.IMG_EDIT_EXPANDALL);
- Text text = gaCreateService.createDefaultText(getDiagram(), rectangle);
+ Text text = gaCreateService.createText(rectangle);
text.setForeground(manageColor(getConfiguration().getTextColor()));
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- text.getFont().setBold(true);
+ text.setFont(gaService.manageFont(getDiagram(), "Arial", 8, false, true)); //$NON-NLS-1$
// create link and wire it
Object[] businessObjects = linkCreationInfo.getBusinessObjects();
diff --git a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/grid/GridPattern.java b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/grid/GridPattern.java
index b1063b3..3904024 100644
--- a/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/grid/GridPattern.java
+++ b/examples/org.eclipse.graphiti.examples.common/src/org/eclipse/graphiti/examples/common/pattern/grid/GridPattern.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
@@ -9,6 +9,7 @@
*
* Contributors:
* SAP AG - initial API, implementation and documentation
+ * mwenz - Bug 355347 - Deprecate setters of Graphiti's Font Interface
*
* </copyright>
*
@@ -300,19 +301,18 @@
private void createCellShapes(ContainerShape containerShape, List<ILinkCreationInfo> linkCreationInfos) {
+ IGaService gaService = Graphiti.getGaService();
+
// add text shapes for each BO
for (ILinkCreationInfo linkCreationInfo : linkCreationInfos) {
Shape shape = Graphiti.getPeCreateService().createShape(containerShape, false);
- Text text = Graphiti.getGaService().createDefaultText(getDiagram(), shape);
+ Text text = Graphiti.getGaService().createText(shape);
text.setForeground(manageColor(getConfiguration().getTextColor()));
text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- text.getFont().setBold(false);
- text.getFont().setItalic(true);
- text.getFont().setSize(10);
- text.getFont().setName("Baskerville Old Face"); //$NON-NLS-1$
+ text.setFont(gaService.manageFont(getDiagram(), "Baskerville Old Face", 10, true, false)); //$NON-NLS-1$
// create link and wire it
link(shape, linkCreationInfo.getBusinessObjects());
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Color.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Color.java
index c54fd1d..6113528 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Color.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Color.java
@@ -17,32 +17,35 @@
import org.eclipse.emf.ecore.EObject;
/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Color</b></em>'.
- * <!-- end-user-doc -->
- *
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Color</b></em>'. <!-- end-user-doc -->
+ *
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getRed <em>Red</em>}</li>
- * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getGreen <em>Green</em>}</li>
- * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getBlue <em>Blue</em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getRed <em>Red
+ * </em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getGreen <em>Green
+ * </em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getBlue <em>Blue
+ * </em>}</li>
* </ul>
* </p>
- *
+ *
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getColor()
* @model
* @generated
*/
public interface Color extends EObject {
/**
- * Returns the value of the '<em><b>Red</b></em>' attribute.
- * <!-- begin-user-doc -->
+ * Returns the value of the '<em><b>Red</b></em>' attribute. <!--
+ * begin-user-doc -->
* <p>
- * If the meaning of the '<em>Red</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Red</em>' attribute isn't clear, there really
+ * should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Red</em>' attribute.
* @see #setRed(int)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getColor_Red()
@@ -52,23 +55,30 @@
int getRed();
/**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getRed <em>Red</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Red</em>' attribute.
+ * Sets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.Color#getRed
+ * <em>Red</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Red</em>' attribute.
* @see #getRed()
- * @generated
+ * @generated not
+ * @deprecated use the manageColor methods in class IGaService instead to
+ * create a Color with the desired properties, see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=355347 for
+ * details
*/
void setRed(int value);
/**
- * Returns the value of the '<em><b>Green</b></em>' attribute.
- * <!-- begin-user-doc -->
+ * Returns the value of the '<em><b>Green</b></em>' attribute. <!--
+ * begin-user-doc -->
* <p>
- * If the meaning of the '<em>Green</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Green</em>' attribute isn't clear, there
+ * really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Green</em>' attribute.
* @see #setGreen(int)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getColor_Green()
@@ -78,23 +88,30 @@
int getGreen();
/**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getGreen <em>Green</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Green</em>' attribute.
+ * Sets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.Color#getGreen
+ * <em>Green</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Green</em>' attribute.
* @see #getGreen()
- * @generated
+ * @generated not
+ * @deprecated use the manageColor methods in class IGaService instead to
+ * create a Color with the desired properties, see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=355347 for
+ * details
*/
void setGreen(int value);
/**
- * Returns the value of the '<em><b>Blue</b></em>' attribute.
- * <!-- begin-user-doc -->
+ * Returns the value of the '<em><b>Blue</b></em>' attribute. <!--
+ * begin-user-doc -->
* <p>
- * If the meaning of the '<em>Blue</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Blue</em>' attribute isn't clear, there really
+ * should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Blue</em>' attribute.
* @see #setBlue(int)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getColor_Blue()
@@ -104,12 +121,18 @@
int getBlue();
/**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.algorithms.styles.Color#getBlue <em>Blue</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Blue</em>' attribute.
+ * Sets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.Color#getBlue
+ * <em>Blue</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Blue</em>' attribute.
* @see #getBlue()
- * @generated
+ * @generated not
+ * @deprecated use the manageColor methods in class IGaService instead to
+ * create a Color with the desired properties, see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=355347 for
+ * details
*/
void setBlue(int value);
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Font.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Font.java
index a9befd9..df59109 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Font.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/Font.java
@@ -17,33 +17,37 @@
import org.eclipse.emf.ecore.EObject;
/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Font</b></em>'.
- * <!-- end-user-doc -->
- *
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Font</b></em>'. <!-- end-user-doc -->
+ *
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#getSize <em>Size</em>}</li>
- * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#isItalic <em>Italic</em>}</li>
- * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#isBold <em>Bold</em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#getSize <em>Size
+ * </em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#isItalic <em>Italic
+ * </em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.Font#isBold <em>Bold
+ * </em>}</li>
* </ul>
* </p>
- *
+ *
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getFont()
* @model
* @generated
*/
public interface Font extends EObject {
/**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc -->
* <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Name</em>' attribute isn't clear, there really
+ * should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getFont_Name()
@@ -53,23 +57,30 @@
String getName();
/**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.algorithms.styles.Font#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
+ * Sets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.Font#getName
+ * <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
* @see #getName()
- * @generated
+ * @generated not
+ * @deprecated use the manageFont methods in class IGaService instead to
+ * create a Font with the desired properties, see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=355347 for
+ * details
*/
void setName(String value);
/**
- * Returns the value of the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
+ * Returns the value of the '<em><b>Size</b></em>' attribute. <!--
+ * begin-user-doc -->
* <p>
- * If the meaning of the '<em>Size</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Size</em>' attribute isn't clear, there really
+ * should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Size</em>' attribute.
* @see #setSize(int)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getFont_Size()
@@ -79,23 +90,30 @@
int getSize();
/**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.algorithms.styles.Font#getSize <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Size</em>' attribute.
+ * Sets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.Font#getSize
+ * <em>Size</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Size</em>' attribute.
* @see #getSize()
- * @generated
+ * @generated not
+ * @deprecated use the manageFont methods in class IGaService instead to
+ * create a Font with the desired properties, see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=355347 for
+ * details
*/
void setSize(int value);
/**
- * Returns the value of the '<em><b>Italic</b></em>' attribute.
- * <!-- begin-user-doc -->
+ * Returns the value of the '<em><b>Italic</b></em>' attribute. <!--
+ * begin-user-doc -->
* <p>
- * If the meaning of the '<em>Italic</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Italic</em>' attribute isn't clear, there
+ * really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Italic</em>' attribute.
* @see #setItalic(boolean)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getFont_Italic()
@@ -105,23 +123,31 @@
boolean isItalic();
/**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.algorithms.styles.Font#isItalic <em>Italic</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Italic</em>' attribute.
+ * Sets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.Font#isItalic
+ * <em>Italic</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Italic</em>' attribute.
* @see #isItalic()
- * @generated
+ * @generated not
+ * @deprecated use the manageFont methods in class IGaService instead to
+ * create a Font with the desired properties, see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=355347 for
+ * details
*/
void setItalic(boolean value);
/**
- * Returns the value of the '<em><b>Bold</b></em>' attribute.
- * <!-- begin-user-doc -->
+ * Returns the value of the '<em><b>Bold</b></em>' attribute. <!--
+ * begin-user-doc -->
* <p>
- * If the meaning of the '<em>Bold</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Bold</em>' attribute isn't clear, there really
+ * should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Bold</em>' attribute.
* @see #setBold(boolean)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getFont_Bold()
@@ -131,12 +157,18 @@
boolean isBold();
/**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.algorithms.styles.Font#isBold <em>Bold</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Bold</em>' attribute.
+ * Sets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.Font#isBold
+ * <em>Bold</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Bold</em>' attribute.
* @see #isBold()
- * @generated
+ * @generated not
+ * @deprecated use the manageFont methods in class IGaService instead to
+ * create a Font with the desired properties, see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=355347 for
+ * details
*/
void setBold(boolean value);
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 b9d5f15..61f6a4c 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
@@ -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
@@ -9,6 +9,7 @@
*
* Contributors:
* SAP AG - initial API, implementation and documentation
+ * mwenz - Bug 355347 - Deprecate setters of Graphiti's Font Interface
*
* </copyright>
*
diff --git a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/util/PredefinedColoredAreas.java b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/util/PredefinedColoredAreas.java
index 131f77a..b8ce3f6 100644
--- a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/util/PredefinedColoredAreas.java
+++ b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/util/PredefinedColoredAreas.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
@@ -9,6 +9,7 @@
*
* Contributors:
* SAP AG - initial API, implementation and documentation
+ * mwenz - Bug 355347 - Deprecate setters of Graphiti's Font Interface
*
* </copyright>
*
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/clazz/TestAddClassFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/clazz/TestAddClassFeature.java
index 7d2aa2a..9b33710 100644
--- a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/clazz/TestAddClassFeature.java
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/clazz/TestAddClassFeature.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
@@ -9,6 +9,7 @@
*
* Contributors:
* SAP AG - initial API, implementation and documentation
+ * mwenz - Bug 355347 - Deprecate setters of Graphiti's Font Interface
*
* </copyright>
*
@@ -126,11 +127,11 @@
Shape shape = pecService.createShape(containerShape, false);
// create and set text graphics algorithm
- Text text = gaService.createDefaultText(getDiagram(), shape, addedClass.getName());
+ Text text = gaService.createText(shape, addedClass.getName());
text.setForeground(manageColor(CLASS_TEXT_FOREGROUND));
text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- text.getFont().setBold(true);
+ text.setFont(gaService.manageFont(getDiagram(), "Arial", 8, false, true)); //$NON-NLS-1$
gaService.setLocationAndSize(text, 0, 0, width, 20);
// create link and wire it
diff --git a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/pack/TestAddPackageFeature.java b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/pack/TestAddPackageFeature.java
index b29cf6f..741d12d 100644
--- a/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/pack/TestAddPackageFeature.java
+++ b/tests/org.eclipse.graphiti.testtool.ecore/src/org/eclipse/graphiti/testtool/ecore/features/pack/TestAddPackageFeature.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
@@ -9,6 +9,7 @@
*
* Contributors:
* SAP AG - initial API, implementation and documentation
+ * mwenz - Bug 355347 - Deprecate setters of Graphiti's Font Interface
*
* </copyright>
*
@@ -111,11 +112,11 @@
Shape shape = pecService.createShape(containerShape, false);
// create and set text graphics algorithm
- Text text = gaService.createDefaultText(getDiagram(), shape, addedPackage.getName());
+ Text text = gaService.createText(shape, addedPackage.getName());
text.setForeground(manageColor(PACKAGE_TEXT_FOREGROUND));
text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- text.getFont().setBold(true);
+ text.setFont(gaService.manageFont(getDiagram(), "Arial", 8, false, true)); //$NON-NLS-1$
gaService.setLocationAndSize(text, 0, 0, width, 20);
// create link and wire it