コード例 #1
0
ファイル: MyXMLio.java プロジェクト: geogebra/geogebra-old
  /** Returns XML representation of all settings and construction needed for undo. */
  public synchronized StringBuilder getUndoXML(Construction c) {
    Application app = c.getApplication();

    StringBuilder sb = new StringBuilder();
    addXMLHeader(sb);
    addGeoGebraHeader(sb, false, app.getUniqueId());
    // sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
    // sb.append("<geogebra format=\"" + GeoGebra.XML_FILE_FORMAT + "\">\n");

    // save euclidianView settings
    app.getEuclidianViewXML(sb, false);

    // save euclidian view 2 settings
    if (app.hasEuclidianView2EitherShowingOrNot()) {
      app.getEuclidianView2().getXML(sb, false);
    }

    // save kernel settings
    c.getKernel().getKernelXML(sb, false);

    // save construction
    c.getConstructionXML(sb);

    //		// save cas session
    //		if (app.useFullGui() && app.getGuiManager().hasCasView()) {
    //			app.getGuiManager().getCasView().getSessionXML(sb);
    //		}

    // save spreadsheetView settings
    //	if (app.useFullGui() && app.getGuiManager().hasSpreadsheetView())
    //		app.getGuiManager().getSpreadsheetViewXML(sb);

    // save algebraView settings
    // app.getGuiManager().getAlgebraViewXML(sb);

    // save ProbabilityCalculator settings
    if (app.useFullGui() && app.getGuiManager().hasProbabilityCalculator()) {
      app.getGuiManager().getProbabilityCalculatorXML(sb);
    }

    sb.append("</geogebra>");

    /*
     * Application.debug("*******************");
     * Application.debug(sb.toString());
     * Application.debug("*******************");
     */

    return sb;
  }
コード例 #2
0
ファイル: MyXMLio.java プロジェクト: geogebra/geogebra-old
  /** Returns XML representation of all settings and construction. GeoGebra File Format. */
  public String getFullXML() {
    StringBuilder sb = new StringBuilder();
    addXMLHeader(sb);
    addGeoGebraHeader(sb, false, app.getUniqueId());
    // sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
    // sb.append("<geogebra format=\"" + GeoGebra.XML_FILE_FORMAT + "\"");
    // sb.append(" xsi:noNamespaceSchemaLocation=\"http://www.geogebra.org/");
    // sb.append(GeoGebra.GGB_XSD_FILENAME); //eg	ggb.xsd
    // sb.append("\" xmlns=\"\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" >\n");

    // save gui settings
    sb.append(app.getCompleteUserInterfaceXML(false));

    // save construction
    cons.getConstructionXML(sb);

    sb.append("</geogebra>");
    return sb.toString();
  }