Class: Shoes::Swt::Image

Inherits:
Object
  • Object
show all
Includes:
Common::PainterUpdatesPosition, Common::Resource, Common::Clickable, Common::ImageHandling, Common::Remove, Common::Visibility
Defined in:
shoes-swt/lib/shoes/swt/image.rb

Instance Attribute Summary collapse

Attributes included from Common::Clickable

#pass_coordinates

Instance Method Summary collapse

Methods included from Common::ImageHandling

#absolute_file_path, #default_search_paths, #search_for

Methods included from Common::Remove

#remove

Methods included from Common::Visibility

#hidden?, #hidden_from_view?, #hide, #outside_parent_view?, #show, #toggle, #visible?

Methods included from Common::Clickable

#click, #pass_coordinates?, #register_click, #release

Constructor Details

#initialize(dsl, app) ⇒ Image

Returns a new instance of Image


20
21
22
23
24
25
26
27
28
# File 'shoes-swt/lib/shoes/swt/image.rb', line 20

def initialize(dsl, app)
  @dsl = dsl
  @app = app
  @tmpname_or_data = nil
  update_image

  @painter = ImagePainter.new(self)
  app.add_paint_listener(@painter)
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app


18
19
20
# File 'shoes-swt/lib/shoes/swt/image.rb', line 18

def app
  @app
end

#dslObject (readonly)

Returns the value of attribute dsl


18
19
20
# File 'shoes-swt/lib/shoes/swt/image.rb', line 18

def dsl
  @dsl
end

#full_heightObject (readonly)

Returns the value of attribute full_height


18
19
20
# File 'shoes-swt/lib/shoes/swt/image.rb', line 18

def full_height
  @full_height
end

#full_widthObject (readonly)

Returns the value of attribute full_width


18
19
20
# File 'shoes-swt/lib/shoes/swt/image.rb', line 18

def full_width
  @full_width
end

#painterObject (readonly)

Returns the value of attribute painter


18
19
20
# File 'shoes-swt/lib/shoes/swt/image.rb', line 18

def painter
  @painter
end

#realObject (readonly)

Returns the value of attribute real


18
19
20
# File 'shoes-swt/lib/shoes/swt/image.rb', line 18

def real
  @real
end

Instance Method Details

#update_imageObject


30
31
32
# File 'shoes-swt/lib/shoes/swt/image.rb', line 30

def update_image
  load_image(@dsl.file_path)
end