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));
}
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);
}
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);
}
Aggregations