ea 0.6.5 → 0.6.7
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/svg/ea_emitter/elements.rb +9 -0
- data/lib/ea/svg/ea_emitter/label/end_label.rb +45 -3
- 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: d066021fc111c616534f8445aa46fc1217d16bd06e5a7555634033b692d1023c
|
|
4
|
+
data.tar.gz: b09455921b726464c95e69a918a916eccc7b6caa66675493e84438eea62c6000
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b388387a89b3d933b8a7c6667c70134da049679cdbc2ef3d3c2aa11937228cd8b0ef55b3509c780b47f5ce437d93a4641e356bd84562929d65ea0012466a67c
|
|
7
|
+
data.tar.gz: be2f5b42394a8a3be5eeeb7bff3d48b6929d47009823f632c105e59f2f2ec33652b9bf6e4fa5a5194c20bf8e74c194a1d3448b6a32ab3f1d145bc59f9ab056bf
|
|
@@ -94,6 +94,15 @@ module Ea
|
|
|
94
94
|
tagged_values_for(classifier).size,
|
|
95
95
|
header_lines)
|
|
96
96
|
end
|
|
97
|
+
# EA suppresses the operations compartment when its rows
|
|
98
|
+
# overflow the stored box height (same rule as attributes).
|
|
99
|
+
if op_lines.any? && geometry.op_first_y &&
|
|
100
|
+
geometry.op_bottom_y.to_i + size > bounds.y + bounds.height
|
|
101
|
+
op_lines = []
|
|
102
|
+
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
103
|
+
tagged_values_for(classifier).size,
|
|
104
|
+
header_lines)
|
|
105
|
+
end
|
|
97
106
|
RenderContext.new(
|
|
98
107
|
element: element,
|
|
99
108
|
bounds: bounds,
|
|
@@ -122,13 +122,23 @@ module Ea
|
|
|
122
122
|
assoc = association_for(connector)
|
|
123
123
|
return [nil, nil, nil] unless assoc
|
|
124
124
|
|
|
125
|
-
prop = property_at_end(assoc, end_kind)
|
|
125
|
+
prop = property_at_end(assoc, end_kind, connector)
|
|
126
126
|
return [true, *property_role(prop)] if prop
|
|
127
127
|
|
|
128
128
|
[false, *association_role(assoc, end_kind)]
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
def property_at_end(association, end_kind)
|
|
131
|
+
def property_at_end(association, end_kind, connector = nil)
|
|
132
|
+
# EA renders the source classifier's synthesized
|
|
133
|
+
# association-end property (matched by the connector's
|
|
134
|
+
# relationship guid), falling back to the property index
|
|
135
|
+
# lookup by association source/target id.
|
|
136
|
+
if connector&.relationship_ref
|
|
137
|
+
placed = placed_classifier_id(association, end_kind)
|
|
138
|
+
prop = assoc_end_property(placed, connector.relationship_ref)
|
|
139
|
+
return prop if prop
|
|
140
|
+
end
|
|
141
|
+
|
|
132
142
|
id = end_kind == :source ? association.source_id : association.target_id
|
|
133
143
|
return nil unless id
|
|
134
144
|
|
|
@@ -137,9 +147,29 @@ module Ea
|
|
|
137
147
|
fallback_property_lookup(id)
|
|
138
148
|
end
|
|
139
149
|
|
|
150
|
+
def placed_classifier_id(association, end_kind)
|
|
151
|
+
end_kind == :source ? association.source_id : association.target_id
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Find the synthesized association-end property on the
|
|
155
|
+
# placed classifier whose association_id matches the
|
|
156
|
+
# connector's relationship reference.
|
|
157
|
+
def assoc_end_property(classifier_id, relationship_ref)
|
|
158
|
+
return nil unless classifier_id
|
|
159
|
+
|
|
160
|
+
classifier = model_index[classifier_id]
|
|
161
|
+
return nil unless classifier.is_a?(Ea::Model::Classifier)
|
|
162
|
+
|
|
163
|
+
(classifier.properties || []).find do |p|
|
|
164
|
+
p.association_id == relationship_ref
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
140
168
|
# Linear-scan fallback for callers that did not wire in
|
|
141
169
|
# the Document. Production paths go through Document's
|
|
142
170
|
# property_index for O(1) lookup.
|
|
171
|
+
|
|
172
|
+
|
|
143
173
|
def fallback_property_lookup(id)
|
|
144
174
|
return nil unless model_index
|
|
145
175
|
|
|
@@ -155,11 +185,23 @@ module Ea
|
|
|
155
185
|
def property_role(property)
|
|
156
186
|
visibility = visibility_prefix(property)
|
|
157
187
|
name = property.name.to_s
|
|
158
|
-
|
|
188
|
+
type_name = property.type_name.to_s
|
|
189
|
+
line = if type_name.empty? || type_name == " "
|
|
190
|
+
"#{visibility}#{name}"
|
|
191
|
+
else
|
|
192
|
+
"#{visibility}#{name}: #{namespace_double_colon(type_name)}"
|
|
193
|
+
end
|
|
194
|
+
role = line.empty? ? nil : line
|
|
159
195
|
mult = multiplicity_text(property)
|
|
160
196
|
[role, mult]
|
|
161
197
|
end
|
|
162
198
|
|
|
199
|
+
def namespace_double_colon(type_name)
|
|
200
|
+
return type_name if type_name.nil? || type_name.empty?
|
|
201
|
+
|
|
202
|
+
type_name.to_s.gsub(/([A-Za-z0-9_]):([A-Za-z])/, '\1::\2')
|
|
203
|
+
end
|
|
204
|
+
|
|
163
205
|
def association_role(assoc, end_kind)
|
|
164
206
|
name = end_kind == :source ? assoc.source_role_name : assoc.target_role_name
|
|
165
207
|
lower = end_kind == :source ? assoc.source_multiplicity_lower : assoc.target_multiplicity_lower
|
data/lib/ea/version.rb
CHANGED