/** * Inserts figure into DocBook file * * @param path * @param * @return true of false */ public static void insertFigure( DocbookFactory factory, FigureType ucFigure, String path, String legend, String align, String scale /*String id*/ ) { // Tag Imagedata creation ImagedataType ucImageData = factory.createImagedataType(); ucImageData.setFileref(path); ucImageData.setAlign(align); ucImageData.setScale(scale); // Tag Imageobject creation ImageobjectType ucImageObject = factory.createImageobjectType(); ucImageObject.setImagedata(ucImageData); // Tag MediaobjectType Creation MediaobjectType ucMediaObject = factory.createMediaobjectType(); ucMediaObject.setImageobject(ucImageObject); // ucFigure.setId(id); TitleType ucFigureTitle = factory.createTitleType(); FeatureMapUtil.addText(ucFigureTitle.getMixed(), legend); ucFigure.setTitle(ucFigureTitle); ucFigure.setMediaobject(ucMediaObject); }
public static void insertText(DocbookFactory factory, EntryType entry, String text) { if (text != null) { java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(text, "\n"); while (tokenizer.hasMoreTokens()) { ParaType p = factory.createParaType(); FeatureMapUtil.addText(p.getMixed(), tokenizer.nextToken()); entry.getPara().add(p); } } }