Class: Archimate::Svg::Entity::Group

Inherits:
BaseEntity show all
Defined in:
lib/archimate/svg/entity/group.rb

Instance Attribute Summary

Attributes inherited from BaseEntity

#background_class, #badge, #badge_bounds, #bounds_offset, #child, #entity, #text_bounds

Instance Method Summary collapse

Methods inherited from BaseEntity

#entity_badge, #entity_label, #group_attrs, #layer_background_class, #optional_link, #shape_style, #text_lines, #text_style, #to_svg

Constructor Details

#initialize(child, bounds_offset) ⇒ Group

Returns a new instance of Group.



8
9
10
11
# File 'lib/archimate/svg/entity/group.rb', line 8

def initialize(child, bounds_offset)
  super
  @background_class = "archimate-group-background"
end

Instance Method Details

#entity_shape(xml, bounds) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/archimate/svg/entity/group.rb', line 13

def entity_shape(xml, bounds)
  group_header_height = 21
  xml.rect(x: bounds.left, y: bounds.top + group_header_height, width: bounds.width, height: bounds.height - group_header_height, class: background_class, style: shape_style)
  xml.rect(x: bounds.left, y: bounds.top, width: bounds.width / 2.0, height: group_header_height, class: background_class, style: shape_style)
  xml.rect(x: bounds.left, y: bounds.top, width: bounds.width / 2.0, height: group_header_height, class: "archimate-decoration")
  @text_bounds = bounds.with(height: group_header_height)
  @text_align = "left"
end