Class Tk::BLT::PlotComponent::Marker
In: tk/lib/tkextlib/blt/component.rb
Parent: TkObject

Methods

after   before   cget   configinfo   configure   create   create_type   current_configinfo   delete   exist?   id   id2obj   new   to_eval   type   type2class  

Constants

MarkerTypeName = nil
MarkerTypeToClass = {}
MarkerID_TBL = TkCore::INTERP.create_table

Public Class methods

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 924
      def self.create(chart, keys={})
        unless self::MarkerTypeName
          fail RuntimeError, "#{self} is an abstract class"
        end
        args, fontkeys = _parse_create_args(keys)
        idnum = tk_call_without_enc(chart.path, 'marker', 'create', 
                                    self::MarkerTypeName, *args)
        chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
        idnum.to_i  # 'item id' is an integer number
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 935
      def self.create_type(chart, type, keys={})
        args, fontkeys = _parse_create_args(keys)
        idnum = tk_call_without_enc(chart.path, 'marker', 'create', 
                                    type, *args)
        chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
        id = idnum.to_i  # 'item id' is an integer number
        obj = self.allocate
        obj.instance_eval{
          @parent = @chart = chart
          @cpath = chart.path
          @id = id
          unless Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath]
            Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath] = {}
          end
          Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath][@id] = self
        }
        obj
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 879
      def Marker.id2obj(chart, id)
        cpath = chart.path
        return id unless MarkerID_TBL[cpath]
        MarkerID_TBL[cpath][id]? MarkerID_TBL[cpath][id]: id
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 954
      def initialize(parent, *args)
        @parent = @chart = parent
        @cpath = parent.path

        @path = @id = create_self(*args) # an integer number as 'item id'
        unless Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath]
          Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath] = {}
        end
        Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath][@id] = self
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 875
      def Marker.type2class(type)
        MarkerTypeToClass[type]
      end

Public Instance methods

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 991
      def after(target=None)
        @chart.marker_after(@id, target)
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 995
      def before(target=None)
        @chart.marker_before(@id, target)
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 977
      def cget(option)
        @chart.marker_cget(@id, option)
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 984
      def configinfo(key=nil)
        @chart.marker_configinfo(@id, key)
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 980
      def configure(key, value=None)
        @chart.marker_configure(@id, key, value)
        self
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 987
      def current_configinfo(key=nil)
        @chart.current_marker_configinfo(@id, key)
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 999
      def delete
        @chart.marker_delete(@id)
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 1003
      def exist?
        @chart.marker_exist(@id)
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 969
      def id
        @id
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 973
      def to_eval
        @id
      end

[Source]

# File tk/lib/tkextlib/blt/component.rb, line 1007
      def type
        @chart.marker_type(@id)
      end

[Validate]