ea 0.6.128 → 0.6.130
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/fonts/carlito_gdi_widths.json +1 -0
- data/lib/ea/fonts/cjk_fallback_widths.json +1 -0
- data/lib/ea/fonts/metrics.rb +73 -15
- data/lib/ea/fonts/vertical_metrics.json +154 -0
- data/lib/ea/sources/qea/diagram_builder/association_class.rb +52 -0
- data/lib/ea/sources/qea/diagram_builder/routing.rb +57 -3
- data/lib/ea/sources/qea/diagram_builder.rb +5 -2
- data/lib/ea/sources/qea/relationship_builder.rb +6 -6
- data/lib/ea/sources/xmi/relationship_builder.rb +15 -8
- data/lib/ea/svg/ea_emitter/compartment/note_body.rb +56 -20
- data/lib/ea/svg/ea_emitter/compartment/note_html.rb +18 -31
- data/lib/ea/svg/ea_emitter/connector_redock.rb +40 -0
- data/lib/ea/svg/ea_emitter/connectors.rb +1 -0
- data/lib/ea/svg/ea_emitter/font_resolver.rb +6 -1
- data/lib/ea/svg/ea_emitter/label/end_label.rb +92 -7
- data/lib/ea/svg/ea_emitter/label/midpoint_label.rb +28 -8
- data/lib/ea/svg/ea_emitter/labels.rb +18 -3
- data/lib/ea/svg/ea_emitter/marker/diamond.rb +29 -5
- data/lib/ea/version.rb +1 -1
- metadata +5 -1
|
@@ -92,7 +92,8 @@ module Ea
|
|
|
92
92
|
anchor: source_pt, connector: connector,
|
|
93
93
|
end_kind: :source, tree: tree && tree[:source],
|
|
94
94
|
heading: (stored_src || stored_labels) && source_heading(connector, points),
|
|
95
|
-
stored_labels: stored_labels
|
|
95
|
+
stored_labels: stored_labels,
|
|
96
|
+
source_bounds: source_dock_bounds(connector)).each { |t| texts << t }
|
|
96
97
|
end_renderer.texts(text_box: tgt_tb,
|
|
97
98
|
mult_box: tgt_mb,
|
|
98
99
|
anchor: target_pt, connector: connector,
|
|
@@ -291,7 +292,9 @@ module Ea
|
|
|
291
292
|
theme: theme,
|
|
292
293
|
font_family: label_font_family,
|
|
293
294
|
font_size: label_font_size,
|
|
294
|
-
font_unit: theme.label_font_size_unit
|
|
295
|
+
font_unit: theme.label_font_size_unit,
|
|
296
|
+
font_weight: label_font_weight,
|
|
297
|
+
font_style: label_font_style
|
|
295
298
|
)
|
|
296
299
|
end
|
|
297
300
|
|
|
@@ -301,7 +304,9 @@ module Ea
|
|
|
301
304
|
model_index: model_index,
|
|
302
305
|
font_family: label_font_family,
|
|
303
306
|
font_size: label_font_size,
|
|
304
|
-
font_unit: theme.label_font_size_unit
|
|
307
|
+
font_unit: theme.label_font_size_unit,
|
|
308
|
+
font_weight: label_font_weight,
|
|
309
|
+
font_style: label_font_style
|
|
305
310
|
)
|
|
306
311
|
end
|
|
307
312
|
|
|
@@ -327,9 +332,19 @@ module Ea
|
|
|
327
332
|
end
|
|
328
333
|
|
|
329
334
|
def label_font_family
|
|
335
|
+
return FontResolver::HAND_DRAW_FAMILY if diagram.hand_draw
|
|
336
|
+
|
|
330
337
|
theme.label_font_family || DEFAULT_FAMILY
|
|
331
338
|
end
|
|
332
339
|
|
|
340
|
+
def label_font_weight
|
|
341
|
+
diagram.hand_draw ? FontResolver::HAND_DRAW_LABEL_WEIGHT : 400
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
def label_font_style
|
|
345
|
+
diagram.hand_draw ? "italic" : "normal"
|
|
346
|
+
end
|
|
347
|
+
|
|
333
348
|
def label_font_size
|
|
334
349
|
theme.label_font_size || DEFAULT_SIZE
|
|
335
350
|
end
|
|
@@ -17,10 +17,11 @@ module Ea
|
|
|
17
17
|
whole_anchor = whole_at_target ? target : source
|
|
18
18
|
whole_base = whole_at_target ? before_target : after_source
|
|
19
19
|
specs = [Registry::Spec.new(shape: diamond_shape(connector, relationship, whole_at_target),
|
|
20
|
-
anchor: whole_anchor,
|
|
21
|
-
base: whole_base)]
|
|
20
|
+
anchor: whole_anchor, base: whole_base)]
|
|
22
21
|
return specs unless whole_at_target
|
|
23
|
-
|
|
22
|
+
|
|
23
|
+
target, before_target = target_arrow_points(connector, relationship, target, before_target)
|
|
24
|
+
return specs unless target
|
|
24
25
|
|
|
25
26
|
specs.concat(direction_specs(connector, source, target,
|
|
26
27
|
before_target, after_source))
|
|
@@ -68,14 +69,27 @@ module Ea
|
|
|
68
69
|
!whole_end_at_source?(connector)
|
|
69
70
|
end
|
|
70
71
|
|
|
71
|
-
#
|
|
72
|
-
#
|
|
72
|
+
# Navigable target-owned aggregations put the arrow at the
|
|
73
|
+
# diamond's inner vertex; nonnavigable targets omit it.
|
|
73
74
|
def self.arrow_on_target_diamond?(connector, relationship)
|
|
74
75
|
connector.direction == "Source -> Destination" &&
|
|
75
76
|
dest_flagged?(relationship)
|
|
76
77
|
end
|
|
77
78
|
private_class_method :arrow_on_target_diamond?
|
|
78
79
|
|
|
80
|
+
def self.inner_vertex(tip, base)
|
|
81
|
+
tx, ty = tip
|
|
82
|
+
bx, by = base
|
|
83
|
+
dx = bx - tx
|
|
84
|
+
dy = by - ty
|
|
85
|
+
length = Math.hypot(dx, dy)
|
|
86
|
+
return tip if length.zero?
|
|
87
|
+
|
|
88
|
+
depth = Markers::DIAMOND_HALF_H * 2
|
|
89
|
+
[(tx + dx / length * depth).round, (ty + dy / length * depth).round]
|
|
90
|
+
end
|
|
91
|
+
private_class_method :inner_vertex
|
|
92
|
+
|
|
79
93
|
def self.dest_flagged?(relationship)
|
|
80
94
|
relationship &&
|
|
81
95
|
%w[shared composite].include?(relationship.target_aggregation.to_s)
|
|
@@ -97,6 +111,16 @@ module Ea
|
|
|
97
111
|
base: before_target)]
|
|
98
112
|
end
|
|
99
113
|
private_class_method :direction_specs
|
|
114
|
+
|
|
115
|
+
def self.target_arrow_points(connector, relationship, target, before_target)
|
|
116
|
+
return [target, before_target] unless arrow_on_target_diamond?(connector, relationship)
|
|
117
|
+
return [] unless relationship.target_navigable
|
|
118
|
+
|
|
119
|
+
anchor = inner_vertex(target, before_target)
|
|
120
|
+
base = anchor.zip(before_target, target).map { |inner, before, tip| inner + before - tip }
|
|
121
|
+
[anchor, base]
|
|
122
|
+
end
|
|
123
|
+
private_class_method :target_arrow_points
|
|
100
124
|
end
|
|
101
125
|
end
|
|
102
126
|
end
|
data/lib/ea/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ea
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.130
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -618,8 +618,11 @@ files:
|
|
|
618
618
|
- lib/ea/fonts.rb
|
|
619
619
|
- lib/ea/fonts/cambria_7_regular_widths.json
|
|
620
620
|
- lib/ea/fonts/cambria_7_styled_widths.json
|
|
621
|
+
- lib/ea/fonts/carlito_gdi_widths.json
|
|
621
622
|
- lib/ea/fonts/carlito_metrics.json
|
|
623
|
+
- lib/ea/fonts/cjk_fallback_widths.json
|
|
622
624
|
- lib/ea/fonts/metrics.rb
|
|
625
|
+
- lib/ea/fonts/vertical_metrics.json
|
|
623
626
|
- lib/ea/guid_format.rb
|
|
624
627
|
- lib/ea/image.rb
|
|
625
628
|
- lib/ea/image/emf_renderer.rb
|
|
@@ -818,6 +821,7 @@ files:
|
|
|
818
821
|
- lib/ea/sources/qea/connector_relationship_map.rb
|
|
819
822
|
- lib/ea/sources/qea/context_diagram_support.rb
|
|
820
823
|
- lib/ea/sources/qea/diagram_builder.rb
|
|
824
|
+
- lib/ea/sources/qea/diagram_builder/association_class.rb
|
|
821
825
|
- lib/ea/sources/qea/diagram_builder/auto_routing.rb
|
|
822
826
|
- lib/ea/sources/qea/diagram_builder/font_settings.rb
|
|
823
827
|
- lib/ea/sources/qea/diagram_builder/routing.rb
|