@Test public void testNewViewInstance() { final BusinessKnowledgeModel businessKnowledgeModel = new BusinessKnowledgeModel(); shapeDef.newViewInstance(viewFactory, businessKnowledgeModel); verify(viewFactory).businessKnowledgeModel(); verify(viewResource).build(businessKnowledgeModel.getDimensionsSet().getWidth().getValue(), businessKnowledgeModel.getDimensionsSet().getHeight().getValue(), true); reset(viewResource); final Decision decision = new Decision(); shapeDef.newViewInstance(viewFactory, decision); verify(viewFactory).decision(); verify(viewResource).build(decision.getDimensionsSet().getWidth().getValue(), decision.getDimensionsSet().getHeight().getValue(), true); reset(viewResource); shapeDef.newViewInstance(viewFactory, new InputData()); verify(viewFactory).inputData(); verify(viewResource).build(businessKnowledgeModel.getDimensionsSet().getWidth().getValue(), businessKnowledgeModel.getDimensionsSet().getHeight().getValue(), true); reset(viewResource); final KnowledgeSource knowledgeSource = new KnowledgeSource(); shapeDef.newViewInstance(viewFactory, knowledgeSource); verify(viewFactory).knowledgeSource(); verify(viewResource).build(knowledgeSource.getDimensionsSet().getWidth().getValue(), knowledgeSource.getDimensionsSet().getHeight().getValue(), true); reset(viewResource); final TextAnnotation textAnnotation = new TextAnnotation(); shapeDef.newViewInstance(viewFactory, textAnnotation); verify(viewFactory).textAnnotation(); verify(viewResource).build(textAnnotation.getDimensionsSet().getWidth().getValue(), textAnnotation.getDimensionsSet().getHeight().getValue(), true); }
@Override public SVGShapeView<?> newViewInstance(final DMNSVGViewFactory factory, final DMNViewDefinition bean) { final double width = bean.getDimensionsSet().getWidth().getValue(); final double height = bean.getDimensionsSet().getHeight().getValue(); return VIEW_RESOURCES .getResource(factory, bean) .build(width, height, true); }
DMNSVGShapeDefImpl implements DMNSVGShapeDef<DMNViewDefinition, DMNSVGViewFactory> { @Override public SVGShapeView<?> newViewInstance(final DMNSVGViewFactory factory, final DMNViewDefinition bean) { final double width = bean.getDimensionsSet().getWidth().getValue(); final double height = bean.getDimensionsSet().getHeight().getValue(); return VIEW_RESOURCES .getResource(factory, bean) .build(width, height, true); } }
DMNSVGShapeDefImpl implements DMNSVGShapeDef<DMNViewDefinition, DMNSVGViewFactory> { @Override public SVGShapeView<?> newViewInstance(final DMNSVGViewFactory factory, final DMNViewDefinition bean) { final double width = bean.getDimensionsSet().getWidth().getValue(); final double height = bean.getDimensionsSet().getHeight().getValue(); return VIEW_RESOURCES .getResource(factory, bean) .build(width, height, true); }  }
DMNSVGShapeDefImpl implements DMNSVGShapeDef<DMNViewDefinition, DMNSVGViewFactory> { @Override public SVGShapeView<?> newViewInstance(final DMNSVGViewFactory factory, final DMNViewDefinition bean) { final double width = bean.getDimensionsSet().getWidth().getValue(); final double height = bean.getDimensionsSet().getHeight().getValue(); return VIEW_RESOURCES .getResource(factory, bean) .build(width, height, true); }  @Override Class<DMNSVGViewFactory> getViewFactoryType(); @Override SVGShapeView<?> newViewInstance(final DMNSVGViewFactory factory,
                                           final DMNViewDefinition bean); @Override Glyph getGlyph(final Class<? extends DMNViewDefinition> type,
                          final String defId); @Override Glyph getGlyph(final Class<? extends DMNViewDefinition> type,
                          final Class<? extends ShapeFactory.GlyphConsumer> consumer,
                          final String defId); }
DMNSVGShapeDefImpl implements DMNSVGShapeDef<DMNViewDefinition, DMNSVGViewFactory> { @Override public SVGShapeView<?> newViewInstance(final DMNSVGViewFactory factory, final DMNViewDefinition bean) { final double width = bean.getDimensionsSet().getWidth().getValue(); final double height = bean.getDimensionsSet().getHeight().getValue(); return VIEW_RESOURCES .getResource(factory, bean) .build(width, height, true); }  @Override Class<DMNSVGViewFactory> getViewFactoryType(); @Override SVGShapeView<?> newViewInstance(final DMNSVGViewFactory factory,
                                           final DMNViewDefinition bean); @Override Glyph getGlyph(final Class<? extends DMNViewDefinition> type,
                          final String defId); @Override Glyph getGlyph(final Class<? extends DMNViewDefinition> type,
                          final Class<? extends ShapeFactory.GlyphConsumer> consumer,
                          final String defId); static final SVGShapeViewResources<DMNDefinition, DMNSVGViewFactory> VIEW_RESOURCES; static final Map<Class<? extends DMNDefinition>, Glyph> GLYPHS_TOOLBOX; static final Map<Class<? extends DMNDefinition>, Glyph> GLYPHS_PALETTE; }