001: /**
002: * <copyright></copyright> $Id$
003: */package net.refractions.udig.project.internal.impl;
004:
005: import net.refractions.udig.project.internal.ProjectPackage;
006: import net.refractions.udig.project.internal.StyleBlackboard;
007: import net.refractions.udig.project.internal.StyleEntry;
008:
009: import org.eclipse.emf.common.notify.Notification;
010: import org.eclipse.emf.ecore.EClass;
011: import org.eclipse.emf.ecore.EStructuralFeature;
012: import org.eclipse.emf.ecore.impl.ENotificationImpl;
013: import org.eclipse.emf.ecore.impl.EObjectImpl;
014:
015: /**
016: * Default implementation
017: *
018: * @author Jesse
019: * @since 1.0.0
020: * @generated
021: */
022: public class StyleEntryImpl extends EObjectImpl implements StyleEntry {
023:
024: /**
025: * <!-- begin-user-doc --> <!-- end-user-doc -->
026: * @generated
027: */
028: public static final String copyright = "uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004, Refractions Research Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details."; //$NON-NLS-1$
029:
030: /**
031: * The default value of the '{@link #getID() <em>ID</em>}' attribute.
032: * <!-- begin-user-doc -->
033: * <!-- end-user-doc -->
034: * @see #getID()
035: * @generated
036: * @ordered
037: */
038: protected static final String ID_EDEFAULT = null;
039:
040: /**
041: * The cached value of the '{@link #getID() <em>ID</em>}' attribute.
042: * <!-- begin-user-doc -->
043: * <!-- end-user-doc -->
044: * @see #getID()
045: * @generated
046: * @ordered
047: */
048: protected String iD = ID_EDEFAULT;
049:
050: /**
051: * The default value of the '{@link #getMemento() <em>Memento</em>}' attribute. <!--
052: * begin-user-doc --> <!-- end-user-doc -->
053: *
054: * @see #getMemento()
055: * @generated
056: * @ordered
057: */
058: protected static final String MEMENTO_EDEFAULT = null;
059:
060: /**
061: * The cached value of the '{@link #getMemento() <em>Memento</em>}' attribute. <!--
062: * begin-user-doc --> <!-- end-user-doc -->
063: *
064: * @see #getMemento()
065: * @generated
066: * @ordered
067: */
068: protected String memento = MEMENTO_EDEFAULT;
069:
070: /**
071: * The default value of the '{@link #getStyle() <em>Style</em>}' attribute. <!--
072: * begin-user-doc --> <!-- end-user-doc -->
073: *
074: * @see #getStyle()
075: * @generated
076: * @ordered
077: */
078: protected static final Object STYLE_EDEFAULT = null;
079:
080: /**
081: * The default value of the '{@link #getStyleClass() <em>Style Class</em>}' attribute. <!--
082: * begin-user-doc --> <!-- end-user-doc -->
083: *
084: * @see #getStyleClass()
085: * @generated
086: * @ordered
087: */
088: protected static final Class STYLE_CLASS_EDEFAULT = null;
089:
090: /**
091: * The cached style.
092: *
093: * @generated NOT
094: */
095: protected Object style = STYLE_EDEFAULT;
096:
097: /**
098: * The cached style class.
099: *
100: * @generated NOT
101: */
102: private Class styleClass = STYLE_CLASS_EDEFAULT;
103:
104: /**
105: * Indicates whether the entry is <em>selected</em>
106: * @see StyleBlackboard#setSelected(String[])
107: */
108: private volatile boolean selected = false;
109:
110: /**
111: * <!-- begin-user-doc --> <!-- end-user-doc -->
112: * @generated
113: */
114: protected StyleEntryImpl() {
115: super ();
116: }
117:
118: /**
119: * <!-- begin-user-doc --> <!-- end-user-doc -->
120: * @generated
121: */
122: protected EClass eStaticClass() {
123: return ProjectPackage.eINSTANCE.getStyleEntry();
124: }
125:
126: /**
127: * <!-- begin-user-doc --> <!-- end-user-doc -->
128: * @generated
129: */
130: public String getID() {
131: return iD;
132: }
133:
134: /**
135: * <!-- begin-user-doc --> <!-- end-user-doc -->
136: * @generated
137: */
138: public void setID(String newID) {
139: String oldID = iD;
140: iD = newID;
141: if (eNotificationRequired())
142: eNotify(new ENotificationImpl(this , Notification.SET,
143: ProjectPackage.STYLE_ENTRY__ID, oldID, iD));
144: }
145:
146: /**
147: * <!-- begin-user-doc --> <!-- end-user-doc -->
148: * @generated
149: */
150: public String getMemento() {
151: return memento;
152: }
153:
154: /**
155: * <!-- begin-user-doc --> <!-- end-user-doc -->
156: * @generated
157: */
158: public void setMemento(String newMemento) {
159: String oldMemento = memento;
160: memento = newMemento;
161: if (eNotificationRequired())
162: eNotify(new ENotificationImpl(this , Notification.SET,
163: ProjectPackage.STYLE_ENTRY__MEMENTO, oldMemento,
164: memento));
165: }
166:
167: /**
168: * <!-- begin-user-doc --> <!-- end-user-doc -->
169: *
170: * @uml.property name="style"
171: * @generated NOT
172: */
173: public Object getStyle() {
174: return style;
175: }
176:
177: /**
178: * <!-- begin-user-doc --> <!-- end-user-doc -->
179: *
180: * @uml.property name="style"
181: * @generated NOT
182: */
183: public void setStyle(Object newStyle) {
184: style = newStyle;
185: }
186:
187: /**
188: * <!-- begin-user-doc --> <!-- end-user-doc -->
189: *
190: * @uml.property name="styleClass"
191: * @generated NOT
192: */
193: public Class getStyleClass() {
194: return styleClass;
195: }
196:
197: /**
198: * <!-- begin-user-doc --> <!-- end-user-doc -->
199: *
200: * @uml.property name="styleClass"
201: * @generated NOT
202: */
203: public void setStyleClass(Class newStyleClass) {
204: styleClass = newStyleClass;
205: }
206:
207: /**
208: * <!-- begin-user-doc --> <!-- end-user-doc -->
209: * @generated
210: */
211: public Object eGet(EStructuralFeature eFeature, boolean resolve) {
212: switch (eDerivedStructuralFeatureID(eFeature)) {
213: case ProjectPackage.STYLE_ENTRY__ID:
214: return getID();
215: case ProjectPackage.STYLE_ENTRY__MEMENTO:
216: return getMemento();
217: case ProjectPackage.STYLE_ENTRY__STYLE:
218: return getStyle();
219: case ProjectPackage.STYLE_ENTRY__STYLE_CLASS:
220: return getStyleClass();
221: }
222: return eDynamicGet(eFeature, resolve);
223: }
224:
225: /**
226: * <!-- begin-user-doc --> <!-- end-user-doc -->
227: * @generated
228: */
229: public void eSet(EStructuralFeature eFeature, Object newValue) {
230: switch (eDerivedStructuralFeatureID(eFeature)) {
231: case ProjectPackage.STYLE_ENTRY__ID:
232: setID((String) newValue);
233: return;
234: case ProjectPackage.STYLE_ENTRY__MEMENTO:
235: setMemento((String) newValue);
236: return;
237: case ProjectPackage.STYLE_ENTRY__STYLE:
238: setStyle((Object) newValue);
239: return;
240: case ProjectPackage.STYLE_ENTRY__STYLE_CLASS:
241: setStyleClass((Class) newValue);
242: return;
243: }
244: eDynamicSet(eFeature, newValue);
245: }
246:
247: /**
248: * <!-- begin-user-doc --> <!-- end-user-doc -->
249: * @generated
250: */
251: public void eUnset(EStructuralFeature eFeature) {
252: switch (eDerivedStructuralFeatureID(eFeature)) {
253: case ProjectPackage.STYLE_ENTRY__ID:
254: setID(ID_EDEFAULT);
255: return;
256: case ProjectPackage.STYLE_ENTRY__MEMENTO:
257: setMemento(MEMENTO_EDEFAULT);
258: return;
259: case ProjectPackage.STYLE_ENTRY__STYLE:
260: setStyle(STYLE_EDEFAULT);
261: return;
262: case ProjectPackage.STYLE_ENTRY__STYLE_CLASS:
263: setStyleClass(STYLE_CLASS_EDEFAULT);
264: return;
265: }
266: eDynamicUnset(eFeature);
267: }
268:
269: /**
270: * <!-- begin-user-doc --> <!-- end-user-doc -->
271: * @generated
272: */
273: public boolean eIsSet(EStructuralFeature eFeature) {
274: switch (eDerivedStructuralFeatureID(eFeature)) {
275: case ProjectPackage.STYLE_ENTRY__ID:
276: return ID_EDEFAULT == null ? iD != null : !ID_EDEFAULT
277: .equals(iD);
278: case ProjectPackage.STYLE_ENTRY__MEMENTO:
279: return MEMENTO_EDEFAULT == null ? memento != null
280: : !MEMENTO_EDEFAULT.equals(memento);
281: case ProjectPackage.STYLE_ENTRY__STYLE:
282: return STYLE_EDEFAULT == null ? getStyle() != null
283: : !STYLE_EDEFAULT.equals(getStyle());
284: case ProjectPackage.STYLE_ENTRY__STYLE_CLASS:
285: return STYLE_CLASS_EDEFAULT == null ? getStyleClass() != null
286: : !STYLE_CLASS_EDEFAULT.equals(getStyleClass());
287: }
288: return eDynamicIsSet(eFeature);
289: }
290:
291: /**
292: * <!-- begin-user-doc --> <!-- end-user-doc -->
293: * @generated NOT
294: */
295: public String toString() {
296: if (eIsProxy())
297: return super .toString();
298:
299: StringBuffer result = new StringBuffer(super .toString());
300: result.append(" (iD: "); //$NON-NLS-1$
301: result.append(iD);
302: result.append(", memento: "); //$NON-NLS-1$
303: result.append(memento);
304: result.append(", selected: "); //$NON-NLS-1$
305: result.append(selected);
306: result.append(')');
307: return result.toString();
308: }
309:
310: public boolean isSelected() {
311: return selected;
312: }
313:
314: public void setSelected(boolean selected) {
315: this .selected = selected;
316: }
317:
318: } // StyleEntryImpl
|