Examples of Guide


Examples of nl.siegmann.epublib.domain.Guide

      EpubReader epubReader, Book book, Resources resources) {
    Element guideElement = DOMUtil.getFirstElementByTagNameNS(packageDocument.getDocumentElement(), NAMESPACE_OPF, OPFTags.guide);
    if(guideElement == null) {
      return;
    }
    Guide guide = book.getGuide();
    NodeList guideReferences = guideElement.getElementsByTagNameNS(NAMESPACE_OPF, OPFTags.reference);
    for (int i = 0; i < guideReferences.getLength(); i++) {
      Element referenceElement = (Element) guideReferences.item(i);
      String resourceHref = DOMUtil.getAttribute(referenceElement, NAMESPACE_OPF, OPFAttributes.href);
      if (StringUtil.isBlank(resourceHref)) {
        continue;
      }
      Resource resource = resources.getByHref(StringUtil.substringBefore(resourceHref, Constants.FRAGMENT_SEPARATOR_CHAR));
      if (resource == null) {
        log.error("Guide is referencing resource with href " + resourceHref + " which could not be found");
        continue;
      }
      String type = DOMUtil.getAttribute(referenceElement, NAMESPACE_OPF, OPFAttributes.type);
      if (StringUtil.isBlank(type)) {
        log.error("Guide is referencing resource with href " + resourceHref + " which is missing the 'type' attribute");
        continue;
      }
      String title = DOMUtil.getAttribute(referenceElement, NAMESPACE_OPF, OPFAttributes.title);
      if (GuideReference.COVER.equalsIgnoreCase(type)) {
        continue; // cover is handled elsewhere
      }
      GuideReference reference = new GuideReference(resource, type, title, StringUtil.substringAfter(resourceHref, Constants.FRAGMENT_SEPARATOR_CHAR));
      guide.addReference(reference);
    }
  }
View Full Code Here

Examples of org.apache.poi.xslf.model.geom.Guide

                public Guide getAdjustValue(String name) {
                    CTPresetGeometry2D prst = _shape.getSpPr().getPrstGeom();
                    if (prst.isSetAvLst()) {
                        for (CTGeomGuide g : prst.getAvLst().getGdList()) {
                            if (g.getName().equals(name)) {
                                return new Guide(g);
                            }
                        }
                    }
                    return null;
                }
View Full Code Here

Examples of org.apache.poi.xslf.model.geom.Guide

                public Guide getAdjustValue(String name) {
                    CTPresetGeometry2D prst = _shape.getSpPr().getPrstGeom();
                    if (prst.isSetAvLst()) {
                        for (CTGeomGuide g : prst.getAvLst().getGdList()) {
                            if (g.getName().equals(name)) {
                                return new Guide(g);
                            }
                        }
                    }
                    return null;
                }
View Full Code Here

Examples of org.apache.poi.xslf.model.geom.Guide

*/
public class TestFormulaParser extends TestCase {
    public void testParse(){

        Formula[] ops = {
            new Guide("adj1", "val 100"),
            new Guide("adj2", "val 200"),
            new Guide("adj3", "val -1"),
            new Guide("a1", "*/ adj1 2 adj2"), // a1 = 100*2 / 200
            new Guide("a2", "+- adj2 a1 adj1"), // a2 = 200 + a1 - 100
            new Guide("a3", "+/ adj1 adj2 adj2"), // a3 = (100 + 200) / 200
            new Guide("a4", "?: adj3 adj1 adj2"), // a4 = adj3 > 0 ? adj1 : adj2
            new Guide("a5", "abs -2"),
        };

        CustomGeometry geom = new CustomGeometry(CTCustomGeometry2D.Factory.newInstance());
        Context ctx = new Context(geom, null, null);
        for(Formula fmla : ops) {
View Full Code Here

Examples of org.apache.poi.xslf.model.geom.Guide

                public Guide getAdjustValue(String name) {
                    CTPresetGeometry2D prst = _shape.getSpPr().getPrstGeom();
                    if (prst.isSetAvLst()) {
                        for (CTGeomGuide g : prst.getAvLst().getGdArray()) {
                            if (g.getName().equals(name)) {
                                return new Guide(g);
                            }
                        }
                    }
                    return null;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.