Search in sources :

Example 1 with FeatureGraphic

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());
}
Also used : FeatureGraphic(org.osate.ge.graphics.internal.FeatureGraphic) BusinessObjectContext(org.osate.ge.BusinessObjectContext) NamedElement(org.osate.aadl2.NamedElement)

Example 2 with FeatureGraphic

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());
}
Also used : FeatureGraphic(org.osate.ge.graphics.internal.FeatureGraphic) FeatureInstance(org.osate.aadl2.instance.FeatureInstance)

Aggregations

FeatureGraphic (org.osate.ge.graphics.internal.FeatureGraphic)2 NamedElement (org.osate.aadl2.NamedElement)1 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)1 BusinessObjectContext (org.osate.ge.BusinessObjectContext)1