Search in sources :

Example 1 with IPathClipper

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

the class GuidedDecisionTableViewImpl method makeHeaderCaption.

private Group makeHeaderCaption() {
    final Group g = GWT.create(Group.class);
    final double captionWidth = 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)

Aggregations

Group (com.ait.lienzo.client.core.shape.Group)1 IPathClipper (com.ait.lienzo.client.core.shape.IPathClipper)1 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 Rectangle (com.ait.lienzo.client.core.shape.Rectangle)1 Text (com.ait.lienzo.client.core.shape.Text)1 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)1 GuidedDecisionTableTheme (org.drools.workbench.screens.guided.dtable.client.widget.table.themes.GuidedDecisionTableTheme)1