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