use of org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class ButtonGridItemImplTest method testGrid.
@Test
public void testGrid() {
Point2DGrid grid = mock(Point2DGrid.class);
ButtonGridItemImpl cascade = tested.grid(grid);
assertEquals(tested, cascade);
verify(toolbox, times(1)).grid(eq(grid));
}
use of org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class ToolboxImplTest method testGrid.
@Test
public void testGrid() {
Point2DGrid grid = mock(Point2DGrid.class);
when(wrapped.getGrid()).thenReturn(grid);
ToolboxImpl cascade = tested.grid(grid);
assertEquals(tested, cascade);
verify(wrapped, times(1)).grid(eq(grid));
}
use of org.kie.workbench.common.stunner.lienzo.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(MORPH_BUTTON_GLYPH, 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 org.kie.workbench.common.stunner.lienzo.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 org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid in project kie-wb-common by kiegroup.
the class WiresShapeToolboxTest method testGrid.
@Test
public void testGrid() {
Point2DGrid grid = mock(Point2DGrid.class);
when(toolbox.getAt()).thenReturn(Direction.EAST);
when(toolbox.getGrid()).thenReturn(grid);
WiresShapeToolbox cascade = tested.grid(grid);
assertEquals(tested, cascade);
verify(toolbox, times(1)).grid(eq(grid));
}
Aggregations