~ubuntu-branches/ubuntu/wily/ctioga2/wily

« back to all changes in this revision

Viewing changes to lib/ctioga2/graphics/styles/legend.rb

  • Committer: Package Import Robot
  • Author(s): Vincent Fourmond
  • Date: 2013-07-08 20:58:17 UTC
  • mfrom: (6.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130708205817-cephnc6etndyxrrp
Tags: 0.4-2
* Upload to unstable
* Already conforms to newer standards

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# This module contains all the classes used by ctioga
18
18
module CTioga2
19
19
 
20
 
  Version::register_svn_info('$Revision: 55 $', '$Date: 2009-05-27 00:01:34 +0200 (Wed, 27 May 2009) $')
 
20
  Version::register_svn_info('$Revision: 359 $', '$Date: 2012-12-26 10:45:35 +0100 (Wed, 26 Dec 2012) $')
21
21
 
22
22
  module Graphics
23
23
 
27
27
      class LegendStorageStyle < BasicStyle
28
28
 
29
29
        # The distance between two lines, a Types::Dimension object.
30
 
        attr_accessor :dy
 
30
        typed_attribute :dy, 'dimension'
31
31
 
32
32
        # The width of the legend pictogram, a Types::Dimension object.
33
33
        attr_accessor :picto_width
38
38
        # The distance between the legend pictogram and the text
39
39
        attr_accessor :picto_to_text
40
40
 
41
 
        # The scale of the legend
42
 
        attr_accessor :scale
 
41
        # The overall scale of the legend
 
42
        typed_attribute :scale, 'float'
43
43
 
44
44
        # The scale of the legend text -- relative to the overall
45
45
        # scale.
46
 
        attr_accessor :text_scale
 
46
        typed_attribute :text_scale, 'float'
 
47
 
 
48
        # The scale of the pictogram
 
49
        typed_attribute :symbol_scale, 'float'
 
50
 
 
51
 
 
52
        # A frame around the legend
 
53
        sub_style :frame, BoxStyle
 
54
 
 
55
        # Padding around the frame
 
56
        typed_attribute :frame_padding, 'dimension'
47
57
 
48
58
        def initialize
49
59
          @dy = Types::Dimension.new(:dy, 1.6, :y)
55
65
 
56
66
          @scale = 0.8
57
67
          @text_scale = 0.82
 
68
          @symbol_scale = 1
 
69
 
 
70
          @frame = BoxStyle.new()
 
71
          
 
72
          @frame_padding = Types::Dimension.from_text("1mm", :x)
58
73
        end
59
74
      end
60
75
    end