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);
}
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);
}
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();
}
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);
}
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();
}
Aggregations