Search in sources :

Example 1 with BModeController

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();
    }
}
Also used : ParserDelegator(javax.swing.text.html.parser.ParserDelegator) LogicalStyleFilterController(org.freeplane.features.styles.LogicalStyleFilterController) FormatController(org.freeplane.features.format.FormatController) BModeController(org.freeplane.features.mode.browsemode.BModeController) PrintController(org.freeplane.features.print.PrintController) BModeController(org.freeplane.features.mode.browsemode.BModeController) FormatController(org.freeplane.features.format.FormatController) MapViewController(org.freeplane.view.swing.map.MapViewController) LinkController(org.freeplane.features.link.LinkController) TimeController(org.freeplane.features.time.TimeController) FilterController(org.freeplane.features.filter.FilterController) HelpController(org.freeplane.features.help.HelpController) MapController(org.freeplane.features.map.MapController) LogicalStyleFilterController(org.freeplane.features.styles.LogicalStyleFilterController) FrameController(org.freeplane.features.ui.FrameController) IconController(org.freeplane.features.icon.IconController) Controller(org.freeplane.features.mode.Controller) TextController(org.freeplane.features.text.TextController) ModelessAttributeController(org.freeplane.features.attribute.ModelessAttributeController) MapViewController(org.freeplane.view.swing.map.MapViewController) NextPresentationItemAction(org.freeplane.features.filter.NextPresentationItemAction) Container(java.awt.Container) BorderLayout(java.awt.BorderLayout) ViewLayoutTypeAction(org.freeplane.view.swing.map.ViewLayoutTypeAction) NextNodeAction(org.freeplane.features.filter.NextNodeAction) ShowSelectionAsRectangleAction(org.freeplane.core.ui.ShowSelectionAsRectangleAction)

Example 2 with BModeController

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;
}
Also used : UrlManager(org.freeplane.features.url.UrlManager) ClipboardController(org.freeplane.features.clipboard.ClipboardController) AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) BModeController(org.freeplane.features.mode.browsemode.BModeController) LinkController(org.freeplane.features.link.LinkController) LocationController(org.freeplane.features.nodelocation.LocationController) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) IconController(org.freeplane.features.icon.IconController) FoldingController(org.freeplane.features.map.FoldingController) FrameController(org.freeplane.features.ui.FrameController) CloneStateIconSupplier(org.freeplane.features.map.CloneStateIconSupplier) NoteController(org.freeplane.features.note.NoteController) EdgeController(org.freeplane.features.edge.EdgeController) AttributeController(org.freeplane.features.attribute.AttributeController) TextController(org.freeplane.features.text.TextController) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) UserInputListenerFactory(org.freeplane.view.swing.ui.UserInputListenerFactory) AccessControlException(java.security.AccessControlException) AttributeController(org.freeplane.features.attribute.AttributeController) EncryptionController(org.freeplane.features.encrypt.EncryptionController) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) ClipboardController(org.freeplane.features.clipboard.ClipboardController) BModeController(org.freeplane.features.mode.browsemode.BModeController) NoteController(org.freeplane.features.note.NoteController) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) EdgeController(org.freeplane.features.edge.EdgeController) ViewController(org.freeplane.features.ui.ViewController) CloudController(org.freeplane.features.cloud.CloudController) LinkController(org.freeplane.features.link.LinkController) FilterController(org.freeplane.features.filter.FilterController) MapController(org.freeplane.features.map.MapController) LocationController(org.freeplane.features.nodelocation.LocationController) FoldingController(org.freeplane.features.map.FoldingController) FrameController(org.freeplane.features.ui.FrameController) IconController(org.freeplane.features.icon.IconController) Controller(org.freeplane.features.mode.Controller) TextController(org.freeplane.features.text.TextController) AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) JPopupMenu(javax.swing.JPopupMenu) MapController(org.freeplane.features.map.MapController) EncryptionController(org.freeplane.features.encrypt.EncryptionController) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) CloudController(org.freeplane.features.cloud.CloudController) FreeplaneToolBar(org.freeplane.core.ui.components.FreeplaneToolBar)

Aggregations

FilterController (org.freeplane.features.filter.FilterController)2 IconController (org.freeplane.features.icon.IconController)2 LinkController (org.freeplane.features.link.LinkController)2 MapController (org.freeplane.features.map.MapController)2 Controller (org.freeplane.features.mode.Controller)2 BModeController (org.freeplane.features.mode.browsemode.BModeController)2 TextController (org.freeplane.features.text.TextController)2 FrameController (org.freeplane.features.ui.FrameController)2 BorderLayout (java.awt.BorderLayout)1 Container (java.awt.Container)1 AccessControlException (java.security.AccessControlException)1 JPopupMenu (javax.swing.JPopupMenu)1 ParserDelegator (javax.swing.text.html.parser.ParserDelegator)1 ShowSelectionAsRectangleAction (org.freeplane.core.ui.ShowSelectionAsRectangleAction)1 FreeplaneToolBar (org.freeplane.core.ui.components.FreeplaneToolBar)1 AttributeController (org.freeplane.features.attribute.AttributeController)1 ModelessAttributeController (org.freeplane.features.attribute.ModelessAttributeController)1 ClipboardController (org.freeplane.features.clipboard.ClipboardController)1 CloudController (org.freeplane.features.cloud.CloudController)1 EdgeController (org.freeplane.features.edge.EdgeController)1