Bug 352542: Boolean Attributes Filled() and LineVisible are unsettable
now, because value null is not persisted but the default values instead.
Metamodel, API and tests are adjusted.
diff --git a/plugins/org.eclipse.graphiti.mm/.settings/.api_filters b/plugins/org.eclipse.graphiti.mm/.settings/.api_filters
index 7908a58..545e61a 100644
--- a/plugins/org.eclipse.graphiti.mm/.settings/.api_filters
+++ b/plugins/org.eclipse.graphiti.mm/.settings/.api_filters
@@ -8,6 +8,32 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src-gen/org/eclipse/graphiti/mm/algorithms/styles/AbstractStyle.java" type="org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle">
+ <filter comment="Uncommented" id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle"/>
+ <message_argument value="isSetFilled()"/>
+ </message_arguments>
+ </filter>
+ <filter comment="Uncommented" id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle"/>
+ <message_argument value="isSetLineVisible()"/>
+ </message_arguments>
+ </filter>
+ <filter comment="Uncommented" id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle"/>
+ <message_argument value="unsetFilled()"/>
+ </message_arguments>
+ </filter>
+ <filter comment="Uncommented" id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle"/>
+ <message_argument value="unsetLineVisible()"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src-gen/org/eclipse/graphiti/mm/algorithms/styles/Color.java" type="org.eclipse.graphiti.mm.algorithms.styles.Color">
<filter id="405901410">
<message_arguments>
diff --git a/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore b/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore
index 6db42a6..46c9398 100644
--- a/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore
+++ b/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore
@@ -260,10 +260,10 @@
unique="false" eType="#//algorithms/styles/LineStyle"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="filled" ordered="false"
unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
- defaultValueLiteral="true"/>
+ defaultValueLiteral="true" unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lineVisible" ordered="false"
unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
- defaultValueLiteral="true"/>
+ defaultValueLiteral="true" unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="renderingStyle" ordered="false"
unique="false" eType="#//algorithms/styles/RenderingStyle" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="transparency" ordered="false"
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/impl/GraphicsAlgorithmImpl.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/impl/GraphicsAlgorithmImpl.java
index c954c2d..0bb1c79 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/impl/GraphicsAlgorithmImpl.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/impl/GraphicsAlgorithmImpl.java
@@ -155,6 +155,15 @@
protected Boolean filled = FILLED_EDEFAULT;
/**
+ * This is true if the Filled attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean filledESet;
+
+ /**
* The default value of the '{@link #getLineVisible() <em>Line Visible</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -175,6 +184,15 @@
protected Boolean lineVisible = LINE_VISIBLE_EDEFAULT;
/**
+ * This is true if the Line Visible attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean lineVisibleESet;
+
+ /**
* The cached value of the '{@link #getRenderingStyle() <em>Rendering Style</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -458,8 +476,33 @@
public void setFilled(Boolean newFilled) {
Boolean oldFilled = filled;
filled = newFilled;
+ boolean oldFilledESet = filledESet;
+ filledESet = true;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, AlgorithmsPackage.GRAPHICS_ALGORITHM__FILLED, oldFilled, filled));
+ eNotify(new ENotificationImpl(this, Notification.SET, AlgorithmsPackage.GRAPHICS_ALGORITHM__FILLED, oldFilled, filled, !oldFilledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetFilled() {
+ Boolean oldFilled = filled;
+ boolean oldFilledESet = filledESet;
+ filled = FILLED_EDEFAULT;
+ filledESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, AlgorithmsPackage.GRAPHICS_ALGORITHM__FILLED, oldFilled, FILLED_EDEFAULT, oldFilledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetFilled() {
+ return filledESet;
}
/**
@@ -479,8 +522,33 @@
public void setLineVisible(Boolean newLineVisible) {
Boolean oldLineVisible = lineVisible;
lineVisible = newLineVisible;
+ boolean oldLineVisibleESet = lineVisibleESet;
+ lineVisibleESet = true;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, AlgorithmsPackage.GRAPHICS_ALGORITHM__LINE_VISIBLE, oldLineVisible, lineVisible));
+ eNotify(new ENotificationImpl(this, Notification.SET, AlgorithmsPackage.GRAPHICS_ALGORITHM__LINE_VISIBLE, oldLineVisible, lineVisible, !oldLineVisibleESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetLineVisible() {
+ Boolean oldLineVisible = lineVisible;
+ boolean oldLineVisibleESet = lineVisibleESet;
+ lineVisible = LINE_VISIBLE_EDEFAULT;
+ lineVisibleESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, AlgorithmsPackage.GRAPHICS_ALGORITHM__LINE_VISIBLE, oldLineVisible, LINE_VISIBLE_EDEFAULT, oldLineVisibleESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetLineVisible() {
+ return lineVisibleESet;
}
/**
@@ -998,10 +1066,10 @@
setLineStyle(LINE_STYLE_EDEFAULT);
return;
case AlgorithmsPackage.GRAPHICS_ALGORITHM__FILLED:
- setFilled(FILLED_EDEFAULT);
+ unsetFilled();
return;
case AlgorithmsPackage.GRAPHICS_ALGORITHM__LINE_VISIBLE:
- setLineVisible(LINE_VISIBLE_EDEFAULT);
+ unsetLineVisible();
return;
case AlgorithmsPackage.GRAPHICS_ALGORITHM__RENDERING_STYLE:
setRenderingStyle((RenderingStyle)null);
@@ -1054,9 +1122,9 @@
case AlgorithmsPackage.GRAPHICS_ALGORITHM__LINE_STYLE:
return lineStyle != LINE_STYLE_EDEFAULT;
case AlgorithmsPackage.GRAPHICS_ALGORITHM__FILLED:
- return FILLED_EDEFAULT == null ? filled != null : !FILLED_EDEFAULT.equals(filled);
+ return isSetFilled();
case AlgorithmsPackage.GRAPHICS_ALGORITHM__LINE_VISIBLE:
- return LINE_VISIBLE_EDEFAULT == null ? lineVisible != null : !LINE_VISIBLE_EDEFAULT.equals(lineVisible);
+ return isSetLineVisible();
case AlgorithmsPackage.GRAPHICS_ALGORITHM__RENDERING_STYLE:
return renderingStyle != null;
case AlgorithmsPackage.GRAPHICS_ALGORITHM__TRANSPARENCY:
@@ -1142,9 +1210,9 @@
result.append(", lineStyle: ");
result.append(lineStyle);
result.append(", filled: ");
- result.append(filled);
+ if (filledESet) result.append(filled); else result.append("<unset>");
result.append(", lineVisible: ");
- result.append(lineVisible);
+ if (lineVisibleESet) result.append(lineVisible); else result.append("<unset>");
result.append(", transparency: ");
result.append(transparency);
result.append(", width: ");
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/AbstractStyle.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/AbstractStyle.java
index 6a39ab5..af2c055 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/AbstractStyle.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/AbstractStyle.java
@@ -157,9 +157,11 @@
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Filled</em>' attribute.
+ * @see #isSetFilled()
+ * @see #unsetFilled()
* @see #setFilled(Boolean)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getAbstractStyle_Filled()
- * @model default="true" unique="false" ordered="false"
+ * @model default="true" unique="false" unsettable="true" ordered="false"
* @generated
*/
Boolean getFilled();
@@ -169,12 +171,42 @@
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Filled</em>' attribute.
+ * @see #isSetFilled()
+ * @see #unsetFilled()
* @see #getFilled()
* @generated
*/
void setFilled(Boolean value);
/**
+ * Unsets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle#getFilled
+ * <em>Filled</em>}' attribute. <!-- begin-user-doc -->
+ *
+ * @since 0.9 <!-- end-user-doc -->
+ *
+ * @see #isSetFilled()
+ * @see #getFilled()
+ * @see #setFilled(Boolean)
+ * @generated
+ */
+ void unsetFilled();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle#getFilled
+ * <em>Filled</em>}' attribute is set. <!-- begin-user-doc -->
+ *
+ * @since 0.9 <!-- end-user-doc -->
+ * @return whether the value of the '<em>Filled</em>' attribute is set.
+ * @see #unsetFilled()
+ * @see #getFilled()
+ * @see #setFilled(Boolean)
+ * @generated
+ */
+ boolean isSetFilled();
+
+ /**
* Returns the value of the '<em><b>Line Visible</b></em>' attribute.
* The default value is <code>"true"</code>.
* <!-- begin-user-doc -->
@@ -184,9 +216,11 @@
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Line Visible</em>' attribute.
+ * @see #isSetLineVisible()
+ * @see #unsetLineVisible()
* @see #setLineVisible(Boolean)
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage#getAbstractStyle_LineVisible()
- * @model default="true" unique="false" ordered="false"
+ * @model default="true" unique="false" unsettable="true" ordered="false"
* @generated
*/
Boolean getLineVisible();
@@ -196,12 +230,45 @@
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Line Visible</em>' attribute.
+ * @see #isSetLineVisible()
+ * @see #unsetLineVisible()
* @see #getLineVisible()
* @generated
*/
void setLineVisible(Boolean value);
/**
+ * Unsets the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle#getLineVisible
+ * <em>Line Visible</em>}' attribute. <!-- begin-user-doc -->
+ *
+ * @since 0.9 <!-- end-user-doc -->
+ *
+ * @see #isSetLineVisible()
+ * @see #getLineVisible()
+ * @see #setLineVisible(Boolean)
+ * @generated
+ */
+ void unsetLineVisible();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle#getLineVisible
+ * <em>Line Visible</em>}' attribute is set. <!-- begin-user-doc -->
+ *
+ * @since 0.9 <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Line Visible</em>' attribute is
+ * set.
+ * @see #unsetLineVisible()
+ * @see #getLineVisible()
+ * @see #setLineVisible(Boolean)
+ * @generated
+ *
+ */
+ boolean isSetLineVisible();
+
+ /**
* Returns the value of the '<em><b>Rendering Style</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/AbstractStyleImpl.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/AbstractStyleImpl.java
index 8d7bece..466804d 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/AbstractStyleImpl.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/AbstractStyleImpl.java
@@ -131,6 +131,15 @@
protected Boolean filled = FILLED_EDEFAULT;
/**
+ * This is true if the Filled attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean filledESet;
+
+ /**
* The default value of the '{@link #getLineVisible() <em>Line Visible</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -151,6 +160,15 @@
protected Boolean lineVisible = LINE_VISIBLE_EDEFAULT;
/**
+ * This is true if the Line Visible attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean lineVisibleESet;
+
+ /**
* The cached value of the '{@link #getRenderingStyle() <em>Rendering Style</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -334,8 +352,33 @@
public void setFilled(Boolean newFilled) {
Boolean oldFilled = filled;
filled = newFilled;
+ boolean oldFilledESet = filledESet;
+ filledESet = true;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.ABSTRACT_STYLE__FILLED, oldFilled, filled));
+ eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.ABSTRACT_STYLE__FILLED, oldFilled, filled, !oldFilledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetFilled() {
+ Boolean oldFilled = filled;
+ boolean oldFilledESet = filledESet;
+ filled = FILLED_EDEFAULT;
+ filledESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, StylesPackage.ABSTRACT_STYLE__FILLED, oldFilled, FILLED_EDEFAULT, oldFilledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetFilled() {
+ return filledESet;
}
/**
@@ -355,8 +398,33 @@
public void setLineVisible(Boolean newLineVisible) {
Boolean oldLineVisible = lineVisible;
lineVisible = newLineVisible;
+ boolean oldLineVisibleESet = lineVisibleESet;
+ lineVisibleESet = true;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.ABSTRACT_STYLE__LINE_VISIBLE, oldLineVisible, lineVisible));
+ eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.ABSTRACT_STYLE__LINE_VISIBLE, oldLineVisible, lineVisible, !oldLineVisibleESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetLineVisible() {
+ Boolean oldLineVisible = lineVisible;
+ boolean oldLineVisibleESet = lineVisibleESet;
+ lineVisible = LINE_VISIBLE_EDEFAULT;
+ lineVisibleESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, StylesPackage.ABSTRACT_STYLE__LINE_VISIBLE, oldLineVisible, LINE_VISIBLE_EDEFAULT, oldLineVisibleESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetLineVisible() {
+ return lineVisibleESet;
}
/**
@@ -548,10 +616,10 @@
setLineStyle(LINE_STYLE_EDEFAULT);
return;
case StylesPackage.ABSTRACT_STYLE__FILLED:
- setFilled(FILLED_EDEFAULT);
+ unsetFilled();
return;
case StylesPackage.ABSTRACT_STYLE__LINE_VISIBLE:
- setLineVisible(LINE_VISIBLE_EDEFAULT);
+ unsetLineVisible();
return;
case StylesPackage.ABSTRACT_STYLE__RENDERING_STYLE:
setRenderingStyle((RenderingStyle)null);
@@ -580,9 +648,9 @@
case StylesPackage.ABSTRACT_STYLE__LINE_STYLE:
return lineStyle != LINE_STYLE_EDEFAULT;
case StylesPackage.ABSTRACT_STYLE__FILLED:
- return FILLED_EDEFAULT == null ? filled != null : !FILLED_EDEFAULT.equals(filled);
+ return isSetFilled();
case StylesPackage.ABSTRACT_STYLE__LINE_VISIBLE:
- return LINE_VISIBLE_EDEFAULT == null ? lineVisible != null : !LINE_VISIBLE_EDEFAULT.equals(lineVisible);
+ return isSetLineVisible();
case StylesPackage.ABSTRACT_STYLE__RENDERING_STYLE:
return renderingStyle != null;
case StylesPackage.ABSTRACT_STYLE__TRANSPARENCY:
@@ -606,9 +674,9 @@
result.append(", lineStyle: ");
result.append(lineStyle);
result.append(", filled: ");
- result.append(filled);
+ if (filledESet) result.append(filled); else result.append("<unset>");
result.append(", lineVisible: ");
- result.append(lineVisible);
+ if (lineVisibleESet) result.append(lineVisible); else result.append("<unset>");
result.append(", transparency: ");
result.append(transparency);
result.append(')');
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StyleImpl.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StyleImpl.java
index 3a74347..b3815d1 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StyleImpl.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StyleImpl.java
@@ -150,6 +150,15 @@
protected Boolean filled = FILLED_EDEFAULT;
/**
+ * This is true if the Filled attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean filledESet;
+
+ /**
* The default value of the '{@link #getLineVisible() <em>Line Visible</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -170,6 +179,15 @@
protected Boolean lineVisible = LINE_VISIBLE_EDEFAULT;
/**
+ * This is true if the Line Visible attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean lineVisibleESet;
+
+ /**
* The cached value of the '{@link #getRenderingStyle() <em>Rendering Style</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -523,8 +541,33 @@
public void setFilled(Boolean newFilled) {
Boolean oldFilled = filled;
filled = newFilled;
+ boolean oldFilledESet = filledESet;
+ filledESet = true;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.STYLE__FILLED, oldFilled, filled));
+ eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.STYLE__FILLED, oldFilled, filled, !oldFilledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetFilled() {
+ Boolean oldFilled = filled;
+ boolean oldFilledESet = filledESet;
+ filled = FILLED_EDEFAULT;
+ filledESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, StylesPackage.STYLE__FILLED, oldFilled, FILLED_EDEFAULT, oldFilledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetFilled() {
+ return filledESet;
}
/**
@@ -544,8 +587,33 @@
public void setLineVisible(Boolean newLineVisible) {
Boolean oldLineVisible = lineVisible;
lineVisible = newLineVisible;
+ boolean oldLineVisibleESet = lineVisibleESet;
+ lineVisibleESet = true;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.STYLE__LINE_VISIBLE, oldLineVisible, lineVisible));
+ eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.STYLE__LINE_VISIBLE, oldLineVisible, lineVisible, !oldLineVisibleESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetLineVisible() {
+ Boolean oldLineVisible = lineVisible;
+ boolean oldLineVisibleESet = lineVisibleESet;
+ lineVisible = LINE_VISIBLE_EDEFAULT;
+ lineVisibleESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, StylesPackage.STYLE__LINE_VISIBLE, oldLineVisible, LINE_VISIBLE_EDEFAULT, oldLineVisibleESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetLineVisible() {
+ return lineVisibleESet;
}
/**
@@ -1078,10 +1146,10 @@
setLineStyle(LINE_STYLE_EDEFAULT);
return;
case StylesPackage.STYLE__FILLED:
- setFilled(FILLED_EDEFAULT);
+ unsetFilled();
return;
case StylesPackage.STYLE__LINE_VISIBLE:
- setLineVisible(LINE_VISIBLE_EDEFAULT);
+ unsetLineVisible();
return;
case StylesPackage.STYLE__RENDERING_STYLE:
setRenderingStyle((RenderingStyle)null);
@@ -1140,9 +1208,9 @@
case StylesPackage.STYLE__LINE_STYLE:
return lineStyle != LINE_STYLE_EDEFAULT;
case StylesPackage.STYLE__FILLED:
- return FILLED_EDEFAULT == null ? filled != null : !FILLED_EDEFAULT.equals(filled);
+ return isSetFilled();
case StylesPackage.STYLE__LINE_VISIBLE:
- return LINE_VISIBLE_EDEFAULT == null ? lineVisible != null : !LINE_VISIBLE_EDEFAULT.equals(lineVisible);
+ return isSetLineVisible();
case StylesPackage.STYLE__RENDERING_STYLE:
return renderingStyle != null;
case StylesPackage.STYLE__TRANSPARENCY:
@@ -1232,9 +1300,9 @@
result.append(", lineStyle: ");
result.append(lineStyle);
result.append(", filled: ");
- result.append(filled);
+ if (filledESet) result.append(filled); else result.append("<unset>");
result.append(", lineVisible: ");
- result.append(lineVisible);
+ if (lineVisibleESet) result.append(lineVisible); else result.append("<unset>");
result.append(", transparency: ");
result.append(transparency);
result.append(", id: ");
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StylesPackageImpl.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StylesPackageImpl.java
index 97a4d2e..d24c2db 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StylesPackageImpl.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/algorithms/styles/impl/StylesPackageImpl.java
@@ -846,8 +846,8 @@
initEReference(getAbstractStyle_Foreground(), this.getColor(), null, "foreground", null, 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEAttribute(getAbstractStyle_LineWidth(), ecorePackage.getEIntegerObject(), "lineWidth", null, 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEAttribute(getAbstractStyle_LineStyle(), this.getLineStyle(), "lineStyle", null, 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
- initEAttribute(getAbstractStyle_Filled(), ecorePackage.getEBooleanObject(), "filled", "true", 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
- initEAttribute(getAbstractStyle_LineVisible(), ecorePackage.getEBooleanObject(), "lineVisible", "true", 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+ initEAttribute(getAbstractStyle_Filled(), ecorePackage.getEBooleanObject(), "filled", "true", 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+ initEAttribute(getAbstractStyle_LineVisible(), ecorePackage.getEBooleanObject(), "lineVisible", "true", 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEReference(getAbstractStyle_RenderingStyle(), this.getRenderingStyle(), null, "renderingStyle", null, 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEAttribute(getAbstractStyle_Transparency(), ecorePackage.getEDoubleObject(), "transparency", null, 0, 1, AbstractStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/Diagram.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/Diagram.java
index 4a26247..ba68529 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/Diagram.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/Diagram.java
@@ -246,17 +246,17 @@
/**
* Returns the value of the '<em><b>Version</b></em>' attribute. The default
* value is <code>""</code>. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Version</em>' attribute isn't clear, there
- * really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
*
+ * @since 0.9
+ * <p>
+ * If the meaning of the '<em>Version</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
* @return the value of the '<em>Version</em>' attribute.
* @see org.eclipse.graphiti.mm.pictograms.PictogramsPackage#getDiagram_Version()
* @model default="" suppressedSetVisibility="true"
* @generated
- * @since 0.9
*/
String getVersion();
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/PictogramsPackage.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/PictogramsPackage.java
index 9734641..b855608 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/PictogramsPackage.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/PictogramsPackage.java
@@ -1790,13 +1790,13 @@
/**
* Returns the meta object for the attribute '
* {@link org.eclipse.graphiti.mm.pictograms.Diagram#getVersion
- * <em>Version</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <em>Version</em>}'. <!-- begin-user-doc -->
*
+ * @since 0.9 <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Version</em>'.
* @see org.eclipse.graphiti.mm.pictograms.Diagram#getVersion()
* @see #getDiagram()
* @generated
- * @since 0.9
*/
EAttribute getDiagram_Version();
@@ -2328,10 +2328,10 @@
/**
* The meta object literal for the '<em><b>Version</b></em>' attribute
- * feature. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * feature. <!-- begin-user-doc -->
*
+ * @since 0.9 <!-- end-user-doc -->
* @generated
- * @since 0.9
*/
EAttribute DIAGRAM__VERSION = eINSTANCE.getDiagram_Version();
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/impl/PictogramsFactoryImpl.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/impl/PictogramsFactoryImpl.java
index 5b33091..4047552 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/impl/PictogramsFactoryImpl.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/pictograms/impl/PictogramsFactoryImpl.java
@@ -19,6 +19,7 @@
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.graphiti.mm.pictograms.*;
import org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor;
import org.eclipse.graphiti.mm.pictograms.ChopboxAnchor;
import org.eclipse.graphiti.mm.pictograms.Connection;
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 52d54da..d3e340d 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
@@ -1402,10 +1402,12 @@
@Override
public void resetAll(AbstractStyle abstractStyle) {
abstractStyle.setBackground(null);
- abstractStyle.setFilled(null);
+ // Boolean filled is set to unsettable (not to null)
+ abstractStyle.unsetFilled();
abstractStyle.setForeground(null);
abstractStyle.setLineStyle(LineStyle.UNSPECIFIED);
- abstractStyle.setLineVisible(null);
+ // Boolean lineVisible is set to unsettable (not to null)
+ abstractStyle.unsetLineVisible();
abstractStyle.setLineWidth(null);
deleteRenderingStyle(abstractStyle);
abstractStyle.setTransparency(null);
@@ -1441,8 +1443,8 @@
*/
@Override
public boolean isFilled(GraphicsAlgorithm ga, boolean checkStyles) {
- Boolean filled = ga.getFilled();
- if (filled == null) {
+ // Check if Boolean filled is unsettable
+ if (!ga.isSetFilled()) {
if (checkStyles) {
Style style = ga.getStyle();
if (style != null) {
@@ -1452,7 +1454,7 @@
}
}
} else {
- return filled;
+ return ga.getFilled();
}
return true; // default value
}
@@ -1466,8 +1468,8 @@
*/
@Override
public boolean isLineVisible(GraphicsAlgorithm ga, boolean checkStyles) {
- Boolean lv = ga.getLineVisible();
- if (lv == null) {
+ // Check if Boolean lineVisible is unsettable
+ if (!ga.isSetLineVisible()) {
if (checkStyles) {
Style style = ga.getStyle();
if (style != null) {
@@ -1477,7 +1479,7 @@
}
}
} else {
- return lv;
+ return ga.getLineVisible();
}
return true; // default value
}
diff --git a/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/GFAbstractCreateTestCase.java b/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/GFAbstractCreateTestCase.java
index 7ea0925..919dd0f 100644
--- a/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/GFAbstractCreateTestCase.java
+++ b/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/GFAbstractCreateTestCase.java
@@ -50,11 +50,11 @@
}
protected void checkInheritedPlainStyleDefaultsFromMetamodel(Style style) {
- assertNull(style.getFilled());
+ assertFalse(style.isSetFilled()); // is it in state unsettable
assertNull(style.getBackground());
assertNull(style.getForeground());
assertSame(LineStyle.UNSPECIFIED, style.getLineStyle());
- assertNull(style.getLineVisible());
+ assertFalse(style.isSetLineVisible()); // is it in state unsettable
assertNull(style.getLineWidth());
assertSame(Orientation.UNSPECIFIED, style.getHorizontalAlignment());
assertSame(Orientation.UNSPECIFIED, style.getVerticalAlignment());
@@ -84,11 +84,11 @@
}
protected void checkPlainGraphicsAlgorithmDefaults(GraphicsAlgorithm ga) {
- assertNull(ga.getFilled());
+ assertFalse(ga.isSetFilled()); // is it in state unsettable
assertNull(ga.getBackground());
assertNull(ga.getForeground());
assertSame(LineStyle.UNSPECIFIED, ga.getLineStyle());
- assertNull(ga.getLineVisible());
+ assertFalse(ga.isSetLineVisible());// is it in state unsettable
assertNull(ga.getLineWidth());
assertNull(ga.getTransparency());
assertNull(ga.getRenderingStyle());
diff --git a/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/GaServiceTest.java b/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/GaServiceTest.java
index cb7a16c..36c8e11 100644
--- a/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/GaServiceTest.java
+++ b/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/GaServiceTest.java
@@ -662,12 +662,12 @@
text.setAngle(null);
text.setLineWidth(null);
text.setLineStyle(LineStyle.UNSPECIFIED);
- text.setLineVisible(null);
+ text.unsetLineVisible();
text.setFont(null);
text.setHorizontalAlignment(Orientation.UNSPECIFIED);
text.setVerticalAlignment(Orientation.UNSPECIFIED);
text.setTransparency(null);
- text.setFilled(null);
+ text.unsetFilled();
assertNotNull(text);
assertEquals(2, gas.getAngle(text, true));
@@ -742,10 +742,10 @@
assertNull(style.getBackground());
assertNull(style.getForeground());
assertEquals(LineStyle.UNSPECIFIED, style.getLineStyle());
- assertNull(style.getLineVisible());
+ assertFalse((style.isSetLineVisible())); // is it in state unsettable
assertNull(style.getLineWidth());
assertNull(style.getRenderingStyle());
- assertNull(style.getFilled());
- assertNull(style.getTransparency());
+ assertFalse(style.isSetFilled());
+ assertNull(style.getTransparency()); // is it in state unsettable
}
}
diff --git a/tests/org.eclipse.graphiti.ui.tests/src/org/eclipse/graphiti/ui/tests/PackageTest.java b/tests/org.eclipse.graphiti.ui.tests/src/org/eclipse/graphiti/ui/tests/PackageTest.java
index 6062a4e..b738d8c 100644
--- a/tests/org.eclipse.graphiti.ui.tests/src/org/eclipse/graphiti/ui/tests/PackageTest.java
+++ b/tests/org.eclipse.graphiti.ui.tests/src/org/eclipse/graphiti/ui/tests/PackageTest.java
@@ -97,6 +97,7 @@
import org.eclipse.graphiti.mm.algorithms.styles.Color;
import org.eclipse.graphiti.mm.algorithms.styles.Font;
import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
+import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
import org.eclipse.graphiti.mm.algorithms.styles.RenderingStyle;
import org.eclipse.graphiti.mm.algorithms.styles.Style;
import org.eclipse.graphiti.mm.pictograms.Anchor;
@@ -1015,34 +1016,36 @@
replay(styleContainerMock);
Style styleMock = createNiceMock(Style.class);
- expect(styleMock.getAngle()).andReturn(new Integer(-1));
- expect(styleMock.getAngle()).andReturn(new Integer(-1));
-
expect(styleMock.getAngle()).andReturn(null);
-
- expect(styleMock.getStyleContainer()).andReturn(styleContainerMock);
+ expect(styleMock.getStyleContainer()).andReturn(styleMock);
+ expect(styleMock.getAngle()).andReturn(null);
+ expect(styleMock.getStyleContainer()).andReturn(null);
+ expect(styleMock.getAngle()).andReturn(new Integer(-1));
replay(styleMock);
AbstractText abstractTextMock = createNiceMock(AbstractText.class);
// run 1
expect(abstractTextMock.getAngle()).andReturn(null);
- expect(abstractTextMock.getStyle()).andReturn(styleMock);
+ // expect(abstractTextMock.getStyle()).andReturn(styleMock);
// run 2
- expect(abstractTextMock.getAngle()).andReturn(null);
- expect(abstractTextMock.getStyle()).andReturn(styleMock);
+ expect(abstractTextMock.getAngle()).andReturn(new Integer(0));
+ // expect(abstractTextMock.getStyle()).andReturn(styleMock);
// run 3
expect(abstractTextMock.getAngle()).andReturn(null);
+ expect(abstractTextMock.getStyle()).andReturn(styleMock);
// run 4
- expect(abstractTextMock.getAngle()).andReturn(new Integer(0));
- expect(abstractTextMock.getAngle()).andReturn(new Integer(0));
+ // expect(abstractTextMock.getAngle()).andReturn(new Integer(0));
+ expect(abstractTextMock.getAngle()).andReturn(null);
+ expect(abstractTextMock.getStyle()).andReturn(styleMock);
+ // expect(abstractTextMock.getAngle()).andReturn(new Integer(0));
replay(abstractTextMock);
IGaService gaService = Graphiti.getGaService();
- gaService.getAngle(abstractTextMock, true);
- gaService.getAngle(abstractTextMock, true);
gaService.getAngle(abstractTextMock, false);
gaService.getAngle(abstractTextMock, false);
+ gaService.getAngle(abstractTextMock, true);
+ gaService.getAngle(abstractTextMock, true);
// verify(styleMock);
@@ -1057,13 +1060,12 @@
expect(styleMock.getStyleContainer()).andReturn(styleMock);
expect(styleMock.getBackground()).andReturn(null);
expect(styleMock.getStyleContainer()).andReturn(null);
- expect(styleMock.getBackground()).andReturn(colorMock).times(2);
+ expect(styleMock.getBackground()).andReturn(colorMock);
replay(styleMock);
GraphicsAlgorithm graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
// run 1
expect(graphicsAlgorithmMock.getBackground()).andReturn(colorMock);
- expect(graphicsAlgorithmMock.getBackground()).andReturn(colorMock);
// run 2
expect(graphicsAlgorithmMock.getBackground()).andReturn(null);
// run 3
@@ -1129,7 +1131,7 @@
graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
// run 1
- expect(graphicsAlgorithmMock.getForeground()).andReturn(colorMock).times(2);
+ expect(graphicsAlgorithmMock.getForeground()).andReturn(colorMock);
// run 2
expect(graphicsAlgorithmMock.getForeground()).andReturn(null);
// run 3
@@ -1153,22 +1155,20 @@
styleMock = createNiceMock(Style.class);
expect(styleMock.getHorizontalAlignment()).andReturn(null);
expect(styleMock.getStyleContainer()).andReturn(styleMock);
- expect(styleMock.getHorizontalAlignment()).andReturn(null);
+ expect(styleMock.getHorizontalAlignment()).andReturn(Orientation.ALIGNMENT_RIGHT);
expect(styleMock.getStyleContainer()).andReturn(null);
- // expect(styleMock.getHorizontalAlignment()).andReturn(createNiceMock(Orientation.class)).times(2);
replay(styleMock);
abstractTextMock = createMock(AbstractText.class);
// run 1
- expect(abstractTextMock.getHorizontalAlignment()).andReturn(null);
+ expect(abstractTextMock.getHorizontalAlignment()).andReturn(Orientation.UNSPECIFIED);
// run 2
- // expect(abstractTextMock.getHorizontalAlignment()).andReturn(createMock(Orientation.class));
- expect(abstractTextMock.getHorizontalAlignment()).andReturn(null);
+ expect(abstractTextMock.getHorizontalAlignment()).andReturn(Orientation.ALIGNMENT_LEFT);
// run 3
- expect(abstractTextMock.getHorizontalAlignment()).andReturn(null);
+ expect(abstractTextMock.getHorizontalAlignment()).andReturn(Orientation.UNSPECIFIED);
expect(abstractTextMock.getStyle()).andReturn(styleMock);
// run 4
- expect(abstractTextMock.getHorizontalAlignment()).andReturn(null);
+ expect(abstractTextMock.getHorizontalAlignment()).andReturn(Orientation.UNSPECIFIED);
expect(abstractTextMock.getStyle()).andReturn(styleMock);
replay(abstractTextMock);
@@ -1185,22 +1185,20 @@
styleMock = createNiceMock(Style.class);
expect(styleMock.getVerticalAlignment()).andReturn(null);
expect(styleMock.getStyleContainer()).andReturn(styleMock);
- expect(styleMock.getVerticalAlignment()).andReturn(null);
+ expect(styleMock.getVerticalAlignment()).andReturn(Orientation.ALIGNMENT_TOP);
expect(styleMock.getStyleContainer()).andReturn(null);
- // expect(styleMock.getVerticalAlignment()).andReturn(createNiceMock(Orientation.class)).times(2);
replay(styleMock);
abstractTextMock = createMock(AbstractText.class);
// run 1
- expect(abstractTextMock.getVerticalAlignment()).andReturn(null);
+ expect(abstractTextMock.getVerticalAlignment()).andReturn(Orientation.UNSPECIFIED);
// run 2
- // expect(abstractTextMock.getVerticalAlignment()).andReturn(createMock(Orientation.class));
- expect(abstractTextMock.getVerticalAlignment()).andReturn(null);
+ expect(abstractTextMock.getVerticalAlignment()).andReturn(Orientation.ALIGNMENT_BOTTOM);
// run 3
- expect(abstractTextMock.getVerticalAlignment()).andReturn(null);
+ expect(abstractTextMock.getVerticalAlignment()).andReturn(Orientation.UNSPECIFIED);
expect(abstractTextMock.getStyle()).andReturn(styleMock);
// run 4
- expect(abstractTextMock.getVerticalAlignment()).andReturn(null);
+ expect(abstractTextMock.getVerticalAlignment()).andReturn(Orientation.UNSPECIFIED);
expect(abstractTextMock.getStyle()).andReturn(styleMock);
replay(abstractTextMock);
@@ -1217,28 +1215,27 @@
styleMock = createNiceMock(Style.class);
expect(styleMock.getLineStyle()).andReturn(null);
expect(styleMock.getStyleContainer()).andReturn(styleMock);
- expect(styleMock.getLineStyle()).andReturn(null);
+ expect(styleMock.getLineStyle()).andReturn(LineStyle.DASHDOT);
expect(styleMock.getStyleContainer()).andReturn(null);
- // expect(styleMock.getLineStyle()).andReturn(createNiceMock(LineStyle.class)).times(2);
replay(styleMock);
graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
// run 1
- // expect(graphicsAlgorithmMock.getLineStyle()).andReturn(createMock(LineStyle.class)).times(2);
+ expect(graphicsAlgorithmMock.getLineStyle()).andReturn(LineStyle.UNSPECIFIED);
// run 2
- expect(graphicsAlgorithmMock.getLineStyle()).andReturn(null);
+ expect(graphicsAlgorithmMock.getLineStyle()).andReturn(LineStyle.SOLID);
// run 3
- expect(graphicsAlgorithmMock.getLineStyle()).andReturn(null);
+ expect(graphicsAlgorithmMock.getLineStyle()).andReturn(LineStyle.UNSPECIFIED);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
// run 4
- expect(graphicsAlgorithmMock.getLineStyle()).andReturn(null);
+ expect(graphicsAlgorithmMock.getLineStyle()).andReturn(LineStyle.UNSPECIFIED);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
replay(graphicsAlgorithmMock);
gaService.getLineStyle(graphicsAlgorithmMock, false);
gaService.getLineStyle(graphicsAlgorithmMock, false);
- // gaService.getLineStyle(graphicsAlgorithmMock, true);
- // gaService.getLineStyle(graphicsAlgorithmMock, true);
+ gaService.getLineStyle(graphicsAlgorithmMock, true);
+ gaService.getLineStyle(graphicsAlgorithmMock, true);
// verify(styleMock);
@@ -1255,9 +1252,9 @@
graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
// run 1
- expect(graphicsAlgorithmMock.getLineWidth()).andReturn(new Integer(6)).times(2);
- // run 2
expect(graphicsAlgorithmMock.getLineWidth()).andReturn(null);
+ // run 2
+ expect(graphicsAlgorithmMock.getLineWidth()).andReturn(new Integer(6));
// run 3
expect(graphicsAlgorithmMock.getLineWidth()).andReturn(null);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
@@ -1286,9 +1283,9 @@
graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
// run 1
- expect(graphicsAlgorithmMock.getRenderingStyle()).andReturn(createMock(RenderingStyle.class)).times(2);
- // run 2
expect(graphicsAlgorithmMock.getRenderingStyle()).andReturn(null);
+ // run 2
+ expect(graphicsAlgorithmMock.getRenderingStyle()).andReturn(createMock(RenderingStyle.class));
// run 3
expect(graphicsAlgorithmMock.getRenderingStyle()).andReturn(null);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
@@ -1317,9 +1314,9 @@
graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
// run 1
- expect(graphicsAlgorithmMock.getTransparency()).andReturn(new Double(0.0)).times(2);
- // run 2
expect(graphicsAlgorithmMock.getTransparency()).andReturn(null);
+ // run 2
+ expect(graphicsAlgorithmMock.getTransparency()).andReturn(new Double(0.0));
// run 3
expect(graphicsAlgorithmMock.getTransparency()).andReturn(null);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
@@ -1346,16 +1343,17 @@
expect(styleMock.getFilled()).andReturn(new Boolean(true)).times(2);
replay(styleMock);
- graphicsAlgorithmMock = createNiceMock(GraphicsAlgorithm.class);
+ graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
// run 1
- expect(graphicsAlgorithmMock.getFilled()).andReturn(new Boolean(false)).times(2);
+ expect(graphicsAlgorithmMock.isSetFilled()).andReturn(false);
// run 2
- expect(graphicsAlgorithmMock.getFilled()).andReturn(null);
+ expect(graphicsAlgorithmMock.isSetFilled()).andReturn(true);
+ expect(graphicsAlgorithmMock.getFilled()).andReturn(new Boolean(false));
// run 3
- expect(graphicsAlgorithmMock.getFilled()).andReturn(null);
+ expect(graphicsAlgorithmMock.isSetFilled()).andReturn(false);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
// run 4
- expect(graphicsAlgorithmMock.getFilled()).andReturn(null);
+ expect(graphicsAlgorithmMock.isSetFilled()).andReturn(false);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
replay(graphicsAlgorithmMock);
@@ -1377,16 +1375,17 @@
expect(styleMock.getLineVisible()).andReturn(new Boolean(true)).times(2);
replay(styleMock);
- graphicsAlgorithmMock = createMock(GraphicsAlgorithm.class);
+ graphicsAlgorithmMock = createNiceMock(GraphicsAlgorithm.class);
// run 1
- expect(graphicsAlgorithmMock.getLineVisible()).andReturn(new Boolean(false)).times(2);
+ expect(graphicsAlgorithmMock.isSetLineVisible()).andReturn(false);
// run 2
- expect(graphicsAlgorithmMock.getLineVisible()).andReturn(null);
+ expect(graphicsAlgorithmMock.isSetLineVisible()).andReturn(true);
+ expect(graphicsAlgorithmMock.getLineVisible()).andReturn(new Boolean(false));
// run 3
- expect(graphicsAlgorithmMock.getLineVisible()).andReturn(null);
+ expect(graphicsAlgorithmMock.isSetLineVisible()).andReturn(false);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
// run 4
- expect(graphicsAlgorithmMock.getLineVisible()).andReturn(null);
+ expect(graphicsAlgorithmMock.isSetLineVisible()).andReturn(false);
expect(graphicsAlgorithmMock.getStyle()).andReturn(styleMock);
replay(graphicsAlgorithmMock);
@@ -1405,14 +1404,14 @@
expect(styleMock.getStyleContainer()).andReturn(styleMock);
expect(styleMock.getProportional()).andReturn(null);
expect(styleMock.getStyleContainer()).andReturn(null);
- expect(styleMock.getProportional()).andReturn(new Boolean(true)).times(2);
+ expect(styleMock.getProportional()).andReturn(new Boolean(true));
replay(styleMock);
Image imageMock = createMock(Image.class);
// run 1
- expect(imageMock.getProportional()).andReturn(new Boolean(false)).times(2);
- // run 2
expect(imageMock.getProportional()).andReturn(null);
+ // run 2
+ expect(imageMock.getProportional()).andReturn(new Boolean(false));
// run 3
expect(imageMock.getProportional()).andReturn(null);
expect(imageMock.getStyle()).andReturn(styleMock);
@@ -1436,14 +1435,14 @@
expect(styleMock.getStyleContainer()).andReturn(styleMock);
expect(styleMock.getStretchH()).andReturn(null);
expect(styleMock.getStyleContainer()).andReturn(null);
- expect(styleMock.getStretchH()).andReturn(new Boolean(true)).times(2);
+ expect(styleMock.getStretchH()).andReturn(new Boolean(true));
replay(styleMock);
imageMock = createMock(Image.class);
// run 1
- expect(imageMock.getStretchH()).andReturn(new Boolean(false)).times(2);
- // run 2
expect(imageMock.getStretchH()).andReturn(null);
+ // run 2
+ expect(imageMock.getStretchH()).andReturn(new Boolean(false));
// run 3
expect(imageMock.getStretchH()).andReturn(null);
expect(imageMock.getStyle()).andReturn(styleMock);
@@ -1467,14 +1466,14 @@
expect(styleMock.getStyleContainer()).andReturn(styleMock);
expect(styleMock.getStretchV()).andReturn(null);
expect(styleMock.getStyleContainer()).andReturn(null);
- expect(styleMock.getStretchV()).andReturn(new Boolean(true)).times(2);
+ expect(styleMock.getStretchV()).andReturn(new Boolean(true));
replay(styleMock);
imageMock = createMock(Image.class);
// run 1
- expect(imageMock.getStretchV()).andReturn(new Boolean(false)).times(2);
- // run 2
expect(imageMock.getStretchV()).andReturn(null);
+ // run 2
+ expect(imageMock.getStretchV()).andReturn(new Boolean(false));
// run 3
expect(imageMock.getStretchV()).andReturn(null);
expect(imageMock.getStyle()).andReturn(styleMock);