use of org.freeplane.features.mode.browsemode.BModeController in project freeplane by freeplane.
the class FreeplaneApplet method init.
@SuppressWarnings("serial")
@Override
public void init() {
try {
appletLock.lock();
appletResourceController = new AppletResourceController(this);
if (appletResourceController == null) {
appletResourceController = new AppletResourceController(this);
}
new ParserDelegator() {
{
setDefaultDTD();
}
};
updateLookAndFeel();
createRootPane();
controller = new Controller(appletResourceController);
appletResourceController.init();
Controller.setCurrentController(controller);
final Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
MapViewController mapViewController = new MapViewController(controller);
appletViewController = new AppletViewController(this, controller, mapViewController);
controller.addAction(new ViewLayoutTypeAction(MapViewLayout.OUTLINE));
FilterController.install();
PrintController.install();
HelpController.install();
NodeHistory.install(controller);
FormatController.install(new FormatController());
ModelessAttributeController.install();
TextController.install();
MapController.install();
TimeController.install();
LinkController.install();
IconController.install();
FilterController.getCurrentFilterController().getConditionFactory().addConditionController(70, new LogicalStyleFilterController());
final BModeController browseController = BModeControllerFactory.createModeController();
final Set<String> emptySet = Collections.emptySet();
FilterController.getController(controller).loadDefaultConditions();
browseController.updateMenus("/xml/appletMenu.xml", emptySet);
controller.addAction(new ShowSelectionAsRectangleAction());
controller.addAction(new NextNodeAction(Direction.FORWARD));
controller.addAction(new NextNodeAction(Direction.BACK));
controller.addAction(new NextPresentationItemAction());
controller.selectMode(browseController);
appletResourceController.setPropertyByParameter(this, "browsemode_initial_map");
appletViewController.init(controller);
final GlassPane glassPane = new GlassPane();
setGlassPane(glassPane);
glassPane.setVisible(true);
controller.getViewController().setMenubarVisible(false);
} catch (RuntimeException e) {
e.printStackTrace();
throw e;
} finally {
appletLock.unlock();
}
}
use of org.freeplane.features.mode.browsemode.BModeController in project freeplane by freeplane.
the class BModeControllerFactory method createModeController.
public static BModeController createModeController() {
final Controller controller = Controller.getCurrentController();
modeController = new BModeController(controller);
final UserInputListenerFactory userInputListenerFactory = new UserInputListenerFactory(modeController, false);
modeController.setUserInputListenerFactory(userInputListenerFactory);
controller.addModeController(modeController);
controller.selectModeForBuild(modeController);
new MapController(modeController);
IconController.install(new IconController(modeController));
UrlManager.install(new UrlManager());
MapIO.install(modeController);
AttributeController.install(new AttributeController(modeController));
NodeStyleController.install(new NodeStyleController(modeController));
EdgeController.install(new EdgeController(modeController));
CloudController.install(new CloudController(modeController));
NoteController.install(new NoteController());
TextController.install(new TextController(modeController));
LinkController.install(new LinkController());
LogicalStyleController.install(new LogicalStyleController(modeController));
try {
ClipboardController.install(new ClipboardController());
} catch (final AccessControlException e) {
LogUtils.warn("can not access system clipboard, clipboard controller disabled");
}
LocationController.install(new LocationController());
SummaryNode.install();
FreeNode.install();
MapStyle.install(true);
final BToolbarContributor toolbarContributor = new BToolbarContributor();
modeController.addMenuContributor(toolbarContributor);
controller.getMapViewManager().addMapViewChangeListener(toolbarContributor);
userInputListenerFactory.setNodePopupMenu(new JPopupMenu());
final FreeplaneToolBar toolBar = new FreeplaneToolBar("main_toolbar", SwingConstants.HORIZONTAL);
FrameController frameController = (FrameController) controller.getViewController();
UIComponentVisibilityDispatcher.install(frameController, toolBar, "toolbarVisible");
userInputListenerFactory.addToolBar("/main_toolbar", ViewController.TOP, toolBar);
userInputListenerFactory.addToolBar("/filter_toolbar", ViewController.BOTTOM, FilterController.getController(controller).getFilterToolbar());
userInputListenerFactory.addToolBar("/status", ViewController.BOTTOM, controller.getViewController().getStatusBar());
FoldingController.install(new FoldingController());
new ViewerController();
EncryptionController.install(new EncryptionController(modeController));
new AutomaticLayoutController();
new CloneStateIconSupplier().registerStateIconProvider();
return modeController;
}
Aggregations