Search in sources :

Example 1 with FilterController

use of org.freeplane.features.filter.FilterController in project freeplane by freeplane.

the class MapProxy method setFilter.

// Map: R/W
public void setFilter(final Closure<Boolean> closure) {
    final FilterController filterController = FilterController.getCurrentFilterController();
    if (closure == null) {
        filterController.applyNoFiltering();
    } else {
        final Filter filter = new Filter(ProxyUtils.createCondition(closure, getScriptContext()), false, false, true);
        filterController.applyFilter(filter, getDelegate(), true);
    }
}
Also used : Filter(org.freeplane.features.filter.Filter) FilterController(org.freeplane.features.filter.FilterController)

Example 2 with FilterController

use of org.freeplane.features.filter.FilterController in project freeplane by freeplane.

the class MapProxy method setFilter.

// Map: R/W
public void setFilter(final boolean showAncestors, final boolean showDescendants, final Closure<Boolean> closure) {
    final FilterController filterController = FilterController.getCurrentFilterController();
    if (closure == null) {
        filterController.applyNoFiltering();
    } else {
        final Filter filter = new Filter(ProxyUtils.createCondition(closure, getScriptContext()), showAncestors, showDescendants, true);
        filterController.applyFilter(filter, getDelegate(), true);
    }
}
Also used : Filter(org.freeplane.features.filter.Filter) FilterController(org.freeplane.features.filter.FilterController)

Example 3 with FilterController

use of org.freeplane.features.filter.FilterController in project freeplane by freeplane.

the class NodeView method paintDecoration.

private void paintDecoration(final Graphics2D g) {
    final PaintingMode paintingMode = map.getPaintingMode();
    if (!(getMainView() != null && (paintingMode.equals(PaintingMode.NODES) && !isSelected() || paintingMode.equals(PaintingMode.SELECTED_NODES) && isSelected()) && isContentVisible()))
        return;
    final Graphics2D g2 = g;
    final ModeController modeController = map.getModeController();
    final Object renderingHint = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
    g2.setStroke(BubbleMainView.DEF_STROKE);
    modeController.getController().getMapViewManager().setEdgesRenderingHint(g2);
    final Point origin = new Point();
    UITools.convertPointToAncestor(mainView, origin, this);
    g.translate(origin.x, origin.y);
    mainView.paintDecoration(this, g);
    g.translate(-origin.x, -origin.y);
    final FilterController filterController = FilterController.getController(getMap().getModeController().getController());
    if (filterController.isNodeHighlighted(getModel())) {
        final Color oldColor = g.getColor();
        final Stroke oldStroke = g.getStroke();
        g.setColor(Color.MAGENTA);
        g.setStroke(getMap().getStandardSelectionStroke());
        final JComponent content = getContent();
        Point contentLocation = content.getLocation();
        final int arcWidth = 8;
        g.drawRoundRect(contentLocation.x - arcWidth, contentLocation.y - arcWidth, content.getWidth() + 2 * arcWidth, content.getHeight() + 2 * arcWidth, 15, 15);
        g.setColor(oldColor);
        g.setStroke(oldStroke);
    }
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, renderingHint);
}
Also used : Stroke(java.awt.Stroke) Color(java.awt.Color) JComponent(javax.swing.JComponent) ModeController(org.freeplane.features.mode.ModeController) Point(java.awt.Point) FilterController(org.freeplane.features.filter.FilterController) Point(java.awt.Point) Graphics2D(java.awt.Graphics2D)

Aggregations

FilterController (org.freeplane.features.filter.FilterController)3 Filter (org.freeplane.features.filter.Filter)2 Color (java.awt.Color)1 Graphics2D (java.awt.Graphics2D)1 Point (java.awt.Point)1 Stroke (java.awt.Stroke)1 JComponent (javax.swing.JComponent)1 ModeController (org.freeplane.features.mode.ModeController)1