Package org.freeplane.core.extension

Examples of org.freeplane.core.extension.IExtension


      final MapView mapView = (MapView) e.getComponent();
      final Object object = mapView.detectCollision(new Point(originX, originY));
      if(object != null)
        return;
      final ModeController modeController = Controller.getCurrentModeController();
      final IExtension freeNode = modeController.getExtension(FreeNode.class);
      if(freeNode != null && modeController instanceof MModeController){
        final JComponent rootContent = mapView.getRoot().getMainView();
        final Point contentPt = new Point();
        UITools.convertPointToAncestor(rootContent, contentPt, mapView);
        final float zoom = mapView.getZoom();
View Full Code Here


    }
     
    }

  public Color getBackground(final MapModel map) {
    final IExtension extension = map.getRootNode().getExtension(MapStyleModel.class);
    final Color backgroundColor = extension != null ? ((MapStyleModel) extension).getBackgroundColor() : null;
    if (backgroundColor != null) {
      return backgroundColor;
    }
    final String stdcolor = ResourceController.getResourceController().getProperty(
View Full Code Here

  private void moveStyle(final MapModel sourceMap, final MapModel targetMap, boolean overwrite) {
      final MapStyleModel source = (MapStyleModel) sourceMap.getRootNode().removeExtension(MapStyleModel.class);
      if(source == null)
        return;
    final IExtension undoHandler = targetMap.getExtension(IUndoHandler.class);
    source.getStyleMap().putExtension(IUndoHandler.class, undoHandler);
    final NodeModel targetRoot = targetMap.getRootNode();
    final MapStyleModel target = MapStyleModel.getExtension(targetRoot);
    if(target == null){
      targetRoot.addExtension(source);
View Full Code Here

      return null;
    }
 
  public void copyStyle(final URL source, final MapModel targetMap, boolean undoable) {
      final MapModel styleMapContainer = new MapModel();
    final IExtension oldStyleModel = targetMap.getRootNode().removeExtension(MapStyleModel.class);
    UrlManager.getController().loadCatchExceptions(source, styleMapContainer);
    onCreate(styleMapContainer);
    moveStyle(styleMapContainer, targetMap, true);
    LogicalStyleController.getController().refreshMap(targetMap);
    if(! undoable){
      return;
    }
    final IExtension newStyleModel = targetMap.getRootNode().getExtension(MapStyleModel.class);
    IActor actor = new IActor() {
      public void undo() {
        targetMap.getRootNode().putExtension(oldStyleModel);
      }
     
View Full Code Here

        mNodeFormat.setValue(viewNodeFormat);
      }
      if(mAutomaticLayoutComboBox != null){
        final ModeController modeController = Controller.getCurrentModeController();
        AutomaticLayoutController al = modeController.getExtension(AutomaticLayoutController.class);
        IExtension extension = al.getExtension(node);
        if(extension == null)
          mAutomaticLayoutComboBox.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);
        else
          mAutomaticLayoutComboBox.setSelectedIndex(((AutomaticLayout)extension).ordinal());
      }
View Full Code Here

      }
      final NodeModel node = (NodeModel) userObject;
      if (node.getExtension(getExtensionClass()) != null) {
        return;
      }
      final IExtension extension = createExtension(node, lastBuiltElement);
      if (extension == null) {
        return;
      }
      add(node, extension);
    }
View Full Code Here

  }

  public void addExtensionAttributes(final Object map, final Collection<IExtension> extensions) {
    final Iterator<IExtension> extensionIterator = extensions.iterator();
    while (extensionIterator.hasNext()) {
      final IExtension extension = extensionIterator.next();
      final Iterator<IExtensionAttributeWriter> writerIterator = writeManager.getExtensionAttributeWriters()
          .iterator(extension.getClass());
      while (writerIterator.hasNext()) {
        writerIterator.next().writeAttributes(this, map, extension);
      }
    }
  }
View Full Code Here

  }

  public void addExtensionNodes(final Object map, final Collection<IExtension> extensions) throws IOException {
    final Iterator<IExtension> extensionIterator = extensions.iterator();
    while (extensionIterator.hasNext()) {
      final IExtension extension = extensionIterator.next();
      final Iterator<IExtensionElementWriter> writerIterator = writeManager.getExtensionElementWriters()
          .iterator(extension.getClass());
      while (writerIterator.hasNext()) {
        writerIterator.next().writeContent(this, map, extension);
      }
    }
  }
View Full Code Here

    private boolean isActiveForSelection(Enum<?> value) {
        final NodeModel[] nodes = getNodes();
        for (int i = 0; i < nodes.length; i++) {
            final NodeModel nodeModel = nodes[i];
            final IExtension nodeValue = nodeModel.getExtension(getExtensionClass());
            if (value == null && nodeValue != null || value != null && !value.equals(nodeValue)) {
                return false;
            }
        }
        return true;
View Full Code Here

  public void undoableActivateHook(final NodeModel node, final IExtension extension) {
    undoableToggleHook(node, extension);
  }

  public void undoableDeactivateHook(final NodeModel node) {
    final IExtension extension = node.getExtension(getExtensionClass());
    if (extension != null) {
      undoableToggleHook(node, extension);
    }
  }
View Full Code Here

TOP

Related Classes of org.freeplane.core.extension.IExtension

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.