Search in sources :

Example 1 with Shadow

use of com.ait.lienzo.client.core.types.Shadow in project kie-wb-common by kiegroup.

the class WiresConnectorViewTest method testSetShadow.

@Test
public void testSetShadow() {
    tested.setShadow("red", 1, 2d, 3d);
    ArgumentCaptor<Shadow> shadowArgumentCaptor = ArgumentCaptor.forClass(Shadow.class);
    verify(line, times(1)).setShadow(shadowArgumentCaptor.capture());
    final Shadow shadow = shadowArgumentCaptor.getValue();
    assertEquals("red", shadow.getColor());
    assertEquals(1, shadow.getBlur());
    assertEquals(2d, shadow.getOffset().getX(), 0d);
    assertEquals(3d, shadow.getOffset().getY(), 0d);
}
Also used : Shadow(com.ait.lienzo.client.core.types.Shadow) Test(org.junit.Test)

Example 2 with Shadow

use of com.ait.lienzo.client.core.types.Shadow in project kie-wb-common by kiegroup.

the class SVGPrimitiveShapeTest method testShadow.

@Test
public void testShadow() {
    Shape<?> instance = mock(Shape.class);
    tested = new SVGPrimitiveShape(instance);
    tested.setShadow("c1", 1, 2, 3);
    ArgumentCaptor<Shadow> shadowArgumentCaptor = ArgumentCaptor.forClass(Shadow.class);
    verify(instance, times(1)).setShadow(shadowArgumentCaptor.capture());
    Shadow shadow = shadowArgumentCaptor.getValue();
    assertEquals("c1", shadow.getColor());
    assertEquals(1, shadow.getBlur());
    assertEquals(2, shadow.getOffset().getX(), 0);
    assertEquals(3, shadow.getOffset().getY(), 0);
}
Also used : Shadow(com.ait.lienzo.client.core.types.Shadow) Test(org.junit.Test)

Example 3 with Shadow

use of com.ait.lienzo.client.core.types.Shadow in project lienzo-core by ahome-it.

the class Shape method doApplyShadow.

/**
 * Applies this shape's Shadow.
 *
 * @param context
 * @param attr
 * @return boolean
 */
protected final void doApplyShadow(final Context2D context, final Attributes attr) {
    if ((false == isAppliedShadow()) && (attr.hasShadow())) {
        setAppliedShadow(true);
        final Shadow shadow = attr.getShadow();
        if (null != shadow) {
            context.setShadow(shadow);
        }
    }
}
Also used : Shadow(com.ait.lienzo.client.core.types.Shadow)

Example 4 with Shadow

use of com.ait.lienzo.client.core.types.Shadow in project kie-wb-common by kiegroup.

the class FlowActionsToolboxView method createDecorator.

@Override
protected BoxDecorator createDecorator() {
    final BoxDecorator decorator = super.createDecorator();
    decorator.configure(path -> {
        path.setStrokeWidth(1).setStrokeColor("#0000FF").setShadow(new Shadow(ColorName.BLACK.getColor().setA(0.80), 10, 3, 3));
    });
    return decorator;
}
Also used : Shadow(com.ait.lienzo.client.core.types.Shadow) BoxDecorator(com.ait.lienzo.client.core.shape.toolbox.items.decorator.BoxDecorator)

Aggregations

Shadow (com.ait.lienzo.client.core.types.Shadow)4 Test (org.junit.Test)2 BoxDecorator (com.ait.lienzo.client.core.shape.toolbox.items.decorator.BoxDecorator)1