Search in sources :

Example 1 with AutoGrid

use of org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid in project kie-wb-common by kiegroup.

the class ToolboxImplTest method testUpdateGridSize.

@Test
public void testUpdateGridSize() {
    AutoGrid grid = spy(new AutoGrid.Builder().forBoundingBox(boundingBox).build());
    when(wrapped.getGrid()).thenReturn(grid);
    ToolboxImpl cascade = tested.grid(grid);
    assertEquals(tested, cascade);
    verify(wrapped, times(1)).grid(eq(grid));
    verify(grid, times(1)).setSize(eq(53d), eq(53d));
}
Also used : AutoGrid(org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid) Test(org.junit.Test)

Example 2 with AutoGrid

use of org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid 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(layer));
    // 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);
}
Also used : Point2DGrid(org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid) AutoGrid(org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid) Test(org.junit.Test)

Example 3 with AutoGrid

use of org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid 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(layer));
    // 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());
}
Also used : Point2DGrid(org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid) AutoGrid(org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 AutoGrid (org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid)3 Point2DGrid (org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid)2