ea 0.6.23 → 0.6.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97806417f959531420feddb1143826efed14a41349b2e8909402dfba9fa8ba79
4
- data.tar.gz: c312c7a1706cb9c1d42aa72c254665eea5dc8dc39435f6b8d2531a569bf33566
3
+ metadata.gz: 6a72022a4812f53c8a781acb37516bd893f69a5213a30f7f82b1f288649e2625
4
+ data.tar.gz: 6a82f59b5fa348f14d89c18b2af5169f91a35cd4000c29e10f6c828661b78626
5
5
  SHA512:
6
- metadata.gz: 0df1c576f75d366c43d724f665328602b8ed8f82bf6ff49062e815956f63acd8f624ebb746624092b49307ffbbb28f39ffd22dbac522d32262020416f8e06c6a
7
- data.tar.gz: e2b89b4df82927308d368fa3896abb5022957fc2b5235ef6f040b1f220aeab10617cca6831784457003aa7e213f13730a40b00e30897fe2dfff5e468d421db41
6
+ metadata.gz: b7c1c47b59c593cf59c2f039419280963db21de104b3f84f4b32e9d95f7073d9e2356e068271145276a325c266ac3a5e93255bc7faa6932f0dd5b46323fec8c0
7
+ data.tar.gz: 4e3f163d3001eef153396e3eb1be9ecb4fdf8460fcc27c83f3c03f87fff249f6cd8d0fd6e7b2d4e7539cb613d3327955c2837f9b4af436f427fc813c89a8fd29
@@ -74,7 +74,8 @@ module Ea
74
74
  foreign_package_name: foreign_package_name_for(classifier)) : []
75
75
  is_classifier = classifier.is_a?(Ea::Model::Classifier)
76
76
  attr_lines = if is_classifier && show_attributes? &&
77
- !classifier.is_a?(Ea::Model::Interface)
77
+ !classifier.is_a?(Ea::Model::Interface) &&
78
+ attributes_visible?(element)
78
79
  Element::AttributeRenderer.lines_for(
79
80
  classifier, lookup: attribute_lookup,
80
81
  exclude_association_ids: drawn_association_ids
@@ -82,7 +83,11 @@ module Ea
82
83
  else
83
84
  []
84
85
  end
85
- op_lines = (is_classifier && show_operations?) ? Element::OperationRenderer.lines_for(classifier) : []
86
+ op_lines = if is_classifier && show_operations? && operations_visible?(element)
87
+ Element::OperationRenderer.lines_for(classifier)
88
+ else
89
+ []
90
+ end
86
91
  geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
87
92
  tagged_values_for(classifier).size,
88
93
  header_lines, classifier: classifier,
@@ -97,7 +102,7 @@ module Ea
97
102
  # TK_PositionType keeps 7 rows ending 6px above the bottom,
98
103
  # while a 13px-tighter box loses them all.
99
104
  if attr_lines.any? &&
100
- geometry.attr_bottom_y.to_i + 4 > bounds.y + bounds.height
105
+ geometry.attr_bottom_y.to_i + 3 > bounds.y + bounds.height
101
106
  attr_lines = []
102
107
  geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
103
108
  tagged_values_for(classifier).size,
@@ -109,7 +114,7 @@ module Ea
109
114
  # EA suppresses the operations compartment when its rows
110
115
  # overflow the stored box height (same rule as attributes).
111
116
  if op_lines.any? && geometry.op_first_y &&
112
- geometry.op_bottom_y.to_i + 4 > bounds.y + bounds.height
117
+ geometry.op_bottom_y.to_i + 3 > bounds.y + bounds.height
113
118
  op_lines = []
114
119
  geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
115
120
  tagged_values_for(classifier).size,
@@ -194,6 +199,32 @@ module Ea
194
199
  attr_lines.first.to_s.start_with?("«") ? 11 : 7
195
200
  end
196
201
 
202
+ # EA's per-instance attribute visibility toggles (ObjectStyle
203
+ # AttPub/AttPri/AttPro/AttPkg). When ANY toggle is stored, only
204
+ # attributes of an enabled visibility class render; the GM_*
205
+ # geometry boxes carry all four at 0 and render header-only.
206
+ def attributes_visible?(element)
207
+ toggles = visibility_toggles(element)
208
+ return true if toggles.empty?
209
+
210
+ toggles.values.any? { |v| v == "1" }
211
+ end
212
+
213
+ def visibility_toggles(element)
214
+ style = element.style || {}
215
+ %i[attpub attpri attpro attpkg]
216
+ .each_with_object({}) { |k, acc| acc[k] = style[k] if style.key?(k) }
217
+ end
218
+
219
+ def operations_visible?(element)
220
+ style = element.style || {}
221
+ keys = %i[oppub oppri oppro oppkg]
222
+ present = keys.select { |k| style.key?(k) }
223
+ return true if present.empty?
224
+
225
+ present.any? { |k| style[k] == "1" }
226
+ end
227
+
197
228
  def drawn_association_ids
198
229
  (diagram.connectors || []).select(&:renderable?)
199
230
  .map(&:relationship_ref).compact.to_set
data/lib/ea/version.rb CHANGED
@@ -4,5 +4,5 @@ module Ea
4
4
  # Gem release version. Extracted to its own file so the
5
5
  # `gem-release` tool's `gem bump` can find and update it via the
6
6
  # standard `lib/<gem>/version.rb` convention.
7
- VERSION = "0.6.23"
7
+ VERSION = "0.6.24"
8
8
  end
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.23
4
+ version: 0.6.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.