Search in sources :

Example 26 with Controller

use of org.freeplane.features.mode.Controller in project freeplane by freeplane.

the class UITools method showInputDialog.

public static String showInputDialog(final NodeModel node, final String message, final String initialValue) {
    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, message, initialValue);
}
Also used : IMapViewManager(org.freeplane.features.ui.IMapViewManager) Controller(org.freeplane.features.mode.Controller) ResourceController(org.freeplane.core.resources.ResourceController) ModeController(org.freeplane.features.mode.ModeController) Component(java.awt.Component) JComponent(javax.swing.JComponent) JTextComponent(javax.swing.text.JTextComponent)

Example 27 with Controller

use of org.freeplane.features.mode.Controller 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) Controller(org.freeplane.features.mode.Controller) ResourceController(org.freeplane.core.resources.ResourceController) ModeController(org.freeplane.features.mode.ModeController) Component(java.awt.Component) JComponent(javax.swing.JComponent) JTextComponent(javax.swing.text.JTextComponent)

Example 28 with Controller

use of org.freeplane.features.mode.Controller in project freeplane by freeplane.

the class UndoHandler method addActor.

/*
	 * (non-Javadoc)
	 * @see
	 * freeplane.base.undo.UndoHandler#addActor(freeplane.base.undo.UndoableActor
	 * )
	 */
public void addActor(final IActor actor) {
    resetRedo();
    actorList.commitDelay = COMMIT_DELAY;
    final long currentTime = System.currentTimeMillis();
    if (deactivated) {
        if (!actionFrameStarted && currentTime - timeOfLastAdd > UndoHandler.TIME_TO_BEGIN_NEW_ACTION) {
            deactivated = false;
        } else {
            if (actorList.size() > 0) {
                actorList.clear();
                actorIterator = actorList.listIterator();
            }
            return;
        }
    }
    if ((actorList.size() > 0) && (actionFrameStarted || currentTime - timeOfLastAdd < UndoHandler.TIME_TO_BEGIN_NEW_ACTION)) {
        CompoundActor compoundActor = (CompoundActor) actorIterator.previous();
        compoundActor.add(actor);
        actorIterator.next();
    } else {
        CompoundActor compoundActor = new CompoundActor();
        final Controller controller = Controller.getCurrentController();
        if (map == controller.getMap()) {
            final IMapSelection selection = controller.getSelection();
            final SelectionActor selectionActor = SelectionActor.create(selection);
            compoundActor.add(selectionActor);
        }
        compoundActor.add(actor);
        actorIterator.add(compoundActor);
        final int maxEntries = UndoHandler.MAX_ENTRIES;
        while (actorList.size() > maxEntries) {
            actorList.removeFirst();
            actorIterator = actorList.listIterator(actorList.size());
        }
    }
    startActionFrame();
    timeOfLastAdd = currentTime;
    fireStateChanged();
}
Also used : IMapSelection(org.freeplane.features.map.IMapSelection) Controller(org.freeplane.features.mode.Controller) ViewController(org.freeplane.features.ui.ViewController)

Example 29 with Controller

use of org.freeplane.features.mode.Controller in project freeplane by freeplane.

the class EdgeColorAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent e) {
    final ModeController modeController = Controller.getCurrentModeController();
    final NodeModel model = modeController.getMapController().getSelectedNode();
    final Controller controller = modeController.getController();
    final Color edgeColor = EdgeController.getController().getColor(model);
    actionColor = ColorTracker.showCommonJColorChooserDialog(controller.getSelection().getSelected(), TextUtils.getText("choose_edge_color"), edgeColor, EdgeController.STANDARD_EDGE_COLOR);
    super.actionPerformed(e);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) Color(java.awt.Color) ModeController(org.freeplane.features.mode.ModeController) EdgeController(org.freeplane.features.edge.EdgeController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 30 with Controller

use of org.freeplane.features.mode.Controller in project freeplane by freeplane.

the class ExportWithXSLT method getMapXml.

/**
 * @param mode
 * @throws IOException
 */
private String getMapXml(final Mode mode) throws IOException {
    final StringWriter writer = new StringWriter();
    final ModeController modeController = Controller.getCurrentModeController();
    final Controller controller = modeController.getController();
    final MapModel map = controller.getMap();
    modeController.getMapController().getFilteredXml(map, writer, mode, Mode.EXPORT.equals(mode));
    return writer.getBuffer().toString();
}
Also used : StringWriter(java.io.StringWriter) ModeController(org.freeplane.features.mode.ModeController) MapModel(org.freeplane.features.map.MapModel) ResourceController(org.freeplane.core.resources.ResourceController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Aggregations

Controller (org.freeplane.features.mode.Controller)135 ModeController (org.freeplane.features.mode.ModeController)78 ResourceController (org.freeplane.core.resources.ResourceController)63 NodeModel (org.freeplane.features.map.NodeModel)44 MapController (org.freeplane.features.map.MapController)37 LinkController (org.freeplane.features.link.LinkController)32 MapModel (org.freeplane.features.map.MapModel)31 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)30 MMapController (org.freeplane.features.map.mindmapmode.MMapController)27 TextController (org.freeplane.features.text.TextController)24 ViewController (org.freeplane.features.ui.ViewController)22 IconController (org.freeplane.features.icon.IconController)20 Component (java.awt.Component)18 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)18 FilterController (org.freeplane.features.filter.FilterController)16 FormatController (org.freeplane.features.format.FormatController)15 ScannerController (org.freeplane.features.format.ScannerController)15 IMapSelection (org.freeplane.features.map.IMapSelection)15 MTextController (org.freeplane.features.text.mindmapmode.MTextController)14 IMapViewManager (org.freeplane.features.ui.IMapViewManager)14