Search in sources :

Example 1 with FeatureType

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

the class GroupPrototypeHolderItemProvider method getImage.

/**
 * This returns GroupPrototypeHolder.gif.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 */
@Override
public Object getImage(Object object) {
    String imgFile = BehaviorElementItemProvider.OSATE_IMG_PATH;
    PrototypeHolder holder = (PrototypeHolder) object;
    PrototypeBinding pb = holder.getPrototypeBinding();
    if (pb != null) {
        FeatureType type = FeatureType.ABSTRACT_FEATURE;
        if (pb instanceof ComponentPrototypeBinding) {
            type = AadlBaUtils.getCompPrototypeType((ComponentPrototypeBinding) pb);
        } else if (pb instanceof FeatureGroupPrototypeBinding) {
            type = FeatureType.FEATURE_GROUP_PROTOTYPE;
        } else if (pb instanceof FeaturePrototypeBinding) {
            type = AadlBaUtils.getFeatPrototypeType((FeaturePrototypeBinding) pb);
        }
        switch(type) {
            case FEATURE_GROUP_PROTOTYPE:
                {
                    imgFile += "FeatureGroup";
                    break;
                }
            case THREAD_GROUP_PROTOTYPE:
                {
                    imgFile += "ThreadGroup";
                    break;
                }
            case REQUIRES_SUBPROGRAM_GROUP_ACCESS_PROTOTYPE:
            case PROVIDES_SUBPROGRAM_GROUP_ACCESS_PROTOTYPE:
            case SUBPROGRAM_GROUP_PROTOTYPE:
                {
                    imgFile += "Subprogram";
                    break;
                }
            default:
                imgFile = "full/obj16/IfStatement";
        }
    }
    return overlayImage(object, getResourceLocator().getImage(imgFile));
}
Also used : FeatureType(org.osate.ba.aadlba.FeatureType) FeatureGroupPrototypeBinding(org.osate.aadl2.FeatureGroupPrototypeBinding) ComponentPrototypeBinding(org.osate.aadl2.ComponentPrototypeBinding) FeaturePrototypeBinding(org.osate.aadl2.FeaturePrototypeBinding) ComponentPrototypeBinding(org.osate.aadl2.ComponentPrototypeBinding) FeatureGroupPrototypeBinding(org.osate.aadl2.FeatureGroupPrototypeBinding) FeaturePrototypeBinding(org.osate.aadl2.FeaturePrototypeBinding) PrototypeBinding(org.osate.aadl2.PrototypeBinding) PrototypeHolder(org.osate.ba.aadlba.PrototypeHolder)

Aggregations

ComponentPrototypeBinding (org.osate.aadl2.ComponentPrototypeBinding)1 FeatureGroupPrototypeBinding (org.osate.aadl2.FeatureGroupPrototypeBinding)1 FeaturePrototypeBinding (org.osate.aadl2.FeaturePrototypeBinding)1 PrototypeBinding (org.osate.aadl2.PrototypeBinding)1 FeatureType (org.osate.ba.aadlba.FeatureType)1 PrototypeHolder (org.osate.ba.aadlba.PrototypeHolder)1