Search in sources :

Example 21 with Group

use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.

the class LienzoPictureGlyphRendererTest method testDestroy.

@Test
@SuppressWarnings("unchecked")
public void testDestroy() {
    final Group glyphView = tested.render(glyph, 100, 100);
    assertNotNull(glyphView);
    glyphView.removeFromParent();
    verify(picture, times(1)).removeFromParent();
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Test(org.junit.Test)

Example 22 with Group

use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.

the class LienzoPanelUtils method newPanel.

public LienzoPanel newPanel(final Glyph glyph, final int width, final int height) {
    final Group glyphGroup = glyphLienzoGlyphRenderer.render(glyph, width, height);
    final com.ait.lienzo.client.widget.LienzoPanel panel = new LienzoPanel(width, height);
    final Layer layer = new Layer();
    panel.add(layer.setTransformable(true));
    layer.add(glyphGroup);
    return panel;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) Layer(com.ait.lienzo.client.core.shape.Layer)

Example 23 with Group

use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.

the class LienzoImageStripGlyphRenderer method render.

@Override
public Group render(final ImageStripGlyph glyph, final double width, final double height) {
    final Group group = new Group();
    final Image image = imageBuilder.apply(ImageStripRegistry.getName(glyph.getStripType()), glyph.getIndex());
    scaleShape(image, width, height);
    group.add(image);
    return group;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Image(com.ait.lienzo.client.core.image.Image)

Example 24 with Group

use of com.ait.lienzo.client.core.shape.Group 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);
}
Also used : Point2DGrid(com.ait.lienzo.client.core.shape.toolbox.grid.Point2DGrid) Point2DGrid(com.ait.lienzo.client.core.shape.toolbox.grid.Point2DGrid) ButtonGridItem(com.ait.lienzo.client.core.shape.toolbox.items.ButtonGridItem) ColorName(com.ait.lienzo.shared.core.types.ColorName) ToolboxTextTooltip(com.ait.lienzo.client.core.shape.toolbox.items.tooltip.ToolboxTextTooltip) Group(com.ait.lienzo.client.core.shape.Group) ActionsToolbox(org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolbox) StunnerCommonIconsGlyphFactory(org.kie.workbench.common.stunner.core.client.resources.StunnerCommonIconsGlyphFactory) Inject(javax.inject.Inject) FixedLayoutGrid(com.ait.lienzo.client.core.shape.toolbox.grid.FixedLayoutGrid) LienzoGlyphRenderers(org.kie.workbench.common.stunner.client.lienzo.components.glyph.LienzoGlyphRenderers) Dependent(javax.enterprise.context.Dependent) MorphActionsToolbox(org.kie.workbench.common.stunner.core.client.components.toolbox.actions.MorphActionsToolbox) Direction(com.ait.lienzo.shared.core.types.Direction) ToolboxVisibilityExecutors(com.ait.lienzo.client.core.shape.toolbox.ToolboxVisibilityExecutors) ButtonItem(com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem) ToolboxFactory(com.ait.lienzo.client.core.shape.toolbox.items.impl.ToolboxFactory) Group(com.ait.lienzo.client.core.shape.Group)

Example 25 with Group

use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.

the class WiresScalableContainer method addScalable.

public WiresScalableContainer addScalable(final IPrimitive<?> child) {
    if (isScalable(child)) {
        scalableChildren.add(child);
        add(child);
    } else {
        if (null == transformableContainer) {
            transformableContainer = new Group();
            addChild(transformableContainer);
        }
        transformableContainer.add(child);
        scaleRatio = null;
    }
    scaleRequired = true;
    return this;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group)

Aggregations

Group (com.ait.lienzo.client.core.shape.Group)66 Test (org.junit.Test)17 Rectangle (com.ait.lienzo.client.core.shape.Rectangle)10 Before (org.junit.Before)10 Text (com.ait.lienzo.client.core.shape.Text)9 GridRenderer (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)8 Layer (com.ait.lienzo.client.core.shape.Layer)7 Point2D (com.ait.lienzo.client.core.types.Point2D)7 Command (org.uberfire.mvp.Command)6 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)4 GridColumn (org.uberfire.ext.wires.core.grids.client.model.GridColumn)4 Line (com.ait.lienzo.client.core.shape.Line)3 ArrayList (java.util.ArrayList)3 SVGContainer (org.kie.workbench.common.stunner.svg.client.shape.view.SVGContainer)3 GridWidget (org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget)3 GridRendererTheme (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme)3 IPathClipper (com.ait.lienzo.client.core.shape.IPathClipper)2 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)2 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)2 Point2DArray (com.ait.lienzo.client.core.types.Point2DArray)2