Search in sources :

Example 6 with ViewerController

use of org.freeplane.view.swing.features.filepreview.ViewerController in project freeplane by freeplane.

the class Activator method registerMindMapModeExtension.

private void registerMindMapModeExtension(final BundleContext context) {
    final Hashtable<String, String[]> props = new Hashtable<String, String[]>();
    props.put("mode", new String[] { MModeController.MODENAME });
    context.registerService(IModeControllerExtensionProvider.class.getName(), new IModeControllerExtensionProvider() {

        public void installExtension(ModeController modeController) {
            final ExportController exportController = ExportController.getController(modeController);
            exportController.addExportEngine(new ExampleFileFilter("pdf", TextUtils.getText("export_pdf_text")), new ExportPdf());
            exportController.addExportEngine(new ExampleFileFilter("svg", TextUtils.getText("export_svg_text")), new ExportSvg());
            final ViewerController extension = (ViewerController) modeController.getExtension(ViewerController.class);
            extension.addFactory(new SvgViewerFactory());
        }
    }, props);
}
Also used : Hashtable(java.util.Hashtable) MModeController(org.freeplane.features.mode.mindmapmode.MModeController) BModeController(org.freeplane.features.mode.browsemode.BModeController) ModeController(org.freeplane.features.mode.ModeController) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) IModeControllerExtensionProvider(org.freeplane.main.osgi.IModeControllerExtensionProvider) ExampleFileFilter(org.freeplane.core.ui.ExampleFileFilter) ExportController(org.freeplane.features.export.mindmapmode.ExportController)

Example 7 with ViewerController

use of org.freeplane.view.swing.features.filepreview.ViewerController in project freeplane by freeplane.

the class MModeControllerFactory method createAddIns.

private void createAddIns() {
    final StyleEditorPanel panel = new StyleEditorPanel(modeController, uiFactory, true);
    final JScrollPane styleScrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    UITools.setScrollbarIncrement(styleScrollPane);
    final JComponent tabs = (JComponent) modeController.getUserInputListenerFactory().getToolBar("/format").getComponent(1);
    tabs.add(TextUtils.getText("format_panel"), styleScrollPane);
    new AttributePanelManager(modeController);
    new HierarchicalIcons();
    new AutomaticLayoutController();
    new BlinkingNodeHook();
    SummaryNode.install();
    AlwaysUnfoldedNode.install();
    FreeNode.install();
    new CreationModificationPlugin();
    modeController.addExtension(ReminderHook.class, new ReminderHook(modeController));
    new AutomaticEdgeColorHook();
    new ViewerController();
    modeController.addAction(new AddAttributeAction());
    modeController.addAction(new RemoveFirstAttributeAction());
    modeController.addAction(new RemoveLastAttributeAction());
    modeController.addAction(new RemoveAllAttributesAction());
    modeController.addAction(new AddExternalImageAction());
    modeController.addAction(new RemoveExternalImageAction());
    modeController.addAction(new ChangeExternalImageAction());
    modeController.addAction(new ShowFormatPanelAction());
    modeController.addAction(new FitToPage());
    MEncryptionController.install(new MEncryptionController(modeController));
    modeController.addAction(new IconSelectionPlugin());
    modeController.addAction(new NewParentNode());
    modeController.addAction(new SaveAll());
    modeController.addAction(new SortNodes());
    modeController.addAction(new SplitNode());
    new ChangeNodeLevelController(modeController);
    NodeHistory.install(modeController);
    modeController.addAction(new ImportMindmanagerFiles());
}
Also used : StyleEditorPanel(org.freeplane.features.styles.mindmapmode.StyleEditorPanel) CreationModificationPlugin(org.freeplane.features.time.CreationModificationPlugin) RemoveFirstAttributeAction(org.freeplane.features.attribute.mindmapmode.RemoveFirstAttributeAction) AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) AddAttributeAction(org.freeplane.features.attribute.mindmapmode.AddAttributeAction) MEncryptionController(org.freeplane.features.encrypt.mindmapmode.MEncryptionController) AutomaticEdgeColorHook(org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook) ImportMindmanagerFiles(org.freeplane.features.export.mindmapmode.ImportMindmanagerFiles) RemoveExternalImageAction(org.freeplane.view.swing.features.filepreview.RemoveExternalImageAction) FitToPage(org.freeplane.view.swing.features.FitToPage) ChangeNodeLevelController(org.freeplane.features.map.mindmapmode.ChangeNodeLevelController) ShowFormatPanelAction(org.freeplane.features.styles.mindmapmode.ShowFormatPanelAction) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) RemoveAllAttributesAction(org.freeplane.features.attribute.mindmapmode.RemoveAllAttributesAction) BlinkingNodeHook(org.freeplane.view.swing.features.BlinkingNodeHook) SplitNode(org.freeplane.features.text.mindmapmode.SplitNode) RemoveLastAttributeAction(org.freeplane.features.attribute.mindmapmode.RemoveLastAttributeAction) SortNodes(org.freeplane.features.text.mindmapmode.SortNodes) IconSelectionPlugin(org.freeplane.features.icon.mindmapmode.IconSelectionPlugin) SaveAll(org.freeplane.features.url.mindmapmode.SaveAll) JScrollPane(javax.swing.JScrollPane) AddExternalImageAction(org.freeplane.view.swing.features.filepreview.AddExternalImageAction) NewParentNode(org.freeplane.features.map.mindmapmode.NewParentNode) JComponent(javax.swing.JComponent) AttributePanelManager(org.freeplane.view.swing.map.attribute.AttributePanelManager) HierarchicalIcons(org.freeplane.features.icon.HierarchicalIcons) ChangeExternalImageAction(org.freeplane.view.swing.features.filepreview.ChangeExternalImageAction) ReminderHook(org.freeplane.view.swing.features.time.mindmapmode.ReminderHook)

