use of org.osate.ge.graphics.internal.FeatureGraphicBuilder in project osate2 by osate.
the class AadlGraphics method getFeatureGraphic.
public static FeatureGraphic getFeatureGraphic(final EClass featureClass, DirectionType direction) {
final FeatureGraphicBuilder builder = FeatureGraphicBuilder.create();
// Configure the feature type
final Aadl2Package aadl2Pkg = Aadl2Package.eINSTANCE;
if (featureClass == aadl2Pkg.getAbstractFeature()) {
builder.abstractFeature();
} else if (featureClass == aadl2Pkg.getEventPort()) {
builder.eventPort();
} else if (featureClass == aadl2Pkg.getDataPort() || featureClass == aadl2Pkg.getParameter()) {
builder.dataPort();
} else if (featureClass == aadl2Pkg.getEventDataPort()) {
builder.eventDataPort();
} else if (featureClass == aadl2Pkg.getSubprogramAccess()) {
builder.subprogramAccess();
} else if (featureClass == aadl2Pkg.getSubprogramGroupAccess()) {
builder.subprogramGroupAccess();
} else if (featureClass == aadl2Pkg.getDataAccess()) {
builder.dataAccess();
} else if (featureClass == aadl2Pkg.getBusAccess()) {
builder.busAccess();
} else if (featureClass == aadl2Pkg.getFeatureGroup()) {
builder.featureGroup();
} else if (featureClass == aadl2Pkg.getPortProxy()) {
builder.portProxy();
} else if (featureClass == aadl2Pkg.getEventSource()) {
builder.eventSource();
} else if (featureClass == aadl2Pkg.getEventDataSource()) {
builder.eventDataSource();
} else if (featureClass == aadl2Pkg.getSubprogramProxy()) {
builder.subprogramProxy();
}
switch(direction) {
case IN:
builder.input();
break;
case OUT:
builder.output();
break;
case IN_OUT:
builder.bidirectional();
break;
}
return builder.build();
}
Aggregations