Search in sources :

Example 1 with FontSize

use of org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize in project kie-wb-common by kiegroup.

the class BaseArtifactsTest method testEquals.

@Test
public void testEquals() {
    assertTrue(tested.equals(new DataObject()));
    assertFalse(tested.equals(""));
    final DataObject dataObject = new DataObject();
    BgColor color = new BgColor();
    color.setValue("Black");
    dataObject.getBackgroundSet().setBgColor(color);
    assertFalse(tested.equals(dataObject));
    tested.getBackgroundSet().setBgColor(color);
    assertTrue(tested.equals(dataObject));
    dataObject.getFontSet().setFontSize(new FontSize(11.0));
    assertFalse(tested.equals(dataObject));
    tested.getFontSet().setFontSize(new FontSize(11.0));
    assertTrue(tested.equals(dataObject));
    dataObject.getDimensionsSet().setHeight(new Height(11.0));
    assertFalse(tested.equals(dataObject));
    tested.getDimensionsSet().setHeight(new Height(11.0));
    assertTrue(tested.equals(dataObject));
}
Also used : FontSize(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize) Height(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Height) BgColor(org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor) Test(org.junit.Test)

Example 2 with FontSize

use of org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize in project kie-wb-common by kiegroup.

the class BasePropertyReader method getFontSet.

@Override
public FontSet getFontSet() {
    final FontFamily fontFamily = new FontFamily();
    final FontColor fontColor = new FontColor(optionalAttribute("fontcolor").orElse(colorsDefaultFont()));
    final FontSize fontSize = new FontSize(optionalAttribute("fontsize").map(Double::parseDouble).orElse(null));
    final FontBorderSize fontBorderSize = new FontBorderSize();
    final FontBorderColor fontBorderColor = new FontBorderColor();
    return new FontSet(fontFamily, fontColor, fontSize, fontBorderSize, fontBorderColor);
}
Also used : FontFamily(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontFamily) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) FontSize(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize) FontColor(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontColor) FontBorderColor(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontBorderColor) FontBorderSize(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontBorderSize)

Example 3 with FontSize

use of org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize in project kie-wb-common by kiegroup.

the class DataObjectTest method testNotEquals.

@Test
public void testNotEquals() {
    DataObject dataObject1 = new DataObject();
    DataObject dataObject2 = new DataObject();
    dataObject1.setName(new Name("dataObject1"));
    dataObject2.setName(new Name("dataObject2"));
    // Test Name
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setName(new Name("dataObject1"));
    assertEquals(dataObject1, dataObject2);
    // Test Type
    DataObjectType dataObjectType = new DataObjectType();
    dataObjectType.setValue(new DataObjectTypeValue("someType"));
    dataObject2.setType(dataObjectType);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setType(new DataObjectType());
    assertEquals(dataObject1, dataObject2);
    // Test General Set
    BPMNGeneralSet generalSet = new BPMNGeneralSet();
    generalSet.setName(new Name("someName"));
    dataObject2.setGeneral(generalSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setGeneral(new BPMNGeneralSet());
    assertEquals(dataObject1, dataObject2);
    // Test Background Set
    BackgroundSet backgroundSet = new BackgroundSet();
    backgroundSet.setBgColor(new BgColor("Black"));
    dataObject2.setBackgroundSet(backgroundSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setBackgroundSet(new BackgroundSet());
    assertEquals(dataObject1, dataObject2);
    // Test Font Set
    FontSet fontSet = new FontSet();
    fontSet.setFontSize(new FontSize(11.0));
    dataObject2.setFontSet(fontSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setFontSet(new FontSet());
    assertEquals(dataObject1, dataObject2);
    // Test Dimension Set
    RectangleDimensionsSet rectangleDimensionsSet = new RectangleDimensionsSet(100.0, 100.0);
    dataObject2.setDimensionsSet(rectangleDimensionsSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setDimensionsSet(new RectangleDimensionsSet());
    assertEquals(dataObject1, dataObject2);
}
Also used : FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) FontSize(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue) BgColor(org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor) DataObjectType(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) Test(org.junit.Test)

Aggregations

FontSize (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize)3 Test (org.junit.Test)2 BgColor (org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor)2 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)2 DataObjectType (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType)1 DataObjectTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue)1 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)1 Height (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Height)1 RectangleDimensionsSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet)1 FontBorderColor (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontBorderColor)1 FontBorderSize (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontBorderSize)1 FontColor (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontColor)1 FontFamily (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontFamily)1 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1