Example 8 with ViewerController

use of org.freeplane.view.swing.features.filepreview.ViewerController 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)

Example 9 with ViewerController

use of org.freeplane.view.swing.features.filepreview.ViewerController in project freeplane by freeplane.

the class ExtendedProgress10Action method actionPerformed.

/**
 * Adds a svg-file as an external object to the node.
 * The handling of the file and the updating of the icons
 * is done in the ViewerController.
 */
@Override
protected void actionPerformed(final ActionEvent e, final NodeModel node) {
    final ViewerController vc = ((ViewerController) Controller.getCurrentController().getModeController().getExtension(ViewerController.class));
    try {
        URI uri = new URI(ResourceController.FREEPLANE_RESOURCE_URL_PROTOCOL, null, "/images/svg/Progress_tenth_00.svg", null);
        vc.paste(uri, node);
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
}
Also used : ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI)

Example 10 with ViewerController

use of org.freeplane.view.swing.features.filepreview.ViewerController in project freeplane by freeplane.

the class ExtendedProgress25Action method actionPerformed.

/**
 * Adds a svg-file as an external object to the node.
 * The handling of the file and the updating of the icons
 * is done in the ViewerController.
 */
@Override
protected void actionPerformed(final ActionEvent e, final NodeModel node) {
    final ViewerController vc = ((ViewerController) Controller.getCurrentController().getModeController().getExtension(ViewerController.class));
    try {
        URI uri = new URI(ResourceController.FREEPLANE_RESOURCE_URL_PROTOCOL, null, "/images/svg/Progress_quarter_00.svg", null);
        vc.paste(uri, node);
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
}
Also used : ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI)

Aggregations

ViewerController (org.freeplane.view.swing.features.filepreview.ViewerController)10 AutomaticLayoutController (org.freeplane.features.styles.AutomaticLayoutController)4 URI (java.net.URI)3 BModeController (org.freeplane.features.mode.browsemode.BModeController)3 URISyntaxException (java.net.URISyntaxException)2 AccessControlException (java.security.AccessControlException)2 Hashtable (java.util.Hashtable)2 JPopupMenu (javax.swing.JPopupMenu)2 FreeplaneToolBar (org.freeplane.core.ui.components.FreeplaneToolBar)2 AttributeController (org.freeplane.features.attribute.AttributeController)2 ClipboardController (org.freeplane.features.clipboard.ClipboardController)2 CloudController (org.freeplane.features.cloud.CloudController)2 EdgeController (org.freeplane.features.edge.EdgeController)2 AutomaticEdgeColorHook (org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook)2 EncryptionController (org.freeplane.features.encrypt.EncryptionController)2 MEncryptionController (org.freeplane.features.encrypt.mindmapmode.MEncryptionController)2 ImportMindmanagerFiles (org.freeplane.features.export.mindmapmode.ImportMindmanagerFiles)2 FilterController (org.freeplane.features.filter.FilterController)2 IconController (org.freeplane.features.icon.IconController)2 LinkController (org.freeplane.features.link.LinkController)2