Class: MotionPlot::PlotArea
- Inherits:
-
Object
- Object
- MotionPlot::PlotArea
- Defined in:
- lib/motion-plot/utilities/plot_area.rb
Constant Summary collapse
- DEFAULTS =
{ padding: [50.0, 10.0, 20.0, 20.0], border_line_style: default_border_line_style, mask_to_border: false, corner_radius: 5.0 }
Instance Attribute Summary collapse
-
#border_line_style ⇒ Object
Returns the value of attribute border_line_style.
-
#corner_radius ⇒ Object
Returns the value of attribute corner_radius.
-
#mask_to_border ⇒ Object
Returns the value of attribute mask_to_border.
-
#padding ⇒ Object
Returns the value of attribute padding.
Class Method Summary collapse
Instance Method Summary collapse
- #add_style(graph_plot_area) ⇒ Object
-
#initialize(args = {}) ⇒ PlotArea
constructor
A new instance of PlotArea.
Constructor Details
Instance Attribute Details
#border_line_style ⇒ Object
Returns the value of attribute border_line_style.
4 5 6 |
# File 'lib/motion-plot/utilities/plot_area.rb', line 4 def border_line_style @border_line_style end |
#corner_radius ⇒ Object
Returns the value of attribute corner_radius.
4 5 6 |
# File 'lib/motion-plot/utilities/plot_area.rb', line 4 def corner_radius @corner_radius end |
#mask_to_border ⇒ Object
Returns the value of attribute mask_to_border.
4 5 6 |
# File 'lib/motion-plot/utilities/plot_area.rb', line 4 def mask_to_border @mask_to_border end |
#padding ⇒ Object
Returns the value of attribute padding.
4 5 6 |
# File 'lib/motion-plot/utilities/plot_area.rb', line 4 def padding @padding end |
Class Method Details
.default_border_line_style ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/motion-plot/utilities/plot_area.rb', line 6 def self.default_border_line_style line_style = CPTMutableLineStyle.lineStyle line_style.lineColor = CPTColor.blackColor line_style.lineWidth = 2.0 line_style end |
Instance Method Details
#add_style(graph_plot_area) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/motion-plot/utilities/plot_area.rb', line 29 def add_style(graph_plot_area) graph_plot_area.masksToBorder = @mask_to_border graph_plot_area.borderLineStyle = @border_line_style || nil graph_plot_area.cornerRadius = @corner_radius unless(border_line_style.nil?) %W(left top right bottom).each_with_index do |pos, index| graph_plot_area.send("padding#{pos.camelize}=", @padding[index]) unless(padding[index].nil?) end graph_plot_area end |