diff options
Diffstat (limited to 'extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/RadialGradientImpl.java')
-rw-r--r-- | extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/RadialGradientImpl.java | 83 |
1 files changed, 43 insertions, 40 deletions
diff --git a/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/RadialGradientImpl.java b/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/RadialGradientImpl.java index 24c69fa5b26..41664e13edc 100644 --- a/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/RadialGradientImpl.java +++ b/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/RadialGradientImpl.java @@ -12,19 +12,25 @@ package org.eclipse.papyrus.dd.dg.impl; import java.lang.reflect.InvocationTargetException; + import java.util.Map; import org.eclipse.emf.common.notify.Notification; + import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; + import org.eclipse.emf.ecore.EClass; + import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; + import org.eclipse.papyrus.dd.dc.Point; import org.eclipse.papyrus.dd.dg.DGPackage; import org.eclipse.papyrus.dd.dg.RadialGradient; + import org.eclipse.papyrus.dd.dg.util.DGValidator; /** @@ -119,9 +125,9 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { public NotificationChain basicSetCenter(Point newCenter, NotificationChain msgs) { Point oldCenter = center; center = newCenter; - if (eNotificationRequired()) { + if(eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DGPackage.RADIAL_GRADIENT__CENTER, oldCenter, newCenter); - if (msgs == null) { + if(msgs == null) { msgs = notification; } else { msgs.add(notification); @@ -137,19 +143,19 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public void setCenter(Point newCenter) { - if (newCenter != center) { + if(newCenter != center) { NotificationChain msgs = null; - if (center != null) { - msgs = ((InternalEObject) center).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__CENTER, null, msgs); + if(center != null) { + msgs = ((InternalEObject)center).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__CENTER, null, msgs); } - if (newCenter != null) { - msgs = ((InternalEObject) newCenter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__CENTER, null, msgs); + if(newCenter != null) { + msgs = ((InternalEObject)newCenter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__CENTER, null, msgs); } msgs = basicSetCenter(newCenter, msgs); - if (msgs != null) { + if(msgs != null) { msgs.dispatch(); } - } else if (eNotificationRequired()) { + } else if(eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, DGPackage.RADIAL_GRADIENT__CENTER, newCenter, newCenter)); } } @@ -172,9 +178,9 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { public NotificationChain basicSetFocus(Point newFocus, NotificationChain msgs) { Point oldFocus = focus; focus = newFocus; - if (eNotificationRequired()) { + if(eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DGPackage.RADIAL_GRADIENT__FOCUS, oldFocus, newFocus); - if (msgs == null) { + if(msgs == null) { msgs = notification; } else { msgs.add(notification); @@ -190,19 +196,19 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public void setFocus(Point newFocus) { - if (newFocus != focus) { + if(newFocus != focus) { NotificationChain msgs = null; - if (focus != null) { - msgs = ((InternalEObject) focus).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__FOCUS, null, msgs); + if(focus != null) { + msgs = ((InternalEObject)focus).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__FOCUS, null, msgs); } - if (newFocus != null) { - msgs = ((InternalEObject) newFocus).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__FOCUS, null, msgs); + if(newFocus != null) { + msgs = ((InternalEObject)newFocus).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DGPackage.RADIAL_GRADIENT__FOCUS, null, msgs); } msgs = basicSetFocus(newFocus, msgs); - if (msgs != null) { + if(msgs != null) { msgs.dispatch(); } - } else if (eNotificationRequired()) { + } else if(eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, DGPackage.RADIAL_GRADIENT__FOCUS, newFocus, newFocus)); } } @@ -226,7 +232,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { public void setRadius(double newRadius) { double oldRadius = radius; radius = newRadius; - if (eNotificationRequired()) { + if(eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, DGPackage.RADIAL_GRADIENT__RADIUS, oldRadius, radius)); } } @@ -250,8 +256,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public boolean validCenterPoint(DiagnosticChain diagnostics, Map<Object, Object> context) { - return DGValidator.validate(DGPackage.Literals.RADIAL_GRADIENT, this, diagnostics, context, "http://www.eclipse.org/emf/2002/Ecore/OCL", DGPackage.Literals.RADIAL_GRADIENT___VALID_CENTER_POINT__DIAGNOSTICCHAIN_MAP, - VALID_CENTER_POINT_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, Diagnostic.ERROR, DGValidator.DIAGNOSTIC_SOURCE, DGValidator.RADIAL_GRADIENT__VALID_CENTER_POINT); + return DGValidator.validate(DGPackage.Literals.RADIAL_GRADIENT, this, diagnostics, context, "http://www.eclipse.org/emf/2002/Ecore/OCL", DGPackage.Literals.RADIAL_GRADIENT___VALID_CENTER_POINT__DIAGNOSTICCHAIN_MAP, VALID_CENTER_POINT_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, Diagnostic.ERROR, DGValidator.DIAGNOSTIC_SOURCE, DGValidator.RADIAL_GRADIENT__VALID_CENTER_POINT); } /** @@ -273,8 +278,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public boolean validFocusPoint(DiagnosticChain diagnostics, Map<Object, Object> context) { - return DGValidator.validate(DGPackage.Literals.RADIAL_GRADIENT, this, diagnostics, context, "http://www.eclipse.org/emf/2002/Ecore/OCL", DGPackage.Literals.RADIAL_GRADIENT___VALID_FOCUS_POINT__DIAGNOSTICCHAIN_MAP, - VALID_FOCUS_POINT_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, Diagnostic.ERROR, DGValidator.DIAGNOSTIC_SOURCE, DGValidator.RADIAL_GRADIENT__VALID_FOCUS_POINT); + return DGValidator.validate(DGPackage.Literals.RADIAL_GRADIENT, this, diagnostics, context, "http://www.eclipse.org/emf/2002/Ecore/OCL", DGPackage.Literals.RADIAL_GRADIENT___VALID_FOCUS_POINT__DIAGNOSTICCHAIN_MAP, VALID_FOCUS_POINT_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, Diagnostic.ERROR, DGValidator.DIAGNOSTIC_SOURCE, DGValidator.RADIAL_GRADIENT__VALID_FOCUS_POINT); } /** @@ -296,8 +300,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public boolean validRadius(DiagnosticChain diagnostics, Map<Object, Object> context) { - return DGValidator.validate(DGPackage.Literals.RADIAL_GRADIENT, this, diagnostics, context, "http://www.eclipse.org/emf/2002/Ecore/OCL", DGPackage.Literals.RADIAL_GRADIENT___VALID_RADIUS__DIAGNOSTICCHAIN_MAP, - VALID_RADIUS_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, Diagnostic.ERROR, DGValidator.DIAGNOSTIC_SOURCE, DGValidator.RADIAL_GRADIENT__VALID_RADIUS); + return DGValidator.validate(DGPackage.Literals.RADIAL_GRADIENT, this, diagnostics, context, "http://www.eclipse.org/emf/2002/Ecore/OCL", DGPackage.Literals.RADIAL_GRADIENT___VALID_RADIUS__DIAGNOSTICCHAIN_MAP, VALID_RADIUS_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, Diagnostic.ERROR, DGValidator.DIAGNOSTIC_SOURCE, DGValidator.RADIAL_GRADIENT__VALID_RADIUS); } /** @@ -307,7 +310,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { + switch(featureID) { case DGPackage.RADIAL_GRADIENT__CENTER: return basicSetCenter(null, msgs); case DGPackage.RADIAL_GRADIENT__FOCUS: @@ -323,7 +326,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { + switch(featureID) { case DGPackage.RADIAL_GRADIENT__CENTER: return getCenter(); case DGPackage.RADIAL_GRADIENT__FOCUS: @@ -341,15 +344,15 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public void eSet(int featureID, Object newValue) { - switch (featureID) { + switch(featureID) { case DGPackage.RADIAL_GRADIENT__CENTER: - setCenter((Point) newValue); + setCenter((Point)newValue); return; case DGPackage.RADIAL_GRADIENT__FOCUS: - setFocus((Point) newValue); + setFocus((Point)newValue); return; case DGPackage.RADIAL_GRADIENT__RADIUS: - setRadius((Double) newValue); + setRadius((Double)newValue); return; } super.eSet(featureID, newValue); @@ -362,12 +365,12 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public void eUnset(int featureID) { - switch (featureID) { + switch(featureID) { case DGPackage.RADIAL_GRADIENT__CENTER: - setCenter((Point) null); + setCenter((Point)null); return; case DGPackage.RADIAL_GRADIENT__FOCUS: - setFocus((Point) null); + setFocus((Point)null); return; case DGPackage.RADIAL_GRADIENT__RADIUS: setRadius(RADIUS_EDEFAULT); @@ -383,7 +386,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public boolean eIsSet(int featureID) { - switch (featureID) { + switch(featureID) { case DGPackage.RADIAL_GRADIENT__CENTER: return center != null; case DGPackage.RADIAL_GRADIENT__FOCUS: @@ -402,13 +405,13 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { @Override @SuppressWarnings("unchecked") public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { - switch (operationID) { + switch(operationID) { case DGPackage.RADIAL_GRADIENT___VALID_CENTER_POINT__DIAGNOSTICCHAIN_MAP: - return validCenterPoint((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + return validCenterPoint((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case DGPackage.RADIAL_GRADIENT___VALID_FOCUS_POINT__DIAGNOSTICCHAIN_MAP: - return validFocusPoint((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + return validFocusPoint((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case DGPackage.RADIAL_GRADIENT___VALID_RADIUS__DIAGNOSTICCHAIN_MAP: - return validRadius((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + return validRadius((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); } return super.eInvoke(operationID, arguments); } @@ -420,7 +423,7 @@ public class RadialGradientImpl extends GradientImpl implements RadialGradient { */ @Override public String toString() { - if (eIsProxy()) { + if(eIsProxy()) { return super.toString(); } StringBuffer result = new StringBuffer(super.toString()); |