use of org.freeplane.features.highlight.NodeHighlighter in project freeplane by freeplane.
the class PresentationController method install.
public static void install(final ModeController modeController) {
final PresentationController presentationController = new PresentationController(modeController);
modeController.addExtension(PresentationController.class, presentationController);
presentationController.registerActions();
presentationController.addMapSelectionListener();
new PresentationBuilder().register(modeController.getMapController(), presentationController);
HighlightController highlightController = modeController.getController().getExtension(HighlightController.class);
final PresentationState presentationState = presentationController.presentationState;
new PresentationPngExporter.ActionInstaller().installActions(modeController, presentationState);
final JTabbedPane tabs = (JTabbedPane) modeController.getUserInputListenerFactory().getToolBar("/format").getComponent(1);
tabs.add("Presentations", presentationController.createPanel());
highlightController.addNodeHighlighter(new NodeHighlighter() {
@Override
public boolean isNodeHighlighted(NodeModel node, boolean isPrinting) {
return !isPrinting && presentationState.shouldHighlightNodeContainedOnSlide(node);
}
@Override
public void configure(Graphics2D g, boolean isPrinting) {
g.setColor(NODE_HIGHLIGHTING_COLOR);
}
});
highlightController.addNodeHighlighter(new NodeHighlighter() {
@Override
public boolean isNodeHighlighted(NodeModel node, boolean isPrinting) {
return !isPrinting && presentationState.shouldHighlightNodeFoldedOnSlide(node);
}
@Override
public void configure(Graphics2D g, boolean isPrinting) {
g.setColor(NODE_HIGHLIGHTING_COLOR);
g.setStroke(FOLDED_NODE_STROKE);
}
});
KeyEventDispatcher navigationKeyEventDispatcher = new NavigationKeyEventDispatcher(presentationState);
KeyEventDispatcher escapeKeyEventDispatcher = new EscapeKeyEventDispatcher(presentationState);
final PresentationAutomation presentationKeyHandler = new PresentationAutomation(presentationState, PresentationKeyEventDispatcher.of(navigationKeyEventDispatcher, PROCESS_NAVIGATION_KEYS_PROPERTY), PresentationKeyEventDispatcher.of(escapeKeyEventDispatcher, PROCESS_ESCAPE_KEY_PROPERTY));
presentationState.addPresentationStateListener(presentationKeyHandler);
}
use of org.freeplane.features.highlight.NodeHighlighter in project freeplane by freeplane.
the class FilterController method install.
public static void install() {
final Controller controller = Controller.getCurrentController();
final FilterController extension = new FilterController();
controller.addExtension(FilterController.class, extension);
controller.getExtension(HighlightController.class).addNodeHighlighter(new NodeHighlighter() {
@Override
public boolean isNodeHighlighted(NodeModel node, boolean isPrinting) {
return !isPrinting && FilterController.getController(controller).isNodeHighlighted(node);
}
@Override
public void configure(Graphics2D g, boolean isPrinting) {
g.setColor(Color.MAGENTA);
}
});
}
Aggregations