Example #1
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
  }
 /**
  * Creates a DOM document representation of the object.
  *
  * @exception ParserConfigurationException
  * @return Document
  */
 public Document makeDocument() throws ParserConfigurationException {
   Document doc = UJAXP.makeDocument();
   makeElement(doc);
   return (doc);
 }
 /**
  * Initializes the <code>TextTransition</code> by the Reader <code>reader</code>.
  *
  * @param reader
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(Reader reader) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getDocument(reader, UJAXP.FLAG_NAMESPACE_AWARE));
 }
 /**
  * Initializes the <code>TextTransition</code> by the InputSource <code>is</code>.
  *
  * @param is
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(InputSource is) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getDocument(is, UJAXP.FLAG_NAMESPACE_AWARE));
 }
 /**
  * Initializes the <code>TextTransition</code> by the URL <code>url</code>.
  *
  * @param url
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(URL url) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getDocument(url, UJAXP.FLAG_NAMESPACE_AWARE));
 }
Example #6
0
 /**
  * Initializes the <code>FtLegal</code> by the InputStream <code>in</code>.
  *
  * @param in
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(InputStream in) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getDocument(in, UJAXP.FLAG_NONE));
 }
Example #7
0
 /**
  * Initializes the <code>FtLegal</code> by the String representation of URI <code>uri</code>.
  *
  * @param uri
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(String uri) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getDocument(uri, UJAXP.FLAG_NONE));
 }
 /**
  * Initializes the <code>Direction</code> by the Reader <code>reader</code>.
  *
  * @param reader
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(Reader reader) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getValidDocument(reader));
 }
 /**
  * Initializes the <code>Direction</code> by the InputSource <code>is</code>.
  *
  * @param is
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(InputSource is) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getValidDocument(is));
 }
 /**
  * Initializes the <code>Direction</code> by the URL <code>url</code>.
  *
  * @param url
  * @exception IOException
  * @exception SAXException
  * @exception ParserConfigurationException
  */
 public void setup(URL url) throws IOException, SAXException, ParserConfigurationException {
   setup(UJAXP.getValidDocument(url));
 }