archimate 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.projectile +18 -0
- data/.rubocop.yml +13 -0
- data/.travis.yml +4 -0
- data/.yardocs +15 -0
- data/Gemfile +5 -0
- data/Guardfile +27 -0
- data/LICENSE +201 -0
- data/README.md +94 -0
- data/Rakefile +29 -0
- data/TODOs.org +286 -0
- data/archimate.gemspec +51 -0
- data/bin/archimate +17 -0
- data/bin/console +13 -0
- data/bin/setup +8 -0
- data/exe/archidiff +7 -0
- data/exe/archidiff-summary +7 -0
- data/exe/archimate +7 -0
- data/exe/archimerge +7 -0
- data/exe/fmtxml +7 -0
- data/lib/archimate/cli/archi.rb +189 -0
- data/lib/archimate/cli/cleanup.rb +54 -0
- data/lib/archimate/cli/conflict_resolver.rb +39 -0
- data/lib/archimate/cli/convert.rb +39 -0
- data/lib/archimate/cli/diff.rb +31 -0
- data/lib/archimate/cli/diff_summary.rb +101 -0
- data/lib/archimate/cli/duper.rb +85 -0
- data/lib/archimate/cli/lint.rb +16 -0
- data/lib/archimate/cli/mapper.rb +82 -0
- data/lib/archimate/cli/merge.rb +49 -0
- data/lib/archimate/cli/merger.rb +109 -0
- data/lib/archimate/cli/stats.rb +42 -0
- data/lib/archimate/cli/svger.rb +40 -0
- data/lib/archimate/color.rb +53 -0
- data/lib/archimate/config.rb +35 -0
- data/lib/archimate/data_model/any_attribute.rb +13 -0
- data/lib/archimate/data_model/any_element.rb +15 -0
- data/lib/archimate/data_model/archimate_node.rb +181 -0
- data/lib/archimate/data_model/bounds.rb +72 -0
- data/lib/archimate/data_model/color.rb +47 -0
- data/lib/archimate/data_model/concept.rb +14 -0
- data/lib/archimate/data_model/concern.rb +17 -0
- data/lib/archimate/data_model/connection.rb +107 -0
- data/lib/archimate/data_model/constants.rb +82 -0
- data/lib/archimate/data_model/container.rb +17 -0
- data/lib/archimate/data_model/diagram.rb +40 -0
- data/lib/archimate/data_model/diffable_array.rb +213 -0
- data/lib/archimate/data_model/diffable_primitive.rb +83 -0
- data/lib/archimate/data_model/documentation.rb +14 -0
- data/lib/archimate/data_model/element.rb +87 -0
- data/lib/archimate/data_model/font.rb +54 -0
- data/lib/archimate/data_model/label.rb +19 -0
- data/lib/archimate/data_model/lang_string.rb +41 -0
- data/lib/archimate/data_model/location.rb +31 -0
- data/lib/archimate/data_model/metadata.rb +14 -0
- data/lib/archimate/data_model/model.rb +217 -0
- data/lib/archimate/data_model/modeling_note.rb +13 -0
- data/lib/archimate/data_model/named_referenceable.rb +14 -0
- data/lib/archimate/data_model/organization.rb +40 -0
- data/lib/archimate/data_model/property.rb +25 -0
- data/lib/archimate/data_model/property_definition.rb +16 -0
- data/lib/archimate/data_model/referenceable.rb +29 -0
- data/lib/archimate/data_model/relationship.rb +85 -0
- data/lib/archimate/data_model/schema_info.rb +18 -0
- data/lib/archimate/data_model/style.rb +32 -0
- data/lib/archimate/data_model/view.rb +12 -0
- data/lib/archimate/data_model/view_concept.rb +18 -0
- data/lib/archimate/data_model/view_node.rb +114 -0
- data/lib/archimate/data_model/viewpoint.rb +87 -0
- data/lib/archimate/data_model.rb +54 -0
- data/lib/archimate/diff/archimate_array_reference.rb +113 -0
- data/lib/archimate/diff/archimate_identified_node_reference.rb +41 -0
- data/lib/archimate/diff/archimate_node_attribute_reference.rb +70 -0
- data/lib/archimate/diff/archimate_node_reference.rb +80 -0
- data/lib/archimate/diff/change.rb +49 -0
- data/lib/archimate/diff/conflict.rb +31 -0
- data/lib/archimate/diff/conflicts/base_conflict.rb +53 -0
- data/lib/archimate/diff/conflicts/deleted_items_child_updated_conflict.rb +30 -0
- data/lib/archimate/diff/conflicts/deleted_items_referenced_conflict.rb +63 -0
- data/lib/archimate/diff/conflicts/path_conflict.rb +51 -0
- data/lib/archimate/diff/conflicts.rb +89 -0
- data/lib/archimate/diff/delete.rb +41 -0
- data/lib/archimate/diff/difference.rb +113 -0
- data/lib/archimate/diff/insert.rb +43 -0
- data/lib/archimate/diff/merge.rb +70 -0
- data/lib/archimate/diff/move.rb +51 -0
- data/lib/archimate/diff.rb +17 -0
- data/lib/archimate/export/csv_export.rb +32 -0
- data/lib/archimate/export/cypher.rb +171 -0
- data/lib/archimate/export/graph_ml.rb +131 -0
- data/lib/archimate/export/n_quads.rb +142 -0
- data/lib/archimate/file_format.rb +30 -0
- data/lib/archimate/file_formats/archi_file_format.rb +151 -0
- data/lib/archimate/file_formats/archi_file_reader.rb +252 -0
- data/lib/archimate/file_formats/archi_file_writer.rb +230 -0
- data/lib/archimate/file_formats/archimate_v2.rb +461 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_lang_string.rb +35 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_metadata.rb +115 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_property_definitions.rb +28 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_property_defs.rb +27 -0
- data/lib/archimate/file_formats/model_exchange_file_reader.rb +237 -0
- data/lib/archimate/file_formats/model_exchange_file_reader_21.rb +73 -0
- data/lib/archimate/file_formats/model_exchange_file_reader_30.rb +134 -0
- data/lib/archimate/file_formats/model_exchange_file_writer.rb +157 -0
- data/lib/archimate/file_formats/model_exchange_file_writer_21.rb +143 -0
- data/lib/archimate/file_formats/model_exchange_file_writer_30.rb +153 -0
- data/lib/archimate/file_formats/writer.rb +56 -0
- data/lib/archimate/lint/duplicate_entities.rb +121 -0
- data/lib/archimate/lint/linter.rb +146 -0
- data/lib/archimate/logging.rb +55 -0
- data/lib/archimate/maybe_io.rb +34 -0
- data/lib/archimate/progress_indicator.rb +29 -0
- data/lib/archimate/svg/archimate.css +232 -0
- data/lib/archimate/svg/child.rb +29 -0
- data/lib/archimate/svg/connection.rb +184 -0
- data/lib/archimate/svg/css_style.rb +31 -0
- data/lib/archimate/svg/diagram.rb +87 -0
- data/lib/archimate/svg/entity/and_junction.rb +14 -0
- data/lib/archimate/svg/entity/application_collaboration.rb +14 -0
- data/lib/archimate/svg/entity/application_component.rb +41 -0
- data/lib/archimate/svg/entity/application_event.rb +13 -0
- data/lib/archimate/svg/entity/application_function.rb +13 -0
- data/lib/archimate/svg/entity/application_interaction.rb +13 -0
- data/lib/archimate/svg/entity/application_interface.rb +13 -0
- data/lib/archimate/svg/entity/application_process.rb +13 -0
- data/lib/archimate/svg/entity/application_service.rb +13 -0
- data/lib/archimate/svg/entity/artifact.rb +39 -0
- data/lib/archimate/svg/entity/assessment.rb +14 -0
- data/lib/archimate/svg/entity/base_entity.rb +128 -0
- data/lib/archimate/svg/entity/business_actor.rb +14 -0
- data/lib/archimate/svg/entity/business_collaboration.rb +14 -0
- data/lib/archimate/svg/entity/business_event.rb +10 -0
- data/lib/archimate/svg/entity/business_function.rb +13 -0
- data/lib/archimate/svg/entity/business_interaction.rb +13 -0
- data/lib/archimate/svg/entity/business_interface.rb +13 -0
- data/lib/archimate/svg/entity/business_object.rb +13 -0
- data/lib/archimate/svg/entity/business_process.rb +13 -0
- data/lib/archimate/svg/entity/business_role.rb +14 -0
- data/lib/archimate/svg/entity/business_service.rb +13 -0
- data/lib/archimate/svg/entity/capability.rb +14 -0
- data/lib/archimate/svg/entity/communication_network.rb +14 -0
- data/lib/archimate/svg/entity/communication_path.rb +14 -0
- data/lib/archimate/svg/entity/constraint.rb +15 -0
- data/lib/archimate/svg/entity/contract.rb +13 -0
- data/lib/archimate/svg/entity/course_of_action.rb +14 -0
- data/lib/archimate/svg/entity/data_entity.rb +29 -0
- data/lib/archimate/svg/entity/data_object.rb +13 -0
- data/lib/archimate/svg/entity/deliverable.rb +13 -0
- data/lib/archimate/svg/entity/device.rb +48 -0
- data/lib/archimate/svg/entity/diagram_model_reference.rb +22 -0
- data/lib/archimate/svg/entity/diagram_object.rb +30 -0
- data/lib/archimate/svg/entity/distribution_network.rb +14 -0
- data/lib/archimate/svg/entity/driver.rb +14 -0
- data/lib/archimate/svg/entity/equipment.rb +16 -0
- data/lib/archimate/svg/entity/event_entity.rb +36 -0
- data/lib/archimate/svg/entity/facility.rb +16 -0
- data/lib/archimate/svg/entity/function_entity.rb +14 -0
- data/lib/archimate/svg/entity/gap.rb +21 -0
- data/lib/archimate/svg/entity/goal.rb +14 -0
- data/lib/archimate/svg/entity/group.rb +24 -0
- data/lib/archimate/svg/entity/implementation_event.rb +13 -0
- data/lib/archimate/svg/entity/infrastructure_function.rb +13 -0
- data/lib/archimate/svg/entity/infrastructure_interface.rb +13 -0
- data/lib/archimate/svg/entity/infrastructure_service.rb +13 -0
- data/lib/archimate/svg/entity/interaction_entity.rb +14 -0
- data/lib/archimate/svg/entity/interface_entity.rb +35 -0
- data/lib/archimate/svg/entity/junction.rb +19 -0
- data/lib/archimate/svg/entity/location.rb +14 -0
- data/lib/archimate/svg/entity/material.rb +14 -0
- data/lib/archimate/svg/entity/meaning.rb +40 -0
- data/lib/archimate/svg/entity/motivation_entity.rb +40 -0
- data/lib/archimate/svg/entity/network.rb +14 -0
- data/lib/archimate/svg/entity/node.rb +33 -0
- data/lib/archimate/svg/entity/node_shape.rb +64 -0
- data/lib/archimate/svg/entity/note.rb +30 -0
- data/lib/archimate/svg/entity/or_junction.rb +14 -0
- data/lib/archimate/svg/entity/outcome.rb +15 -0
- data/lib/archimate/svg/entity/path.rb +14 -0
- data/lib/archimate/svg/entity/plateau.rb +15 -0
- data/lib/archimate/svg/entity/principle.rb +15 -0
- data/lib/archimate/svg/entity/process_entity.rb +63 -0
- data/lib/archimate/svg/entity/product.rb +20 -0
- data/lib/archimate/svg/entity/rect.rb +13 -0
- data/lib/archimate/svg/entity/rect_entity.rb +25 -0
- data/lib/archimate/svg/entity/representation.rb +31 -0
- data/lib/archimate/svg/entity/requirement.rb +15 -0
- data/lib/archimate/svg/entity/resource.rb +14 -0
- data/lib/archimate/svg/entity/rounded_rect_entity.rb +23 -0
- data/lib/archimate/svg/entity/service_entity.rb +51 -0
- data/lib/archimate/svg/entity/sketch_model_sticky.rb +14 -0
- data/lib/archimate/svg/entity/stakeholder.rb +15 -0
- data/lib/archimate/svg/entity/system_software.rb +14 -0
- data/lib/archimate/svg/entity/technology_collaboration.rb +14 -0
- data/lib/archimate/svg/entity/technology_event.rb +13 -0
- data/lib/archimate/svg/entity/technology_function.rb +13 -0
- data/lib/archimate/svg/entity/technology_interaction.rb +13 -0
- data/lib/archimate/svg/entity/technology_interface.rb +13 -0
- data/lib/archimate/svg/entity/technology_process.rb +13 -0
- data/lib/archimate/svg/entity/technology_service.rb +13 -0
- data/lib/archimate/svg/entity/value.rb +27 -0
- data/lib/archimate/svg/entity/work_package.rb +14 -0
- data/lib/archimate/svg/entity.rb +93 -0
- data/lib/archimate/svg/entity_factory.rb +17 -0
- data/lib/archimate/svg/extents.rb +27 -0
- data/lib/archimate/svg/point.rb +7 -0
- data/lib/archimate/svg/svg_template.rb +27 -0
- data/lib/archimate/svg/svg_template.svg.erb +169 -0
- data/lib/archimate/version.rb +4 -0
- data/lib/archimate.rb +114 -0
- metadata +623 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Equipment < BaseEntity
|
7
|
+
include NodeShape
|
8
|
+
|
9
|
+
def initialize(child, bounds_offset)
|
10
|
+
super
|
11
|
+
@badge = "#archimate-equipment-badge"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class EventEntity < BaseEntity
|
7
|
+
def entity_shape(xml, bounds)
|
8
|
+
notch_x = 18
|
9
|
+
notch_height = bounds.height / 2.0
|
10
|
+
event_width = bounds.width * 0.85
|
11
|
+
rx = 17
|
12
|
+
calc_text_bounds(notch_x)
|
13
|
+
xml.path(
|
14
|
+
d: [
|
15
|
+
"M", bounds.left, bounds.top,
|
16
|
+
"l", notch_x, notch_height,
|
17
|
+
"l", -notch_x, notch_height,
|
18
|
+
"h", event_width,
|
19
|
+
"a", rx, notch_height, 0, 0, 0, 0, -bounds.height,
|
20
|
+
"z"
|
21
|
+
].flatten.join(" "),
|
22
|
+
class: background_class, style: shape_style
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def calc_text_bounds(notch_x)
|
27
|
+
bounds = @text_bounds
|
28
|
+
@text_bounds = bounds.with(
|
29
|
+
x: bounds.left + notch_x * 0.80,
|
30
|
+
width: bounds.width - notch_x
|
31
|
+
)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Facility < BaseEntity
|
7
|
+
include NodeShape
|
8
|
+
|
9
|
+
def initialize(child, bounds_offset)
|
10
|
+
super
|
11
|
+
@badge = "#archimate-facility-badge"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Gap < Representation
|
7
|
+
def initialize(child, bounds_offset)
|
8
|
+
super
|
9
|
+
@background_class = "archimate-implementation2-background"
|
10
|
+
@badge = "#archimate-gap-badge"
|
11
|
+
@badge_bounds = child.bounds.with(
|
12
|
+
x: child.bounds.right - 25,
|
13
|
+
y: child.bounds.top + 5,
|
14
|
+
width: 20,
|
15
|
+
height: 20
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Archimate
|
5
|
+
module Svg
|
6
|
+
module Entity
|
7
|
+
class Group < BaseEntity
|
8
|
+
def initialize(child, bounds_offset)
|
9
|
+
super
|
10
|
+
@background_class = "archimate-group-background"
|
11
|
+
end
|
12
|
+
|
13
|
+
def entity_shape(xml, bounds)
|
14
|
+
group_header_height = 21
|
15
|
+
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)
|
16
|
+
xml.rect(x: bounds.left, y: bounds.top, width: bounds.width / 2.0, height: group_header_height, class: background_class, style: shape_style)
|
17
|
+
xml.rect(x: bounds.left, y: bounds.top, width: bounds.width / 2.0, height: group_header_height, class: "archimate-decoration")
|
18
|
+
@text_bounds = bounds.with(height: group_header_height)
|
19
|
+
@text_align = "left"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class InterfaceEntity < RectEntity
|
7
|
+
def initialize(child, bounds_offset)
|
8
|
+
super
|
9
|
+
@badge = "#archimate-interface-badge"
|
10
|
+
end
|
11
|
+
|
12
|
+
def entity_shape(xml, bounds)
|
13
|
+
case child.child_type
|
14
|
+
when 1
|
15
|
+
@badge = nil
|
16
|
+
elipse_path(xml, bounds)
|
17
|
+
else
|
18
|
+
super
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def elipse_path(xml, bounds)
|
23
|
+
xml.ellipse(
|
24
|
+
cx: bounds.left + bounds.width / 2.0,
|
25
|
+
cy: bounds.top + bounds.height / 2.0,
|
26
|
+
rx: bounds.width / 2.0,
|
27
|
+
ry: bounds.height / 2.0,
|
28
|
+
class: background_class,
|
29
|
+
style: shape_style
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Archimate
|
5
|
+
module Svg
|
6
|
+
module Entity
|
7
|
+
class Junction < RectEntity
|
8
|
+
def initialize(child, bounds_offset)
|
9
|
+
super
|
10
|
+
@background_class = "archimate-junction-background"
|
11
|
+
end
|
12
|
+
|
13
|
+
def entity_shape(xml, bounds)
|
14
|
+
xml.circle(cx: bounds.left + bounds.width / 2.0, cy: bounds.top + bounds.height / 2.0, r: bounds.width / 2.0, class: background_class, style: shape_style)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Meaning < BaseEntity
|
7
|
+
def entity_shape(xml, bounds)
|
8
|
+
meaning_path(xml, bounds)
|
9
|
+
end
|
10
|
+
|
11
|
+
def meaning_path(xml, bounds)
|
12
|
+
pts = [
|
13
|
+
Point.new(bounds.left + bounds.width * 0.04, bounds.top + bounds.height * 0.5),
|
14
|
+
Point.new(bounds.left + bounds.width * 0.5, bounds.top + bounds.height * 0.12),
|
15
|
+
Point.new(bounds.left + bounds.width * 0.94, bounds.top + bounds.height * 0.55),
|
16
|
+
Point.new(bounds.left + bounds.width * 0.53, bounds.top + bounds.height * 0.87)
|
17
|
+
]
|
18
|
+
xml.path(
|
19
|
+
d: [
|
20
|
+
"M", pts[0].x, pts[0].y,
|
21
|
+
"C", pts[0].x - bounds.width * 0.15, pts[0].y - bounds.height * 0.32,
|
22
|
+
pts[1].x - bounds.width * 0.3, pts[1].y - bounds.height * 0.15,
|
23
|
+
pts[1].x, pts[1].y,
|
24
|
+
"C", pts[1].x + bounds.width * 0.29, pts[1].y - bounds.height * 0.184,
|
25
|
+
pts[2].x + bounds.width * 0.204, pts[2].y - bounds.height * 0.304,
|
26
|
+
pts[2].x, pts[2].y,
|
27
|
+
"C", pts[2].x + bounds.width * 0.028, pts[2].y + bounds.height * 0.295,
|
28
|
+
pts[3].x + bounds.width * 0.156, pts[3].y + bounds.height * 0.088,
|
29
|
+
pts[3].x, pts[3].y,
|
30
|
+
"C", pts[3].x - bounds.width * 0.279, pts[3].y + bounds.height * 0.326,
|
31
|
+
pts[0].x - bounds.width * 0.164, pts[0].y + bounds.height * 0.314,
|
32
|
+
pts[0].x, pts[0].y
|
33
|
+
].flatten.join(" "),
|
34
|
+
class: background_class, style: shape_style
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class MotivationEntity < BaseEntity
|
7
|
+
def initialize(child, bounds_offset)
|
8
|
+
super
|
9
|
+
@badge_bounds = child.bounds.with(
|
10
|
+
x: child.bounds.right - 25,
|
11
|
+
y: child.bounds.top + 5,
|
12
|
+
width: 20,
|
13
|
+
height: 20
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
def entity_shape(xml, bounds)
|
18
|
+
margin = 10
|
19
|
+
width = bounds.width - margin * 2
|
20
|
+
height = bounds.height - margin * 2
|
21
|
+
xml.path(
|
22
|
+
d: [
|
23
|
+
["M", bounds.left + margin, bounds.top],
|
24
|
+
["h", width],
|
25
|
+
["l", margin, margin],
|
26
|
+
["v", height],
|
27
|
+
["l", -margin, margin],
|
28
|
+
["h", -width],
|
29
|
+
["l", -margin, -margin],
|
30
|
+
["v", -height],
|
31
|
+
"z"
|
32
|
+
].flatten.join(" "),
|
33
|
+
class: background_class,
|
34
|
+
style: shape_style
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Archimate
|
5
|
+
module Svg
|
6
|
+
module Entity
|
7
|
+
class Node < BaseEntity
|
8
|
+
include Rect
|
9
|
+
include NodeShape
|
10
|
+
|
11
|
+
def initialize(child, bounds_offset)
|
12
|
+
super
|
13
|
+
end
|
14
|
+
|
15
|
+
def entity_shape(xml, bounds)
|
16
|
+
case child.child_type
|
17
|
+
when 1
|
18
|
+
@badge_bounds = bounds.with(
|
19
|
+
x: bounds.right - 25,
|
20
|
+
y: bounds.top + 5,
|
21
|
+
width: 20,
|
22
|
+
height: 20
|
23
|
+
)
|
24
|
+
@badge = "#archimate-node-badge"
|
25
|
+
rect_path(xml, bounds)
|
26
|
+
else
|
27
|
+
node_path(xml, bounds)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
module NodeShape
|
7
|
+
def node_path(xml, bounds)
|
8
|
+
margin = 14
|
9
|
+
@badge_bounds = DataModel::Bounds.new(
|
10
|
+
x: bounds.right - margin - 25,
|
11
|
+
y: bounds.top + margin + 5,
|
12
|
+
width: 20,
|
13
|
+
height: 20
|
14
|
+
)
|
15
|
+
node_box_height = bounds.height - margin
|
16
|
+
node_box_width = bounds.width - margin
|
17
|
+
@text_bounds = DataModel::Bounds.new(
|
18
|
+
x: bounds.left + 1,
|
19
|
+
y: bounds.top + margin + 1,
|
20
|
+
width: node_box_width - 2,
|
21
|
+
height: node_box_height - 2
|
22
|
+
)
|
23
|
+
xml.g(class: background_class, style: shape_style) do
|
24
|
+
xml.path(
|
25
|
+
d: [
|
26
|
+
["M", bounds.left, bounds.bottom],
|
27
|
+
["v", -node_box_height],
|
28
|
+
["l", margin, -margin],
|
29
|
+
["h", node_box_width],
|
30
|
+
["v", node_box_height],
|
31
|
+
["l", -margin, margin],
|
32
|
+
"z"
|
33
|
+
].flatten.join(" ")
|
34
|
+
)
|
35
|
+
xml.path(
|
36
|
+
d: [
|
37
|
+
["M", bounds.left, bounds.top + margin],
|
38
|
+
["l", margin, -margin],
|
39
|
+
["h", node_box_width],
|
40
|
+
["v", node_box_height],
|
41
|
+
["l", -margin, margin],
|
42
|
+
["v", -node_box_height],
|
43
|
+
"z",
|
44
|
+
["M", bounds.right, bounds.top],
|
45
|
+
["l", -margin, margin]
|
46
|
+
].flatten.join(" "),
|
47
|
+
class: "archimate-decoration"
|
48
|
+
)
|
49
|
+
xml.path(
|
50
|
+
d: [
|
51
|
+
["M", bounds.left, bounds.top + margin],
|
52
|
+
["h", node_box_width],
|
53
|
+
["l", margin, -margin],
|
54
|
+
["M", bounds.left + node_box_width, bounds.bottom],
|
55
|
+
["v", -node_box_height]
|
56
|
+
].flatten.join(" "),
|
57
|
+
style: "fill:none;stroke:inherit;"
|
58
|
+
)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Note < BaseEntity
|
7
|
+
def initialize(child, bounds_offset)
|
8
|
+
super
|
9
|
+
@background_class = "archimate-note-background"
|
10
|
+
@text_align = "left"
|
11
|
+
end
|
12
|
+
|
13
|
+
def entity_shape(xml, bounds)
|
14
|
+
xml.path(
|
15
|
+
d: [
|
16
|
+
["m", bounds.left, bounds.top],
|
17
|
+
["h", bounds.width],
|
18
|
+
["v", bounds.height - 8],
|
19
|
+
["l", -8, 8],
|
20
|
+
["h", -(bounds.width - 8)],
|
21
|
+
"z"
|
22
|
+
].flatten.join(" "),
|
23
|
+
class: background_class,
|
24
|
+
style: shape_style
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Outcome < MotivationEntity
|
7
|
+
def initialize(child, bounds_offset)
|
8
|
+
super
|
9
|
+
@background_class = "archimate-motivation2-background"
|
10
|
+
@badge = "#archimate-outcome-badge"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Plateau < Node
|
7
|
+
def initialize(child, bounds_offset)
|
8
|
+
super
|
9
|
+
@background_class = "archimate-implementation2-background"
|
10
|
+
@badge = "#archimate-plateau-badge"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module Svg
|
5
|
+
module Entity
|
6
|
+
class Principle < MotivationEntity
|
7
|
+
def initialize(child, bounds_offset)
|
8
|
+
super
|
9
|
+
@background_class = "archimate-motivation2-background"
|
10
|
+
@badge = "#archimate-principle-badge"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|