@Test(expected=OfxAuthoringException.class) public void withoutBody() throws IOException, OfxAuthoringException { Table table = createTable(); table.getContent().unsetBody(); renderer.render(table); }
public void render(Table table) throws OfxAuthoringException { if(!table.isSetSpecification()){throw new OfxAuthoringException("<table> without <specification>");} if(!table.isSetContent()){throw new OfxAuthoringException("<table> without <content>");} if(table.getContent().getBody().size()!=1){throw new OfxAuthoringException("<content> must exactly have 1 body!");} if(!table.getSpecification().isSetLong()){table.getSpecification().setLong(false);} if(!table.getSpecification().isSetFloat()){table.getSpecification().setFloat(XmlFloatFactory.build(false));} OfxLatexTableRenderer tableRenderer = new LatexTabuRenderer(cmm,dsm); if(preBlankLine){preTxt.add("");} preTxt.addAll(LatexCommentRenderer.stars()); preTxt.addAll(LatexCommentRenderer.comment("Rendering a Latex table with: "+tableRenderer.getClass().getSimpleName())); if(table.isSetComment()) { LatexCommentRenderer rComment = new LatexCommentRenderer(cmm,dsm); rComment.render(table.getComment()); renderer.add(rComment); } LatexTabluarWidthCalculator tabularWidthCalculator = new LatexTabluarWidthCalculator(table.getSpecification().getColumns()); boolean longTable = table.getSpecification().isLong(); boolean floating = table.getSpecification().getFloat().isValue(); boolean flex = tabularWidthCalculator.isFlexTable(); if(!longTable){renderPre(table,floating);} tableRenderer.render(table); renderer.add(tableRenderer); if(!longTable){renderPost(table,floating);} }
LatexTableRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Table table) throws OfxAuthoringException { if(!table.isSetSpecification()){throw new OfxAuthoringException("<table> without <specification>");} if(!table.isSetContent()){throw new OfxAuthoringException("<table> without <content>");} if(table.getContent().getBody().size()!=1){throw new OfxAuthoringException("<content> must exactly have 1 body!");} if(!table.getSpecification().isSetLong()){table.getSpecification().setLong(false);} if(!table.getSpecification().isSetFloat()){table.getSpecification().setFloat(XmlFloatFactory.build(false));} OfxLatexTableRenderer tableRenderer = new LatexTabuRenderer(cmm,dsm); if(preBlankLine){preTxt.add("");} preTxt.addAll(LatexCommentRenderer.stars()); preTxt.addAll(LatexCommentRenderer.comment("Rendering a Latex table with: "+tableRenderer.getClass().getSimpleName())); if(table.isSetComment()) { LatexCommentRenderer rComment = new LatexCommentRenderer(cmm,dsm); rComment.render(table.getComment()); renderer.add(rComment); } LatexTabluarWidthCalculator tabularWidthCalculator = new LatexTabluarWidthCalculator(table.getSpecification().getColumns()); boolean longTable = table.getSpecification().isLong(); boolean floating = table.getSpecification().getFloat().isValue(); boolean flex = tabularWidthCalculator.isFlexTable(); if(!longTable){renderPre(table,floating);} tableRenderer.render(table); renderer.add(tableRenderer); if(!longTable){renderPost(table,floating);} } }
LatexTableRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Table table) throws OfxAuthoringException { if(!table.isSetSpecification()){throw new OfxAuthoringException("<table> without <specification>");} if(!table.isSetContent()){throw new OfxAuthoringException("<table> without <content>");} if(table.getContent().getBody().size()!=1){throw new OfxAuthoringException("<content> must exactly have 1 body!");} if(!table.getSpecification().isSetLong()){table.getSpecification().setLong(false);} if(!table.getSpecification().isSetFloat()){table.getSpecification().setFloat(XmlFloatFactory.build(false));} OfxLatexTableRenderer tableRenderer = new LatexTabuRenderer(cmm,dsm); if(preBlankLine){preTxt.add("");} preTxt.addAll(LatexCommentRenderer.stars()); preTxt.addAll(LatexCommentRenderer.comment("Rendering a Latex table with: "+tableRenderer.getClass().getSimpleName())); if(table.isSetComment()) { LatexCommentRenderer rComment = new LatexCommentRenderer(cmm,dsm); rComment.render(table.getComment()); renderer.add(rComment); } LatexTabluarWidthCalculator tabularWidthCalculator = new LatexTabluarWidthCalculator(table.getSpecification().getColumns()); boolean longTable = table.getSpecification().isLong(); boolean floating = table.getSpecification().getFloat().isValue(); boolean flex = tabularWidthCalculator.isFlexTable(); if(!longTable){renderPre(table,floating);} tableRenderer.render(table); renderer.add(tableRenderer); if(!longTable){renderPost(table,floating);} } LatexTableRenderer(CrossMediaManager cmm,DefaultSettingsManager dsm); }
LatexTableRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Table table) throws OfxAuthoringException { if(!table.isSetSpecification()){throw new OfxAuthoringException("<table> without <specification>");} if(!table.isSetContent()){throw new OfxAuthoringException("<table> without <content>");} if(table.getContent().getBody().size()!=1){throw new OfxAuthoringException("<content> must exactly have 1 body!");} if(!table.getSpecification().isSetLong()){table.getSpecification().setLong(false);} if(!table.getSpecification().isSetFloat()){table.getSpecification().setFloat(XmlFloatFactory.build(false));} OfxLatexTableRenderer tableRenderer = new LatexTabuRenderer(cmm,dsm); if(preBlankLine){preTxt.add("");} preTxt.addAll(LatexCommentRenderer.stars()); preTxt.addAll(LatexCommentRenderer.comment("Rendering a Latex table with: "+tableRenderer.getClass().getSimpleName())); if(table.isSetComment()) { LatexCommentRenderer rComment = new LatexCommentRenderer(cmm,dsm); rComment.render(table.getComment()); renderer.add(rComment); } LatexTabluarWidthCalculator tabularWidthCalculator = new LatexTabluarWidthCalculator(table.getSpecification().getColumns()); boolean longTable = table.getSpecification().isLong(); boolean floating = table.getSpecification().getFloat().isValue(); boolean flex = tabularWidthCalculator.isFlexTable(); if(!longTable){renderPre(table,floating);} tableRenderer.render(table); renderer.add(tableRenderer); if(!longTable){renderPost(table,floating);} } LatexTableRenderer(CrossMediaManager cmm,DefaultSettingsManager dsm); void setPreBlankLine(boolean preBlankLine); void render(Table table); }
LatexTableRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Table table) throws OfxAuthoringException { if(!table.isSetSpecification()){throw new OfxAuthoringException("<table> without <specification>");} if(!table.isSetContent()){throw new OfxAuthoringException("<table> without <content>");} if(table.getContent().getBody().size()!=1){throw new OfxAuthoringException("<content> must exactly have 1 body!");} if(!table.getSpecification().isSetLong()){table.getSpecification().setLong(false);} if(!table.getSpecification().isSetFloat()){table.getSpecification().setFloat(XmlFloatFactory.build(false));} OfxLatexTableRenderer tableRenderer = new LatexTabuRenderer(cmm,dsm); if(preBlankLine){preTxt.add("");} preTxt.addAll(LatexCommentRenderer.stars()); preTxt.addAll(LatexCommentRenderer.comment("Rendering a Latex table with: "+tableRenderer.getClass().getSimpleName())); if(table.isSetComment()) { LatexCommentRenderer rComment = new LatexCommentRenderer(cmm,dsm); rComment.render(table.getComment()); renderer.add(rComment); } LatexTabluarWidthCalculator tabularWidthCalculator = new LatexTabluarWidthCalculator(table.getSpecification().getColumns()); boolean longTable = table.getSpecification().isLong(); boolean floating = table.getSpecification().getFloat().isValue(); boolean flex = tabularWidthCalculator.isFlexTable(); if(!longTable){renderPre(table,floating);} tableRenderer.render(table); renderer.add(tableRenderer); if(!longTable){renderPost(table,floating);} } LatexTableRenderer(CrossMediaManager cmm,DefaultSettingsManager dsm); void setPreBlankLine(boolean preBlankLine); void render(Table table);  }