use of org.osate.ge.graphics.internal.FeatureGraphic in project osate2 by osate.
the class FeatureHandler method getGraphicalConfiguration.
@Override
public Optional<GraphicalConfiguration> getGraphicalConfiguration(final GetGraphicalConfigurationContext ctx) {
final BusinessObjectContext featureBoc = ctx.getBusinessObjectContext();
final NamedElement feature = featureBoc.getBusinessObject(NamedElement.class).get();
final FeatureGraphic graphic = getGraphicalRepresentation(feature, featureBoc);
return Optional.of(GraphicalConfigurationBuilder.create().graphic(graphic).annotation(AadlGraphics.getFeatureAnnotation(feature.eClass())).style(StyleBuilder.create(AadlInheritanceUtil.isInherited(featureBoc) ? Styles.INHERITED_ELEMENT : Style.EMPTY).backgroundColor(AadlGraphics.getDefaultBackgroundColor(graphic.featureType)).labelsAboveTop().labelsLeft().build()).defaultDockingPosition(getDefaultDockingPosition(feature, featureBoc)).build());
}
use of org.osate.ge.graphics.internal.FeatureGraphic in project osate2 by osate.
the class FeatureInstanceHandler method getGraphicalConfiguration.
@Override
public Optional<GraphicalConfiguration> getGraphicalConfiguration(final GetGraphicalConfigurationContext ctx) {
final FeatureInstance fi = ctx.getBusinessObjectContext().getBusinessObject(FeatureInstance.class).get();
final FeatureGraphic graphic = getGraphicalRepresentation(fi);
return Optional.of(GraphicalConfigurationBuilder.create().graphic(graphic).annotation(AadlGraphics.getFeatureAnnotation(fi.getFeature().eClass())).style(StyleBuilder.create().backgroundColor(AadlGraphics.getDefaultBackgroundColor(graphic.featureType)).labelsAboveTop().labelsLeft().build()).defaultDockingPosition(getDefaultDockingPosition(fi)).build());
}
Aggregations