private JNoteElementAbstract getHighestNoteGlyphBetween ( NoteAbstract start , NoteAbstract end , boolean excludeStartAndEnd ) { Collection jnotes = getNoteGlyphesBetween ( start , end ) ; JNoteElementAbstract ret = null ; boolean first = true ; for ( Iterator it = jnotes . iterator ( ) ; it . hasNext ( ) ; ) { JNoteElementAbstract n = ( JNoteElementAbstract ) it . next ( ) ; if ( first && excludeStartAndEnd ) { //ignore start ? first = false ; continue ; } if ( ! it . hasNext ( ) && excludeStartAndEnd ) { //ignore end ? break ; } if ( ret == null ) ret = n ; else { if ( n . getBoundingBox ( ) . getMinY ( ) < ret . getBoundingBox ( ) . getMinY ( ) ) ret = n ; } } return ret ; }
Return the JNote that have the highest bounding box