Search in sources :

Example 6 with StyleDefinition

use of org.kie.workbench.common.stunner.svg.gen.model.StyleDefinition in project kie-wb-common by kiegroup.

the class SVGTranslationTestAssertions method assertPath.

public static void assertPath(final MultiPathDefinition pathDefinition) {
    assertEquals("M150 0 L75 200 L225 200 Z", pathDefinition.getPath());
    assertEquals("p1", pathDefinition.getId());
    assertEquals(1d, pathDefinition.getAlpha(), 0d);
    assertEquals(0d, pathDefinition.getX(), 0d);
    assertEquals(0d, pathDefinition.getY(), 0d);
    final TransformDefinition transformDefinition = pathDefinition.getTransformDefinition();
    assertTransformDef(transformDefinition, 0.25d, 0.25d, 10d, 10d);
    final StyleDefinition styleDefinition = pathDefinition.getStyleDefinition();
    assertStyleDef(styleDefinition, 1d, "#ff0000", 1d, "#0000ff", 1d, 2d);
}
Also used : TransformDefinition(org.kie.workbench.common.stunner.svg.gen.model.TransformDefinition) StyleDefinition(org.kie.workbench.common.stunner.svg.gen.model.StyleDefinition)

Example 7 with StyleDefinition

use of org.kie.workbench.common.stunner.svg.gen.model.StyleDefinition in project kie-wb-common by kiegroup.

the class SVGTranslationTestAssertions method assertRectangle.

public static void assertRectangle(final RectDefinition rectDefinition) {
    assertNotNull(rectDefinition);
    assertEquals("r1", rectDefinition.getId());
    assertEquals(1d, rectDefinition.getAlpha(), 0d);
    assertEquals(1d, rectDefinition.getX(), 0d);
    assertEquals(2d, rectDefinition.getY(), 0d);
    assertEquals(200d, rectDefinition.getWidth(), 0d);
    assertEquals(230d, rectDefinition.getHeight(), 0d);
    assertEquals(15d, rectDefinition.getCornerRadius(), 0d);
    final TransformDefinition transformDefinition = rectDefinition.getTransformDefinition();
    assertTransformDef(transformDefinition, 0.5d, 0.5d, 25d, 30d);
    final StyleDefinition styleDefinition = rectDefinition.getStyleDefinition();
    assertStyleDef(styleDefinition, 1d, "#0000ff", 1d, "#000000", 1d, 3d);
}
Also used : TransformDefinition(org.kie.workbench.common.stunner.svg.gen.model.TransformDefinition) StyleDefinition(org.kie.workbench.common.stunner.svg.gen.model.StyleDefinition)

Aggregations

StyleDefinition (org.kie.workbench.common.stunner.svg.gen.model.StyleDefinition)7 TransformDefinition (org.kie.workbench.common.stunner.svg.gen.model.TransformDefinition)3 CSSStyleRuleImpl (com.steadystate.css.dom.CSSStyleRuleImpl)1 CSSStyleSheetImpl (com.steadystate.css.dom.CSSStyleSheetImpl)1 InputStreamReader (java.io.InputStreamReader)1 StyleSheetDefinition (org.kie.workbench.common.stunner.svg.gen.model.StyleSheetDefinition)1 InputSource (org.w3c.css.sac.InputSource)1 CSSRule (org.w3c.dom.css.CSSRule)1 CSSRuleList (org.w3c.dom.css.CSSRuleList)1 CSSStyleDeclaration (org.w3c.dom.css.CSSStyleDeclaration)1