コード例 #1
0
 /**
  * Renders the annotation property into a paragraph in the page.
  *
  * @param page The page to insert the paragraph into.
  * @param annotation The annotation containing the property to be rendered.
  * @param defaultForeground The default foreground color.
  * @param defaultBackground The default background color.
  * @param isSelected Specifies whether the associated cell is selected or not.
  */
 private Paragraph renderAnnotationProperty(
     Page page,
     OWLAnnotation annotation,
     Color defaultForeground,
     Color defaultBackground,
     boolean isSelected) {
   OWLAnnotationProperty property = annotation.getProperty();
   String rendering = editorKit.getOWLModelManager().getRendering(property);
   Paragraph paragraph = page.addParagraph(rendering);
   Color foreground = getAnnotationPropertyForeground(defaultForeground, isSelected);
   paragraph.setForeground(foreground);
   //        if (isReferenceOntologyActive()) {
   //            paragraph.setBold(true);
   //        }
   if (annotation.getValue() instanceof OWLLiteral) {
     OWLLiteral literalValue = (OWLLiteral) annotation.getValue();
     paragraph.append("    ", foreground);
     appendTag(paragraph, literalValue, foreground, isSelected);
   }
   switch (annotationRenderingStyle) {
     case COMFORTABLE:
       paragraph.setMarginBottom(4);
       break;
     case COSY:
       paragraph.setMarginBottom(2);
       break;
     case COMPACT:
       paragraph.setMarginBottom(1);
       break;
   }
   return paragraph;
 }
コード例 #2
0
 /**
  * Formats paragraphs that were generated as a result of rendering an annotation value with global
  * formatting such as tab count and margins. This ensures that all paragraphs representing
  * annotation values have the correct indentation etc.
  *
  * @param valueRenderingParagraphs The paragraphs to be formatted.
  */
 private void applyGlobalFormattingToAnnotationValueParagraphs(
     List<Paragraph> valueRenderingParagraphs) {
   for (Paragraph paragraph : valueRenderingParagraphs) {
     paragraph.setTabCount(0);
     paragraph.setMarginBottom(2);
   }
 }