Sha256: f86b59c0dd72e26657f58ec8ddef4500f3e9ac71c0421ad9327b6733a6efdd6b

Contents?: true

Size: 937 Bytes

Versions: 29

Compression:

Stored size: 937 Bytes

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

require 'cosmos/tools/tlm_viewer/widgets/widget'

module Cosmos

  class CanvaslabelWidget
    include Widget

    def initialize(parent_layout, x, y, text, font_size = 12, color='black')
      super()
      @x = x.to_i
      @y = y.to_i
      @text = text
      @color = Cosmos::getColor(color)
      @font = Cosmos.getFont("helvetica", font_size.to_i)
      parent_layout.add_repaint(self)
    end

    def paint(painter)
      painter.save
      painter.setPen(@color)
      painter.setFont(@font)
      painter.drawText(@x, @y, @text)
      painter.restore
    end
  end

end # module Cosmos

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
cosmos-4.0.0-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-4.0.0 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.9.2 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.9.1 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.8.3 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.8.2 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.8.1 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.8.0 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.7.1 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.7.0 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.6.3 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.6.2 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.6.1 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.6.0 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.5.3 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.5.2 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.5.0 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.4.2 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.4.1 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb
cosmos-3.4.0 lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb