Search in sources :

Example 1 with EventPortHolder

use of org.osate.ba.aadlba.EventPortHolder in project osate2 by osate.

the class AadlBaParserVisitor method cloneHolder.

private ElementHolder cloneHolder(ElementHolder sourceElementHolder) {
    ElementHolder targetElementHolder = null;
    if (sourceElementHolder instanceof ClassifierFeatureHolder) {
        ClassifierFeatureHolder sourceCfh = (ClassifierFeatureHolder) sourceElementHolder;
        if (sourceElementHolder instanceof BehaviorVariableHolder) {
            // BehaviorVariableHolder
            targetElementHolder = _baFact.createBehaviorVariableHolder();
        } else if (sourceElementHolder instanceof FeatureHolder) {
            FeatureHolder sourceFeatureHolder = (FeatureHolder) sourceElementHolder;
            // FeatureHolder
            if (sourceFeatureHolder instanceof DataAccessHolder) {
                // DataAccessHolder
                targetElementHolder = _baFact.createDataAccessHolder();
            } else if (sourceFeatureHolder instanceof ParameterHolder) {
                // ParameterHolder
                targetElementHolder = _baFact.createParameterHolder();
            } else if (sourceFeatureHolder instanceof DataPortHolder) {
                targetElementHolder = _baFact.createDataPortHolder();
            } else if (sourceFeatureHolder instanceof EventDataPortHolder) {
                targetElementHolder = _baFact.createEventDataPortHolder();
            } else if (sourceFeatureHolder instanceof EventPortHolder) {
                targetElementHolder = _baFact.createEventPortHolder();
            } else if (sourceFeatureHolder instanceof SubprogramAccessHolder) {
                targetElementHolder = _baFact.createSubprogramAccessHolder();
            }
        } else // PrototypeHolder
        if (sourceElementHolder instanceof PrototypeHolder) {
            // DataAccessPrototypeHolder
            if (sourceElementHolder instanceof DataAccessPrototypeHolder) {
                targetElementHolder = _baFact.createDataAccessPrototypeHolder();
            } else if (sourceElementHolder instanceof FeaturePrototypeHolder) {
                targetElementHolder = _baFact.createFeaturePrototypeHolder();
            } else if (sourceElementHolder instanceof PortPrototypeHolder) {
                targetElementHolder = _baFact.createPortPrototypeHolder();
            } else if (sourceElementHolder instanceof SubprogramPrototypeHolder) {
                targetElementHolder = _baFact.createSubprogramPrototypeHolder();
            }
        } else // SubcomponentHolder
        if (sourceElementHolder instanceof SubcomponentHolder) {
            // DataSubcomponentHolder
            if (sourceElementHolder instanceof DataSubcomponentHolder) {
                targetElementHolder = _baFact.createDataSubcomponentHolder();
            } else if (sourceElementHolder instanceof SubprogramSubcomponentHolder) {
                targetElementHolder = _baFact.createSubprogramSubcomponentHolder();
            }
        }
        ClassifierFeatureHolder targetCfh = (ClassifierFeatureHolder) targetElementHolder;
        targetCfh.setClassifierFeature(sourceCfh.getClassifierFeature());
    }
    if (targetElementHolder != null) {
        targetElementHolder.setElement(sourceElementHolder.getElement());
    }
    return targetElementHolder;
}
Also used : DataAccessHolder(org.osate.ba.aadlba.DataAccessHolder) PortPrototypeHolder(org.osate.ba.aadlba.PortPrototypeHolder) ClassifierFeatureHolder(org.osate.ba.aadlba.ClassifierFeatureHolder) FeatureHolder(org.osate.ba.aadlba.FeatureHolder) FeaturePrototypeHolder(org.osate.ba.aadlba.FeaturePrototypeHolder) SubprogramSubcomponentHolder(org.osate.ba.aadlba.SubprogramSubcomponentHolder) ElementHolder(org.osate.ba.aadlba.ElementHolder) PropertyElementHolder(org.osate.ba.aadlba.PropertyElementHolder) ClassifierFeatureHolder(org.osate.ba.aadlba.ClassifierFeatureHolder) BehaviorVariableHolder(org.osate.ba.aadlba.BehaviorVariableHolder) EventPortHolder(org.osate.ba.aadlba.EventPortHolder) SubcomponentHolder(org.osate.ba.aadlba.SubcomponentHolder) DataSubcomponentHolder(org.osate.ba.aadlba.DataSubcomponentHolder) SubprogramSubcomponentHolder(org.osate.ba.aadlba.SubprogramSubcomponentHolder) EventDataPortHolder(org.osate.ba.aadlba.EventDataPortHolder) DataPortHolder(org.osate.ba.aadlba.DataPortHolder) DataSubcomponentHolder(org.osate.ba.aadlba.DataSubcomponentHolder) EventDataPortHolder(org.osate.ba.aadlba.EventDataPortHolder) DataAccessPrototypeHolder(org.osate.ba.aadlba.DataAccessPrototypeHolder) ParameterHolder(org.osate.ba.aadlba.ParameterHolder) SubprogramAccessHolder(org.osate.ba.aadlba.SubprogramAccessHolder) PrototypeHolder(org.osate.ba.aadlba.PrototypeHolder) PortPrototypeHolder(org.osate.ba.aadlba.PortPrototypeHolder) SubprogramPrototypeHolder(org.osate.ba.aadlba.SubprogramPrototypeHolder) DataAccessPrototypeHolder(org.osate.ba.aadlba.DataAccessPrototypeHolder) FeaturePrototypeHolder(org.osate.ba.aadlba.FeaturePrototypeHolder) SubprogramPrototypeHolder(org.osate.ba.aadlba.SubprogramPrototypeHolder)

