ea 0.6.113 → 0.6.114
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/ea/sources/qea/diagram_builder.rb +15 -0
- data/lib/ea/svg/ea_emitter/connector_redock.rb +1 -0
- data/lib/ea/svg/ea_emitter/element/header_line_pipeline.rb +1 -0
- data/lib/ea/svg/ea_emitter/element/header_line_provider/stereotype_label.rb +10 -10
- data/lib/ea/svg/ea_emitter/elements.rb +3 -1
- data/lib/ea/svg/ea_emitter/font_resolver.rb +4 -10
- data/lib/ea/svg/ea_emitter/label/end_label.rb +11 -5
- data/lib/ea/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 251161fffac3b07a12851b0abd26a046998a61b19a9418da8c6d6ceea1cbb09f
|
|
4
|
+
data.tar.gz: 549486eec86fb19c6275db6ab7dafdcb7987c1a22b12df2740140e60c7bb2690
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5cccbc615740b54619be7e36e4c6edb6382768d97b8a120841aca69018b73e693d9dadb8480e78c9e1e0a18ccfc09122668caf9680571496d99b44372c593cd
|
|
7
|
+
data.tar.gz: 87a9b79c59a7102d10aaf4968c052f5a63c1e707ef4daf2376d1278ca79b1317e2fc7d47988d57cb09c5abe88d57aeb12b611ba7066e421a1820ce07ac7ff581
|
|
@@ -126,6 +126,8 @@ module Ea
|
|
|
126
126
|
@current_obj_row = obj_row
|
|
127
127
|
style_hash = DiagramStyleParser.parse(obj_row.objectstyle)
|
|
128
128
|
style_hash[:stored_attribute_order] = true
|
|
129
|
+
fqname = stereotype_fqname_for(obj_row)
|
|
130
|
+
style_hash[:stereotype_fqname] = fqname if fqname
|
|
129
131
|
font_style = effective_font_style(obj_row, style_hash)
|
|
130
132
|
Ea::Model::DiagramElement.new(
|
|
131
133
|
id: IdNormalizer.synthetic("de", diagram_row.diagram_id,
|
|
@@ -150,6 +152,19 @@ module Ea
|
|
|
150
152
|
raw == "1" || raw == "-1"
|
|
151
153
|
end
|
|
152
154
|
|
|
155
|
+
def stereotype_fqname_for(placement)
|
|
156
|
+
object = database.find_object(placement.ea_object_id)
|
|
157
|
+
return nil unless object
|
|
158
|
+
|
|
159
|
+
database.xrefs_for_client(object.ea_guid).each do |xref|
|
|
160
|
+
application = Xref::Parser.parse(xref.description).stereotype
|
|
161
|
+
next unless application && application.name == object.stereotype
|
|
162
|
+
|
|
163
|
+
return application.fqname
|
|
164
|
+
end
|
|
165
|
+
nil
|
|
166
|
+
end
|
|
167
|
+
|
|
153
168
|
def build_connectors(diagram_row)
|
|
154
169
|
links = database.diagram_links_for(diagram_row.diagram_id) || []
|
|
155
170
|
context = ContextDiagramSupport.context?(diagram_row)
|
|
@@ -389,6 +389,7 @@ module Ea
|
|
|
389
389
|
dividers = [divider_y_by_ref[source_ref],
|
|
390
390
|
divider_y_by_ref[target_ref]]
|
|
391
391
|
return nil unless bounds.all? && dividers.all?
|
|
392
|
+
return nil if flush_lateral_line?(connector, pairs, *bounds)
|
|
392
393
|
|
|
393
394
|
preserve_source = explicit_horizontal_source_dock?(pairs, connector)
|
|
394
395
|
adjusted = row_slot_pairs(pairs, bounds, dividers, preserve_source: preserve_source)
|
|
@@ -22,7 +22,7 @@ module Ea
|
|
|
22
22
|
# render zero «...» lines, classes included).
|
|
23
23
|
return [] if context.suppress_stereotypes
|
|
24
24
|
|
|
25
|
-
labels = label_for(classifier, context.umldi_keyword)
|
|
25
|
+
labels = label_for(classifier, context.umldi_keyword, context.stereotype_fqname)
|
|
26
26
|
return [] if labels.empty?
|
|
27
27
|
|
|
28
28
|
labels.map { |l| [l, :normal] }
|
|
@@ -30,10 +30,10 @@ module Ea
|
|
|
30
30
|
|
|
31
31
|
# @return [Array<String>] «name» labels (EA renders one
|
|
32
32
|
# line per applied stereotype)
|
|
33
|
-
def self.label_for(classifier, umldi_keyword)
|
|
33
|
+
def self.label_for(classifier, umldi_keyword, stereotype_fqname = nil)
|
|
34
34
|
return ["«#{umldi_keyword}»"] if umldi_keyword && !umldi_keyword.empty?
|
|
35
35
|
|
|
36
|
-
explicit = explicit_stereotype(classifier)
|
|
36
|
+
explicit = explicit_stereotype(classifier, stereotype_fqname)
|
|
37
37
|
return explicit if explicit
|
|
38
38
|
|
|
39
39
|
case classifier
|
|
@@ -45,21 +45,21 @@ module Ea
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
def self.explicit_stereotype(classifier)
|
|
48
|
+
def self.explicit_stereotype(classifier, stereotype_fqname = nil)
|
|
49
49
|
return nil unless classifier.is_a?(Ea::Model::Classifier) ||
|
|
50
50
|
classifier.is_a?(Ea::Model::Package)
|
|
51
51
|
|
|
52
52
|
refs = classifier.stereotype_refs
|
|
53
53
|
return nil unless refs&.any?
|
|
54
54
|
|
|
55
|
-
refs.map { |ref| "«#{canonical(ref)}»" }
|
|
55
|
+
refs.map { |ref| "«#{canonical(ref, stereotype_fqname)}»" }
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
# EA
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
# EA's standard Class stereotype displays as «type» while
|
|
59
|
+
# its semantic name remains Type. Custom profiles retain case.
|
|
60
|
+
def self.canonical(ref, stereotype_fqname = nil)
|
|
61
|
+
return "type" if ref == "Type" && stereotype_fqname == "StandardProfileL2::Type"
|
|
62
|
+
|
|
63
63
|
ref
|
|
64
64
|
end
|
|
65
65
|
|
|
@@ -166,10 +166,12 @@ module Ea
|
|
|
166
166
|
)
|
|
167
167
|
end
|
|
168
168
|
end
|
|
169
|
+
stereotype_fqname = element.style&.fetch(:stereotype_fqname, nil)
|
|
169
170
|
header_lines = classifier ? Element::HeaderLines.for(classifier,
|
|
170
171
|
diagram_package_id: diagram.package_id,
|
|
171
172
|
visually_nested: visually_nested?(element),
|
|
172
173
|
umldi_keyword: element.umldi_keyword,
|
|
174
|
+
stereotype_fqname: stereotype_fqname,
|
|
173
175
|
bounds_width: bounds.width,
|
|
174
176
|
font_size: size, logical_height: logical_height,
|
|
175
177
|
family: family,
|
|
@@ -452,7 +454,7 @@ module Ea
|
|
|
452
454
|
def tagged_values_for(classifier)
|
|
453
455
|
return [] unless classifier.is_a?(Ea::Model::Classifier)
|
|
454
456
|
|
|
455
|
-
classifier.tagged_values || []
|
|
457
|
+
(classifier.tagged_values || []).reject { |tag| tag.value.nil? || tag.value.empty? }
|
|
456
458
|
end
|
|
457
459
|
|
|
458
460
|
# Real OCL constraints render trailing, after the content
|
|
@@ -10,7 +10,7 @@ module Ea
|
|
|
10
10
|
# 2. theme.font_family / theme.font_size (when theme is themed)
|
|
11
11
|
# 3. diagram-level default (most common non-nil value across
|
|
12
12
|
# the diagram's elements)
|
|
13
|
-
# 4.
|
|
13
|
+
# 4. unthemed fallback (Cambria)
|
|
14
14
|
#
|
|
15
15
|
# Lives outside the Elements emitter so the resolution rule is
|
|
16
16
|
# defined once (MECE) and reusable by Labels and any future
|
|
@@ -83,14 +83,8 @@ module Ea
|
|
|
83
83
|
theme.element_font_family || theme.font_family
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
# "Calibri" 10. We can't query EA's runtime, so we infer
|
|
89
|
-
# from the diagram:
|
|
90
|
-
#
|
|
91
|
-
# - If ANY element specifies font=, use the most common.
|
|
92
|
-
# - If NO element specifies font= (all are "use default"),
|
|
93
|
-
# assume the EA English-locale default: Calibri 10.
|
|
86
|
+
# Unthemed diagrams without a saved family use Cambria.
|
|
87
|
+
# Saved families still supply the diagram default.
|
|
94
88
|
def diagram_default_family
|
|
95
89
|
families = element_families
|
|
96
90
|
return FALLBACK_DEFAULT_FAMILY if families.empty?
|
|
@@ -98,7 +92,7 @@ module Ea
|
|
|
98
92
|
most_common(families)
|
|
99
93
|
end
|
|
100
94
|
|
|
101
|
-
FALLBACK_DEFAULT_FAMILY = "
|
|
95
|
+
FALLBACK_DEFAULT_FAMILY = "Cambria"
|
|
102
96
|
|
|
103
97
|
def most_common(values)
|
|
104
98
|
return nil if values.empty?
|
|
@@ -247,12 +247,15 @@ module Ea
|
|
|
247
247
|
def source_bottom_dock?(connector, heading, box)
|
|
248
248
|
source_seat?(:source, heading) && heading[0].zero? && heading[1].positive? &&
|
|
249
249
|
zero_source_property_box?(box) && default_presentation?(box) &&
|
|
250
|
-
source_bottom_property_route?(connector.style.to_h) &&
|
|
251
|
-
source_property_font?(connector, :down)
|
|
250
|
+
source_bottom_property_route?(connector.style.to_h) && source_property_cambria?(connector)
|
|
252
251
|
end
|
|
253
252
|
|
|
253
|
+
# A downward leg on the horizontal lateral tree seats an absent
|
|
254
|
+
# box like the up leg already does on the same route.
|
|
254
255
|
def source_bottom_property_route?(style)
|
|
255
|
-
|
|
256
|
+
return false unless style.values_at(:mode, :lwidth) == %w[3 2]
|
|
257
|
+
|
|
258
|
+
style[:tree] == "LH" || (style[:stored_association_ray] == true && style[:tree].nil?)
|
|
256
259
|
end
|
|
257
260
|
|
|
258
261
|
def plain_upward_seat(connector, direction, anchor, box, role)
|
|
@@ -386,11 +389,14 @@ module Ea
|
|
|
386
389
|
end
|
|
387
390
|
|
|
388
391
|
def source_property_font?(connector, direction)
|
|
389
|
-
|
|
390
|
-
property_label?(connector, :source) &&
|
|
392
|
+
source_property_cambria?(connector) &&
|
|
391
393
|
source_property_route?(connector.style.to_h, direction)
|
|
392
394
|
end
|
|
393
395
|
|
|
396
|
+
def source_property_cambria?(connector)
|
|
397
|
+
font_family.to_s.casecmp("Cambria").zero? && property_label?(connector, :source)
|
|
398
|
+
end
|
|
399
|
+
|
|
394
400
|
def source_property_route?(style, direction)
|
|
395
401
|
case direction
|
|
396
402
|
when :left then left_property_route?(style)
|
data/lib/ea/version.rb
CHANGED