Search in sources :

Example 1 with Font

use of org.camunda.bpm.model.bpmn.instance.dc.Font in project camunda-bpmn-model by camunda.

the class FontImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Font.class, DC_ELEMENT_FONT).namespaceUri(DC_NS).instanceProvider(new ModelTypeInstanceProvider<Font>() {

        public Font newInstance(ModelTypeInstanceContext instanceContext) {
            return new FontImpl(instanceContext);
        }
    });
    nameAttribute = typeBuilder.stringAttribute(DC_ATTRIBUTE_NAME).build();
    sizeAttribute = typeBuilder.doubleAttribute(DC_ATTRIBUTE_SIZE).build();
    isBoldAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_BOLD).build();
    isItalicAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_ITALIC).build();
    isUnderlineAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_UNDERLINE).build();
    isStrikeTroughAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_STRIKE_THROUGH).build();
    typeBuilder.build();
}
Also used : ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext) Font(org.camunda.bpm.model.bpmn.instance.dc.Font)

Example 2 with Font

use of org.camunda.bpm.model.bpmn.instance.dc.Font in project camunda-bpmn-model by camunda.

the class BpmnDiTest method testBpmnLabelStyle.

@Test
public void testBpmnLabelStyle() {
    BpmnLabelStyle labelStyle = modelInstance.getModelElementsByType(BpmnLabelStyle.class).iterator().next();
    Font font = labelStyle.getFont();
    assertThat(font).isNotNull();
    assertThat(font.getName()).isEqualTo("Arial");
    assertThat(font.getSize()).isEqualTo(8.0);
    assertThat(font.isBold()).isTrue();
    assertThat(font.isItalic()).isFalse();
    assertThat(font.isStrikeThrough()).isFalse();
    assertThat(font.isUnderline()).isFalse();
}
Also used : Font(org.camunda.bpm.model.bpmn.instance.dc.Font) Test(org.junit.Test)

Aggregations

Font (org.camunda.bpm.model.bpmn.instance.dc.Font)2 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 Test (org.junit.Test)1