Ejemplo n.º 1
0
  private static XStartGlyphElement loadGlyphElement(InputStream a_in) {
    IGlyphFactory factory = GlyphFactory.getFactory();
    XStartGlyphElement retval = null;

    try {
      retval = factory.createXStartGlyphElement(a_in);
    } catch (SAXException | ParserConfigurationException | IOException e) {
      e.printStackTrace();
    }

    return retval;
  }
Ejemplo n.º 2
0
 /**
  * Initializes the <code>XParamList</code> by the Stack <code>stack</code> that contains Elements.
  * This constructor is supposed to be used internally by the Relaxer system.
  *
  * @param stack
  */
 public void setup(RStack stack) {
   Element element = stack.getContextElement();
   IGlyphFactory factory = GlyphFactory.getFactory();
   paramListParam_.clear();
   while (true) {
     if (XParamListParam.isMatch(stack)) {
       addParamListParam(factory.createXParamListParam(stack));
     } else {
       break;
     }
   }
 }
Ejemplo n.º 3
0
  /** used for cut and paste. */
  public void addObjectFromClipboard(String a_value) throws CircularIncludeException {
    Reader reader = new StringReader(a_value);
    Document document = null;
    try {
      document = UJAXP.getDocument(reader);
    } catch (Exception e) {
      e.printStackTrace();
      return;
    } // try-catch

    Element root = document.getDocumentElement();
    if (!root.getNodeName().equals("clipboard")) {
      return;
    } // if

    Node child;
    for (child = root.getFirstChild(); child != null; child = child.getNextSibling()) {
      if (!(child instanceof Element)) {
        continue;
      } // if
      Element element = (Element) child;

      IGlyphFactory factory = GlyphFactory.getFactory();

      if (XModule.isMatch(element)) {
        EModuleInvoke module = (EModuleInvoke) factory.createXModule(element);
        addModule(module);
        continue;
      } // if

      if (XContour.isMatch(element)) {
        EContour contour = (EContour) factory.createXContour(element);
        addContour(contour);
        continue;
      } // if

      if (XInclude.isMatch(element)) {
        EIncludeInvoke include = (EIncludeInvoke) factory.createXInclude(element);
        addInclude(include);
        continue;
      } // if
    } // while
  }
Ejemplo n.º 4
0
 /** @return Object */
 public Object clone() {
   IGlyphFactory factory = GlyphFactory.getFactory();
   return (factory.createXParamList((XParamList) this));
 }