Search in sources :

Example 31 with Group

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

the class RadarMenuViewImpl method makeDecisionTableGlyph.

private Group makeDecisionTableGlyph(final GuidedDecisionTableView view) {
    final Group g = new Group();
    final Rectangle r = new Rectangle(view.getWidth(), view.getHeight());
    r.setFillColor(ColorName.LIGHTGRAY);
    r.setLocation(view.getLocation());
    g.setListening(false);
    g.add(r);
    return g;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Rectangle(com.ait.lienzo.client.core.shape.Rectangle)

Example 32 with Group

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

the class GuidedDecisionTableViewImpl method makeHeaderCaption.

private Group makeHeaderCaption() {
    final Group g = GWT.create(Group.class);
    final double captionWidth = ((GuidedDecisionTableRenderer) renderer).getHeaderCaptionWidth();
    final GuidedDecisionTableTheme theme = (GuidedDecisionTableTheme) renderer.getTheme();
    final Rectangle r = theme.getBaseRectangle(GuidedDecisionTableTheme.ModelColumnType.CAPTION);
    r.setWidth(captionWidth);
    r.setHeight(HEADER_CAPTION_HEIGHT);
    final MultiPath border = theme.getBodyGridLine();
    border.M(0.5, HEADER_CAPTION_HEIGHT + 0.5);
    border.L(0.5, 0.5);
    border.L(captionWidth + 0.5, 0.5);
    border.L(captionWidth + 0.5, HEADER_CAPTION_HEIGHT + 0.5);
    border.L(0.5, HEADER_CAPTION_HEIGHT + 0.5);
    final Text caption = theme.getHeaderText();
    caption.setText(model.getTableName());
    caption.setX(captionWidth / 2);
    caption.setY(HEADER_CAPTION_HEIGHT / 2);
    // Clip Caption Group
    final BoundingBox bb = new BoundingBox(0, 0, captionWidth + border.getStrokeWidth(), HEADER_CAPTION_HEIGHT + 0.5);
    final IPathClipper clipper = getPathClipper(bb);
    g.setPathClipper(clipper);
    clipper.setActive(true);
    g.add(r);
    g.add(caption);
    g.add(border);
    return g;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) MultiPath(com.ait.lienzo.client.core.shape.MultiPath) IPathClipper(com.ait.lienzo.client.core.shape.IPathClipper) BoundingBox(com.ait.lienzo.client.core.types.BoundingBox) Rectangle(com.ait.lienzo.client.core.shape.Rectangle) GuidedDecisionTableTheme(org.drools.workbench.screens.guided.dtable.client.widget.table.themes.GuidedDecisionTableTheme) Text(com.ait.lienzo.client.core.shape.Text) GuidedDecisionTableRenderer(org.drools.workbench.screens.guided.dtable.client.widget.table.themes.GuidedDecisionTableRenderer)

Example 33 with Group

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

the class GuidedDecisionTreeStencilPaletteBuilder method scaleGlyph.

@Override
protected Group scaleGlyph(final ShapeGlyph glyph) {
    final double sx = GLYPH_WIDTH / glyph.getWidth();
    final double sy = GLYPH_HEIGHT / glyph.getHeight();
    final Group group = glyph.getGroup();
    return group.setX(STENCIL_HEIGHT / 2).setY(STENCIL_HEIGHT / 2).setScale(sx, sy);
}
Also used : Group(com.ait.lienzo.client.core.shape.Group)

Example 34 with Group

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

the class BaseGuidedDecisionTreeShape method setupControl.

protected Group setupControl(final ImageResource resource, final Command command) {
    final Group controlGroup = new Group();
    final Picture p = new Picture(resource, picture1 -> {
        final double offsetX = -picture1.getImageData().getWidth() / 2;
        final double offsetY = -picture1.getImageData().getHeight() / 2;
        picture1.setLocation(new Point2D(offsetX, offsetY));
        picture1.addNodeMouseClickHandler(e -> command.execute());
    }, ImageSelectionMode.SELECT_BOUNDS);
    controlGroup.add(p);
    return controlGroup;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Point2D(com.ait.lienzo.client.core.types.Point2D) Picture(com.ait.lienzo.client.core.shape.Picture)

Example 35 with Group

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

the class GuidedDecisionTableRenderer method renderHeaderBodyDivider.

@Override
public RendererCommand renderHeaderBodyDivider(final double width) {
    return (RenderHeaderGridLinesCommand) (rc) -> {
        if (!rc.isSelectionLayer()) {
            final Group g = new Group();
            final Line dividerLine1 = theme.getGridHeaderBodyDivider();
            final Line dividerLine2 = theme.getGridHeaderBodyDivider();
            dividerLine1.setPoints(new Point2DArray(new Point2D(0, getHeaderHeight() - 1.5), new Point2D(width, getHeaderHeight() - 1.5)));
            dividerLine2.setPoints(new Point2DArray(new Point2D(0, getHeaderHeight() + 0.5), new Point2D(width, getHeaderHeight() + 0.5)));
            g.add(dividerLine1);
            g.add(dividerLine2);
            rc.getGroup().add(g);
        }
    };
}
Also used : Line(com.ait.lienzo.client.core.shape.Line) Point2DArray(com.ait.lienzo.client.core.types.Point2DArray) Group(com.ait.lienzo.client.core.shape.Group) Point2D(com.ait.lienzo.client.core.types.Point2D)

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