Search in sources :

Example 6 with ITextWrapper

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

the class TextWrapperProviderTest method testNoWrap.

@Test
public void testNoWrap() {
    final ITextWrapper wrapper = TextWrapperProvider.get(TextWrapperStrategy.NO_WRAP, text);
    assertTrue(wrapper instanceof TextNoWrap);
}
Also used : TextNoWrap(com.ait.lienzo.client.core.shape.TextNoWrap) ITextWrapper(com.ait.lienzo.client.core.shape.ITextWrapper) Test(org.junit.Test)

Example 7 with ITextWrapper

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

the class WiresTextDecoratorTest method testSetTextWrapperStrategy.

private void testSetTextWrapperStrategy(final TextWrapperStrategy wrapperStrategy) {
    final Text text = decorator.getView();
    final ITextWrapper expectedWrapper = TextWrapperProvider.get(wrapperStrategy, text);
    decorator.setTextWrapper(wrapperStrategy);
    verify(decorator).setTextBoundaries(any(BoundingBox.class));
    assertEquals(expectedWrapper.getClass(), text.getWrapper().getClass());
}
Also used : ITextWrapper(com.ait.lienzo.client.core.shape.ITextWrapper) BoundingBox(com.ait.lienzo.client.core.types.BoundingBox) Text(com.ait.lienzo.client.core.shape.Text)

Example 8 with ITextWrapper

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

the class TextWrapperProviderTest method testBounds.

@Test
public void testBounds() {
    final ITextWrapper wrapper = TextWrapperProvider.get(TextWrapperStrategy.BOUNDS, text);
    assertTrue(wrapper instanceof TextBoundsWrap);
}
Also used : ITextWrapper(com.ait.lienzo.client.core.shape.ITextWrapper) TextBoundsWrap(com.ait.lienzo.client.core.shape.TextBoundsWrap) Test(org.junit.Test)

Aggregations

ITextWrapper (com.ait.lienzo.client.core.shape.ITextWrapper)8 Test (org.junit.Test)6 Text (com.ait.lienzo.client.core.shape.Text)1 TextBoundsAndLineBreaksWrap (com.ait.lienzo.client.core.shape.TextBoundsAndLineBreaksWrap)1 TextBoundsWrap (com.ait.lienzo.client.core.shape.TextBoundsWrap)1 TextLineBreakTruncateWrapper (com.ait.lienzo.client.core.shape.TextLineBreakTruncateWrapper)1 TextLineBreakWrap (com.ait.lienzo.client.core.shape.TextLineBreakWrap)1 TextNoWrap (com.ait.lienzo.client.core.shape.TextNoWrap)1 TextTruncateWrapper (com.ait.lienzo.client.core.shape.TextTruncateWrapper)1 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)1