Class: UU::OS::GVC::Image

Inherits:
Component show all
Defined in:
uu_os_gvc-0.28.16/lib/uu/os/gvc/image.rb

Overview

Image component.

Instance Attribute Summary (collapse)

Attributes inherited from Component

#attributes, #code, #component_type, #form, #id, #name

Method Summary

Methods inherited from Component

#add_message, #focus, #initialize, #messages

Constructor Details

This class inherits a constructor from UU::OS::GVC::Component

Instance Attribute Details

- (Object) data

The data for the image. The data is a Hash and can contain:

  • imageUri [String, UESURI] - the URI of the image

  • imageAreas [Array] - list of active (clickable) areas of the image. Each item is a Hash

    and can contain:

** shapeData [String] - the shape of the clickable area. If the shape is

not given, the whole image will be clickable. *NOT YET SUPPORTED* - shapeData
is currently always treated as if it was not given so it makes
sense to specify at most 1 item in the imageAreas list.

** actionUri [String, UESURI] - URI to navigate to when this area is clicked. ** target [String] - the target window where the action URI will be opened - one of "CURRENT_WINDOW" (default),

"NEW_WINDOW", "DIALOG_WINDOW". For backward compatibility it's also possible to use older equivalents
"SELF", "NEW" and "MODAL".

** tooltip [String] - the tooltip to display when hovering this area.

Examples:

# clickable image with tooltip
image = view.get_components_by_code('image')[0]
image.data = {
  :imageUri => 'ues:TER:ART:AP_IMAGE1',
  :imageAreas => [
    {
      :actionUri => 'ues:TER:ART:GALLERY',
      :target => 'NEW',
      :tooltip => 'Go to gallery'
    }
  ]
}


43
44
45
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/image.rb', line 43

def data
  @data
end

- (Object) data_uri

The URI of the property to get the data from (see #data). Note that due to backward compatibility, it's also possible to set URI of the actual image (equivalent of data). The URI in #data takes precedence though.



49
50
51
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/image.rb', line 49

def data_uri
  @data_uri
end

- (Object) height (readonly)

Image height.



14
15
16
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/image.rb', line 14

def height
  @height
end

- (Object) width (readonly)

Image width.



11
12
13
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/image.rb', line 11

def width
  @width
end