Search in sources :

Example 6 with Point2DGrid

use of org.kie.workbench.common.stunner.lienzo.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(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 7 with Point2DGrid

use of org.kie.workbench.common.stunner.lienzo.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(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)

Example 8 with Point2DGrid

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

Aggregations

Point2DGrid (org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid)8 Test (org.junit.Test)5 FixedLayoutGrid (org.kie.workbench.common.stunner.lienzo.toolbox.grid.FixedLayoutGrid)3 AutoGrid (org.kie.workbench.common.stunner.lienzo.toolbox.grid.AutoGrid)2 Group (com.ait.lienzo.client.core.shape.Group)1 ColorName (com.ait.lienzo.shared.core.types.ColorName)1 Direction (com.ait.lienzo.shared.core.types.Direction)1 Dependent (javax.enterprise.context.Dependent)1 Inject (javax.inject.Inject)1 LienzoGlyphRenderers (org.kie.workbench.common.stunner.client.lienzo.components.glyph.LienzoGlyphRenderers)1 ActionsToolbox (org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolbox)1 MorphActionsToolbox (org.kie.workbench.common.stunner.core.client.components.toolbox.actions.MorphActionsToolbox)1 StunnerCommonImageResources (org.kie.workbench.common.stunner.core.client.resources.StunnerCommonImageResources)1 SvgDataUriGlyph (org.kie.workbench.common.stunner.core.client.shape.SvgDataUriGlyph)1 ToolboxVisibilityExecutors (org.kie.workbench.common.stunner.lienzo.toolbox.ToolboxVisibilityExecutors)1 ButtonGridItem (org.kie.workbench.common.stunner.lienzo.toolbox.items.ButtonGridItem)1 ButtonItem (org.kie.workbench.common.stunner.lienzo.toolbox.items.ButtonItem)1 ToolboxFactory (org.kie.workbench.common.stunner.lienzo.toolbox.items.impl.ToolboxFactory)1 ToolboxTextTooltip (org.kie.workbench.common.stunner.lienzo.toolbox.items.tooltip.ToolboxTextTooltip)1