use of org.kie.workbench.common.stunner.svg.gen.model.impl.TransformDefinitionImpl in project kie-wb-common by kiegroup.
the class ImageDefinitionGeneratorTest method testGenerate.
@Test
public void testGenerate() throws Exception {
final ImageDefinition definition = new ImageDefinition(ID, HREF);
definition.setX(X);
definition.setY(Y);
definition.setAlpha(ALPHA);
definition.setStyleDefinition(new StyleDefinitionImpl.Builder().setAlpha(ALPHA).setFillColor(FILL_COLOR).setFillAlpha(FILL_ALPHA).setStrokeColor(STROKE_COLOR).setStrokeAlpha(STROKE_ALPHA).setStrokeWidth(STROKE_WIDTH).build());
definition.setTransformDefinition(new TransformDefinitionImpl(VBOX_WIDTH, VBOX_HEIGHT, VBOX_MIN_X, VBOX_MIN_Y));
final String generated = tested.generate(definition).toString();
assertTrue(generated.contains("new " + Picture.class.getName() + "(" + GeneratorAssertions.formatString(HREF) + ")"));
GeneratorAssertions.assertDraggable(generated);
GeneratorAssertions.assertID(generated, ID);
GeneratorAssertions.assertX(generated, X);
GeneratorAssertions.assertY(generated, Y);
GeneratorAssertions.assertAlpha(generated, ALPHA);
GeneratorAssertions.assertScale(generated, VBOX_WIDTH, VBOX_HEIGHT);
GeneratorAssertions.assertFillColor(generated, FILL_COLOR);
GeneratorAssertions.assertFillAlpha(generated, FILL_ALPHA);
GeneratorAssertions.assertStrokeColor(generated, STROKE_COLOR);
GeneratorAssertions.assertStrokeAlpha(generated, STROKE_ALPHA);
GeneratorAssertions.assertStrokeWidth(generated, STROKE_WIDTH);
GeneratorAssertions.assertListening(generated, LISTENING);
}
use of org.kie.workbench.common.stunner.svg.gen.model.impl.TransformDefinitionImpl in project kie-wb-common by kiegroup.
the class CircleDefinitionGeneratorTest method testGenerate.
@Test
public void testGenerate() throws Exception {
final CircleDefinition circleDefinition = new CircleDefinition(ID, RADIUS);
circleDefinition.setX(X);
circleDefinition.setY(Y);
circleDefinition.setAlpha(ALPHA);
circleDefinition.setStyleDefinition(new StyleDefinitionImpl.Builder().setAlpha(ALPHA).setFillColor(FILL_COLOR).setFillAlpha(FILL_ALPHA).setStrokeColor(STROKE_COLOR).setStrokeAlpha(STROKE_ALPHA).setStrokeWidth(STROKE_WIDTH).build());
circleDefinition.setTransformDefinition(new TransformDefinitionImpl(VBOX_WIDTH, VBOX_HEIGHT, VBOX_MIN_X, VBOX_MIN_Y));
final String generated = tested.generate(circleDefinition).toString();
assertTrue(generated.contains("new " + Circle.class.getName() + "(" + GeneratorAssertions.formatDouble(RADIUS) + ")"));
GeneratorAssertions.assertDraggable(generated);
GeneratorAssertions.assertID(generated, ID);
GeneratorAssertions.assertX(generated, X);
GeneratorAssertions.assertY(generated, Y);
GeneratorAssertions.assertAlpha(generated, ALPHA);
GeneratorAssertions.assertScale(generated, VBOX_WIDTH, VBOX_HEIGHT);
GeneratorAssertions.assertFillColor(generated, FILL_COLOR);
GeneratorAssertions.assertFillAlpha(generated, FILL_ALPHA);
GeneratorAssertions.assertStrokeColor(generated, STROKE_COLOR);
GeneratorAssertions.assertStrokeAlpha(generated, STROKE_ALPHA);
GeneratorAssertions.assertStrokeWidth(generated, STROKE_WIDTH);
GeneratorAssertions.assertListening(generated, LISTENING);
}
use of org.kie.workbench.common.stunner.svg.gen.model.impl.TransformDefinitionImpl in project kie-wb-common by kiegroup.
the class GroupDefinitionGeneratorTest method testGenerate.
@Test
public void testGenerate() throws Exception {
final GroupDefinition definition = new GroupDefinition(ID);
definition.setX(X);
definition.setY(Y);
definition.setAlpha(ALPHA);
definition.setTransformDefinition(new TransformDefinitionImpl(VBOX_WIDTH, VBOX_HEIGHT, VBOX_MIN_X, VBOX_MIN_Y));
final String generated = tested.generate(definition).toString();
assertTrue(generated.contains("new " + Group.class.getName() + "()"));
GeneratorAssertions.assertDraggable(generated);
GeneratorAssertions.assertID(generated, ID);
GeneratorAssertions.assertX(generated, X);
GeneratorAssertions.assertY(generated, Y);
GeneratorAssertions.assertAlpha(generated, ALPHA);
GeneratorAssertions.assertScale(generated, VBOX_WIDTH, VBOX_HEIGHT);
GeneratorAssertions.assertListening(generated, LISTENING);
}
use of org.kie.workbench.common.stunner.svg.gen.model.impl.TransformDefinitionImpl in project kie-wb-common by kiegroup.
the class MultiPathDefinitionGeneratorTest method testGenerate.
@Test
public void testGenerate() throws Exception {
final MultiPathDefinition definition = new MultiPathDefinition(ID, PATH);
definition.setX(X);
definition.setY(Y);
definition.setAlpha(ALPHA);
definition.setStyleDefinition(new StyleDefinitionImpl.Builder().setAlpha(ALPHA).setFillColor(FILL_COLOR).setFillAlpha(FILL_ALPHA).setStrokeColor(STROKE_COLOR).setStrokeAlpha(STROKE_ALPHA).setStrokeWidth(STROKE_WIDTH).setStrokeDashArray(STROKE_DASHARRAY).build());
definition.setTransformDefinition(new TransformDefinitionImpl(VBOX_WIDTH, VBOX_HEIGHT, VBOX_MIN_X, VBOX_MIN_Y));
final String generated = tested.generate(definition).toString();
assertTrue(generated.contains("new " + MultiPath.class.getName() + "(" + SVGViewFactoryGenerator.FIELD_STATICS + ID.toUpperCase() + ")"));
GeneratorAssertions.assertDraggable(generated);
GeneratorAssertions.assertID(generated, ID);
GeneratorAssertions.assertX(generated, X);
GeneratorAssertions.assertY(generated, Y);
GeneratorAssertions.assertAlpha(generated, ALPHA);
GeneratorAssertions.assertScale(generated, VBOX_WIDTH, VBOX_HEIGHT);
GeneratorAssertions.assertFillColor(generated, FILL_COLOR);
GeneratorAssertions.assertFillAlpha(generated, FILL_ALPHA);
GeneratorAssertions.assertStrokeColor(generated, STROKE_COLOR);
GeneratorAssertions.assertStrokeAlpha(generated, STROKE_ALPHA);
GeneratorAssertions.assertStrokeWidth(generated, STROKE_WIDTH);
GeneratorAssertions.assertStrokeDashArray(generated, STROKE_DASHARRAY);
GeneratorAssertions.assertListening(generated, LISTENING);
}
use of org.kie.workbench.common.stunner.svg.gen.model.impl.TransformDefinitionImpl in project kie-wb-common by kiegroup.
the class RectangleDefinitionGeneratorTest method testGenerate.
@Test
public void testGenerate() throws Exception {
final RectDefinition definition = new RectDefinition(ID, WIDTH, HEIGHT, CORNER_RADIUS);
definition.setX(X);
definition.setY(Y);
definition.setAlpha(ALPHA);
definition.setStyleDefinition(new StyleDefinitionImpl.Builder().setAlpha(ALPHA).setFillColor(FILL_COLOR).setFillAlpha(FILL_ALPHA).setStrokeColor(STROKE_COLOR).setStrokeAlpha(STROKE_ALPHA).setStrokeWidth(STROKE_WIDTH).build());
definition.setTransformDefinition(new TransformDefinitionImpl(VBOX_WIDTH, VBOX_HEIGHT, VBOX_MIN_X, VBOX_MIN_Y));
final String generated = tested.generate(definition).toString();
assertTrue(generated.contains("new " + Rectangle.class.getName() + "(" + GeneratorAssertions.formatDouble(WIDTH) + ", " + GeneratorAssertions.formatDouble(HEIGHT) + ")"));
GeneratorAssertions.assertDraggable(generated);
GeneratorAssertions.assertID(generated, ID);
GeneratorAssertions.assertX(generated, X);
GeneratorAssertions.assertY(generated, Y);
GeneratorAssertions.assertAlpha(generated, ALPHA);
GeneratorAssertions.assertScale(generated, VBOX_WIDTH, VBOX_HEIGHT);
GeneratorAssertions.assertFillColor(generated, FILL_COLOR);
GeneratorAssertions.assertFillAlpha(generated, FILL_ALPHA);
GeneratorAssertions.assertStrokeColor(generated, STROKE_COLOR);
GeneratorAssertions.assertStrokeAlpha(generated, STROKE_ALPHA);
GeneratorAssertions.assertStrokeWidth(generated, STROKE_WIDTH);
GeneratorAssertions.assertListening(generated, LISTENING);
}
Aggregations