use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class EmptyStateLayer method initializeMessage.
private void initializeMessage(final String messageText) {
message = new Text(messageText);
message.setFontFamily(EmptyStateView.TEXT_FONT_FAMILY);
message.setFontSize(EmptyStateView.MESSAGE_FONT_SIZE);
message.setAlpha(EmptyStateView.TEXT_ALPHA);
message.setFillColor(EmptyStateView.TEXT_FILL_COLOR);
message.setStrokeColor(EmptyStateView.TEXT_STROKE_COLOR);
message.setStrokeWidth(EmptyStateView.TEXT_STROKE_WIDTH);
add(message);
}
use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class EmptyStateLayer method initializeCaption.
private void initializeCaption(final String captionText) {
caption = new Text(captionText);
caption.setFontFamily(EmptyStateView.TEXT_FONT_FAMILY);
caption.setFontSize(EmptyStateView.CAPTION_FONT_SIZE);
caption.setAlpha(EmptyStateView.TEXT_ALPHA);
caption.setFillColor(EmptyStateView.TEXT_FILL_COLOR);
caption.setStrokeColor(EmptyStateView.TEXT_STROKE_COLOR);
caption.setStrokeWidth(EmptyStateView.TEXT_STROKE_WIDTH);
add(caption);
}
use of com.ait.lienzo.client.core.shape.Text in project kie-wb-common by kiegroup.
the class WiresTextDecorator method initialize.
private void initialize() {
this.text = new Text("").setAlpha(TEXT_ALPHA).setFontFamily(TEXT_FONT_FAMILY).setFontSize(TEXT_FONT_SIZE).setFillColor(TEXT_FILL_COLOR).setStrokeColor(TEXT_STROKE_COLOR).setStrokeWidth(TEXT_STROKE_WIDTH).setTextAlign(TEXT_ALIGN).setDraggable(false);
this.textWrapper = new TextBoundsWrap(text, shape.getPath().getBoundingBox());
this.text.setWrapper(textWrapper);
// Ensure path bounds are available on the selection context.
text.setFillBoundsForSelection(true);
initializeHandlers();
setTextBoundaries(shape.getPath().getBoundingBox());
}
use of com.ait.lienzo.client.core.shape.Text in project drools-wb by kiegroup.
the class GuidedDecisionTreeStencilPaletteBuilder method drawDescription.
@Override
protected Text drawDescription(final ShapeFactory factory, final FactoryHelper helper) {
String description = factory.getShapeDescription();
if (helper instanceof TypeFactoryHelper) {
description = ((TypeFactoryHelper) helper).getContext().getClassName();
} else if (helper instanceof ConstraintFactoryHelper) {
description = ((ConstraintFactoryHelper) helper).getContext().getFieldName();
}
final Text text = new Text(description, ShapeFactoryUtil.FONT_FAMILY_DESCRIPTION, ShapeFactoryUtil.FONT_SIZE_DESCRIPTION);
text.setFillColor(Color.rgbToBrowserHexColor(100, 100, 100));
text.setTextBaseLine(TextBaseLine.MIDDLE);
text.setX(STENCIL_HEIGHT);
text.setY(STENCIL_HEIGHT / 2);
return text;
}
use of com.ait.lienzo.client.core.shape.Text 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