public TestDocumentContext<Node, Element, Text> createAnnotationContext() {
final AnnotationPainter painter = new AnnotationPainter(timerService);
final PainterRegistry painterRegistry =
new PainterRegistryImpl("l:p", "l:b", painter);
painterRegistry.registerPaintFunction(rangeKeys, new PaintFunction() {
@Override
public Map<String, String> apply(Map<String, Object> from, boolean isEditing) {
Map<String, String> ret = new HashMap<String, String>();
for (Map.Entry<String, Object> entry : from.entrySet()) {
ret.put(entry.getKey(), (String) entry.getValue());
}
return ret;
}
});
boundaryKeys.each(new Proc() {
@Override
public void apply(String key) {
final String k = key;
painterRegistry.registerBoundaryFunction(boundaryKeys, new BoundaryFunction() {
@Override
public <N, E extends N, T extends N> E apply(LocalDocument<N, E, T> localDoc, E parent,
N nodeAfter, Map<String, Object> before, Map<String, Object> after,
boolean isEditing) {
Point.checkRelationship(localDoc, parent, nodeAfter, "Test boundary function");