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());
});
}
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);
}
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;
}
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;
}
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
}
});
}
Aggregations