Package org.freeplane.view.swing.features.filepreview

Examples of org.freeplane.view.swing.features.filepreview.ExternalResource


    private ExternalResource getExternalObjectModel() {
        return (ExternalResource) getDelegate().getExtension(ExternalResource.class);
    }

    public String getUri() {
        final ExternalResource externalObject = getExternalObjectModel();
        final URI uri = externalObject == null ? null : externalObject.getUri();
        return uri == null ? null : uri.toString();
    }
View Full Code Here


    private ViewerController getViewerController() {
        return getModeController().getExtension(ViewerController.class);
    }

    public float getZoom() {
        final ExternalResource externalObject = getExternalObjectModel();
        return externalObject == null ? 1f : externalObject.getZoom();
    }
View Full Code Here

    public void setURI(final String uri) {
        setUri(uri);
    }

    public void setZoom(final float zoom) {
        final ExternalResource externalObject = getExternalObjectModel();
        if (externalObject != null)
            getViewerController().setZoom(getModeController(), getDelegate().getMap(), externalObject, zoom);
    }
View Full Code Here

  /**
   *
   * @return : true if the node has an external resource attached.
   */
  public boolean hasExternalResource(final NodeModel node) {
    final ExternalResource extResource = (ExternalResource) node.getExtension(ExternalResource.class);
    if (extResource == null) {
      return false;
    }
    else {
      return true;
View Full Code Here

  /**
   *
   * @return : true if the node has an extended progress icon attached.
   */
  public boolean hasExtendedProgressIcon(final NodeModel node) {
    final ExternalResource extResource = (ExternalResource) node.getExtension(ExternalResource.class);
    if (extResource == null) {
      return false;
    }
    if (extResource.getUri().toString().matches(ProgressIcons.EXTENDED_PROGRESS_ICON_IDENTIFIER)) {
      return true;
    }
    return false;
  }
View Full Code Here

          if(! FileUtils.getExtension(file.getName()).equals(IMAGE_FORMAT))
            file = new File(file.getPath() + '.' + IMAGE_FORMAT);
          final URI uri = LinkController.toLinkTypeDependantURI(mindmapFile, file);
              ImageIO.write(image, IMAGE_FORMAT, file);
        final NodeModel node = mapController.newNode(file.getName(), target.getMap());
        final ExternalResource extension = new ExternalResource(uri);
        node.addExtension(extension);
        mapController.insertNode(node, target, asSibling, isLeft, isLeft);
            }
            catch (IOException e) {
              e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.freeplane.view.swing.features.filepreview.ExternalResource

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.