use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class AbstractWiresShapeViewText method setUp.
public void setUp() {
this.text = new Text("test");
this.layout = new LabelLayout.Builder().horizontalAlignment(DirectionLayout.HorizontalAlignment.CENTER).verticalAlignment(DirectionLayout.VerticalAlignment.MIDDLE).referencePosition(DirectionLayout.ReferencePosition.INSIDE).build();
when(textDecorator.getView()).thenReturn(text);
when(textDecorator.getLabelLayout()).thenReturn(layout);
this.tested = spy(createInstance());
this.tested.setTextViewDecorator(textDecorator);
verify(tested, never()).addLabel(any(), any());
}
use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class WiresTextDecoratorTest method testMoveTitleToFront.
@Test
public void testMoveTitleToFront() throws NoSuchFieldException, IllegalAccessException {
final Text text = spy(new Text(""));
final WiresTextDecorator localDecorator = new WiresTextDecorator(eventHandlerManager, shape);
final NFastArrayList<WiresShape> children = new NFastArrayList<>();
children.add(child1);
children.add(child2);
when(child1.getGroup()).thenReturn(mock(Group.class));
when(child2.getGroup()).thenReturn(mock(Group.class));
when(shape.getChildShapes()).thenReturn(children);
final Field field = localDecorator.getClass().getDeclaredField("text");
field.setAccessible(true);
field.set(localDecorator, text);
localDecorator.moveTitleToTop();
InOrder order = inOrder(text, child1.getGroup(), child2.getGroup());
order.verify(text).moveToTop();
order.verify(child1.getGroup()).moveToTop();
order.verify(child2.getGroup()).moveToTop();
}
use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class WiresTextDecoratorTest method testBatch.
@Test
public void testBatch() throws IllegalAccessException, NoSuchFieldException {
Text text = spy(new Text(""));
final WiresTextDecorator localDecorator = new WiresTextDecorator(eventHandlerManager, shape);
final Field field = localDecorator.getClass().getDeclaredField("text");
field.setAccessible(true);
field.set(localDecorator, text);
localDecorator.batch();
verify(text).batch();
}
use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class RendererUtils method getEditableHeaderText.
public static Group getEditableHeaderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context, final double blockWidth, final double blockHeight) {
final Group headerGroup = GWT.create(Group.class);
final GridRenderer renderer = context.getRenderer();
final GridRendererTheme theme = renderer.getTheme();
final Text text = theme.getHeaderText();
final String value = headerMetaData.getTitle();
text.setX(blockWidth / 2);
text.setY(blockHeight / 2);
text.setText(value);
text.setListening(false);
headerGroup.add(text);
return headerGroup;
}
use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class RendererUtils method getEditableHeaderPlaceHolderText.
public static Group getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context, final double blockWidth, final double blockHeight) {
final Group headerGroup = GWT.create(Group.class);
headerMetaData.getPlaceHolder().ifPresent(placeHolder -> {
final GridRenderer renderer = context.getRenderer();
final GridRendererTheme theme = renderer.getTheme();
final Text text = theme.getPlaceholderText();
text.setX(blockWidth / 2);
text.setY(blockHeight / 2);
text.setText(placeHolder);
text.setListening(false);
headerGroup.add(text);
});
return headerGroup;
}
Aggregations