Search in sources :

Example 51 with MapView

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

the class NodeHolder method getModeController.

ModeController getModeController() {
    ModeController modeController = null;
    final MapView mapView = getMapView();
    if (mapView != null) {
        modeController = mapView.getModeController();
    }
    return modeController;
}
Also used : MapView(org.freeplane.view.swing.map.MapView) ModeController(org.freeplane.features.mode.ModeController)

Example 52 with MapView

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

the class NodeHolder method isIdentical.

boolean isIdentical(final NodeView pNode) {
    if (pNode == null || pNode.getModel() == null)
        return false;
    final String id = pNode.getModel().createID();
    final MapView mapView = pNode.getMap();
    return mapView == mMapView.get() && id.equals(mNodeId);
}
Also used : MapView(org.freeplane.view.swing.map.MapView)

Example 53 with MapView

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

the class LatexViewer method calculateSize.

private void calculateSize() {
    final MapView mapView = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, this);
    final float mapZoom = mapView.getZoom();
    if (mapZoom == zoom) {
        return;
    }
    zoom = mapZoom;
    final Icon latexIcon = teXFormula.createTeXIcon(TeXConstants.STYLE_DISPLAY, DEFAULT_FONT_SIZE * zoom);
    final Insets insets = getInsets();
    final Dimension dimension = new Dimension(latexIcon.getIconWidth() + insets.left + insets.right, latexIcon.getIconHeight() + insets.top + insets.bottom);
    setPreferredSize(dimension);
}
Also used : Insets(java.awt.Insets) MapView(org.freeplane.view.swing.map.MapView) Icon(javax.swing.Icon) Dimension(java.awt.Dimension)

Example 54 with MapView

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

the class AttributeTable method getPreferredScrollableViewportSize.

@Override
public Dimension getPreferredScrollableViewportSize() {
    if (!isValid()) {
        validate();
    }
    final Dimension dimension = super.getPreferredSize();
    NodeView nodeView = (NodeView) SwingUtilities.getAncestorOfClass(NodeView.class, this);
    if (nodeView != null) {
        final MapView map = nodeView.getMap();
        final ModeController modeController = map.getModeController();
        final NodeStyleController nsc = NodeStyleController.getController(modeController);
        dimension.width = Math.min(map.getZoomed(nsc.getMaxWidth(nodeView.getModel())), dimension.width);
        dimension.height = Math.min(map.getZoomed(AttributeTable.MAX_HEIGTH) - getTableHeaderHeight(), dimension.height);
    } else {
        dimension.width = Math.min(MAX_WIDTH, dimension.width);
        dimension.height = Math.min(MAX_HEIGTH, dimension.height);
    }
    return dimension;
}
Also used : NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) MapView(org.freeplane.view.swing.map.MapView) Dimension(java.awt.Dimension) ModeController(org.freeplane.features.mode.ModeController) NodeView(org.freeplane.view.swing.map.NodeView)

Example 55 with MapView

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

the class EditAttributesAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    final Controller controller = Controller.getCurrentController();
    final AttributeView attributeView = (((MapView) controller.getMapViewManager().getMapViewComponent()).getSelected()).getAttributeView();
    final boolean attributesClosed = null == SwingUtilities.getAncestorOfClass(AttributeTable.class, focusOwner);
    if (attributesClosed) {
        attributeView.startEditing();
    } else {
        attributeView.stopEditing();
    }
}
Also used : MapView(org.freeplane.view.swing.map.MapView) Component(java.awt.Component) Controller(org.freeplane.features.mode.Controller)

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