Module: Shoes::Swt::Common::Fill
- Defined in:
- shoes-swt/lib/shoes/swt/common/fill.rb
Overview
Note:
Including classes must provide ‘#dsl`
Methods for retrieving fill values from a Shoes DSL class
Instance Method Summary collapse
-
#angle ⇒ Integer
The angle to use when filling with a pattern.
- #apply_fill(context) ⇒ Object
-
#fill ⇒ Swt::Graphics::Color
This object’s fill color.
-
#fill_alpha ⇒ Integer
This object’s fill alpha value.
-
#update_fill ⇒ Object
Just clear it out and let next paint recreate and save our SWT color.
Instance Method Details
#angle ⇒ Integer
Returns the angle to use when filling with a pattern.
28 29 30 |
# File 'shoes-swt/lib/shoes/swt/common/fill.rb', line 28 def angle dsl.angle || 0 end |
#apply_fill(context) ⇒ Object
37 38 39 40 41 42 |
# File 'shoes-swt/lib/shoes/swt/common/fill.rb', line 37 def apply_fill(context) return unless fill fill.apply_as_fill(context, self) true end |
#fill ⇒ Swt::Graphics::Color
This object’s fill color
13 14 15 16 17 18 |
# File 'shoes-swt/lib/shoes/swt/common/fill.rb', line 13 def fill return @cached_swt_fill if @cached_swt_fill @color_factory ||= ::Shoes::Swt::ColorFactory.new @cached_swt_fill = @color_factory.create(dsl.fill) end |
#fill_alpha ⇒ Integer
This object’s fill alpha value
23 24 25 |
# File 'shoes-swt/lib/shoes/swt/common/fill.rb', line 23 def fill_alpha fill.alpha end |
#update_fill ⇒ Object
Just clear it out and let next paint recreate and save our SWT color
33 34 35 |
# File 'shoes-swt/lib/shoes/swt/common/fill.rb', line 33 def update_fill @cached_swt_fill = nil end |