# File lib/bio/graphics/feature.rb, line 39
  def initialize(track, feature_object, opts = {})
    @track = track
    @feature_object = feature_object
    # Note: we don't set the glyph and colour here just yet. They are set at
    # draw-time.
    opts = {
      :label => 'anonymous',
      :link => nil,
      :glyph => nil,
      :colour => nil
    }.merge(opts)
    
    @locations = @feature_object.locations

    @start = @locations.collect{|l| l.from}.min.to_i
    @stop = @locations.collect{|l| l.to}.max.to_i

    @label = opts[:label]
    @link = opts[:link]
    @glyph = opts[:glyph]
    @colour = opts[:colour]
    
    # Create Bio::Graphics SubFeatures
    # The drawing is handled by subfeatures. If there are no defined, the
    # subfeatures array will just hold one element: the @feature_object of
    # self.
    @subfeatures = Array.new
    if ! @feature_object.subfeatures.empty?
      @feature_object.subfeatures.each do |subfeature|
        @subfeatures.push(Bio::Graphics::SubFeature.new(self, subfeature, :glyph => @glyph, :colour => @colour))
      end
    else
      @subfeatures.push(Bio::Graphics::SubFeature.new(self, @feature_object, :glyph => @glyph, :colour => @colour))
    end

    @left_pixel_of_subfeatures = Array.new
    @right_pixel_of_subfeatures = Array.new
  end