Search in sources :

Example 16 with Rectangle

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

the class BaseExpressionGridThemeTest method testGetHeaderBackgroundFillColour.

@Test
public void testGetHeaderBackgroundFillColour() {
    tests.stream().forEach(test -> {
        final GridColumn column = mock(test.getK1());
        final Rectangle rectangle = theme.getHeaderBackground(column);
        assertEquals("Column '" + column.getClass().getSimpleName() + "' has wrong colour.", test.getK2(), rectangle.getFillColor());
    });
}
Also used : Rectangle(com.ait.lienzo.client.core.shape.Rectangle) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) Test(org.junit.Test)

Example 17 with Rectangle

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

the class SVGShapeViewImplTest method setup.

@Before
public void setup() throws Exception {
    this.parent = new SVGContainer("parent", new Group().setID("parent"), false, null);
    rectangle = new Rectangle(10d, 10d);
    this.childShape = new SVGPrimitiveShape(new Rectangle(10d, 10d));
    this.child = new SVGBasicShapeViewImpl("svgChild1", childShape, 50d, 23d);
    this.shape = new SVGPrimitiveShape(rectangle);
    this.tested = new SVGShapeViewImpl("svg-test1", shape, 100, 340, false);
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) SVGContainer(org.kie.workbench.common.stunner.svg.client.shape.view.SVGContainer) SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Rectangle(com.ait.lienzo.client.core.shape.Rectangle) Before(org.junit.Before)

Example 18 with Rectangle

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

the class GuidedDecisionTableTheme method getBodyBackground.

@Override
public Rectangle getBodyBackground(final GridColumn<?> column) {
    final Rectangle r = new Rectangle(0, 0);
    r.setFillColor(KIEColours.CELL_CONTENT);
    return r;
}
Also used : Rectangle(com.ait.lienzo.client.core.shape.Rectangle)

Example 19 with Rectangle

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

the class GuidedDecisionTreeStencilPaletteBuilder method drawBoundingBox.

@Override
protected Rectangle drawBoundingBox(final ShapeFactory factory, final FactoryHelper helper) {
    final Rectangle boundingBox = new Rectangle(STENCIL_WIDTH, STENCIL_HEIGHT, STENCIL_CORNER_RADIUS);
    boundingBox.setStrokeColor(ShapeFactoryUtil.RGB_STROKE_BOUNDING).setStrokeWidth(1).setFillColor(ShapeFactoryUtil.RGB_FILL_BOUNDING).setDraggable(false);
    return boundingBox;
}
Also used : Rectangle(com.ait.lienzo.client.core.shape.Rectangle)

Example 20 with Rectangle

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

the class GuidedDecisionTreeWidget method showGettingStartedHint.

private void showGettingStartedHint() {
    if (isGettingStartedHintVisible) {
        return;
    }
    if (hint == null) {
        hint = new Group();
        final Rectangle hintRectangle = new Rectangle(600, 225, 15);
        hintRectangle.setStrokeWidth(2.0);
        hintRectangle.setStrokeColor("#6495ED");
        hintRectangle.setFillColor("#AFEEEE");
        hintRectangle.setAlpha(0.75);
        final Text hintText = new Text(GuidedDecisionTreeConstants.INSTANCE.gettingStartedHint(), ShapeFactoryUtil.FONT_FAMILY_DESCRIPTION, 18);
        hintText.setTextAlign(TextAlign.CENTER);
        hintText.setTextBaseLine(TextBaseLine.MIDDLE);
        hintText.setFillColor("#6495ED");
        hintText.setX(hintRectangle.getWidth() / 2);
        hintText.setY(hintRectangle.getHeight() / 2);
        hint.setX((canvasLayer.getWidth() - hintRectangle.getWidth()) / 2);
        hint.setY((canvasLayer.getHeight() / 3) - (hintRectangle.getHeight() / 2));
        hint.add(hintRectangle);
        hint.add(hintText);
    }
    hint.animate(AnimationTweener.LINEAR, new AnimationProperties(), ANIMATION_DURATION, new IAnimationCallback() {

        @Override
        public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) {
            hint.setAlpha(0.0);
            canvasLayer.add(hint);
            isGettingStartedHintVisible = true;
        }

        @Override
        public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) {
            // Lienzo's IAnimation.getPercent() passes values > 1.0
            final double pct = iAnimation.getPercent() > 1.0 ? 1.0 : iAnimation.getPercent();
            hint.setAlpha(pct);
            hint.getLayer().batch();
        }

        @Override
        public void onClose(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) {
        // Nothing to do
        }
    });
}
Also used : IAnimationHandle(com.ait.lienzo.client.core.animation.IAnimationHandle) Group(com.ait.lienzo.client.core.shape.Group) AnimationProperties(com.ait.lienzo.client.core.animation.AnimationProperties) IAnimation(com.ait.lienzo.client.core.animation.IAnimation) Rectangle(com.ait.lienzo.client.core.shape.Rectangle) Text(com.ait.lienzo.client.core.shape.Text) IAnimationCallback(com.ait.lienzo.client.core.animation.IAnimationCallback)

Aggregations

Rectangle (com.ait.lienzo.client.core.shape.Rectangle)21 Group (com.ait.lienzo.client.core.shape.Group)10 Test (org.junit.Test)5 Text (com.ait.lienzo.client.core.shape.Text)3 Before (org.junit.Before)3 SVGContainer (org.kie.workbench.common.stunner.svg.client.shape.view.SVGContainer)3 IDrawable (com.ait.lienzo.client.core.shape.IDrawable)2 IPathClipper (com.ait.lienzo.client.core.shape.IPathClipper)2 SVGPrimitiveShape (org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape)2 GridColumn (org.uberfire.ext.wires.core.grids.client.model.GridColumn)2 AnimationProperties (com.ait.lienzo.client.core.animation.AnimationProperties)1 IAnimation (com.ait.lienzo.client.core.animation.IAnimation)1 IAnimationCallback (com.ait.lienzo.client.core.animation.IAnimationCallback)1 IAnimationHandle (com.ait.lienzo.client.core.animation.IAnimationHandle)1 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 Triangle (com.ait.lienzo.client.core.shape.Triangle)1 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1 Transform (com.ait.lienzo.client.core.types.Transform)1 GuidedDecisionTableRenderer (org.drools.workbench.screens.guided.dtable.client.widget.table.themes.GuidedDecisionTableRenderer)1