Package com.mxgraph.io

Examples of com.mxgraph.io.mxCodec.decode()


      // Loads the defalt stylesheet from an external file
      mxCodec codec = new mxCodec();
      Document doc = mxUtils.loadDocument(GraphEditor.class.getResource(
          "/com/mxgraph/examples/swing/resources/default-style.xml")
          .toString());
      codec.decode(doc.getDocumentElement(), graph.getStylesheet());

      // Sets the background to white
      getViewport().setOpaque(true);
      getViewport().setBackground(Color.WHITE);
    }
View Full Code Here


        Document doc = mxUtils.loadDocument(EditorActions.class
            .getResource(stylesheet).toString());

        if (doc != null)
        {
          codec.decode(doc.getDocumentElement(),
              graph.getStylesheet());
          graph.refresh();
        }
      }
    }
View Full Code Here

        if (value != null)
        {
          Document document = mxUtils.parseXml(URLDecoder.decode(
              value, "UTF-8"));
          mxCodec codec = new mxCodec(document);
          codec.decode(document.getDocumentElement(), editor
              .getGraphComponent().getGraph().getModel());
          editor.setCurrentFile(file);
          resetEditor(editor);

          return;
View Full Code Here

                        document);
                  }
                  else
                  {
                    mxCodec codec = new mxCodec(document);
                    codec.decode(
                        document.getDocumentElement(),
                        graph.getModel());
                    editor.setCurrentFile(fc
                        .getSelectedFile());
                  }
View Full Code Here

      // Loads the defalt stylesheet from an external file
      mxCodec codec = new mxCodec();
      Document doc = mxUtils.loadDocument(GraphEditor.class.getResource(
          "/com/mxgraph/examples/swing/resources/default-style.xml")
          .toString());
      codec.decode(doc.getDocumentElement(), graph.getStylesheet());

      // Sets the background to white
      getViewport().setOpaque(true);
      getViewport().setBackground(Color.WHITE);
    }
View Full Code Here

        // Handles the special case were no ids should be
        // resolved in the existing model. This change will
        // replace all registered ids and cells from the
        // model and insert a new cell hierarchy instead.
        mxCodec tmp = new mxCodec(node.getOwnerDocument());
        change = tmp.decode(node);
      }
      else
      {
        change = codec.decode(node);
      }
View Full Code Here

        Document doc = mxUtils.loadDocument(EditorActions.class
            .getResource(stylesheet).toString());

        if (doc != null)
        {
          codec.decode(doc.getDocumentElement(),
              graph.getStylesheet());
          graph.refresh();
        }
      }
    }
View Full Code Here

        if (value != null)
        {
          Document document = mxXmlUtils.parseXml(URLDecoder.decode(
              value, "UTF-8"));
          mxCodec codec = new mxCodec(document);
          codec.decode(document.getDocumentElement(), editor
              .getGraphComponent().getGraph().getModel());
          editor.setCurrentFile(file);
          resetEditor(editor);

          return;
View Full Code Here

                      .parseXml(mxUtils.readFile(fc
                          .getSelectedFile()
                          .getAbsolutePath()));

                  mxCodec codec = new mxCodec(document);
                  codec.decode(
                      document.getDocumentElement(),
                      graph.getModel());
                  editor.setCurrentFile(fc
                      .getSelectedFile());
View Full Code Here

        // Handles the special case were no ids should be
        // resolved in the existing model. This change will
        // replace all registered ids and cells from the
        // model and insert a new cell hierarchy instead.
        mxCodec tmp = new mxCodec(node.getOwnerDocument());
        change = tmp.decode(node);
      }
      else
      {
        change = codec.decode(node);
      }
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.