📄 nodeelementimpl.java
字号:
/**
* <copyright>
* </copyright>
*
* $Id: NodeElementImpl.java,v 1.1 2006/12/30 02:45:06 niegy Exp $
*/
package com.primeton.studio.gef.core.impl;
import com.primeton.studio.gef.core.Connection;
import com.primeton.studio.gef.core.CorePackage;
import com.primeton.studio.gef.core.Location;
import com.primeton.studio.gef.core.NodeElement;
import com.primeton.studio.gef.core.NodeElementLabel;
import com.primeton.studio.gef.core.Size;
import com.primeton.studio.gef.core.TNodeType;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Node Element</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#getParent <em>Parent</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#getTargetConnections <em>Target Connections</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#getSourceConnections <em>Source Connections</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#getLocation <em>Location</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#getSize <em>Size</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#isCollapsed <em>Collapsed</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#getNodeType <em>Node Type</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#isGrouped <em>Grouped</em>}</li>
* <li>{@link com.primeton.studio.gef.core.impl.NodeElementImpl#getNodeLabel <em>Node Label</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class NodeElementImpl extends NodeImpl implements NodeElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "";
/**
* The cached value of the '{@link #getParent() <em>Parent</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParent()
* @generated
* @ordered
*/
protected NodeElement parent = null;
/**
* The cached value of the '{@link #getTargetConnections() <em>Target Connections</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTargetConnections()
* @generated
* @ordered
*/
protected EList targetConnections = null;
/**
* The cached value of the '{@link #getSourceConnections() <em>Source Connections</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSourceConnections()
* @generated
* @ordered
*/
protected EList sourceConnections = null;
/**
* The cached value of the '{@link #getLocation() <em>Location</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLocation()
* @generated
* @ordered
*/
protected Location location = null;
/**
* The cached value of the '{@link #getSize() <em>Size</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSize()
* @generated
* @ordered
*/
protected Size size = null;
/**
* The default value of the '{@link #isCollapsed() <em>Collapsed</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isCollapsed()
* @generated
* @ordered
*/
protected static final boolean COLLAPSED_EDEFAULT = false;
/**
* The cached value of the '{@link #isCollapsed() <em>Collapsed</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isCollapsed()
* @generated
* @ordered
*/
protected boolean collapsed = COLLAPSED_EDEFAULT;
/**
* The default value of the '{@link #getNodeType() <em>Node Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNodeType()
* @generated
* @ordered
*/
protected static final TNodeType NODE_TYPE_EDEFAULT = TNodeType.COMMON_LITERAL;
/**
* The cached value of the '{@link #getNodeType() <em>Node Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNodeType()
* @generated
* @ordered
*/
protected TNodeType nodeType = NODE_TYPE_EDEFAULT;
/**
* The default value of the '{@link #isGrouped() <em>Grouped</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isGrouped()
* @ordered
*/
protected static final boolean GROUPED_EDEFAULT = false;
/**
* The cached value of the '{@link #isGrouped() <em>Grouped</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isGrouped()
* @generated
* @ordered
*/
protected boolean grouped = GROUPED_EDEFAULT;
/**
* The cached value of the '{@link #getNodeLabel() <em>Node Label</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNodeLabel()
* @generated
* @ordered
*/
protected NodeElementLabel nodeLabel = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected NodeElementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return CorePackage.Literals.NODE_ELEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NodeElement getParent() {
return parent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetParent(NodeElement newParent, NotificationChain msgs) {
NodeElement oldParent = parent;
parent = newParent;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CorePackage.NODE_ELEMENT__PARENT, oldParent, newParent);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParent(NodeElement newParent) {
if (newParent != parent) {
NotificationChain msgs = null;
if (parent != null)
msgs = ((InternalEObject)parent).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CorePackage.NODE_ELEMENT__PARENT, null, msgs);
if (newParent != null)
msgs = ((InternalEObject)newParent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CorePackage.NODE_ELEMENT__PARENT, null, msgs);
msgs = basicSetParent(newParent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.NODE_ELEMENT__PARENT, newParent, newParent));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getTargetConnections() {
if (targetConnections == null) {
targetConnections = new EObjectEList(Connection.class, this, CorePackage.NODE_ELEMENT__TARGET_CONNECTIONS);
}
return targetConnections;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getSourceConnections() {
if (sourceConnections == null) {
sourceConnections = new EObjectContainmentEList(Connection.class, this, CorePackage.NODE_ELEMENT__SOURCE_CONNECTIONS);
}
return sourceConnections;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Location getLocation() {
return location;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLocation(Location newLocation, NotificationChain msgs) {
Location oldLocation = location;
location = newLocation;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CorePackage.NODE_ELEMENT__LOCATION, oldLocation, newLocation);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLocation(Location newLocation) {
if (newLocation != location) {
NotificationChain msgs = null;
if (location != null)
msgs = ((InternalEObject)location).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CorePackage.NODE_ELEMENT__LOCATION, null, msgs);
if (newLocation != null)
msgs = ((InternalEObject)newLocation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CorePackage.NODE_ELEMENT__LOCATION, null, msgs);
msgs = basicSetLocation(newLocation, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.NODE_ELEMENT__LOCATION, newLocation, newLocation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Size getSize() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -