@Test @SuppressWarnings("unchecked") public void testNewFontHandler() { final DecisionService decisionService = new DecisionService(); final SVGShapeView<?> shapeView = mock(SVGShapeView.class); final FontHandler<DecisionService, SVGShapeView> handler = shapeDef.newFontHandler(); handler.handle(decisionService, shapeView); verify(shapeView).setTitlePosition(HasTitle.VerticalAlignment.TOP, HasTitle.HorizontalAlignment.CENTER, HasTitle.ReferencePosition.INSIDE, HasTitle.Orientation.HORIZONTAL); verify(shapeView).setMargins(new Maps.Builder().put(HasTitle.VerticalAlignment.TOP, 20.0).build()); verify(shapeView).setTextWrapper(TextWrapperStrategy.TRUNCATE); }
@Override public FontHandler<DecisionService, SVGShapeView> newFontHandler() { return new FontHandler.Builder<DecisionService, SVGShapeView>() .fontFamily(bean -> bean.getFontSet().getFontFamily().getValue()) .fontColor(bean -> bean.getFontSet().getFontColour().getValue()) .fontSize(bean -> bean.getFontSet().getFontSize().getValue()) .textWrapperStrategy(bean -> TextWrapperStrategy.TRUNCATE) .strokeAlpha(bean -> 0.0d) .verticalAlignment(bean -> HasTitle.VerticalAlignment.TOP) .horizontalAlignment(bean -> HasTitle.HorizontalAlignment.CENTER) .referencePosition(bean -> HasTitle.ReferencePosition.INSIDE) .orientation(bean -> HasTitle.Orientation.HORIZONTAL) .margin(HasTitle.VerticalAlignment.TOP, Y_OFFSET) .build(); }
DMNDecisionServiceSVGShapeDefImpl implements DMNDecisionServiceSVGShapeDef { @Override public FontHandler<DecisionService, SVGShapeView> newFontHandler() { return new FontHandler.Builder<DecisionService, SVGShapeView>() .fontFamily(bean -> bean.getFontSet().getFontFamily().getValue()) .fontColor(bean -> bean.getFontSet().getFontColour().getValue()) .fontSize(bean -> bean.getFontSet().getFontSize().getValue()) .textWrapperStrategy(bean -> TextWrapperStrategy.TRUNCATE) .strokeAlpha(bean -> 0.0d) .verticalAlignment(bean -> HasTitle.VerticalAlignment.TOP) .horizontalAlignment(bean -> HasTitle.HorizontalAlignment.CENTER) .referencePosition(bean -> HasTitle.ReferencePosition.INSIDE) .orientation(bean -> HasTitle.Orientation.HORIZONTAL) .margin(HasTitle.VerticalAlignment.TOP, Y_OFFSET) .build(); } }
DMNDecisionServiceSVGShapeDefImpl implements DMNDecisionServiceSVGShapeDef { @Override public FontHandler<DecisionService, SVGShapeView> newFontHandler() { return new FontHandler.Builder<DecisionService, SVGShapeView>() .fontFamily(bean -> bean.getFontSet().getFontFamily().getValue()) .fontColor(bean -> bean.getFontSet().getFontColour().getValue()) .fontSize(bean -> bean.getFontSet().getFontSize().getValue()) .textWrapperStrategy(bean -> TextWrapperStrategy.TRUNCATE) .strokeAlpha(bean -> 0.0d) .verticalAlignment(bean -> HasTitle.VerticalAlignment.TOP) .horizontalAlignment(bean -> HasTitle.HorizontalAlignment.CENTER) .referencePosition(bean -> HasTitle.ReferencePosition.INSIDE) .orientation(bean -> HasTitle.Orientation.HORIZONTAL) .margin(HasTitle.VerticalAlignment.TOP, Y_OFFSET) .build(); }  }
DMNDecisionServiceSVGShapeDefImpl implements DMNDecisionServiceSVGShapeDef { @Override public FontHandler<DecisionService, SVGShapeView> newFontHandler() { return new FontHandler.Builder<DecisionService, SVGShapeView>() .fontFamily(bean -> bean.getFontSet().getFontFamily().getValue()) .fontColor(bean -> bean.getFontSet().getFontColour().getValue()) .fontSize(bean -> bean.getFontSet().getFontSize().getValue()) .textWrapperStrategy(bean -> TextWrapperStrategy.TRUNCATE) .strokeAlpha(bean -> 0.0d) .verticalAlignment(bean -> HasTitle.VerticalAlignment.TOP) .horizontalAlignment(bean -> HasTitle.HorizontalAlignment.CENTER) .referencePosition(bean -> HasTitle.ReferencePosition.INSIDE) .orientation(bean -> HasTitle.Orientation.HORIZONTAL) .margin(HasTitle.VerticalAlignment.TOP, Y_OFFSET) .build(); }  @Override Class<DMNDecisionServiceSVGViewFactory> getViewFactoryType(); @Override SizeHandler<DecisionService, SVGShapeView> newSizeHandler(); @Override FontHandler<DecisionService, SVGShapeView> newFontHandler(); @Override SVGShapeView<?> newViewInstance(final DMNDecisionServiceSVGViewFactory factory,
                                           final DecisionService bean); @Override Glyph getGlyph(final Class<? extends DecisionService> type,
                          final Class<? extends ShapeFactory.GlyphConsumer> consumer,
                          final String defId); }
DMNDecisionServiceSVGShapeDefImpl implements DMNDecisionServiceSVGShapeDef { @Override public FontHandler<DecisionService, SVGShapeView> newFontHandler() { return new FontHandler.Builder<DecisionService, SVGShapeView>() .fontFamily(bean -> bean.getFontSet().getFontFamily().getValue()) .fontColor(bean -> bean.getFontSet().getFontColour().getValue()) .fontSize(bean -> bean.getFontSet().getFontSize().getValue()) .textWrapperStrategy(bean -> TextWrapperStrategy.TRUNCATE) .strokeAlpha(bean -> 0.0d) .verticalAlignment(bean -> HasTitle.VerticalAlignment.TOP) .horizontalAlignment(bean -> HasTitle.HorizontalAlignment.CENTER) .referencePosition(bean -> HasTitle.ReferencePosition.INSIDE) .orientation(bean -> HasTitle.Orientation.HORIZONTAL) .margin(HasTitle.VerticalAlignment.TOP, Y_OFFSET) .build(); }  @Override Class<DMNDecisionServiceSVGViewFactory> getViewFactoryType(); @Override SizeHandler<DecisionService, SVGShapeView> newSizeHandler(); @Override FontHandler<DecisionService, SVGShapeView> newFontHandler(); @Override SVGShapeView<?> newViewInstance(final DMNDecisionServiceSVGViewFactory factory,
                                           final DecisionService bean); @Override Glyph getGlyph(final Class<? extends DecisionService> type,
                          final Class<? extends ShapeFactory.GlyphConsumer> consumer,
                          final String defId); static final SVGShapeViewResources<DMNDefinition, DMNDecisionServiceSVGViewFactory> VIEW_RESOURCES; static final Map<Class<? extends DMNDefinition>, Glyph> GLYPHS_PALETTE; }