Package org.freeplane.view.swing.map

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


   * @see
   * freeplane.modes.ModeController.MouseWheelEventHandler#handleMouseWheelEvent
   * (java.awt.event.MouseWheelEvent)
   */
  public void mouseWheelMoved(final MouseWheelEvent e) {
    final MapView mapView = (MapView) e.getSource();
    final ModeController mController = mapView.getModeController();
    if (mController.isBlocked()) {
      return;
    }
    final Set<IMouseWheelEventHandler> registeredMouseWheelEventHandler = mController.getUserInputListenerFactory()
        .getMouseWheelEventHandlers();
View Full Code Here


  protected void handlePopup(final MouseEvent e) {
    if (e.isPopupTrigger()) {
      Component popup = null;
      final Component popupForModel;
      final MapView mapView = (MapView) Controller.getCurrentController().getMapViewManager().getMapViewComponent();
      final ModeController modeController = Controller.getCurrentController().getModeController();
      if(mapView != null){
        final java.lang.Object obj = mapView.detectCollision(e.getPoint());
        popupForModel= LinkController.getController(modeController).getPopupForModel(obj);
      }
      else{
        popupForModel = null;
      }
View Full Code Here

  public void mouseClicked(final MouseEvent e) {
    final Object source = e.getSource();
    if(! (source instanceof MapView))
      return;
    final MapView map = (MapView) source;
    final Controller controller = map.getModeController().getController();
    final IMapSelection selection = controller.getSelection();
    if(selection != null){
      final NodeModel selected = selection.getSelected();
      if(selected != null)
        controller.getMapViewManager().getComponent(selected).requestFocusInWindow();
View Full Code Here

  public void mouseMoved(final MouseEvent e) {
  }

  public void mousePressed(final MouseEvent e) {
    final MapView mapView = MapView.getMapView(e.getComponent());
    if(mapView != null)
      mapView.select();
    if (e.isPopupTrigger()) {
      handlePopup(e);
    }
    else if (e.getButton() == MouseEvent.BUTTON1){
      if(mapView != null){
        mapView.setMoveCursor(true);
        originX = e.getX();
        originY = e.getY();
      }
    }
    e.consume();
View Full Code Here

    }
    e.consume();
  }

  public void mouseReleased(final MouseEvent e) {
    final MapView mapView = MapView.getMapView(e.getComponent());
    if(mapView != null)
      mapView.setMoveCursor(false);
    originX = -1;
    originY = -1;
    handlePopup(e);
    e.consume();
  }
View Full Code Here

  /**
   *
   */
  public void mouseDragged(final MouseEvent e) {
    final JComponent component = (JComponent) e.getComponent();
    final MapView mapView = MapView.getMapView(component);
    if(mapView == null)
      return;
    if (originX >= 0) {
      final int dx = originX - e.getX();
      final int dy = originY - e.getY();
      final Rectangle visibleRect = component.getVisibleRect();
      final Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1);
      final boolean isEventPointVisible = visibleRect.contains(r);
      if (isEventPointVisible)
              mapView.scrollBy(dx, dy);
            else {
        mapView.scrollBy(dx/3, dy/3);
        originX += dx/3;
        originY += dy/3;
      }
    }
  }
View Full Code Here

      currentNodeHolder = lastNodeHolder;
      go(back);
      return;
    }
    boolean changeModule = false;
    MapView newModule = null;
    if (lastNodeHolder.getHoldMapView() != currentNodeHolder.getHoldMapView()) {
      changeModule = true;
      newModule = currentNodeHolder.getMapView();
      if (newModule == null) {
        nodeIterator.remove();
        go(back);
        return;
      }
    }
    final boolean fChangeModule = changeModule;
    final MapView newView;
    if (fChangeModule) {
      newView = newModule;
      final Controller controller = newView.getModeController().getController();
      final IMapViewManager mapViewManager = controller.getMapViewManager();
      final boolean res = mapViewManager.changeToMapView(newView);
      if (!res) {
        LogUtils.warn("Can't change to map mapView " + newView);
        return;
      }
    }
    else {
      newView = currentNodeHolder.getHoldMapView();
    }
    if (!toBeSelected.isRoot()) {
      newView.getModeController().getMapController().setFolded(toBeSelected.getParentNode(), false);
    }
    newView.getModeController().getMapController().select(toBeSelected);
  }
View Full Code Here

  private final String mNodeId;
  private boolean reachedByLink;

  public NodeHolder(final NodeView pNode) {
    mNodeId = pNode.getModel().createID();
    final MapView mapView = pNode.getMap();
    mMapView = new WeakReference<MapView>(mapView);
    reachedByLink = false;
  }
View Full Code Here

  public MapView getHoldMapView() {
    return mMapView.get();
  }

  MapView getMapView() {
    final MapView mapView = mMapView.get();
    final Controller controller = mapView.getModeController().getController();
    final MapViewController mapViewManager = (MapViewController) controller.getMapViewManager();
    for (final MapView m : mapViewManager.getMapViewVector()) {
      if (m == mapView) {
        return mapView;
      }
View Full Code Here

    return null;
  }

  ModeController getModeController() {
    ModeController modeController = null;
    final MapView mapView = getMapView();
    if (mapView != null) {
      modeController = mapView.getModeController();
    }
    return modeController;
  }
View Full Code Here

TOP

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

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.