Package org.freeplane.view.swing.map

Examples of org.freeplane.view.swing.map.NodeView


  public void drop(final DropTargetDropEvent dtde) {
    try {
      int dropAction = dtde.getDropAction();
      final Transferable t = dtde.getTransferable();
      final MainView mainView = (MainView) dtde.getDropTargetContext().getComponent();
      final NodeView targetNodeView = mainView.getNodeView();
      final MapView mapView = targetNodeView.getMap();
      mapView.select();
      final NodeModel targetNode = targetNodeView.getModel();
      final Controller controller = Controller.getCurrentController();
      if (dtde.isLocalTransfer() && t.isDataFlavorSupported(MindMapNodesSelection.dropActionFlavor)) {
        final String sourceAction = (String) t.getTransferData(MindMapNodesSelection.dropActionFlavor);
        if (sourceAction.equals("LINK")) {
          dropAction = DnDConstants.ACTION_LINK;
View Full Code Here


      if(popupmenu.isShowing()){
        return;
      }
    }
    final MainView component = (MainView) e.getComponent();
    NodeView nodeView = component.getNodeView();
    if (nodeView == null)
      return;

    final NodeModel node = nodeView.getModel();
    final boolean plainEvent = Compat.isPlainEvent(e);
    final boolean inside = nodeSelector.isInside(e);
    final MapController mapController = mc.getMapController();
    if(e.getButton() == 1){
      if(plainEvent){
View Full Code Here

  private void showFoldingPopup(MouseEvent e) {
    ModeController mc = Controller.getCurrentController().getModeController();
    final FoldingController foldingController = mc.getExtension(FoldingController.class);
    if(foldingController == null)
      return;
    final NodeView nodeView = nodeSelector.getRelatedNodeView(e);
    final JPopupMenu popupmenu = foldingController.createFoldingPopupMenu(nodeView.getModel());
    AutoHide.start(popupmenu);
    new NodePopupMenuDisplayer().showMenuAndConsumeEvent(popupmenu, e);
    }
View Full Code Here

  @Override
  protected void add(final NodeModel node, final IExtension extension) {
    final ExternalResource preview = (ExternalResource) extension;
    for(NodeModel nodeClone : node.clones()){
      for (final INodeView iNodeView : nodeClone.getViewers()) {
        final NodeView view = (NodeView) iNodeView;
        createViewer(preview, view);
      }
    }
    super.add(node, extension);
  }
View Full Code Here

  protected Class<ExternalResource> getExtensionClass() {
    return ExternalResource.class;
  }

  public void onViewCreated(final Container container) {
    final NodeView nodeView = (NodeView) container;
    final ExternalResource previewUri = nodeView.getModel().getExtension(ExternalResource.class);
    if (previewUri == null) {
      return;
    }
    createViewer(previewUri, nodeView);
  }
View Full Code Here

    }
    createViewer(previewUri, nodeView);
  }

  public void onViewRemoved(final Container container) {
    final NodeView nodeView = (NodeView) container;
    final ExternalResource previewUri = nodeView.getModel().getExtension(ExternalResource.class);
    if (previewUri == null) {
      return;
    }
    deleteViewer(previewUri, nodeView);
  }
View Full Code Here

    MModeWorkspaceLinkController.getController().prepareOptionPanelBuilder(((MModeController)modeController).getOptionPanelBuilder());
   
    modeController.addINodeViewLifeCycleListener(new INodeViewLifeCycleListener() {

      public void onViewCreated(Container nodeView) {
        NodeView node = (NodeView) nodeView;
        final DropTarget dropTarget = new DropTarget(node.getMainView(), new MNodeDropListener() {
          public void drop(final DropTargetDropEvent dtde) {
            DropTargetDropEvent evt = dtde;
            if(dtde.getTransferable().isDataFlavorSupported(WorkspaceTransferable.WORKSPACE_NODE_FLAVOR)) {
              evt = new DropTargetDropEvent(dtde.getDropTargetContext(), dtde.getLocation(), dtde.getDropAction(), dtde.getSourceActions(), false);
            }
View Full Code Here

          .getProperty("el__max_default_window_width")));
        final Dimension preferredSize = new Dimension(preferredWidth, preferredHeight);
        editNodeWYSIWYG.setPreferredSize(preferredSize);
      }
      final MainView mainView = (MainView) getComponent(node);
          final NodeView nodeView = mainView.getNodeView();
      if(EditedComponent.TEXT.equals(editControl.getEditType())){
              final Font font = getFont(node);
              editNodeWYSIWYG.setTitle("edit_long_node");
              editNodeWYSIWYG.setFont(font);
              final Color nodeTextColor = getTextColor(node);
              editNodeWYSIWYG.setTextColor(nodeTextColor);
        editNodeWYSIWYG.setBackground (nodeView.getTextBackground());
      }
      else if(EditedComponent.DETAIL.equals(editControl.getEditType())){
          final MapView map = nodeView.getMap();
              editNodeWYSIWYG.setTitle("edit_details");
                editNodeWYSIWYG.setFont(map.getDetailFont());
                editNodeWYSIWYG.setTextColor(map.getDetailForeground());
                editNodeWYSIWYG.setBackground (nodeView.getDetailBackground());
      }
      else if(EditedComponent.NOTE.equals(editControl.getEditType())){
          final MapView map = nodeView.getMap();
              editNodeWYSIWYG.setTitle("edit_note");
                editNodeWYSIWYG.setFont(map.getDefaultNoteFont());
                editNodeWYSIWYG.setBackground (Color.WHITE);
      }
      return editNodeWYSIWYG;
View Full Code Here

      if (mainView.getMouseArea().equals(MouseArea.MOTION)) {
        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

 
  private EditNodeBase createEditor(final NodeModel node, final EditedComponent parent, final String text,
                                                       final IEditControl editControl) {
    final ZoomableLabel parentComponent;
    final MainView mainView = (MainView) getComponent(node);
        final NodeView nodeView = mainView.getNodeView();
    if(EditedComponent.TEXT.equals(parent))
      parentComponent = mainView;
    else if(EditedComponent.DETAIL.equals(parent)) {
      final JComponent component = nodeView.getContent(NodeView.DETAIL_VIEWER_POSITION);
          if(component instanceof ZoomableLabel)
            parentComponent = (ZoomableLabel) component;
          else
            parentComponent = null;
        }
        else
      parentComponent = null;
    if(parentComponent == null || ! parentComponent.isVisible()){
      return null;
    }
    final EditNodeTextField textField = new EditNodeTextField(node, (ZoomableLabel) parentComponent, text, editControl);
    if(EditedComponent.TEXT.equals(parent))
      textField.setBackground (nodeView.getTextBackground());
    else if(EditedComponent.DETAIL.equals(parent))
      textField.setBackground (nodeView.getDetailBackground());
    return textField;
  }
View Full Code Here

TOP

Related Classes of org.freeplane.view.swing.map.NodeView

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.