Skip to content

Package: VTFontPropertiesStylePropertyImpl

VTFontPropertiesStylePropertyImpl

nameinstructionbranchcomplexitylinemethod
VTFontPropertiesStylePropertyImpl()
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 6 C: 20
77%
M: 1 C: 5
83%
M: 1 C: 5
83%
M: 1 C: 6
86%
M: 0 C: 1
100%
eIsSet(int)
M: 22 C: 33
60%
M: 8 C: 12
60%
M: 6 C: 7
54%
M: 1 C: 6
86%
M: 0 C: 1
100%
eSet(int, Object)
M: 16 C: 19
54%
M: 3 C: 3
50%
M: 3 C: 3
50%
M: 6 C: 7
54%
M: 0 C: 1
100%
eStaticClass()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eUnset(int)
M: 26 C: 0
0%
M: 6 C: 0
0%
M: 6 C: 0
0%
M: 13 C: 0
0%
M: 1 C: 0
0%
equalStyles(VTStyleProperty)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getColorHEX()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getFontName()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getHeight()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isBold()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isItalic()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setBold(boolean)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setColorHEX(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setFontName(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setHeight(int)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setItalic(boolean)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
toString()
M: 3 C: 61
95%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 14
93%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.fontProperties.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.impl.ENotificationImpl;
19: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
20: import org.eclipse.emf.ecp.common.spi.EMFUtils;
21: import org.eclipse.emf.ecp.view.template.model.VTStyleProperty;
22: import org.eclipse.emf.ecp.view.template.style.fontProperties.model.VTFontPropertiesPackage;
23: import org.eclipse.emf.ecp.view.template.style.fontProperties.model.VTFontPropertiesStyleProperty;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * An implementation of the model object '<em><b>Style Property</b></em>'.
28: * <!-- end-user-doc -->
29: * <p>
30: * The following features are implemented:
31: * <ul>
32: * <li>
33: * {@link org.eclipse.emf.ecp.view.template.style.fontProperties.model.impl.VTFontPropertiesStylePropertyImpl#isItalic
34: * <em>Italic</em>}</li>
35: * <li>
36: * {@link org.eclipse.emf.ecp.view.template.style.fontProperties.model.impl.VTFontPropertiesStylePropertyImpl#isBold
37: * <em>Bold</em>}</li>
38: * <li>
39: * {@link org.eclipse.emf.ecp.view.template.style.fontProperties.model.impl.VTFontPropertiesStylePropertyImpl#getColorHEX
40: * <em>Color HEX</em>}</li>
41: * <li>
42: * {@link org.eclipse.emf.ecp.view.template.style.fontProperties.model.impl.VTFontPropertiesStylePropertyImpl#getHeight
43: * <em>Height</em>}</li>
44: * <li>
45: * {@link org.eclipse.emf.ecp.view.template.style.fontProperties.model.impl.VTFontPropertiesStylePropertyImpl#getFontName
46: * <em>Font Name</em>}</li>
47: * </ul>
48: * </p>
49: *
50: * @generated
51: */
52: public class VTFontPropertiesStylePropertyImpl extends MinimalEObjectImpl.Container implements
53:         VTFontPropertiesStyleProperty {
54:         /**
55:          * The default value of the '{@link #isItalic() <em>Italic</em>}' attribute.
56:          * <!-- begin-user-doc -->
57:          * <!-- end-user-doc -->
58:          *
59:          * @see #isItalic()
60:          * @generated
61:          * @ordered
62:          */
63:         protected static final boolean ITALIC_EDEFAULT = false;
64:
65:         /**
66:          * The cached value of the '{@link #isItalic() <em>Italic</em>}' attribute.
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @see #isItalic()
71:          * @generated
72:          * @ordered
73:          */
74:         protected boolean italic = ITALIC_EDEFAULT;
75:
76:         /**
77:          * The default value of the '{@link #isBold() <em>Bold</em>}' attribute.
78:          * <!-- begin-user-doc -->
79:          * <!-- end-user-doc -->
80:          *
81:          * @see #isBold()
82:          * @generated
83:          * @ordered
84:          */
85:         protected static final boolean BOLD_EDEFAULT = false;
86:
87:         /**
88:          * The cached value of the '{@link #isBold() <em>Bold</em>}' attribute.
89:          * <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @see #isBold()
93:          * @generated
94:          * @ordered
95:          */
96:         protected boolean bold = BOLD_EDEFAULT;
97:
98:         /**
99:          * The default value of the '{@link #getColorHEX() <em>Color HEX</em>}' attribute.
100:          * <!-- begin-user-doc -->
101:          * <!-- end-user-doc -->
102:          *
103:          * @see #getColorHEX()
104:          * @generated
105:          * @ordered
106:          */
107:         protected static final String COLOR_HEX_EDEFAULT = null;
108:
109:         /**
110:          * The cached value of the '{@link #getColorHEX() <em>Color HEX</em>}' attribute.
111:          * <!-- begin-user-doc -->
112:          * <!-- end-user-doc -->
113:          *
114:          * @see #getColorHEX()
115:          * @generated
116:          * @ordered
117:          */
118:         protected String colorHEX = COLOR_HEX_EDEFAULT;
119:
120:         /**
121:          * The default value of the '{@link #getHeight() <em>Height</em>}' attribute.
122:          * <!-- begin-user-doc -->
123:          * <!-- end-user-doc -->
124:          *
125:          * @see #getHeight()
126:          * @generated
127:          * @ordered
128:          */
129:         protected static final int HEIGHT_EDEFAULT = 0;
130:
131:         /**
132:          * The cached value of the '{@link #getHeight() <em>Height</em>}' attribute.
133:          * <!-- begin-user-doc -->
134:          * <!-- end-user-doc -->
135:          *
136:          * @see #getHeight()
137:          * @generated
138:          * @ordered
139:          */
140:         protected int height = HEIGHT_EDEFAULT;
141:
142:         /**
143:          * The default value of the '{@link #getFontName() <em>Font Name</em>}' attribute.
144:          * <!-- begin-user-doc -->
145:          * <!-- end-user-doc -->
146:          *
147:          * @see #getFontName()
148:          * @generated
149:          * @ordered
150:          */
151:         protected static final String FONT_NAME_EDEFAULT = null;
152:
153:         /**
154:          * The cached value of the '{@link #getFontName() <em>Font Name</em>}' attribute.
155:          * <!-- begin-user-doc -->
156:          * <!-- end-user-doc -->
157:          *
158:          * @see #getFontName()
159:          * @generated
160:          * @ordered
161:          */
162:         protected String fontName = FONT_NAME_EDEFAULT;
163:
164:         /**
165:          * <!-- begin-user-doc -->
166:          * <!-- end-user-doc -->
167:          *
168:          * @generated
169:          */
170:         protected VTFontPropertiesStylePropertyImpl() {
171:                 super();
172:         }
173:
174:         /**
175:          * <!-- begin-user-doc -->
176:          * <!-- end-user-doc -->
177:          *
178:          * @generated
179:          */
180:         @Override
181:         protected EClass eStaticClass() {
182:                 return VTFontPropertiesPackage.Literals.FONT_PROPERTIES_STYLE_PROPERTY;
183:         }
184:
185:         /**
186:          * <!-- begin-user-doc -->
187:          * <!-- end-user-doc -->
188:          *
189:          * @generated
190:          */
191:         @Override
192:         public boolean isItalic() {
193:                 return italic;
194:         }
195:
196:         /**
197:          * <!-- begin-user-doc -->
198:          * <!-- end-user-doc -->
199:          *
200:          * @generated
201:          */
202:         @Override
203:         public void setItalic(boolean newItalic) {
204:                 final boolean oldItalic = italic;
205:                 italic = newItalic;
206:•                if (eNotificationRequired()) {
207:                         eNotify(new ENotificationImpl(this, Notification.SET,
208:                                 VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__ITALIC, oldItalic, italic));
209:                 }
210:         }
211:
212:         /**
213:          * <!-- begin-user-doc -->
214:          * <!-- end-user-doc -->
215:          *
216:          * @generated
217:          */
218:         @Override
219:         public boolean isBold() {
220:                 return bold;
221:         }
222:
223:         /**
224:          * <!-- begin-user-doc -->
225:          * <!-- end-user-doc -->
226:          *
227:          * @generated
228:          */
229:         @Override
230:         public void setBold(boolean newBold) {
231:                 final boolean oldBold = bold;
232:                 bold = newBold;
233:•                if (eNotificationRequired()) {
234:                         eNotify(new ENotificationImpl(this, Notification.SET,
235:                                 VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__BOLD, oldBold, bold));
236:                 }
237:         }
238:
239:         /**
240:          * <!-- begin-user-doc -->
241:          * <!-- end-user-doc -->
242:          *
243:          * @generated
244:          */
245:         @Override
246:         public String getColorHEX() {
247:                 return colorHEX;
248:         }
249:
250:         /**
251:          * <!-- begin-user-doc -->
252:          * <!-- end-user-doc -->
253:          *
254:          * @generated
255:          */
256:         @Override
257:         public void setColorHEX(String newColorHEX) {
258:                 final String oldColorHEX = colorHEX;
259:                 colorHEX = newColorHEX;
260:•                if (eNotificationRequired()) {
261:                         eNotify(new ENotificationImpl(this, Notification.SET,
262:                                 VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__COLOR_HEX, oldColorHEX, colorHEX));
263:                 }
264:         }
265:
266:         /**
267:          * <!-- begin-user-doc -->
268:          * <!-- end-user-doc -->
269:          *
270:          * @generated
271:          */
272:         @Override
273:         public int getHeight() {
274:                 return height;
275:         }
276:
277:         /**
278:          * <!-- begin-user-doc -->
279:          * <!-- end-user-doc -->
280:          *
281:          * @generated
282:          */
283:         @Override
284:         public void setHeight(int newHeight) {
285:                 final int oldHeight = height;
286:                 height = newHeight;
287:•                if (eNotificationRequired()) {
288:                         eNotify(new ENotificationImpl(this, Notification.SET,
289:                                 VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__HEIGHT, oldHeight, height));
290:                 }
291:         }
292:
293:         /**
294:          * <!-- begin-user-doc -->
295:          * <!-- end-user-doc -->
296:          *
297:          * @generated
298:          */
299:         @Override
300:         public String getFontName() {
301:                 return fontName;
302:         }
303:
304:         /**
305:          * <!-- begin-user-doc -->
306:          * <!-- end-user-doc -->
307:          *
308:          * @generated
309:          */
310:         @Override
311:         public void setFontName(String newFontName) {
312:                 final String oldFontName = fontName;
313:                 fontName = newFontName;
314:•                if (eNotificationRequired()) {
315:                         eNotify(new ENotificationImpl(this, Notification.SET,
316:                                 VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__FONT_NAME, oldFontName, fontName));
317:                 }
318:         }
319:
320:         /**
321:          * <!-- begin-user-doc -->
322:          * <!-- end-user-doc -->
323:          *
324:          * @generated
325:          */
326:         @Override
327:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
328:•                switch (featureID) {
329:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__ITALIC:
330:                         return isItalic();
331:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__BOLD:
332:                         return isBold();
333:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__COLOR_HEX:
334:                         return getColorHEX();
335:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__HEIGHT:
336:                         return getHeight();
337:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__FONT_NAME:
338:                         return getFontName();
339:                 }
340:                 return super.eGet(featureID, resolve, coreType);
341:         }
342:
343:         /**
344:          * <!-- begin-user-doc -->
345:          * <!-- end-user-doc -->
346:          *
347:          * @generated
348:          */
349:         @Override
350:         public void eSet(int featureID, Object newValue) {
351:•                switch (featureID) {
352:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__ITALIC:
353:                         setItalic((Boolean) newValue);
354:                         return;
355:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__BOLD:
356:                         setBold((Boolean) newValue);
357:                         return;
358:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__COLOR_HEX:
359:                         setColorHEX((String) newValue);
360:                         return;
361:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__HEIGHT:
362:                         setHeight((Integer) newValue);
363:                         return;
364:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__FONT_NAME:
365:                         setFontName((String) newValue);
366:                         return;
367:                 }
368:                 super.eSet(featureID, newValue);
369:         }
370:
371:         /**
372:          * <!-- begin-user-doc -->
373:          * <!-- end-user-doc -->
374:          *
375:          * @generated
376:          */
377:         @Override
378:         public void eUnset(int featureID) {
379:•                switch (featureID) {
380:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__ITALIC:
381:                         setItalic(ITALIC_EDEFAULT);
382:                         return;
383:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__BOLD:
384:                         setBold(BOLD_EDEFAULT);
385:                         return;
386:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__COLOR_HEX:
387:                         setColorHEX(COLOR_HEX_EDEFAULT);
388:                         return;
389:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__HEIGHT:
390:                         setHeight(HEIGHT_EDEFAULT);
391:                         return;
392:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__FONT_NAME:
393:                         setFontName(FONT_NAME_EDEFAULT);
394:                         return;
395:                 }
396:                 super.eUnset(featureID);
397:         }
398:
399:         /**
400:          * <!-- begin-user-doc -->
401:          * <!-- end-user-doc -->
402:          *
403:          * @generated
404:          */
405:         @Override
406:         public boolean eIsSet(int featureID) {
407:•                switch (featureID) {
408:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__ITALIC:
409:                         return italic != ITALIC_EDEFAULT;
410:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__BOLD:
411:                         return bold != BOLD_EDEFAULT;
412:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__COLOR_HEX:
413:•                        return COLOR_HEX_EDEFAULT == null ? colorHEX != null : !COLOR_HEX_EDEFAULT.equals(colorHEX);
414:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__HEIGHT:
415:•                        return height != HEIGHT_EDEFAULT;
416:                 case VTFontPropertiesPackage.FONT_PROPERTIES_STYLE_PROPERTY__FONT_NAME:
417:•                        return FONT_NAME_EDEFAULT == null ? fontName != null : !FONT_NAME_EDEFAULT.equals(fontName);
418:                 }
419:                 return super.eIsSet(featureID);
420:         }
421:
422:         /**
423:          * <!-- begin-user-doc -->
424:          * <!-- end-user-doc -->
425:          *
426:          * @generated
427:          */
428:         @Override
429:         public String toString() {
430:•                if (eIsProxy()) {
431:                         return super.toString();
432:                 }
433:
434:                 final StringBuffer result = new StringBuffer(super.toString());
435:                 result.append(" (italic: "); //$NON-NLS-1$
436:                 result.append(italic);
437:                 result.append(", bold: "); //$NON-NLS-1$
438:                 result.append(bold);
439:                 result.append(", colorHEX: "); //$NON-NLS-1$
440:                 result.append(colorHEX);
441:                 result.append(", height: "); //$NON-NLS-1$
442:                 result.append(height);
443:                 result.append(", fontName: "); //$NON-NLS-1$
444:                 result.append(fontName);
445:                 result.append(')');
446:                 return result.toString();
447:         }
448:
449:         /**
450:          * {@inheritDoc}
451:          *
452:          * @see org.eclipse.emf.ecp.view.template.model.VTStyleProperty#equalStyles(org.eclipse.emf.ecp.view.template.model.VTStyleProperty)
453:          */
454:         @Override
455:         public boolean equalStyles(VTStyleProperty styleProperty) {
456:                 return EMFUtils.filteredEquals(this, styleProperty);
457:         }
458:
459: } // VTFontPropertiesStylePropertyImpl