Search in sources :

Example 16 with MapView

use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.

the class AttributeTable method columnWidthChanged.

public void columnWidthChanged(final ColumnWidthChangeEvent event) {
    final float zoom = getZoom();
    final int col = event.getColumnNumber();
    final AttributeTableLayoutModel layoutModel = (AttributeTableLayoutModel) event.getSource();
    final int width = layoutModel.getColumnWidth(col);
    getColumnModel().getColumn(col).setPreferredWidth((int) (width * zoom));
    final MapView map = attributeView.getMapView();
    final NodeModel node = attributeView.getNode();
    map.getModeController().getMapController().nodeChanged(node);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapView(org.freeplane.view.swing.map.MapView) AttributeTableLayoutModel(org.freeplane.features.attribute.AttributeTableLayoutModel)

Example 17 with MapView

use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.

the class DefaultMapMouseListener method mousePressed.

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();
}
Also used : MapView(org.freeplane.view.swing.map.MapView)

Example 18 with MapView

use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.

the class DefaultMapMouseListener method mouseClicked.

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();
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) IMapSelection(org.freeplane.features.map.IMapSelection) MapView(org.freeplane.view.swing.map.MapView) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) LinkController(org.freeplane.features.link.LinkController)

Example 19 with MapView

use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.

the class DefaultMapMouseListener method mouseDragged.

/**
 */
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;
        }
    }
}
Also used : JComponent(javax.swing.JComponent) Rectangle(java.awt.Rectangle) MapView(org.freeplane.view.swing.map.MapView) Point(java.awt.Point)

Example 20 with MapView

use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.

the class MapViewDockingWindows method afterViewChange.

public void afterViewChange(final Component pOldMap, final Component pNewMap) {
    if (pNewMap == null) {
        return;
    }
    if (!loadingLayoutFromObjectInpusStream) {
        for (int i = 0; i < mapViews.size(); ++i) {
            if (mapViews.get(i) == pNewMap) {
                View dockedView = getContainingDockedWindow(pNewMap);
                if (dockedView.isMinimized())
                    dockedView.restore();
                else
                    dockedView.restoreFocus();
                focusMapViewLater((MapView) pNewMap);
                return;
            }
        }
        addDockedWindow(pNewMap);
    } else if (mapViews.contains(pNewMap))
        return;
    mapViews.add(pNewMap);
}
Also used : NodeView(org.freeplane.view.swing.map.NodeView) MapView(org.freeplane.view.swing.map.MapView) View(net.infonode.docking.View)

Aggregations

MapView (org.freeplane.view.swing.map.MapView)55 NodeView (org.freeplane.view.swing.map.NodeView)20 ModeController (org.freeplane.features.mode.ModeController)19 Point (java.awt.Point)15 NodeModel (org.freeplane.features.map.NodeModel)13 Controller (org.freeplane.features.mode.Controller)11 Component (java.awt.Component)9 MainView (org.freeplane.view.swing.map.MainView)9 Dimension (java.awt.Dimension)8 JComponent (javax.swing.JComponent)8 MMapController (org.freeplane.features.map.mindmapmode.MMapController)7 ResourceController (org.freeplane.core.resources.ResourceController)6 MapController (org.freeplane.features.map.MapController)6 MTextController (org.freeplane.features.text.mindmapmode.MTextController)5 IMapViewManager (org.freeplane.features.ui.IMapViewManager)5 Color (java.awt.Color)4 Rectangle (java.awt.Rectangle)4 LocationController (org.freeplane.features.nodelocation.LocationController)4 MLocationController (org.freeplane.features.nodelocation.mindmapmode.MLocationController)4 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)4