All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.dd.dc.impl.FontImpl Maven / Gradle / Ivy

There is a newer version: 7.54.0.Final
Show newest version
/**
 * 
 * 
 * Copyright (c) 2010 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
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *    Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
 * 
 * 
 */
package org.eclipse.dd.dc.impl;

import com.google.gwt.user.client.rpc.GwtTransient;

import java.util.Map;

import org.eclipse.dd.dc.DcPackage;
import org.eclipse.dd.dc.Font;

import org.eclipse.dd.dc.util.DcValidator;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.eclipse.emf.ecore.util.EObjectValidator;

/**
 * 
 * An implementation of the model object 'Font'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsBold Is Bold}
  • *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsItalic Is Italic}
  • *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsStrikeThrough Is Strike Through}
  • *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsUnderline Is Underline}
  • *
  • {@link org.eclipse.dd.dc.impl.FontImpl#getName Name}
  • *
  • {@link org.eclipse.dd.dc.impl.FontImpl#getSize Size}
  • *
* * @generated */ public class FontImpl extends EObjectImpl implements Font { /** * The default value of the '{@link #isIsBold() Is Bold}' attribute. * * * @see #isIsBold() * @generated * @ordered */ protected static final boolean IS_BOLD_EDEFAULT = false; /** * The cached value of the '{@link #isIsBold() Is Bold}' attribute. * * * @see #isIsBold() * @generated * @ordered */ @GwtTransient protected boolean isBold = IS_BOLD_EDEFAULT; /** * The default value of the '{@link #isIsItalic() Is Italic}' attribute. * * * @see #isIsItalic() * @generated * @ordered */ protected static final boolean IS_ITALIC_EDEFAULT = false; /** * The cached value of the '{@link #isIsItalic() Is Italic}' attribute. * * * @see #isIsItalic() * @generated * @ordered */ @GwtTransient protected boolean isItalic = IS_ITALIC_EDEFAULT; /** * The default value of the '{@link #isIsStrikeThrough() Is Strike Through}' attribute. * * * @see #isIsStrikeThrough() * @generated * @ordered */ protected static final boolean IS_STRIKE_THROUGH_EDEFAULT = false; /** * The cached value of the '{@link #isIsStrikeThrough() Is Strike Through}' attribute. * * * @see #isIsStrikeThrough() * @generated * @ordered */ @GwtTransient protected boolean isStrikeThrough = IS_STRIKE_THROUGH_EDEFAULT; /** * The default value of the '{@link #isIsUnderline() Is Underline}' attribute. * * * @see #isIsUnderline() * @generated * @ordered */ protected static final boolean IS_UNDERLINE_EDEFAULT = false; /** * The cached value of the '{@link #isIsUnderline() Is Underline}' attribute. * * * @see #isIsUnderline() * @generated * @ordered */ @GwtTransient protected boolean isUnderline = IS_UNDERLINE_EDEFAULT; /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ @GwtTransient protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getSize() Size}' attribute. * * * @see #getSize() * @generated * @ordered */ protected static final float SIZE_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getSize() Size}' attribute. * * * @see #getSize() * @generated * @ordered */ @GwtTransient protected float size = SIZE_EDEFAULT; /** * * * @generated */ protected FontImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return DcPackage.Literals.FONT; } /** * * * @generated */ @Override public boolean isIsBold() { return isBold; } /** * * * @generated */ @Override public void setIsBold(boolean newIsBold) { boolean oldIsBold = isBold; isBold = newIsBold; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_BOLD, oldIsBold, isBold)); } /** * * * @generated */ @Override public boolean isIsItalic() { return isItalic; } /** * * * @generated */ @Override public void setIsItalic(boolean newIsItalic) { boolean oldIsItalic = isItalic; isItalic = newIsItalic; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_ITALIC, oldIsItalic, isItalic)); } /** * * * @generated */ @Override public boolean isIsStrikeThrough() { return isStrikeThrough; } /** * * * @generated */ @Override public void setIsStrikeThrough(boolean newIsStrikeThrough) { boolean oldIsStrikeThrough = isStrikeThrough; isStrikeThrough = newIsStrikeThrough; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_STRIKE_THROUGH, oldIsStrikeThrough, isStrikeThrough)); } /** * * * @generated */ @Override public boolean isIsUnderline() { return isUnderline; } /** * * * @generated */ @Override public void setIsUnderline(boolean newIsUnderline) { boolean oldIsUnderline = isUnderline; isUnderline = newIsUnderline; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_UNDERLINE, oldIsUnderline, isUnderline)); } /** * * * @generated */ @Override public String getName() { return name; } /** * * * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__NAME, oldName, name)); } /** * * * @generated */ @Override public float getSize() { return size; } /** * * * @generated */ @Override public void setSize(float newSize) { float oldSize = size; size = newSize; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__SIZE, oldSize, size)); } /** * * * @generated */ @Override public boolean non_negative_size(DiagnosticChain diagnostics, Map context) { // TODO: implement this method // -> specify the condition that violates the invariant // -> verify the details of the diagnostic, including severity and message // Ensure that you remove @generated or mark it @generated NOT if (false) { if (diagnostics != null) { diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, DcValidator.DIAGNOSTIC_SOURCE, DcValidator.FONT__NON_NEGATIVE_SIZE, EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "non_negative_size", EObjectValidator.getObjectLabel(this, context) }), new Object[] { this })); } return false; } return true; } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DcPackage.FONT__IS_BOLD: return isIsBold(); case DcPackage.FONT__IS_ITALIC: return isIsItalic(); case DcPackage.FONT__IS_STRIKE_THROUGH: return isIsStrikeThrough(); case DcPackage.FONT__IS_UNDERLINE: return isIsUnderline(); case DcPackage.FONT__NAME: return getName(); case DcPackage.FONT__SIZE: return getSize(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DcPackage.FONT__IS_BOLD: setIsBold((Boolean) newValue); return; case DcPackage.FONT__IS_ITALIC: setIsItalic((Boolean) newValue); return; case DcPackage.FONT__IS_STRIKE_THROUGH: setIsStrikeThrough((Boolean) newValue); return; case DcPackage.FONT__IS_UNDERLINE: setIsUnderline((Boolean) newValue); return; case DcPackage.FONT__NAME: setName((String) newValue); return; case DcPackage.FONT__SIZE: setSize((Float) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DcPackage.FONT__IS_BOLD: setIsBold(IS_BOLD_EDEFAULT); return; case DcPackage.FONT__IS_ITALIC: setIsItalic(IS_ITALIC_EDEFAULT); return; case DcPackage.FONT__IS_STRIKE_THROUGH: setIsStrikeThrough(IS_STRIKE_THROUGH_EDEFAULT); return; case DcPackage.FONT__IS_UNDERLINE: setIsUnderline(IS_UNDERLINE_EDEFAULT); return; case DcPackage.FONT__NAME: setName(NAME_EDEFAULT); return; case DcPackage.FONT__SIZE: setSize(SIZE_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DcPackage.FONT__IS_BOLD: return isBold != IS_BOLD_EDEFAULT; case DcPackage.FONT__IS_ITALIC: return isItalic != IS_ITALIC_EDEFAULT; case DcPackage.FONT__IS_STRIKE_THROUGH: return isStrikeThrough != IS_STRIKE_THROUGH_EDEFAULT; case DcPackage.FONT__IS_UNDERLINE: return isUnderline != IS_UNDERLINE_EDEFAULT; case DcPackage.FONT__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case DcPackage.FONT__SIZE: return size != SIZE_EDEFAULT; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (isBold: "); result.append(isBold); result.append(", isItalic: "); result.append(isItalic); result.append(", isStrikeThrough: "); result.append(isStrikeThrough); result.append(", isUnderline: "); result.append(isUnderline); result.append(", name: "); result.append(name); result.append(", size: "); result.append(size); result.append(')'); return result.toString(); } } //FontImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy