Package org.freeplane.core.util

Examples of org.freeplane.core.util.FreeplaneVersion


        NodeStyleModel.setNodeFormat(node, value);
      }
    };
    reader.addAttributeHandler(NodeBuilder.XML_NODE, "FORMAT", formatHandler);
    reader.addAttributeHandler(NodeBuilder.XML_STYLENODE, "FORMAT", formatHandler);
    if (FreeplaneVersion.getVersion().isOlderThan(new FreeplaneVersion(1, 3, 0))) {
      // compatibility for a view 1.2.X preview versions - remove after release 1.3
      reader.addAttributeHandler(NodeBuilder.XML_NODE, "TEMPLATE", formatHandler);
      reader.addAttributeHandler(NodeBuilder.XML_STYLENODE, "TEMPLATE", formatHandler);
    }
View Full Code Here


      return sb.toString();
    }
  }

  private FreeplaneVersion getKnownNewVersion() {
    final FreeplaneVersion localVersion = FreeplaneVersion.getVersion();
    final String property = ResourceController.getResourceController().getProperty(LAST_UPDATE_VERSION);
    if (property.equals("")) {
      return null;
    }
   
    FreeplaneVersion lastVersion = FreeplaneVersion.getVersion(property);
    if (lastVersion.compareTo(localVersion) <= 0) {
      lastVersion = null;
    }
    return lastVersion;
  }
View Full Code Here

    final long nextCheckMillis = ResourceController.getResourceController().getLongProperty(LAST_UPDATE_CHECK_TIME,
        0)
            + TWO_DAYS;
    final Date nextCheckDate = new Date(nextCheckMillis);
    if (now.before(nextCheckDate)) {
      final FreeplaneVersion knownNewVersion = getKnownNewVersion();
      addUpdateButton(knownNewVersion);
      return;
    }
    autorunTimer = new Timer(CHECK_TIME, this);
    autorunTimer.setRepeats(false);
View Full Code Here

       
    // first row : freeplane
        c.gridy = 1;
       
    final JLabel freeplaneLabel = new JLabel("Freeplane");
    final FreeplaneVersion freeplaneLocalVersion = FreeplaneVersion.getVersion();
    final JLabel freeplaneInstalledVersionLabel = new JLabel(freeplaneLocalVersion.toString(), SwingConstants.CENTER);
    final JLabel freeplaneLatestVersionLabel;

    JButton updateButton;
    JButton changelogButton;
    final Locale defaultLocale = Locale.getDefault();
    final String language = defaultLocale.getLanguage();
    final String translatedWebUpdate = getWebUpdateUrl(language);
   
    changelogButton = new JButton(TextUtils.getText("updater.viewChangelog"));
    changelogButton.addActionListener(openUrlListener);
    changelogButton.setActionCommand(translatedWebUpdate);
   
    updateButton = new JButton(TextUtils.getText("updater.goToDownload"));
    updateButton.addActionListener(openUrlListener);
    updateButton.setActionCommand("http://freeplane.sourceforge.net");

    Boolean needsUpdate = Boolean.FALSE;
    if (freeplaneLatestVersion != null) {
      if (freeplaneLocalVersion.compareTo(freeplaneLatestVersion) < 0) {
        needsUpdate = Boolean.TRUE;
      } else {
        needsUpdate = Boolean.FALSE;
      }
      freeplaneLatestVersionLabel = new JLabel(freeplaneLatestVersion.toString(), SwingConstants.CENTER);
    } else {
      freeplaneLatestVersionLabel = new JLabel(TextUtils.getText("updater.version.unknown"), SwingConstants.CENTER);
      freeplaneLatestVersionLabel.setToolTipText(TextUtils.getText(info));
    }
    changelogButton.setEnabled(needsUpdate);
    updateButton.setEnabled(needsUpdate);

    c.gridx = 0;
    gridPane.add(freeplaneLabel, c);
    c.gridx = 1;
    gridPane.add(freeplaneInstalledVersionLabel, c);
    c.gridx = 2;
    gridPane.add(freeplaneLatestVersionLabel, c);
    c.gridx = 3;
    gridPane.add(changelogButton, c);
    c.gridx = 4;
    gridPane.add(updateButton, c);
   

    final List<AddOnProperties> installedAddOns = AddOnsController.getController().getInstalledAddOns();
    gridRow = 3;
    for (AddOnProperties addOnProperties : installedAddOns) {
      FreeplaneVersion addOnLocalVersion = toFreeplaneVersion(addOnProperties.getVersion());
      FreeplaneVersion addOnLatestVersion = toFreeplaneVersion(addOnProperties.getLatestVersion());
     
      final JLabel addOnInstalledVersionLabel = new JLabel(addOnLocalVersion.toString(), SwingConstants.CENTER);
      final JLabel addOnLatestVersionLabel;
      needsUpdate = Boolean.FALSE;
      if (addOnLatestVersion != null) {
        if (addOnLocalVersion.compareTo(addOnLatestVersion) < 0) {
          needsUpdate = Boolean.TRUE;
        }
        addOnLatestVersionLabel = new JLabel(addOnLatestVersion.toString(), SwingConstants.CENTER);
      } else {
        addOnLatestVersionLabel = new JLabel(TextUtils.getText("updater.version.unknown"), SwingConstants.CENTER);
        if (addOnProperties.getUpdateUrl() != null) {
          addOnLatestVersionLabel.setToolTipText(TextUtils.getText("updater.version.unreachable") + " " + addOnProperties.getUpdateUrl());
        } else {
View Full Code Here

      final Graphics2D g2 = (Graphics2D) g;
      splashImage.paintIcon(this, g2, 0, 0);
      if(splashResource.getProtocol().equals("file"))
        return;
      g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
      final FreeplaneVersion version = FreeplaneVersion.getVersion();
      final String versionString = getVersionText(version);
      g2.setColor(Color.WHITE);
      createVersionTextFont();
      final float versionFontSize= 20;
      g2.setFont(versionTextFont.deriveFont(versionFontSize));
View Full Code Here

        final StringBuilder historyBuffer = new StringBuilder();
        historyBuffer.append(firstLine);
        historyBuffer.append('\n');
        for (String line = in.readLine(); line != null; line = in.readLine()) {
            try {
                final FreeplaneVersion version = FreeplaneVersion.getVersion(line);
                if (version.compareTo(currentVersion) <= 0) {
                    break;
                }
            }
            catch (final IllegalArgumentException e) {
            }
View Full Code Here

    ResourceController.getResourceController().setProperty(LAST_UPDATE_CHECK_TIME, Long.toString(now.getTime()));
    final Locale defaultLocale = Locale.getDefault();
    final String language = defaultLocale.getLanguage();
    final String DEFAULT_LANGUAGE = "en";
    final String translatedWebUpdate = getWebUpdateUrl(language);
    final FreeplaneVersion localVersion = FreeplaneVersion.getVersion();
    final HttpVersionClient translatedVersionClient = new HttpVersionClient(translatedWebUpdate, localVersion);
    FreeplaneVersion lastTranslatedVersion = translatedVersionClient.getRemoteVersion();
    if (lastTranslatedVersion == null) {
      lastTranslatedVersion = localVersion;
    }
    final String history;
    final FreeplaneVersion lastVersion;
    final boolean connectSuccessfull;
    if (!language.equals(DEFAULT_LANGUAGE)) {
      final String defaultWebUpdate = getWebUpdateUrl(DEFAULT_LANGUAGE);
      final HttpVersionClient defaultVersionClient = new HttpVersionClient(defaultWebUpdate,
          lastTranslatedVersion);
View Full Code Here

  private void checkForAddonsUpdates() {
    // loop on add-ons
    List<AddOnProperties> installedAddOns = AddOnsController.getController().getInstalledAddOns();
    LogUtils.info("checking for updates of " + installedAddOns.size() + " add-ons");
    for (AddOnProperties addOnProperties : installedAddOns) {
      FreeplaneVersion addOnLocalVersion = toFreeplaneVersion(addOnProperties.getVersion());
      // get the update-url for this add-on
      // append the current add-on version for
      // - statistics (appending a freeplane installation unique id would enable building add-on usage statistics)
      // - handling special cases ? (maybe we could send the freeplane version too)     
      final URL updateUrl = addOnProperties.getUpdateUrl();
            if (updateUrl != null) {
        final String addOnUpdateRequest = updateUrl + "?v=" + addOnLocalVersion.toString();
        final HttpVersionClient versionClient = new HttpVersionClient(addOnUpdateRequest, addOnLocalVersion);
        final boolean connectSuccesfull;
        final FreeplaneVersion latestVersion = versionClient.getRemoteVersion();

        connectSuccesfull = versionClient.isSuccessful();
        if (connectSuccesfull) {
          addOnProperties.setLatestVersion(latestVersion.toString());
          if (versionClient.getRemoteVersionDownloadUrl() != null) {
            addOnProperties.setLatestVersionDownloadUrl(versionClient.getRemoteVersionDownloadUrl());
          }
          if (versionClient.getRemoteVersionChangelogUrl() != null) {
            addOnProperties.setLatestVersionChangelogUrl(versionClient.getRemoteVersionChangelogUrl());
View Full Code Here

  }

    private String getWebUpdateUrl(final String language) {
    {
      final String webUpdateUrl = ResourceController.getResourceController().getProperty(WEB_UPDATE_LOCATION_KEY);
      final FreeplaneVersion localVersion = FreeplaneVersion.getVersion();
      final StringBuilder sb = new StringBuilder(webUpdateUrl);
      final String type = localVersion.getType();
      if(! type.equals("")){
        sb.append(type);
        sb.append('/');
      }
      sb.append("history_");
View Full Code Here

TOP

Related Classes of org.freeplane.core.util.FreeplaneVersion

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.