+ public static Character createCharacter(TermNode<DefinedTerm> structureNode,
+ TermNode<DefinedTerm> propertyNode) {
+ Representation structureRepresentation = structureNode.getTerm().getRepresentation(PreferencesUtil.getGlobalLanguage());
+ if(structureRepresentation==null){
+ structureRepresentation = structureNode.getTerm().getRepresentation(Language.DEFAULT());
+ }
+ Representation propertyRepresentation = propertyNode.getTerm().getRepresentation(PreferencesUtil.getGlobalLanguage());
+ if(propertyRepresentation==null){
+ propertyRepresentation = propertyNode.getTerm().getRepresentation(Language.DEFAULT());
+ }
+ String label = null;
+ String abbrevLabel = null;
+ if(structureRepresentation!=null && propertyRepresentation!=null){
+ if(structureRepresentation.getLabel()!=null && propertyRepresentation.getLabel()!=null){
+ label = structureRepresentation.getLabel()+" "+propertyRepresentation.getLabel();
+ }
+ if(structureRepresentation.getAbbreviatedLabel()!=null && propertyRepresentation.getAbbreviatedLabel()!=null){
+ abbrevLabel = structureRepresentation.getAbbreviatedLabel()+" "+propertyRepresentation.getAbbreviatedLabel();
+ }
+ }
+ if(label!=null){
+ //default label
+ label = structureNode.getTerm().getLabel()+" "+propertyNode.getTerm().getLabel();
+ }
+ //create new Character
+ Character character = Character.NewInstance(structureNode, propertyNode, null, label, abbrevLabel);
+ return character;
+ }
+