ea 0.6.154 → 0.6.155
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/cli/app.rb +8 -2
- data/lib/ea/cli/command/base.rb +1 -3
- data/lib/ea/cli/command/convert.rb +2 -2
- data/lib/ea/cli/command/diagrams.rb +4 -4
- data/lib/ea/cli/command/export.rb +1 -1
- data/lib/ea/cli/command/info.rb +1 -1
- data/lib/ea/cli/command/list.rb +2 -2
- data/lib/ea/cli/command/render.rb +1 -2
- data/lib/ea/cli/command/svg.rb +1 -1
- data/lib/ea/cli/command/validate.rb +1 -3
- data/lib/ea/cli/error.rb +1 -1
- data/lib/ea/cli/output.rb +1 -1
- data/lib/ea/diagram/display_config.rb +1 -1
- data/lib/ea/export/json/generator.rb +5 -5
- data/lib/ea/export/json_schema/generator.rb +2 -2
- data/lib/ea/export/plantuml/generator.rb +2 -2
- data/lib/ea/fonts/metrics.rb +3 -4
- data/lib/ea/lint/rules/cyclic_generalization.rb +1 -1
- data/lib/ea/lint/rules/duplicate_name.rb +1 -1
- data/lib/ea/lint/rules/missing_stereotype.rb +4 -3
- data/lib/ea/lint/rules/naming_convention.rb +11 -11
- data/lib/ea/lint/rules/orphan_element.rb +6 -6
- data/lib/ea/mdg/document.rb +0 -1
- data/lib/ea/mdg/loader.rb +0 -1
- data/lib/ea/mdg/xml/technology.rb +1 -1
- data/lib/ea/mdg/xml.rb +0 -1
- data/lib/ea/mdg.rb +0 -1
- data/lib/ea/model/document.rb +2 -2
- data/lib/ea/model/ghost_label.rb +0 -1
- data/lib/ea/model/legend.rb +1 -1
- data/lib/ea/model/property.rb +1 -1
- data/lib/ea/qea/benchmark.rb +9 -13
- data/lib/ea/qea/database.rb +26 -28
- data/lib/ea/qea/factory/association_builder.rb +5 -5
- data/lib/ea/qea/factory/association_transformer.rb +3 -6
- data/lib/ea/qea/factory/attribute_transformer.rb +3 -3
- data/lib/ea/qea/factory/base_transformer.rb +4 -4
- data/lib/ea/qea/factory/class_transformer.rb +5 -5
- data/lib/ea/qea/factory/constraint_transformer.rb +2 -2
- data/lib/ea/qea/factory/data_type_transformer.rb +5 -7
- data/lib/ea/qea/factory/diagram_transformer.rb +3 -7
- data/lib/ea/qea/factory/document_builder.rb +33 -37
- data/lib/ea/qea/factory/ea_to_uml_factory.rb +12 -18
- data/lib/ea/qea/factory/enum_transformer.rb +1 -2
- data/lib/ea/qea/factory/generalization_builder.rb +9 -9
- data/lib/ea/qea/factory/generalization_transformer.rb +3 -5
- data/lib/ea/qea/factory/instance_transformer.rb +3 -8
- data/lib/ea/qea/factory/operation_transformer.rb +2 -4
- data/lib/ea/qea/factory/package_transformer.rb +3 -3
- data/lib/ea/qea/factory/reference_resolver.rb +1 -1
- data/lib/ea/qea/factory/stereotype_loader.rb +1 -5
- data/lib/ea/qea/file_detector.rb +6 -12
- data/lib/ea/qea/infrastructure/database_connection.rb +1 -3
- data/lib/ea/qea/infrastructure/schema_reader.rb +4 -4
- data/lib/ea/qea/infrastructure/table_reader.rb +1 -1
- data/lib/ea/qea/models/ea_attribute.rb +1 -2
- data/lib/ea/qea/models/ea_attribute_tag.rb +1 -2
- data/lib/ea/qea/models/ea_author.rb +1 -1
- data/lib/ea/qea/models/ea_diagram_link.rb +4 -8
- data/lib/ea/qea/models/ea_diagram_object.rb +3 -4
- data/lib/ea/qea/models/ea_document.rb +4 -5
- data/lib/ea/qea/models/ea_glossary.rb +1 -1
- data/lib/ea/qea/models/ea_list.rb +1 -1
- data/lib/ea/qea/models/ea_object.rb +2 -2
- data/lib/ea/qea/models/ea_object_constraint.rb +1 -2
- data/lib/ea/qea/models/ea_object_property.rb +1 -2
- data/lib/ea/qea/models/ea_operation.rb +1 -2
- data/lib/ea/qea/models/ea_phase.rb +1 -1
- data/lib/ea/qea/models/ea_script.rb +5 -6
- data/lib/ea/qea/models/ea_tagged_value.rb +2 -3
- data/lib/ea/qea/models/ea_version.rb +1 -1
- data/lib/ea/qea/models/ea_xref.rb +6 -7
- data/lib/ea/qea/repositories/base_repository.rb +1 -1
- data/lib/ea/qea/services/database_loader.rb +2 -4
- data/lib/ea/qea/validation/association_validator.rb +12 -12
- data/lib/ea/qea/validation/attribute_validator.rb +25 -26
- data/lib/ea/qea/validation/base_validator.rb +5 -5
- data/lib/ea/qea/validation/class_validator.rb +34 -34
- data/lib/ea/qea/validation/database/circular_reference_validator.rb +7 -7
- data/lib/ea/qea/validation/database/ocl_constraint_validator.rb +3 -3
- data/lib/ea/qea/validation/database/orphan_validator.rb +5 -7
- data/lib/ea/qea/validation/database/referential_integrity_validator.rb +39 -39
- data/lib/ea/qea/validation/diagram_validator.rb +39 -39
- data/lib/ea/qea/validation/formatters/json_formatter.rb +16 -16
- data/lib/ea/qea/validation/formatters/text_formatter.rb +10 -10
- data/lib/ea/qea/validation/operation_validator.rb +13 -14
- data/lib/ea/qea/validation/package_validator.rb +18 -18
- data/lib/ea/qea/validation/validation_engine.rb +5 -5
- data/lib/ea/qea/validation/validation_message.rb +56 -73
- data/lib/ea/qea/validation/validation_result.rb +6 -6
- data/lib/ea/qea/verification/comparison_result.rb +13 -21
- data/lib/ea/qea/verification/document_normalizer.rb +6 -12
- data/lib/ea/qea/verification/document_verifier.rb +39 -39
- data/lib/ea/qea/verification/element_comparator.rb +27 -31
- data/lib/ea/qea/verification/structure_matcher.rb +10 -10
- data/lib/ea/qea.rb +5 -7
- data/lib/ea/query/builder.rb +3 -3
- data/lib/ea/render/image_converter.rb +5 -3
- data/lib/ea/shapescript/parser.rb +4 -4
- data/lib/ea/sources/qea/classifier_builder.rb +7 -3
- data/lib/ea/sources/qea/context_diagram_support.rb +2 -2
- data/lib/ea/sources/qea/diagram_builder/routing.rb +4 -4
- data/lib/ea/sources/qea/diagram_builder.rb +80 -51
- data/lib/ea/sources/qea/id_normalizer.rb +0 -1
- data/lib/ea/sources/qea/instance_builder.rb +2 -2
- data/lib/ea/sources/qea/legend_builder.rb +1 -1
- data/lib/ea/sources/qea/note_builder.rb +4 -4
- data/lib/ea/sources/xmi/diagram_builder/stereotype_profiles.rb +1 -1
- data/lib/ea/sources/xmi/extension_style_parser.rb +2 -2
- data/lib/ea/sources/xmi/property_builder.rb +10 -2
- data/lib/ea/sources/xmi/relationship_builder.rb +10 -2
- data/lib/ea/sources/xmi/relationship_type_map.rb +1 -1
- data/lib/ea/sources/xmi/tag_builder.rb +1 -1
- data/lib/ea/sources/xmi/type_classifier_map.rb +1 -1
- data/lib/ea/spa/configuration.rb +2 -4
- data/lib/ea/spa/generator.rb +3 -3
- data/lib/ea/spa/output/strategy.rb +7 -5
- data/lib/ea/spa/projector.rb +21 -17
- data/lib/ea/svg/connector_router.rb +5 -3
- data/lib/ea/svg/ea_emitter/background.rb +0 -1
- data/lib/ea/svg/ea_emitter/bounds_calculator.rb +8 -10
- data/lib/ea/svg/ea_emitter/canvas.rb +1 -1
- data/lib/ea/svg/ea_emitter/color_resolver.rb +1 -1
- data/lib/ea/svg/ea_emitter/compartment/note_body.rb +1 -1
- data/lib/ea/svg/ea_emitter/connector_redock.rb +6 -3
- data/lib/ea/svg/ea_emitter/diagram_frame.rb +2 -2
- data/lib/ea/svg/ea_emitter/document.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/attribute_renderer.rb +2 -4
- data/lib/ea/svg/ea_emitter/element/compartment_geometry.rb +18 -14
- data/lib/ea/svg/ea_emitter/element/header_line_pipeline.rb +6 -5
- data/lib/ea/svg/ea_emitter/element/header_line_provider/name.rb +1 -3
- data/lib/ea/svg/ea_emitter/element/header_line_provider/stereotype_label.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/icon_renderer.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/legend_renderer.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/note_shape_renderer.rb +5 -5
- data/lib/ea/svg/ea_emitter/element/operation_renderer.rb +2 -3
- data/lib/ea/svg/ea_emitter/element/package_shape_renderer.rb +3 -4
- data/lib/ea/svg/ea_emitter/element/stereotype_icon_renderer.rb +1 -1
- data/lib/ea/svg/ea_emitter/elements.rb +64 -63
- data/lib/ea/svg/ea_emitter/ghost_labels.rb +0 -1
- data/lib/ea/svg/ea_emitter/label/end_label.rb +7 -7
- data/lib/ea/svg/ea_emitter/labels.rb +1 -1
- data/lib/ea/svg/ea_emitter/layer_sequencer.rb +5 -5
- data/lib/ea/svg/ea_emitter/marker/arrow_path.rb +4 -2
- data/lib/ea/svg/ea_emitter/marker/open_triangle.rb +4 -4
- data/lib/ea/svg/ea_emitter/markers.rb +3 -1
- data/lib/ea/svg/ea_emitter/render_context.rb +1 -1
- data/lib/ea/svg/ea_emitter/text_renderer.rb +15 -4
- data/lib/ea/theme/definition.rb +17 -17
- data/lib/ea/transformers/qea_to_xmi/context.rb +1 -1
- data/lib/ea/transformers/qea_to_xmi/run_state.rb +1 -1
- data/lib/ea/transformers/qea_to_xmi/transformer.rb +44 -44
- data/lib/ea/transformers/qea_to_xmi/visibility.rb +3 -3
- data/lib/ea/version.rb +1 -1
- data/lib/ea/xmi/liquid_drops/connector_drop.rb +2 -2
- data/lib/ea/xmi/liquid_drops/enum_drop.rb +4 -4
- data/lib/ea/xmi/liquid_drops/generalization_attribute_drop.rb +2 -8
- data/lib/ea/xmi/liquid_drops/generalization_drop.rb +3 -3
- data/lib/ea/xmi/liquid_drops/package_drop.rb +9 -9
- data/lib/ea/xmi/liquid_drops/root_drop.rb +1 -1
- data/lib/ea/xmi/loader.rb +5 -11
- data/lib/ea/xmi/parser.rb +75 -81
- data/lib/ea/xmi/slicer.rb +16 -12
- data/lib/ea/xref_format/legend_definition.rb +31 -0
- data/lib/ea/xref_format/parser.rb +146 -0
- data/lib/ea/xref_format/property_definition.rb +25 -0
- data/lib/ea/xref_format/record.rb +37 -0
- data/lib/ea/xref_format/stereotype_application.rb +33 -0
- data/lib/ea/xref_format.rb +36 -0
- data/lib/ea.rb +1 -0
- metadata +26 -25
- data/lib/ea/sources/qea/xref/legend_definition.rb +0 -35
- data/lib/ea/sources/qea/xref/parser.rb +0 -150
- data/lib/ea/sources/qea/xref/property_definition.rb +0 -29
- data/lib/ea/sources/qea/xref/record.rb +0 -41
- data/lib/ea/sources/qea/xref/stereotype_application.rb +0 -37
|
@@ -69,7 +69,7 @@ module Ea
|
|
|
69
69
|
Layer.new(style_key: :frame_tab, style: TAB_STYLE, body: body)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
def tab_label_layer(
|
|
72
|
+
def tab_label_layer(_canvas, diagram)
|
|
73
73
|
label = tab_label(diagram)
|
|
74
74
|
return nil unless label
|
|
75
75
|
|
|
@@ -84,7 +84,7 @@ module Ea
|
|
|
84
84
|
"M #{inset} #{inset} L #{inset} #{bottom} L #{right} #{bottom} L #{right} #{inset} L #{inset} #{inset}"
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
-
def tab_points(
|
|
87
|
+
def tab_points(_canvas, diagram)
|
|
88
88
|
label_width = tab_label_width(diagram)
|
|
89
89
|
x1 = theme.frame.inset
|
|
90
90
|
x2 = x1 + label_width
|
|
@@ -41,7 +41,7 @@ module Ea
|
|
|
41
41
|
# case). An unframed export is finally anchored on the content.
|
|
42
42
|
def lay_out
|
|
43
43
|
canvas = Canvas.from(diagram, model_index: model_index,
|
|
44
|
-
|
|
44
|
+
content_anchor: content_anchor)
|
|
45
45
|
seq = sequence(canvas)
|
|
46
46
|
canvas, seq = redo_on_drawn(canvas, seq)
|
|
47
47
|
return anchor_on_content(canvas, seq) if content_anchor
|
|
@@ -38,7 +38,6 @@ module Ea
|
|
|
38
38
|
STEREOTYPE_HEADER_X_OFFSET = 12
|
|
39
39
|
ROW_LINE_OFFSET = 6
|
|
40
40
|
|
|
41
|
-
|
|
42
41
|
# EA scales the row text inset with point size:
|
|
43
42
|
# 7pt rows sit at box.x+22, 9pt at box.x+26 (the '+ '
|
|
44
43
|
# visibility run stays at box.x+5 for both).
|
|
@@ -51,7 +50,6 @@ module Ea
|
|
|
51
50
|
fill: "#000000",
|
|
52
51
|
visibility_x_offset: DEFAULT_VISIBILITY_X_OFFSET,
|
|
53
52
|
content_x_offset: nil)
|
|
54
|
-
|
|
55
53
|
line_h = Ea::Fonts::Metrics.compartment_line_height(
|
|
56
54
|
size, family: family, unit: size_unit, offset: ROW_LINE_OFFSET, logical_height: logical_height
|
|
57
55
|
)
|
|
@@ -113,7 +111,7 @@ module Ea
|
|
|
113
111
|
header = "«#{canonical_stereotype(stereotypes.first)}»"
|
|
114
112
|
[header] + ordered_properties(props, stored_order, case_sensitive: true).map do |prop|
|
|
115
113
|
AttributeLineBuilder.new(prop, host: classifier,
|
|
116
|
-
|
|
114
|
+
lookup: lookup).to_s
|
|
117
115
|
end
|
|
118
116
|
else
|
|
119
117
|
# EMPIRICAL FIT (test B58D1A53, the only corpus class mixing
|
|
@@ -126,7 +124,7 @@ module Ea
|
|
|
126
124
|
stereotype = property_stereotype(prop)
|
|
127
125
|
lines << "«#{stereotype}»" if stereotype
|
|
128
126
|
lines << AttributeLineBuilder.new(prop, host: classifier,
|
|
129
|
-
|
|
127
|
+
lookup: lookup).to_s
|
|
130
128
|
end
|
|
131
129
|
end
|
|
132
130
|
end
|
|
@@ -29,21 +29,21 @@ module Ea
|
|
|
29
29
|
:attr_first_offset
|
|
30
30
|
|
|
31
31
|
def initialize(bounds:, size:, header_lines_count:,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
attr_lines_count:, op_lines_count:,
|
|
33
|
+
tagged_values_count:,
|
|
34
|
+
constraints_count: 0,
|
|
35
|
+
marker_count: 0,
|
|
36
|
+
enum_literals_count: 0,
|
|
37
|
+
header_top_padding: 12,
|
|
38
|
+
header_line_offset: 6,
|
|
39
|
+
divider_offset: 8,
|
|
40
|
+
attr_line_offset: 6,
|
|
41
|
+
attr_first_offset: 7,
|
|
42
|
+
attr_group_lead: 0,
|
|
43
43
|
compact_standard_operations: false,
|
|
44
44
|
family: nil, size_unit: "pt", logical_height: nil,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
header_ghost: false,
|
|
46
|
+
header_ghost_tight: false)
|
|
47
47
|
@bounds = bounds
|
|
48
48
|
@size = size
|
|
49
49
|
@family = family
|
|
@@ -102,7 +102,11 @@ module Ea
|
|
|
102
102
|
# The off-canvas parent ghost shifts every following
|
|
103
103
|
# header line +3, and the divider tracks the LAST header
|
|
104
104
|
# baseline + 8 (936AA434: ghost 100, stereo 116 = +16).
|
|
105
|
-
ghost_shift = header_ghost
|
|
105
|
+
ghost_shift = if header_ghost
|
|
106
|
+
header_ghost_tight ? 3 : 6
|
|
107
|
+
else
|
|
108
|
+
0
|
|
109
|
+
end
|
|
106
110
|
|
|
107
111
|
header_first_y +
|
|
108
112
|
([header_lines_count, 1].max - 1) * line_height(header_line_offset || 6) +
|
|
@@ -63,6 +63,7 @@ module Ea
|
|
|
63
63
|
).round
|
|
64
64
|
end
|
|
65
65
|
return [text] if context.bounds_width.nil?
|
|
66
|
+
|
|
66
67
|
usable = context.bounds_width.to_i - 6
|
|
67
68
|
return [text] if width.call(text) <= usable
|
|
68
69
|
|
|
@@ -94,11 +95,11 @@ module Ea
|
|
|
94
95
|
word.split(/(::)/).each_slice(2) do |part, sep|
|
|
95
96
|
chunk << pending << part
|
|
96
97
|
pending = ""
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
next unless sep
|
|
99
|
+
|
|
100
|
+
chunk << sep
|
|
101
|
+
segments << chunk.dup
|
|
102
|
+
chunk.clear
|
|
102
103
|
end
|
|
103
104
|
unless chunk.empty?
|
|
104
105
|
segments << chunk.dup
|
|
@@ -35,9 +35,7 @@ module Ea
|
|
|
35
35
|
def self.wrapped_name_lines(classifier, context, weight)
|
|
36
36
|
name = display_name(classifier)
|
|
37
37
|
name = "#{context.foreign_package_name}::#{name}" if context.foreign_package_name
|
|
38
|
-
unless context.bounds_width && name_exceeds_bounds?(name, context, weight)
|
|
39
|
-
return [[name, weight]]
|
|
40
|
-
end
|
|
38
|
+
return [[name, weight]] unless context.bounds_width && name_exceeds_bounds?(name, context, weight)
|
|
41
39
|
|
|
42
40
|
if (qualified = name.match(/\A(.+?:{1,2})([^:\s].*)\z/))
|
|
43
41
|
[[qualified[1], weight], [qualified[2], weight]]
|
|
@@ -47,7 +47,7 @@ module Ea
|
|
|
47
47
|
|
|
48
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?
|
|
@@ -114,11 +114,11 @@ module Ea
|
|
|
114
114
|
texts = lines.each_with_index.map do |line, idx|
|
|
115
115
|
y = bounds.y + TEXT_Y_OFFSET + (idx * LINE_HEIGHT)
|
|
116
116
|
TextRenderer.new(content: line,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
x: bounds.x + TEXT_X_OFFSET,
|
|
118
|
+
y: y,
|
|
119
|
+
family: family,
|
|
120
|
+
size: size,
|
|
121
|
+
fill: text_fill).to_svg
|
|
122
122
|
end
|
|
123
123
|
texts.join("\n ")
|
|
124
124
|
end
|
|
@@ -96,12 +96,11 @@ module Ea
|
|
|
96
96
|
private_class_method :parameter_text
|
|
97
97
|
|
|
98
98
|
def self.reception_params(operation, parameter_detail)
|
|
99
|
-
|
|
99
|
+
(operation.parameters || []).filter_map do |p|
|
|
100
100
|
next nil if p.type_name.to_s.empty?
|
|
101
101
|
|
|
102
102
|
parameter_text(p, p.type_name, parameter_detail)
|
|
103
|
-
|
|
104
|
-
params
|
|
103
|
+
end.join(", ")
|
|
105
104
|
end
|
|
106
105
|
private_class_method :reception_params
|
|
107
106
|
|
|
@@ -121,9 +121,9 @@ module Ea
|
|
|
121
121
|
|
|
122
122
|
def text_at(x, y, content, weight:)
|
|
123
123
|
TextRenderer.new(content: content,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
x: x, y: y,
|
|
125
|
+
family: family, size: size, size_unit: size_unit,
|
|
126
|
+
weight: weight, fill: text_fill).to_svg
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def label_x
|
|
@@ -228,7 +228,6 @@ module Ea
|
|
|
228
228
|
def self.body_width_for(label:, stereotype:, size:, family: nil)
|
|
229
229
|
autosized_tab_width(label: label, stereotype: stereotype, size: size, family: family) + TAB_BODY_EXTRA
|
|
230
230
|
end
|
|
231
|
-
|
|
232
231
|
end
|
|
233
232
|
end
|
|
234
233
|
end
|
|
@@ -116,8 +116,6 @@ module Ea
|
|
|
116
116
|
@divider_y[element.model_element_ref] = context.geometry.divider_y
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
119
|
# Build the RenderContext for one element. Returns nil when
|
|
122
120
|
# the element has no usable bounds (skip rendering).
|
|
123
121
|
def build_context(element)
|
|
@@ -133,7 +131,6 @@ module Ea
|
|
|
133
131
|
logical_height = font_resolver.logical_height_for(element)
|
|
134
132
|
parent_name = off_canvas_parent_name_for(classifier)
|
|
135
133
|
|
|
136
|
-
|
|
137
134
|
is_classifier = classifier.is_a?(Ea::Model::Classifier)
|
|
138
135
|
# Interfaces DO render attribute compartments when they own
|
|
139
136
|
# attribute rows (936AA434/Surface lists its nine 19107
|
|
@@ -158,13 +155,13 @@ module Ea
|
|
|
158
155
|
end
|
|
159
156
|
op_lines = if is_classifier && show_operations? &&
|
|
160
157
|
(operations_visible?(element) || regenerated_context?)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
158
|
+
Element::OperationRenderer.lines_for(
|
|
159
|
+
classifier,
|
|
160
|
+
parameter_detail: display_config.operation_parameter_detail
|
|
161
|
+
)
|
|
162
|
+
else
|
|
163
|
+
[]
|
|
164
|
+
end
|
|
168
165
|
# Titles wrap; content rows grow the drawn box to fit their insets.
|
|
169
166
|
row_w = [row_content_width(attr_lines, 5, size, family,
|
|
170
167
|
logical_height: logical_height,
|
|
@@ -184,28 +181,32 @@ module Ea
|
|
|
184
181
|
)
|
|
185
182
|
end
|
|
186
183
|
stereotype_fqname = element.style&.fetch(:stereotype_fqname, nil)
|
|
187
|
-
header_lines =
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
184
|
+
header_lines = if classifier
|
|
185
|
+
Element::HeaderLines.for(classifier,
|
|
186
|
+
diagram_package_id: diagram.package_id,
|
|
187
|
+
visually_nested: visually_nested?(element),
|
|
188
|
+
umldi_keyword: element.umldi_keyword,
|
|
189
|
+
stereotype_fqname: stereotype_fqname,
|
|
190
|
+
bounds_width: bounds.width,
|
|
191
|
+
font_size: size, logical_height: logical_height,
|
|
192
|
+
family: family,
|
|
193
|
+
off_canvas_parent_name: parent_name,
|
|
194
|
+
foreign_package_name: foreign_package_name_for(classifier),
|
|
195
|
+
suppress_stereotypes: suppress_stereotypes?)
|
|
196
|
+
else
|
|
197
|
+
[]
|
|
198
|
+
end
|
|
198
199
|
header_lines = header_lines.map do |text, style|
|
|
199
200
|
[text, font_resolver.header_style_for(style, element)]
|
|
200
201
|
end
|
|
201
202
|
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
202
203
|
tagged_values_for(classifier).size,
|
|
203
204
|
header_lines, classifier: classifier, family: family,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
size_unit: size_unit, logical_height: logical_height,
|
|
206
|
+
constraints_count: constraints_for(classifier).size,
|
|
207
|
+
marker_count: marker_lines_for(classifier, element).size,
|
|
208
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
209
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
209
210
|
# EA suppresses the whole attribute compartment when its
|
|
210
211
|
# rows do not fit the stored box height (never truncates
|
|
211
212
|
# rows) - the AOS box on CityFurniture hides its
|
|
@@ -225,11 +226,11 @@ module Ea
|
|
|
225
226
|
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
226
227
|
tagged_values_for(classifier).size,
|
|
227
228
|
header_lines, classifier: classifier, family: family,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
size_unit: size_unit, logical_height: logical_height,
|
|
230
|
+
constraints_count: constraints_for(classifier).size,
|
|
231
|
+
marker_count: marker_lines_for(classifier, element).size,
|
|
232
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
233
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
233
234
|
end
|
|
234
235
|
# EA suppresses the operations compartment when its rows
|
|
235
236
|
# overflow the stored box height (same rule as attributes)
|
|
@@ -246,22 +247,22 @@ module Ea
|
|
|
246
247
|
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
247
248
|
tagged_values_for(classifier).size,
|
|
248
249
|
header_lines, classifier: classifier, family: family,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
250
|
+
size_unit: size_unit, logical_height: logical_height,
|
|
251
|
+
constraints_count: constraints_for(classifier).size,
|
|
252
|
+
marker_count: marker_lines_for(classifier, element).size,
|
|
253
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
254
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
254
255
|
elsif op_lines.any? && geometry.op_first_y &&
|
|
255
|
-
|
|
256
|
+
geometry.op_bottom_y.to_i > bounds.y + bounds.height
|
|
256
257
|
op_lines = []
|
|
257
258
|
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
258
259
|
tagged_values_for(classifier).size,
|
|
259
260
|
header_lines, classifier: classifier, family: family,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
size_unit: size_unit, logical_height: logical_height,
|
|
262
|
+
constraints_count: constraints_for(classifier).size,
|
|
263
|
+
marker_count: marker_lines_for(classifier, element).size,
|
|
264
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
265
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
265
266
|
end
|
|
266
267
|
# Real attributes grow the DRAWN box past the stored
|
|
267
268
|
# height instead of being dropped (0CABA7D7: stored h44
|
|
@@ -390,23 +391,23 @@ module Ea
|
|
|
390
391
|
end
|
|
391
392
|
CompartmentGeometry.new(bounds: bounds, size: size, family: family,
|
|
392
393
|
size_unit: size_unit, logical_height: logical_height,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
394
|
+
compact_standard_operations: compact_standard,
|
|
395
|
+
header_ghost: header_lines.any? &&
|
|
396
|
+
%i[italic italic_tight].include?(header_lines.first.last),
|
|
397
|
+
header_ghost_tight: Element::HeaderLines.parent_ghost_gap(header_lines) == 3,
|
|
398
|
+
header_lines_count: header_lines.size,
|
|
399
|
+
attr_lines_count: attr_lines.size,
|
|
400
|
+
op_lines_count: op_lines.size,
|
|
401
|
+
tagged_values_count: tagged_count,
|
|
402
|
+
constraints_count: constraints_count,
|
|
403
|
+
marker_count: marker_count,
|
|
404
|
+
enum_literals_count: enum_literals_count,
|
|
405
|
+
header_top_padding: header_padding_for(header_lines, classifier),
|
|
406
|
+
header_line_offset: theme.compartments.header_line_offset,
|
|
407
|
+
divider_offset: divider_offset,
|
|
408
|
+
attr_line_offset: theme.compartments.attr_line_offset,
|
|
409
|
+
attr_first_offset: attr_first_offset,
|
|
410
|
+
attr_group_lead: attr_group_lead)
|
|
410
411
|
end
|
|
411
412
|
|
|
412
413
|
# A ghost-led header (italic parent label above the stereotype /
|
|
@@ -459,7 +460,7 @@ module Ea
|
|
|
459
460
|
first = header_lines.first
|
|
460
461
|
return theme.compartments.header_top_padding unless first
|
|
461
462
|
|
|
462
|
-
if
|
|
463
|
+
if %i[italic italic_tight].include?(first.last)
|
|
463
464
|
6 # ghost-led: EA seats the right-aligned ghost at +13
|
|
464
465
|
elsif first.first.to_s.start_with?("«")
|
|
465
466
|
fallback_stereotype_label?(first.first, classifier) ? 6 : 9
|
|
@@ -533,7 +534,7 @@ module Ea
|
|
|
533
534
|
|
|
534
535
|
def drawn_association_ids
|
|
535
536
|
(diagram.connectors || []).select(&:renderable?)
|
|
536
|
-
|
|
537
|
+
.map(&:relationship_ref).compact.to_set
|
|
537
538
|
end
|
|
538
539
|
|
|
539
540
|
def enum_literals_for(classifier)
|
|
@@ -582,7 +583,7 @@ module Ea
|
|
|
582
583
|
parts = []
|
|
583
584
|
parts << "root" if classifier.is_root
|
|
584
585
|
parts << "leaf" if classifier.is_leaf
|
|
585
|
-
parts.empty? ? nil : "{#{parts.join(
|
|
586
|
+
parts.empty? ? nil : "{#{parts.join(",")}}"
|
|
586
587
|
end
|
|
587
588
|
|
|
588
589
|
def marker_constraint(text)
|
|
@@ -824,7 +825,7 @@ module Ea
|
|
|
824
825
|
# classifier id to the Classifier instance. Returns nil
|
|
825
826
|
# when not found or not a Classifier.
|
|
826
827
|
def attribute_lookup
|
|
827
|
-
|
|
828
|
+
->(id) { model_index[id] if model_index && model_index[id].is_a?(Ea::Model::Classifier) }
|
|
828
829
|
end
|
|
829
830
|
|
|
830
831
|
def model_element_for(element)
|
|
@@ -79,7 +79,7 @@ module Ea
|
|
|
79
79
|
from_property, role, mult = role_and_multiplicity(connector, end_kind)
|
|
80
80
|
if role_empty?(role) && mult_empty?(mult)
|
|
81
81
|
other_from_prop, other_role, other_mult = role_and_multiplicity(connector,
|
|
82
|
-
|
|
82
|
+
opposite(end_kind))
|
|
83
83
|
if stored_labels || connector.style.to_h[:explicit_end_roles] ||
|
|
84
84
|
connector.style.to_h[:phantom_outline] == true
|
|
85
85
|
return [] if role_empty?(other_role) && mult_empty?(other_mult)
|
|
@@ -384,7 +384,7 @@ module Ea
|
|
|
384
384
|
end
|
|
385
385
|
end
|
|
386
386
|
|
|
387
|
-
def tree_positions(end_kind, anchor, role,
|
|
387
|
+
def tree_positions(end_kind, anchor, role, _text_pos, _mult_pos)
|
|
388
388
|
if end_kind == :source
|
|
389
389
|
[[anchor[0] + 3, anchor[1] - 23],
|
|
390
390
|
[anchor[0] + 3, anchor[1]]]
|
|
@@ -1050,9 +1050,7 @@ module Ea
|
|
|
1050
1050
|
y + property_y_offset(text_box)]
|
|
1051
1051
|
texts << text_at(stereo_x, stereo_y, stereo)
|
|
1052
1052
|
end
|
|
1053
|
-
if mult && !mult.empty? && mult_pos
|
|
1054
|
-
texts << text_at(*mult_pos, mult)
|
|
1055
|
-
end
|
|
1053
|
+
texts << text_at(*mult_pos, mult) if mult && !mult.empty? && mult_pos
|
|
1056
1054
|
texts
|
|
1057
1055
|
elsif standalone && !standalone.empty? && mult_pos
|
|
1058
1056
|
note_reach(mult_pos, mult_box)
|
|
@@ -1109,8 +1107,11 @@ module Ea
|
|
|
1109
1107
|
PROPERTY_KEYWORD = "property"
|
|
1110
1108
|
|
|
1111
1109
|
def connector_source_dest_stereotype(connector, end_kind)
|
|
1112
|
-
stereo = end_kind == :source
|
|
1110
|
+
stereo = if end_kind == :source
|
|
1111
|
+
connector.source_stereotype
|
|
1112
|
+
else
|
|
1113
1113
|
connector.target_stereotype
|
|
1114
|
+
end
|
|
1114
1115
|
stereo.to_s.strip
|
|
1115
1116
|
end
|
|
1116
1117
|
|
|
@@ -1196,7 +1197,6 @@ module Ea
|
|
|
1196
1197
|
# the Document. Production paths go through Document's
|
|
1197
1198
|
# property_index for O(1) lookup.
|
|
1198
1199
|
|
|
1199
|
-
|
|
1200
1200
|
def fallback_property_lookup(id)
|
|
1201
1201
|
return nil unless model_index
|
|
1202
1202
|
|
|
@@ -80,8 +80,8 @@ module Ea
|
|
|
80
80
|
|
|
81
81
|
def element_layers
|
|
82
82
|
@elements = Elements.new(diagram, model_index: model_index,
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
canvas: canvas,
|
|
84
|
+
document: document)
|
|
85
85
|
@elements.groups
|
|
86
86
|
end
|
|
87
87
|
|
|
@@ -107,9 +107,9 @@ module Ea
|
|
|
107
107
|
|
|
108
108
|
def labels_layer
|
|
109
109
|
@labels = Labels.new(diagram, canvas: canvas, model_index: model_index,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
theme: theme, document: document,
|
|
111
|
+
drawn_bounds: drawn_bounds,
|
|
112
|
+
divider_y_by_ref: divider_y_by_ref)
|
|
113
113
|
@labels.render
|
|
114
114
|
end
|
|
115
115
|
|
|
@@ -35,8 +35,10 @@ module Ea
|
|
|
35
35
|
direction = connector.direction.to_s
|
|
36
36
|
return [] if direction.empty? || direction == "Unspecified"
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
if bidirectional?(connector)
|
|
39
|
+
return bidirectional_specs(source, target, before_target,
|
|
40
|
+
after_source)
|
|
41
|
+
end
|
|
40
42
|
|
|
41
43
|
whole_end_at_source = whole_end_at_source?(connector)
|
|
42
44
|
anchor = whole_end_at_source ? target : source
|
|
@@ -23,10 +23,10 @@ module Ea
|
|
|
23
23
|
anchor = whole_end_at_source ? target : source
|
|
24
24
|
base = whole_end_at_source ? before_target : after_source
|
|
25
25
|
shape = if %w[Dependency InformationFlow].include?(effective_type?(connector))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
:dependency_arrow
|
|
27
|
+
else
|
|
28
|
+
:triangle
|
|
29
|
+
end
|
|
30
30
|
[Registry::Spec.new(shape: shape, anchor: anchor, base: base)]
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -52,7 +52,9 @@ module Ea
|
|
|
52
52
|
entries = visible_connectors.flat_map { |c| entries_for(c) }
|
|
53
53
|
|
|
54
54
|
if grouped
|
|
55
|
-
entries.group_by
|
|
55
|
+
entries.group_by do |e|
|
|
56
|
+
[e.style_key, e.stroke_width, e.stroke_color]
|
|
57
|
+
end.map do |(key, width, color), grouped_entries|
|
|
56
58
|
# EA emits ONE marker per connector regardless of
|
|
57
59
|
# anchor overlap. Verified against plateau Bridge
|
|
58
60
|
# diagram: 9 generalizations fanning from the same
|
|
@@ -43,7 +43,7 @@ module Ea
|
|
|
43
43
|
def content_below_header?
|
|
44
44
|
!attr_lines.empty? || !op_lines.empty? ||
|
|
45
45
|
enum_literals.any? || tagged_values.any? ||
|
|
46
|
-
|
|
46
|
+
constraints&.any? ||
|
|
47
47
|
(!package_content_lines.nil? && !package_content_lines.empty?) ||
|
|
48
48
|
hidden_features_present?
|
|
49
49
|
end
|