Package org.freeplane.features.map

Examples of org.freeplane.features.map.NodeModel


  protected IExtension createExtension(final NodeModel node, final XMLElement element) {
    return this;
  }

  public void nodeChanged(final NodeChangeEvent event) {
    final NodeModel node = event.getNode();
    if (!isActive(node)) {
      return;
    }
    if (event.getProperty().equals(NodeModel.NODE_TEXT) && !((MModeController) Controller.getCurrentModeController()).isUndoAction()) {
      final MNodeStyleController nodeStyleController = (MNodeStyleController) NodeStyleController
View Full Code Here


  protected void actionPerformed(final ActionEvent e, final NodeModel selected) {
    ((MNodeStyleController) NodeStyleController.getController()).setItalic(selected, italic);
  }

  boolean isItalic() {
    final NodeModel node = Controller.getCurrentModeController().getMapController().getSelectedNode();
    return NodeStyleController.getController().isItalic(node);
  }
View Full Code Here

        final Component component = findMapComponent(e);
        if(! (component instanceof MainView)){
          return;
        }
        MainView mainView = (MainView) component;
        final NodeModel model = mainView.getNodeView().getModel();
        switch(e.getClickCount()){
          case 1:
            final MapController mapController = Controller.getCurrentModeController().getMapController();
        mapController.setFolded(model, ! model.isFolded());
            break;
          case 2:
              nodeSelector.nodeSelected(model);
            break;
        }
View Full Code Here

    if (draggedLink != null && mapView.getLayoutType().equals(MapViewLayout.MAP)) {
      final int deltaX = (int) ((e.getX() - originX) / mapView.getZoom());
      final int deltaY = (int) ((e.getY() - originY) / mapView.getZoom());
      double distSqToTarget = 0;
      double distSqToSource = 0;
      final NodeModel target = draggedLink.getTarget();
      final NodeView targetView = mapView.getNodeView(target);
      final NodeView sourceView = mapView.getNodeView(draggedLink.getSource());
      if (targetView != null && sourceView != null) {
        final Point targetLinkPoint = targetView.getLinkPoint(draggedLink.getEndInclination());
        final Point sourceLinkPoint = sourceView.getLinkPoint(draggedLink.getStartInclination());
View Full Code Here

    Rectangle bounds = new Rectangle(0, 0, mainView.getWidth(), mainView.getHeight());
    if(!bounds.contains(e.getDragOrigin()))
      return;
    final int dragActionType = e.getDragAction();
    if (dragActionType == DnDConstants.ACTION_MOVE) {
      final NodeModel node = nodeView.getModel();
      if (node.isRoot()) {
        if(! isLinkDragEvent(e))
          return;
      }
    }
    final String dragActionName;
View Full Code Here

    final ProgressUtilities progUtil = new ProgressUtilities();
    final MapController mapController = Controller.getCurrentModeController().getMapController();
    final Collection<NodeModel> nodes = mapController.getSelectedNodes();
    final ViewerController vc = Controller.getCurrentController().getModeController()
        .getExtension(ViewerController.class);
    final NodeModel selectedNode = mapController.getSelectedNode();
    if (selectedNode == null)
      return;
    final ExternalResource extRes = (ExternalResource) vc.createExtension(selectedNode);
    if (extRes == null)
      return;
    URI absoluteUri = extRes.getAbsoluteUri(selectedNode.getMap());
    if (absoluteUri == null)
      return;
    for (final NodeModel node : nodes) {
      if (!progUtil.hasExternalResource(node)) {
        vc.paste(absoluteUri, node, node.isLeft());
View Full Code Here

  }

  public void extendSelection(final MouseEvent e) {
    final Controller controller = Controller.getCurrentController();
    final NodeView nodeView = getRelatedNodeView(e);
    final NodeModel newlySelectedNode = nodeView.getModel();
    final boolean extend = Compat.isMacOsX() ? e.isMetaDown() : e.isControlDown();
    final boolean range = e.isShiftDown();
    final IMapSelection selection = controller.getSelection();
    if (range && !extend) {
      selection.selectContinuous(newlySelectedNode);
View Full Code Here

                final Component target = ev.getDropTargetContext().getComponent();
                NodeView nodeView = (NodeView) SwingUtilities.getAncestorOfClass(NodeView.class, target);
                final File file = transferData.get(0);
            final ViewerController vc = (Controller.getCurrentController().getModeController()
                  .getExtension(ViewerController.class));
            final NodeModel node = nodeView.getModel();
          vc.paste(file.toURI(), node, node.isLeft());
              }
              catch (Exception e) {
                LogUtils.warn(e);
              }
      }
View Full Code Here

      }
    }
    final NodeView nodeView = nodeSelector.getRelatedNodeView(e);
    if (nodeView == null)
      return;
    final NodeModel model = nodeView.getModel();
      TextController controller = TextController.getController();
    if (eventFromHideDisplayArea(e)){
      final IMapSelection selection = Controller.getCurrentController().getSelection();
      selection.keepNodePosition(model, 0.0f, 0.0f);
        controller.setDetailsHidden(model, ! DetailTextModel.getDetailText(model).isHidden());
View Full Code Here

        final Controller controller = Controller.getCurrentController();
        MLocationController locationController = (MLocationController) LocationController
            .getController(controller.getModeController());
        if (e.getModifiersEx() == 0) {
          final NodeView nodeV = getNodeView(e);
          final NodeModel node = nodeV.getModel();
          locationController.moveNodePosition(node, LocationModel.getModel(node).getVGap(),
              LocationModel.HGAP, 0);
          return;
        }
        if (Compat.isCtrlEvent(e)) {
          final NodeView nodeV = getNodeView(e);
          final NodeModel node = nodeV.getModel();
          locationController.moveNodePosition(node, LocationModel.VGAP, LocationModel.getModel(node)
              .getHGap(), LocationModel.getModel(node).getShiftY());
          return;
        }
      }
View Full Code Here

TOP

Related Classes of org.freeplane.features.map.NodeModel

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.