use of com.ait.lienzo.client.core.shape.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class MorphActionsToolboxView method configureDropDown.
private void configureDropDown(final ActionsToolbox toolbox) {
final Point2DGrid grid = createFixedGrid(GRID_BUTTON_SIZE, GRID_BUTTON_PADDING, toolbox.size());
final Group glyphView = renderGlyph(StunnerCommonIconsGlyphFactory.GEARS, BUTTON_SIZE);
gridItem = getToolboxFactory().buttons().dropRight(glyphView).grid(grid).decorate(getToolboxFactory().decorators().button().setPadding(BUTTON_PADDING).configure(path -> path.setFillColor(ColorName.LIGHTGREY))).decorateGrid(getToolboxFactory().decorators().button().setPadding(GRID_DECORATOR_PADDING).configure(path -> path.setFillColor("#e6e6e6")));
getToolboxView().add(gridItem);
}
use of com.ait.lienzo.client.core.shape.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class MorphActionsToolboxViewTest method assertConfigureButtonGridItem.
private void assertConfigureButtonGridItem() {
final ArgumentCaptor<Point2DGrid> gridCaptor = ArgumentCaptor.forClass(Point2DGrid.class);
verify(buttonGridItem, times(1)).grid(gridCaptor.capture());
final FixedLayoutGrid grid = (FixedLayoutGrid) gridCaptor.getValue();
assertEquals(1, grid.getRows());
assertEquals(2, grid.getCols());
assertEquals(AbstractActionsToolboxView.BUTTON_SIZE, grid.getIconSize(), 0);
assertEquals(AbstractActionsToolboxView.BUTTON_PADDING, grid.getPadding(), 0);
verify(buttonGridItem, times(1)).decorate(eq(buttonDecorator));
verify(buttonGridItem, times(1)).decorateGrid(eq(buttonDecorator));
verify(toolboxView, times(1)).add(eq(buttonGridItem));
}
use of com.ait.lienzo.client.core.shape.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class CommonActionsToolboxViewTest method testInit.
@Test
public void testInit() {
final CommonActionsToolboxView cascade = doInit();
assertEquals(tested, cascade);
verify(toolboxFactory, times(1)).forWiresShape(eq(shape));
verify(toolboxView, times(1)).attachTo(eq(topLayer));
// Verify toolbox settings.
verify(toolboxView, times(1)).at(eq(CommonActionsToolboxView.TOOLBOX_AT));
final ArgumentCaptor<Point2DGrid> gridCaptor = ArgumentCaptor.forClass(Point2DGrid.class);
verify(toolboxView, times(1)).grid(gridCaptor.capture());
final AutoGrid grid = (AutoGrid) gridCaptor.getValue();
assertEquals(AbstractActionsToolboxView.BUTTON_SIZE, grid.getIconSize(), 0);
assertEquals(AbstractActionsToolboxView.BUTTON_PADDING, grid.getPadding(), 0);
assertEquals(CommonActionsToolboxView.GRID_TOWARDS, grid.getDirection());
// Verify toolbip.
verify(toolboxTooltip, times(1)).at(CommonActionsToolboxView.TOOLTIP_AT);
verify(toolboxTooltip, times(1)).towards(CommonActionsToolboxView.TOOLTIP_TOWARDS);
}
use of com.ait.lienzo.client.core.shape.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class MorphActionsToolboxViewTest method assertConfigureToolbox.
private void assertConfigureToolbox() {
verify(toolboxView, times(1)).at(eq(MorphActionsToolboxView.TOOLBOX_AT));
final ArgumentCaptor<Point2DGrid> gridCaptor = ArgumentCaptor.forClass(Point2DGrid.class);
verify(toolboxView, times(1)).grid(gridCaptor.capture());
final FixedLayoutGrid grid = (FixedLayoutGrid) gridCaptor.getValue();
assertEquals(1, grid.getRows());
assertEquals(1, grid.getCols());
assertEquals(AbstractActionsToolboxView.BUTTON_SIZE, grid.getIconSize(), 0);
assertEquals(AbstractActionsToolboxView.BUTTON_PADDING, grid.getPadding(), 0);
}
use of com.ait.lienzo.client.core.shape.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class FlowActionsToolboxViewTest method testInit.
@Test
public void testInit() {
final FlowActionsToolboxView cascade = doInit();
assertEquals(tested, cascade);
verify(toolboxFactory, times(1)).forWiresShape(eq(shape));
verify(toolboxView, times(1)).attachTo(eq(topLayer));
// Verify toolbox settings.
verify(toolboxView, times(1)).at(eq(FlowActionsToolboxView.TOOLBOX_AT));
final ArgumentCaptor<Point2DGrid> gridCaptor = ArgumentCaptor.forClass(Point2DGrid.class);
verify(toolboxView, times(1)).grid(gridCaptor.capture());
final AutoGrid grid = (AutoGrid) gridCaptor.getValue();
assertEquals(AbstractActionsToolboxView.BUTTON_SIZE, grid.getIconSize(), 0);
assertEquals(AbstractActionsToolboxView.BUTTON_PADDING, grid.getPadding(), 0);
assertEquals(FlowActionsToolboxView.GRID_TOWARDS, grid.getDirection());
}
Aggregations