<commit_before>module Shoes
  module Swt
    class Line
      include Shoes::Swt::Common::Stroke

      # @param [Hash] opts Options
      #   Must be provided if this shape is responsible for
      #   drawing itself. Omit if this shape is part of another shape.
      def initialize(dsl, opts = nil)
        @dsl = dsl
        if opts
          @container = opts[:container]
          default_paint_callback = lambda do |event|
            gc = event.gc
            gc.set_antialias ::Swt::SWT::ON
            gc.set_foreground self.stroke
            gc.set_line_width self.strokewidth
            gc.draw_line(dsl.left, dsl.top, dsl.right, dsl.bottom)
          end
          @paint_callback = opts[:paint_callback] || default_paint_callback
          @container.add_paint_listener(@paint_callback)
        end
      end

      attr_reader :dsl
      attr_reader :container, :element
      attr_reader :paint_callback
    end
  end
end<commit_msg>Update Line for new App API<commit_after>module Shoes
  module Swt
    class Line
      include Shoes::Swt::Common::Stroke

      # @param [Hash] opts Options
      #   Must be provided if this shape is responsible for
      #   drawing itself. Omit if this shape is part of another shape.
      def initialize(dsl, opts = nil)
        @dsl = dsl
        if opts
          @container = opts[:container]
          default_paint_callback = lambda do |event|
            gc = event.gc
            gc.set_antialias ::Swt::SWT::ON
            gc.set_foreground self.stroke
            gc.set_line_width self.strokewidth
            gc.draw_line(dsl.left, dsl.top, dsl.right, dsl.bottom)
          end
          @paint_callback = opts[:paint_callback] || default_paint_callback
          @container.real.add_paint_listener(@paint_callback)
        end
      end

      attr_reader :dsl
      attr_reader :container, :element
      attr_reader :paint_callback
    end
  end
end
{'fraction_non_alphanumeric': 0.07444039562727746, 'fraction_numerical': 0.0, 'mean_word_length': 2.12520325203252, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7447948', 'n_tokens_mistral': 584, 'n_tokens_neox': 571, 'n_words': 154}