@Test @SuppressWarnings("unchecked") public void testNewSizeHandler() { final DecisionService decisionService = new DecisionService(); final View<DecisionService> view = new ViewImpl<>(decisionService, Bounds.create(0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT)); final SVGShapeView<?> shapeView = mock(SVGShapeView.class); final SizeHandler<DecisionService, SVGShapeView> handler = shapeDef.newSizeHandler(); handler.handle(view, shapeView); verify(shapeView).setMinWidth(decisionService.getDimensionsSet().getMinimumWidth()); verify(shapeView).setMaxWidth(decisionService.getDimensionsSet().getMaximumWidth()); verify(shapeView).setMinHeight(decisionService.getDividerLineY().getValue() + GeneralRectangleDimensionsSet.DEFAULT_HEIGHT); verify(shapeView).setMaxHeight(decisionService.getDimensionsSet().getMaximumHeight()); }
@Override public SizeHandler<DecisionService, SVGShapeView> newSizeHandler() { return new SizeHandler.Builder<DecisionService, SVGShapeView>().width(e -> e.getDimensionsSet().getWidth().getValue()) .height(e -> e.getDimensionsSet().getHeight().getValue()) .minWidth(p -> p.getDimensionsSet().getMinimumWidth()) .maxWidth(p -> p.getDimensionsSet().getMaximumWidth()) .minHeight(p -> p.getDividerLineY().getValue() + GeneralRectangleDimensionsSet.DEFAULT_HEIGHT) .maxHeight(p -> p.getDimensionsSet().getMaximumHeight()) .build(); }
DMNDecisionServiceSVGShapeDefImpl implements DMNDecisionServiceSVGShapeDef { @Override public SizeHandler<DecisionService, SVGShapeView> newSizeHandler() { return new SizeHandler.Builder<DecisionService, SVGShapeView>().width(e -> e.getDimensionsSet().getWidth().getValue()) .height(e -> e.getDimensionsSet().getHeight().getValue()) .minWidth(p -> p.getDimensionsSet().getMinimumWidth()) .maxWidth(p -> p.getDimensionsSet().getMaximumWidth()) .minHeight(p -> p.getDividerLineY().getValue() + GeneralRectangleDimensionsSet.DEFAULT_HEIGHT) .maxHeight(p -> p.getDimensionsSet().getMaximumHeight()) .build(); } }
DMNDecisionServiceSVGShapeDefImpl implements DMNDecisionServiceSVGShapeDef { @Override public SizeHandler<DecisionService, SVGShapeView> newSizeHandler() { return new SizeHandler.Builder<DecisionService, SVGShapeView>().width(e -> e.getDimensionsSet().getWidth().getValue()) .height(e -> e.getDimensionsSet().getHeight().getValue()) .minWidth(p -> p.getDimensionsSet().getMinimumWidth()) .maxWidth(p -> p.getDimensionsSet().getMaximumWidth()) .minHeight(p -> p.getDividerLineY().getValue() + GeneralRectangleDimensionsSet.DEFAULT_HEIGHT) .maxHeight(p -> p.getDimensionsSet().getMaximumHeight()) .build(); }  }
DMNDecisionServiceSVGShapeDefImpl implements DMNDecisionServiceSVGShapeDef { @Override public SizeHandler<DecisionService, SVGShapeView> newSizeHandler() { return new SizeHandler.Builder<DecisionService, SVGShapeView>().width(e -> e.getDimensionsSet().getWidth().getValue()) .height(e -> e.getDimensionsSet().getHeight().getValue()) .minWidth(p -> p.getDimensionsSet().getMinimumWidth()) .maxWidth(p -> p.getDimensionsSet().getMaximumWidth()) .minHeight(p -> p.getDividerLineY().getValue() + GeneralRectangleDimensionsSet.DEFAULT_HEIGHT) .maxHeight(p -> p.getDimensionsSet().getMaximumHeight()) .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 SizeHandler<DecisionService, SVGShapeView> newSizeHandler() { return new SizeHandler.Builder<DecisionService, SVGShapeView>().width(e -> e.getDimensionsSet().getWidth().getValue()) .height(e -> e.getDimensionsSet().getHeight().getValue()) .minWidth(p -> p.getDimensionsSet().getMinimumWidth()) .maxWidth(p -> p.getDimensionsSet().getMaximumWidth()) .minHeight(p -> p.getDividerLineY().getValue() + GeneralRectangleDimensionsSet.DEFAULT_HEIGHT) .maxHeight(p -> p.getDimensionsSet().getMaximumHeight()) .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; }