public void setPosition ( int pos ) { if ( pos < 0 || pos >= number ) throw new IllegalArgumentException ( "Position " + pos + " out of range" ) ; position = pos ; updateLocationDefinition ( position ) ; forwardButton . setEnabled ( position < number - 1 ) ; backwardButton . setEnabled ( position > 0 ) ; if ( panel . getParent ( ) != null ) positionChanged ( ) ; }
Sets the position of the viewer .