public static Annotation getAnnotation(Properties attributes) {
		float llx = 0, lly = 0, urx = 0, ury = 0;
		String value;

		value = attributes.getProperty(ElementTags.LLX);
		if (value != null) {
			llx = Float.parseFloat(value + "f");
		}
		value = attributes.getProperty(ElementTags.LLY);
		if (value != null) {
			lly = Float.parseFloat(value + "f");
		}
		value = attributes.getProperty(ElementTags.URX);
		if (value != null) {
			urx = Float.parseFloat(value + "f");
		}
		value = attributes.getProperty(ElementTags.URY);
		if (value != null) {
			ury = Float.parseFloat(value + "f");
		}

		String title = attributes.getProperty(ElementTags.TITLE);
		String text = attributes.getProperty(ElementTags.CONTENT);
		if (title != null || text != null) {
			return new Annotation(title, text, llx, lly, urx, ury);
		}
		value = attributes.getProperty(ElementTags.URL);
		if (value != null) {
			return new Annotation(llx, lly, urx, ury, value);
		}
		value = attributes.getProperty(ElementTags.NAMED);
		if (value != null) {
			return new Annotation(llx, lly, urx, ury, Integer.parseInt(value));
		}
		String file = attributes.getProperty(ElementTags.FILE);
		String destination = attributes.getProperty(ElementTags.DESTINATION);
		String page = (String) attributes.remove(ElementTags.PAGE);
		if (file != null) {
			if (destination != null) {
				return new Annotation(llx, lly, urx, ury, file, destination);
			}
			if (page != null) {
				return new Annotation(llx, lly, urx, ury, file, Integer
						.parseInt(page));
			}
		}
		return new Annotation("", "", llx, lly, urx, ury);
	}
public static Annotation getAnnotation ( Properties attributes ) { float llx = 0 , lly = 0 , urx = 0 , ury = 0 ; String value ; value = attributes . getProperty ( ElementTags . LLX ) ; if ( value != null ) { llx = Float . parseFloat ( value + "f" ) ; } value = attributes . getProperty ( ElementTags . LLY ) ; if ( value != null ) { lly = Float . parseFloat ( value + "f" ) ; } value = attributes . getProperty ( ElementTags . URX ) ; if ( value != null ) { urx = Float . parseFloat ( value + "f" ) ; } value = attributes . getProperty ( ElementTags . URY ) ; if ( value != null ) { ury = Float . parseFloat ( value + "f" ) ; } String title = attributes . getProperty ( ElementTags . TITLE ) ; String text = attributes . getProperty ( ElementTags . CONTENT ) ; if ( title != null || text != null ) { return new Annotation ( title , text , llx , lly , urx , ury ) ; } value = attributes . getProperty ( ElementTags . URL ) ; if ( value != null ) { return new Annotation ( llx , lly , urx , ury , value ) ; } value = attributes . getProperty ( ElementTags . NAMED ) ; if ( value != null ) { return new Annotation ( llx , lly , urx , ury , Integer . parseInt ( value ) ) ; } String file = attributes . getProperty ( ElementTags . FILE ) ; String destination = attributes . getProperty ( ElementTags . DESTINATION ) ; String page = ( String ) attributes . remove ( ElementTags . PAGE ) ; if ( file != null ) { if ( destination != null ) { return new Annotation ( llx , lly , urx , ury , file , destination ) ; } if ( page != null ) { return new Annotation ( llx , lly , urx , ury , file , Integer . parseInt ( page ) ) ; } } return new Annotation ( "" , "" , llx , lly , urx , ury ) ; }
Creates an Annotation object based on a list of properties.
@param attributes
@return an Annotation