/** * Renders an annotation value into a {@link Page}. * * @param page The page that the value should be rendered into. * @param annotation The annotation that contains the value to be rendered. * @param defaultForeground The default foreground color. * @param defaultBackground The default background color. * @param isSelected Whether or not the cell containing the annotation is selected. * @return A list of paragraphs that represent the rendering of the annotation value. These * paragraphs will have been added to the Page specified by the page argument. */ private List<Paragraph> renderAnnotationValue( final Page page, OWLAnnotation annotation, final Color defaultForeground, final Color defaultBackground, final boolean isSelected) { OWLAnnotationValue annotationValue = annotation.getValue(); List<Paragraph> paragraphs = annotationValue.accept( new OWLAnnotationValueVisitorEx<List<Paragraph>>() { public List<Paragraph> visit(IRI iri) { return renderIRI( page, iri, defaultForeground, defaultBackground, isSelected, hasFocus()); } public List<Paragraph> visit(OWLAnonymousIndividual individual) { return renderAnonymousIndividual(page, individual); } public List<Paragraph> visit(OWLLiteral literal) { return renderLiteral( page, literal, defaultForeground, defaultBackground, isSelected); } }); applyGlobalFormattingToAnnotationValueParagraphs(paragraphs); return paragraphs; }
/** @param value value */ public void visit(OWLAnnotationValue value) { value.accept( new OWLAnnotationValueVisitor() { @Override public void visit(IRI iri) { iri.accept(LatexObjectVisitor.this); } @Override public void visit(OWLAnonymousIndividual individual) { individual.accept(LatexObjectVisitor.this); } @Override public void visit(OWLLiteral literal) { literal.accept(LatexObjectVisitor.this); } }); }