archimate 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/archimate/data_model/connector_type.rb +0 -1
- data/lib/archimate/data_model/elements.rb +0 -11
- data/lib/archimate/data_model/relationships.rb +0 -15
- data/lib/archimate/data_model/viewpoints.rb +1 -1
- data/lib/archimate/file_formats/sax/archi/archi_handler_factory.rb +1 -1
- data/lib/archimate/file_formats/sax/archi/element.rb +10 -1
- data/lib/archimate/file_formats/serializer/archi/element.rb +19 -7
- data/lib/archimate/lint/duplicate_entities.rb +1 -1
- data/lib/archimate/svg/entity/and_junction.rb +4 -0
- data/lib/archimate/svg/entity/or_junction.rb +4 -0
- data/lib/archimate/svg/legend.rb +14 -10
- data/lib/archimate/version.rb +1 -1
- metadata +1 -2
- data/lib/archimate/svg/entity/junction.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96bba8c44a533b1b6ab3fd4ed2a9119459fb3a8d3a86e48a49ff7d98b90a981a
|
4
|
+
data.tar.gz: 38360fca023b3984dc031644966353eaa050d60bb0dd7aaec574f46d434c3259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 361db052df11cad6194370134a755d3f96df232ff40704ea263d2497df0ecdbf4d00e64310eea2021602a0202a56cd4c1901295265a7be69a90509c627d8b224
|
7
|
+
data.tar.gz: 948f1932a4d21f4ef5e61528d08a5bf83287fe81196e088403beb6f61eecf56ba1a30ab621b0d1cc63735fac68027e9fa7b4e5309b7f6ed533e06f8574f0d2f0
|
@@ -713,17 +713,6 @@ module Archimate
|
|
713
713
|
end
|
714
714
|
end
|
715
715
|
|
716
|
-
class Junction < Element
|
717
|
-
NAME = "Junction"
|
718
|
-
DESCRIPTION = "A junction is used to connect relationships of the same type."
|
719
|
-
CLASSIFICATION = :active_structure
|
720
|
-
LAYER = Layers::Connectors
|
721
|
-
|
722
|
-
def initialize(args)
|
723
|
-
super
|
724
|
-
end
|
725
|
-
end
|
726
|
-
|
727
716
|
class OrJunction < Element
|
728
717
|
NAME = "Or Junction"
|
729
718
|
DESCRIPTION = "A junction is used to connect relationships of the same type."
|
@@ -163,21 +163,6 @@ module Archimate
|
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
166
|
-
# Junction is a relationship connector
|
167
|
-
# * All relationships connected with relationship connectors must be of the same type
|
168
|
-
class Junction < Relationship
|
169
|
-
NAME = "Junction"
|
170
|
-
DESCRIPTION = "A junction is used to connect relationships of the same type."
|
171
|
-
WEIGHT = 0
|
172
|
-
CLASSIFICATION = :other
|
173
|
-
VERB = "junction to"
|
174
|
-
OBJECT_VERB = "junction from"
|
175
|
-
|
176
|
-
def initialize(args)
|
177
|
-
super
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
166
|
# Junction is a relationship connector
|
182
167
|
# * All relationships connected with relationship connectors must be of the same type
|
183
168
|
class AndJunction < Relationship
|
@@ -277,7 +277,7 @@ module Archimate
|
|
277
277
|
allowed_relationship_types: [
|
278
278
|
Relationships::AndJunction, Relationships::Association,
|
279
279
|
Relationships::Composition, Relationships::Flow,
|
280
|
-
Relationships::
|
280
|
+
Relationships::AndJunction, Relationships::OrJunction,
|
281
281
|
Relationships::Triggering
|
282
282
|
]
|
283
283
|
)
|
@@ -26,11 +26,20 @@ module Archimate
|
|
26
26
|
@element ||= DataModel::Elements.create(
|
27
27
|
id: @attrs["id"],
|
28
28
|
name: DataModel::LangString.string(process_text(@attrs["name"])),
|
29
|
-
type:
|
29
|
+
type: mapped_element_type,
|
30
30
|
documentation: documentation,
|
31
31
|
properties: properties
|
32
32
|
)
|
33
33
|
end
|
34
|
+
|
35
|
+
def mapped_element_type
|
36
|
+
case element_type
|
37
|
+
when "Junction"
|
38
|
+
@attrs["type"] == "or" ? "OrJunction" : "AndJunction"
|
39
|
+
else
|
40
|
+
element_type
|
41
|
+
end
|
42
|
+
end
|
34
43
|
end
|
35
44
|
end
|
36
45
|
end
|
@@ -6,17 +6,29 @@ module Archimate
|
|
6
6
|
module Archi
|
7
7
|
module Element
|
8
8
|
def serialize_element(xml, element)
|
9
|
-
xml.element(
|
10
|
-
{
|
11
|
-
"xsi:type" => "archimate:#{element.type}",
|
12
|
-
"id" => element.id,
|
13
|
-
"name" => element.name
|
14
|
-
}.compact
|
15
|
-
) do
|
9
|
+
xml.element(element_attrs(element)) do
|
16
10
|
serialize_documentation(xml, element.documentation)
|
17
11
|
serialize(xml, element.properties)
|
18
12
|
end
|
19
13
|
end
|
14
|
+
|
15
|
+
def element_attrs(element)
|
16
|
+
{
|
17
|
+
"xsi:type" => "archimate:#{mapped_element_name(element)}",
|
18
|
+
"id" => element.id,
|
19
|
+
"name" => element.name,
|
20
|
+
"type" => element.is_a?(DataModel::Elements::OrJunction) ? "or" : nil
|
21
|
+
}.compact
|
22
|
+
end
|
23
|
+
|
24
|
+
def mapped_element_name(element)
|
25
|
+
case element
|
26
|
+
when DataModel::Elements::AndJunction, DataModel::Elements::OrJunction
|
27
|
+
"Junction"
|
28
|
+
else
|
29
|
+
element.type
|
30
|
+
end
|
31
|
+
end
|
20
32
|
end
|
21
33
|
end
|
22
34
|
end
|
@@ -8,6 +8,10 @@ module Archimate
|
|
8
8
|
super
|
9
9
|
@background_class = "archimate-junction-background"
|
10
10
|
end
|
11
|
+
|
12
|
+
def entity_shape(xml, bounds)
|
13
|
+
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)
|
14
|
+
end
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
@@ -8,6 +8,10 @@ module Archimate
|
|
8
8
|
super
|
9
9
|
@background_class = "archimate-or-junction-background"
|
10
10
|
end
|
11
|
+
|
12
|
+
def entity_shape(xml, bounds)
|
13
|
+
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)
|
14
|
+
end
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
data/lib/archimate/svg/legend.rb
CHANGED
@@ -85,24 +85,25 @@ module Archimate
|
|
85
85
|
if klass.superclass == DataModel::Element
|
86
86
|
element_example(x, y, klass, klass_name, xml)
|
87
87
|
elsif klass.superclass == DataModel::Relationship
|
88
|
-
relationship_example(x, y, klass_name, xml)
|
88
|
+
relationship_example(x, y, klass, klass_name, xml)
|
89
89
|
end
|
90
90
|
element_type_description(klass::DESCRIPTION, text_bounds(x, y), xml)
|
91
91
|
end
|
92
92
|
|
93
93
|
def element_example(x, y, klass, klass_name, xml)
|
94
94
|
case klass_name
|
95
|
-
when "
|
95
|
+
when "OrJunction"
|
96
96
|
r = (element_height - 10) / 4
|
97
|
-
|
98
|
-
xml.
|
99
|
-
xml.text_(x: x + r * 2 + text_indent, y: y + r + line_height / 2, class: "archimate-legend-title") do
|
100
|
-
xml.text("And Junction")
|
101
|
-
end
|
102
|
-
xml.circle(cx: x + r, cy: y + row_height / 2 + r, r: r, style: "fill:#fff;stroke:#000")
|
103
|
-
xml.text_(x: x + r * 2 + text_indent, y: y + row_height / 2 + r + line_height / 2, class: "archimate-legend-title") do
|
97
|
+
xml.circle(cx: x + r, cy: y + row_height / 2 - r, r: r, style: "fill:#fff;stroke:#000")
|
98
|
+
xml.text_(x: x + r * 2 + text_indent, y: y + row_height / 2 - line_height / 2, class: "archimate-legend-title") do
|
104
99
|
xml.text("Or Junction")
|
105
100
|
end
|
101
|
+
when "AndJunction"
|
102
|
+
r = (element_height - 10) / 4
|
103
|
+
xml.circle(cx: x + r, cy: y + row_height / 2 - r, r: r, style: "fill:#000;stroke:#000")
|
104
|
+
xml.text_(x: x + r * 2 + text_indent, y: y + row_height / 2 - line_height / 2, class: "archimate-legend-title") do
|
105
|
+
xml.text("And Junction")
|
106
|
+
end
|
106
107
|
else
|
107
108
|
element = DataModel::Elements.const_get(klass_name).new(id: "legend-element-#{klass_name}", name: klass::NAME)
|
108
109
|
view_node = DataModel::ViewNode.new(
|
@@ -117,7 +118,10 @@ module Archimate
|
|
117
118
|
end
|
118
119
|
end
|
119
120
|
|
120
|
-
def relationship_example(x, y, klass_name, xml)
|
121
|
+
def relationship_example(x, y, klass, klass_name, xml)
|
122
|
+
xml.text_(x: x + text_indent, y: y + line_height, class: "archimate-legend-title") do
|
123
|
+
xml.text(klass::NAME)
|
124
|
+
end
|
121
125
|
css_class = "archimate-#{klass_name.downcase} archimate-relationship"
|
122
126
|
xml.path(d: "M#{x} #{y + row_height / 2} h #{element_width}", class: css_class)
|
123
127
|
end
|
data/lib/archimate/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Morga
|
@@ -618,7 +618,6 @@ files:
|
|
618
618
|
- lib/archimate/svg/entity/infrastructure_service.rb
|
619
619
|
- lib/archimate/svg/entity/interaction_entity.rb
|
620
620
|
- lib/archimate/svg/entity/interface_entity.rb
|
621
|
-
- lib/archimate/svg/entity/junction.rb
|
622
621
|
- lib/archimate/svg/entity/location.rb
|
623
622
|
- lib/archimate/svg/entity/material.rb
|
624
623
|
- lib/archimate/svg/entity/meaning.rb
|
@@ -1,19 +0,0 @@
|
|
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
|