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