Search in sources :

Example 6 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class UITools method showConfirmDialog.

public static int showConfirmDialog(final NodeModel node, final Object message, final String title, final int optionType, final int messageType) {
    final Controller controller = Controller.getCurrentController();
    final IMapViewManager viewController = controller.getMapViewManager();
    final Component parentComponent;
    if (node == null) {
        parentComponent = getFrame();
    } else {
        viewController.scrollNodeToVisible(node);
        parentComponent = viewController.getComponent(node);
    }
    return JOptionPane.showConfirmDialog(parentComponent, message, title, optionType, messageType);
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) ResourceController(org.freeplane.core.resources.ResourceController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) JComponent(javax.swing.JComponent) Component(java.awt.Component) JTextComponent(javax.swing.text.JTextComponent)

Example 7 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class UITools method setDialogLocationUnder.

public static void setDialogLocationUnder(final JDialog dialog, final NodeModel node) {
    final Controller controller = Controller.getCurrentController();
    final IMapViewManager viewController = controller.getMapViewManager();
    final JComponent c = (JComponent) viewController.getComponent(node);
    final int x = 0;
    final int y = c.getHeight();
    final Point location = new Point(x, y);
    SwingUtilities.convertPointToScreen(location, c);
    UITools.setBounds(dialog, location.x, location.y, dialog.getWidth(), dialog.getHeight());
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) JComponent(javax.swing.JComponent) Point(java.awt.Point) ResourceController(org.freeplane.core.resources.ResourceController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) Point(java.awt.Point)

Example 8 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class UITools method setDialogLocationRelativeTo.

public static void setDialogLocationRelativeTo(final JDialog dialog, final NodeModel node) {
    if (node == null) {
        return;
    }
    final IMapViewManager viewController = Controller.getCurrentController().getMapViewManager();
    viewController.scrollNodeToVisible(node);
    final Component c = viewController.getComponent(node);
    UITools.setDialogLocationRelativeTo(dialog, c);
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) JComponent(javax.swing.JComponent) Component(java.awt.Component) JTextComponent(javax.swing.text.JTextComponent)

Example 9 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class UITools method showInputDialog.

public static String showInputDialog(final NodeModel node, final String text, final String title, final int type) {
    if (node == null) {
        return null;
    }
    final Controller controller = Controller.getCurrentController();
    final IMapViewManager viewController = controller.getMapViewManager();
    viewController.scrollNodeToVisible(node);
    final Component parentComponent = viewController.getComponent(node);
    return JOptionPane.showInputDialog(parentComponent, text, title, type);
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) ResourceController(org.freeplane.core.resources.ResourceController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController) JComponent(javax.swing.JComponent) Component(java.awt.Component) JTextComponent(javax.swing.text.JTextComponent)

Example 10 with IMapViewManager

use of org.freeplane.features.ui.IMapViewManager in project freeplane by freeplane.

the class NodeColorBlendAction method actionPerformed.

/*
	 * (non-Javadoc)
	 * @see
	 * freeplane.modes.mindmapmode.actions.MultipleNodeAction#actionPerformed
	 * (freeplane.modes.NodeModel)
	 */
@Override
protected void actionPerformed(final ActionEvent e, final NodeModel node) {
    final IMapViewManager viewController = Controller.getCurrentController().getMapViewManager();
    final Component mapView = viewController.getMapViewComponent();
    final Color mapColor = mapView.getBackground();
    Color nodeColor = NodeStyleModel.getColor(node);
    final MNodeStyleController mNodeStyleController = (MNodeStyleController) NodeStyleController.getController();
    if (nodeColor == null) {
        nodeColor = viewController.getBackgroundColor(node);
    }
    mNodeStyleController.setColor(node, new Color((3 * mapColor.getRed() + nodeColor.getRed()) / 4, (3 * mapColor.getGreen() + nodeColor.getGreen()) / 4, (3 * mapColor.getBlue() + nodeColor.getBlue()) / 4));
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) Color(java.awt.Color) Component(java.awt.Component)

Aggregations

IMapViewManager (org.freeplane.features.ui.IMapViewManager)35 Component (java.awt.Component)13 Controller (org.freeplane.features.mode.Controller)13 MapModel (org.freeplane.features.map.MapModel)12 ModeController (org.freeplane.features.mode.ModeController)11 JComponent (javax.swing.JComponent)7 URL (java.net.URL)5 ResourceController (org.freeplane.core.resources.ResourceController)5 NodeModel (org.freeplane.features.map.NodeModel)5 MapView (org.freeplane.view.swing.map.MapView)5 Point (java.awt.Point)4 JTextComponent (javax.swing.text.JTextComponent)4 IUndoHandler (org.freeplane.core.undo.IUndoHandler)3 LinkController (org.freeplane.features.link.LinkController)3 MLinkController (org.freeplane.features.link.mindmapmode.MLinkController)3 ViewController (org.freeplane.features.ui.ViewController)3 Color (java.awt.Color)2 Dimension (java.awt.Dimension)2 ComponentAdapter (java.awt.event.ComponentAdapter)2 ComponentEvent (java.awt.event.ComponentEvent)2