Class: Archimate::Svg::Entity::Node

Inherits:
BaseEntity show all
Includes:
NodeShape, Rect
Defined in:
lib/archimate/svg/entity/node.rb

Direct Known Subclasses

Plateau

Instance Attribute Summary

Attributes inherited from BaseEntity

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

Instance Method Summary collapse

Methods included from NodeShape

#node_path

Methods included from Rect

#rect_path

Methods inherited from BaseEntity

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

Constructor Details

#initialize(child, bounds_offset) ⇒ Node

Returns a new instance of Node.



11
12
13
# File 'lib/archimate/svg/entity/node.rb', line 11

def initialize(child, bounds_offset)
  super
end

Instance Method Details

#entity_shape(xml, bounds) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/archimate/svg/entity/node.rb', line 15

def entity_shape(xml, bounds)
  case child.child_type
  when "1"
    @badge_bounds = DataModel::Bounds.new(
      x: bounds.right - 25,
      y: bounds.top + 5,
      width: 20,
      height: 20
    )
    @badge = "#archimate-node-badge"
    rect_path(xml, bounds)
  else
    node_path(xml, bounds)
  end
end