@Override
 public void visit(OWLLiteral node) {
   write("\"");
   write(node.getLiteral());
   write("\"\\^\\^");
   write(node.getDatatype().getIRI());
 }
 @Override
 public void visit(OWLLiteral node) {
   node.getDatatype().accept(this);
   OWLDatatype dt = (OWLDatatype) obj;
   if (node.hasLang()) {
     obj = dataFactory.getOWLLiteral(node.getLiteral(), node.getLang());
   } else {
     obj = dataFactory.getOWLLiteral(node.getLiteral(), dt);
   }
 }
Beispiel #3
0
 public boolean equals(Object obj) {
   if (super.equals(obj)) {
     if (!(obj instanceof OWLLiteral)) {
       return false;
     }
     OWLLiteral other = (OWLLiteral) obj;
     return literal.equals(other.getLiteral())
         && datatype.equals(other.getDatatype())
         && lang.equals(other.getLang());
   }
   return false;
 }
Beispiel #4
0
 @Override
 protected int compareObjectOfSameType(OWLObject object) {
   OWLLiteral other = (OWLLiteral) object;
   int diff = literal.compareTo(other.getLiteral());
   if (diff != 0) {
     return diff;
   }
   diff = datatype.compareTo(other.getDatatype());
   if (diff != 0) {
     return diff;
   }
   return lang.compareTo(other.getLang());
 }
 private void appendTag(
     Paragraph tagParagraph, OWLLiteral literal, Color foreground, boolean isSelected) {
   Color tagColor = isSelected ? foreground : Color.GRAY;
   Color tagValueColor = isSelected ? foreground : Color.GRAY;
   if (literal.hasLang()) {
     tagParagraph.append("[language: ", tagColor);
     tagParagraph.append(literal.getLang(), tagValueColor);
     tagParagraph.append("]", tagColor);
   } else if (datatypeRendering == RENDER_DATATYPE_INLINE && !literal.isRDFPlainLiteral()) {
     tagParagraph.append("[type: ", tagColor);
     tagParagraph.append(
         editorKit.getOWLModelManager().getRendering(literal.getDatatype()), tagValueColor);
     tagParagraph.append("]", tagColor);
   }
   //        if (ontology != null) {
   //            tagParagraph.append("    ", foreground);
   //            tagParagraph.append("[in: ", tagColor);
   //            String ontologyRendering = editorKit.getOWLModelManager().getRendering(ontology);
   //            tagParagraph.append(ontologyRendering, tagColor);
   //            tagParagraph.append("]", tagColor);
   //        }
 }
 public void visit(OWLLiteral node) {
   node.getDatatype().accept(this);
 }