Package org.freeplane.n3.nanoxml

Examples of org.freeplane.n3.nanoxml.XMLAttribute


    final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
    for (File file : addonXmlFiles) {
      BufferedInputStream inputStream = null;
      try {
        inputStream = new BufferedInputStream(new FileInputStream(file));
        final IXMLReader reader = new StdXMLReader(inputStream);
        parser.setReader(reader);
        registerInstalledAddOn(new AddOnProperties(AddOnType.PLUGIN, (XMLElement) parser.parse()));
      }
      catch (final Exception e) {
        LogUtils.warn("error parsing " + file, e);
View Full Code Here


    InputStream xmlDescriptorStream = null;
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final URL resource = ResourceController.getResourceController().getResource(xmlDescriptorFile);
      xmlDescriptorStream = resource.openStream();
      final IXMLReader reader = new StdXMLReader(xmlDescriptorStream);
      parser.setReader(reader);
      final XMLElement xml = (XMLElement) parser.parse();
      final Enumeration<XMLElement> actionDescriptors = xml.enumerateChildren();
      while (actionDescriptors.hasMoreElements()) {
        final XMLElement descriptor = actionDescriptors.nextElement();
View Full Code Here

      LogUtils.info(pathToFile + " does not exist yet");
      return;
    }
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final IXMLReader reader = new StdXMLReader(new BufferedInputStream(new FileInputStream(configXml)));
      parser.setReader(reader);
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> scannerElements = loader.getChildren();
      for (XMLElement elem : scannerElements) {
        scanners.add(parseScanner(elem));
View Full Code Here

    final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
    for (File file : addonXmlFiles) {
      BufferedInputStream inputStream = null;
      try {
        inputStream = new BufferedInputStream(new FileInputStream(file));
        final IXMLReader reader = new StdXMLReader(inputStream);
        parser.setReader(reader);
        final ScriptAddOnProperties addOn = new ScriptAddOnProperties((XMLElement) parser.parse());
        addOn.setAddOnPropertiesFile(file);
        AddOnsController.getController().registerInstalledAddOn(addOn);
      }
View Full Code Here

   * (non-Javadoc)
   * @see freeplane.persistence.Reader#load()
   */
  public void load(final Reader reader) throws XMLException {
    parser = new XMLParser();
    final IXMLReader nanoxmlReader = new StdXMLReader(reader);
    parser.setReader(nanoxmlReader);
    parser.setBuilder(this);
    parser.setValidator(new NonValidator());
    parser.parse();
  }
View Full Code Here

    return unmarschall(marshalled, dialog);
  }
  protected XMLElement unmarschall(final String marshalled, final JDialog dialog) {
    if (marshalled != null) {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final IXMLReader xmlReader = new StdXMLReader(new StringReader(marshalled));
      parser.setReader(xmlReader);
      try {
        final XMLElement storage = (XMLElement) parser.parse();
        if (storage != null) {
          x = Integer.parseInt(storage.getAttribute("x", "-1"));
View Full Code Here

  private void writeContent(final ITreeWriter writer, final NodeModel node, final NodeStyleModel style,
                            final boolean forceFormatting) throws IOException {
    if(! NodeWriter.shouldWriteSharedContent(writer))
      return;
    if (forceFormatting || style != null) {
      final XMLElement fontElement = new XMLElement();
      fontElement.setName("font");
      boolean isRelevant = forceFormatting;
      final String fontFamilyName = forceFormatting ? nsc.getFontFamilyName(node) : style.getFontFamilyName();
      if (fontFamilyName != null) {
        fontElement.setAttribute("NAME", fontFamilyName);
        isRelevant = true;
      }
      final Integer fontSize = forceFormatting ? Integer.valueOf(nsc.getFontSize(node)) : style.getFontSize();
      if (fontSize != null) {
        fontElement.setAttribute("SIZE", Integer.toString(fontSize));
        isRelevant = true;
      }
      final Boolean bold = forceFormatting ? Boolean.valueOf(nsc.isBold(node)) : style.isBold();
      if (bold != null) {
        fontElement.setAttribute("BOLD", bold ? "true" : "false");
        isRelevant = true;
      }
      final Boolean italic = forceFormatting ? Boolean.valueOf(nsc.isItalic(node)) : style.isItalic();
      if (italic != null) {
        fontElement.setAttribute("ITALIC", italic ? "true" : "false");
        isRelevant = true;
      }
      if (isRelevant) {
        writer.addElement(style, fontElement);
      }
View Full Code Here

  }

  @Override
  protected IExtension createExtension(final NodeModel node, final XMLElement element) {
    final ReminderExtension reminderExtension = new ReminderExtension(node);
    final XMLElement parameters = element.getFirstChildNamed("Parameters");
    final String time = parameters.getAttribute(REMINDUSERAT, "0");
    final String unit = parameters.getAttribute(UNIT, "DAY");
    final String period = parameters.getAttribute(PERIOD, "1");
    reminderExtension.setRemindUserAt(Long.parseLong(time));
    reminderExtension.setPeriodUnit(PeriodUnit.valueOf(unit));
    reminderExtension.setPeriod(Integer.parseInt(period));
    final String script = parameters.getAttribute(SCRIPT, null);
    reminderExtension.setScript(script);
    return reminderExtension;
  }
View Full Code Here

  @Override
  protected void saveExtension(final IExtension extension, final XMLElement element) {
    super.saveExtension(extension, element);
    final ReminderExtension reminderExtension = (ReminderExtension) extension;
    final XMLElement parameters = element.createElement("Parameters");
    parameters.setAttribute(REMINDUSERAT, Long.toString(reminderExtension.getRemindUserAt()));
    parameters.setAttribute(PERIOD, Integer.toString(reminderExtension.getPeriod()));
    parameters.setAttribute(UNIT, reminderExtension.getPeriodUnit().toString());
    final String script = reminderExtension.getScript();
    if(script != null){
      parameters.setAttribute(SCRIPT, script);
    }
   
    element.addChild(parameters);
  }
View Full Code Here

          throws IOException {
    final CloudModel model = extension != null ? (CloudModel) extension : cc.getCloud(node);
    if (model == null) {
      return;
    }
    final XMLElement cloud = new XMLElement();
    cloud.setName("cloud");
    //    final String style = model.getStyle();
    //    if (style != null) {
    //      cloud.setAttribute("STYLE", style);
    //    }
    final Color color = model.getColor();
    if (color != null) {
      cloud.setAttribute("COLOR", ColorUtils.colorToString(color));
    }
    final CloudModel.Shape shape = model.getShape();
    if (shape != null) {
      cloud.setAttribute("SHAPE", shape.toString());
    }
    //    final int width = model.getWidth();
    //    if (width != CloudController.DEFAULT_WIDTH) {
    //      cloud.setAttribute("WIDTH", Integer.toString(width));
    //    }
View Full Code Here

TOP

Related Classes of org.freeplane.n3.nanoxml.XMLAttribute

Copyright © 2018 www.massapicom. 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.