コード例 #1
0
 @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);
   }
 }
コード例 #2
0
ファイル: OWLLiteralImpl.java プロジェクト: juyingnan/OpenOME
 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;
 }
コード例 #3
0
ファイル: OWLLiteralImpl.java プロジェクト: juyingnan/OpenOME
 @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());
 }
コード例 #4
0
 public void visit(OWLLiteral node) {
   if (preferredLanguages == null
       || preferredLanguages.isEmpty()) { // if there are no languages just match the first thing
     lastLangMatchIndex = 0;
     candidateValue = node;
   } else {
     final int index = preferredLanguages.indexOf(node.getLang());
     if (index >= 0 && index < lastLangMatchIndex) {
       lastLangMatchIndex = index;
       candidateValue = node;
     }
   }
 }
コード例 #5
0
 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);
   //        }
 }