Example 2 with EventPortHolder

use of org.osate.ba.aadlba.EventPortHolder in project osate2 by osate.

the class EventPortHolderItemProvider method getImage.

/**
 * This returns EventPortHolder.gif.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 */
@Override
public Object getImage(Object object) {
    String imgFile = BehaviorElementItemProvider.OSATE_IMG_PATH;
    EventPortHolder holder = (EventPortHolder) object;
    switch(holder.getEventPort().getDirection()) {
        default:
        case IN:
            {
                imgFile += "InEventPort";
                break;
            }
        case OUT:
            {
                imgFile += "OutEventPort";
                break;
            }
        case IN_OUT:
            {
                imgFile += "InOutEventPort";
                break;
            }
    }
    return overlayImage(object, getResourceLocator().getImage(imgFile));
}
Also used : EventPortHolder(org.osate.ba.aadlba.EventPortHolder)

Aggregations

EventPortHolder (org.osate.ba.aadlba.EventPortHolder)2 BehaviorVariableHolder (org.osate.ba.aadlba.BehaviorVariableHolder)1 ClassifierFeatureHolder (org.osate.ba.aadlba.ClassifierFeatureHolder)1 DataAccessHolder (org.osate.ba.aadlba.DataAccessHolder)1 DataAccessPrototypeHolder (org.osate.ba.aadlba.DataAccessPrototypeHolder)1 DataPortHolder (org.osate.ba.aadlba.DataPortHolder)1 DataSubcomponentHolder (org.osate.ba.aadlba.DataSubcomponentHolder)1 ElementHolder (org.osate.ba.aadlba.ElementHolder)1 EventDataPortHolder (org.osate.ba.aadlba.EventDataPortHolder)1 FeatureHolder (org.osate.ba.aadlba.FeatureHolder)1 FeaturePrototypeHolder (org.osate.ba.aadlba.FeaturePrototypeHolder)1 ParameterHolder (org.osate.ba.aadlba.ParameterHolder)1 PortPrototypeHolder (org.osate.ba.aadlba.PortPrototypeHolder)1 PropertyElementHolder (org.osate.ba.aadlba.PropertyElementHolder)1 PrototypeHolder (org.osate.ba.aadlba.PrototypeHolder)1 SubcomponentHolder (org.osate.ba.aadlba.SubcomponentHolder)1 SubprogramAccessHolder (org.osate.ba.aadlba.SubprogramAccessHolder)1 SubprogramPrototypeHolder (org.osate.ba.aadlba.SubprogramPrototypeHolder)1 SubprogramSubcomponentHolder (org.osate.ba.aadlba.SubprogramSubcomponentHolder)1