/* ---------------------------------------------------------------- // Function Name : generateAnnotationBuffer // Date Written : 03/04/2008 // Author : yogvinder // Input Parameters : // Return Values : AnnotationBuffer // Description : generateAnnotationBuffer Implemented // ---------------------------------------------------------------- */ public static AnnotationBuffer generateAnnotationBuffer(String annotationBuffer) throws NGException { AnnotationBuffer aBuffer = new AnnotationBuffer(); String[] annotationBufferArray = annotationBuffer.split("[\\n\\r]+"); int length = annotationBufferArray.length; if (length > 0) { int counter = 0; aBuffer.setTotalAnnotations( Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); aBuffer.setNoOfStamp(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); int stamplength = length - 2; double d = stamplength / 14; int stampCounter = stamplength / 14; for (int x = 0; x < stampCounter; x++) { Stamp stamp = new Stamp(); stamp.setStampName(aBuffer.getVal1(annotationBufferArray[counter++])); stamp.setX1(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); stamp.setY1(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); stamp.setX2(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); stamp.setY2(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); stamp.setColor(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); stamp.setTimeOrder(aBuffer.getVal(annotationBufferArray[counter++])); stamp.setMouseSensivity(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); stamp.setAnnotationGroupID(aBuffer.getVal(annotationBufferArray[counter++])); stamp.setUserId(aBuffer.getVal(annotationBufferArray[counter++])); stamp.setRights(aBuffer.getVal(annotationBufferArray[counter++])); stamp.setType(Integer.parseInt(aBuffer.getVal(annotationBufferArray[counter++]))); stamp.setFileName(aBuffer.getVal(annotationBufferArray[counter++])); stamp.setStampFileSource(aBuffer.getVal(annotationBufferArray[counter++])); aBuffer.add2StampList(stamp); } } return aBuffer; }