/
1157.html
217 lines (199 loc) · 7.23 KB
/
1157.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- See: http://trac.edgewall.org/wiki/TracInterfaceCustomization -->
<head>
<title>
#1157 (Decide how to handle ImageDisplay.contains with Data object argument)
– ImageJ
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="trac.css" type="text/css" /><link rel="stylesheet" href="ticket.css" type="text/css" /><link rel="stylesheet" href="tracvote.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="main">
<div id="notice" style="width: 58em; max-width: 100%; margin-left: auto; margin-right: auto; border: 1px solid black; margin-bottom: 2em">
<table>
<tr>
<td style="font-size: 72px; color: firebrick; padding: 0 10px 0 10px">⚠</td>
<td>
<p style="margin: 0.4em">
NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.
</p>
<p style="margin: 0.4em">
The ImageJ project now
<a href="https://imagej.net/Issues">uses GitHub Issues</a> for issue tracking.
</p>
<p style="margin: 0.4em">
Please
<a href="https://github.com/imagej/imagej/issues/new">file all new issues</a>
there.
</p>
</td>
</tr>
</table>
</div>
<div id="content" class="ticket">
<h1 id="trac-ticket-title">
<a href="1157.html">Ticket #1157</a>
<span class="status">(closed task: fixed)</span>
</h1>
<div id="ticket">
<div class="date">
<p>Opened 2012-05-07T15:41:38-05:00</p>
<p>Last modified 2012-05-15T09:39:07-05:00</p>
</div>
<h2 class="summary searchable">Decide how to handle ImageDisplay.contains with Data object argument</h2>
<table class="properties">
<tr>
<th id="h_reporter">Reported by:</th>
<td headers="h_reporter" class="searchable">
curtis
</td>
<th id="h_owner">Owned by:</th>
<td headers="h_owner">
curtis
</td>
</tr>
<tr>
<th id="h_priority">
Priority:
</th>
<td headers="h_priority">
major
</td>
<th id="h_milestone">
Milestone:
</th>
<td headers="h_milestone">
<strike>imagej2-b2-bugfixes</strike>
</td>
</tr><tr>
<th id="h_component">
Component:
</th>
<td headers="h_component">
Display API
</td>
<th id="h_version">
Version:
</th>
<td headers="h_version">
</td>
</tr><tr>
<th id="h_severity">
Severity:
</th>
<td headers="h_severity">
serious
</td>
<th id="h_keywords">
Keywords:
</th>
<td headers="h_keywords" class="searchable">
</td>
</tr><tr>
<th id="h_cc">
Cc:
</th>
<td headers="h_cc" class="searchable">
</td>
<th id="h_blockedby">
Blocked By:
</th>
<td headers="h_blockedby">
</td>
</tr><tr>
<th id="h_blocking">
Blocking:
</th>
<td headers="h_blocking">
<a class="closed" href="1020.html" title="Use ItemIO.BOTH where relevant in plugins">#1020</a>
</td>
<th>
</th>
<td>
</td>
</tr>
</table>
<div class="description">
<h3 id="comment:description">
Description
</h3>
<div class="searchable">
<p>
At the moment, if you have a Data object "data" and an ImageDisplay "imageDisplay" and you call "imageDisplay.contains(data)" it will always return false. The reason is that ImageDisplay is a Display<DataView>, not a Display<Data>, and the contains(Object) method is very literal in its evaluation. To work around this, we provide an ImageDisplay.containsData(Data) method. However, the DefaultDisplayService.getDisplaysContaining(Object) method has no knowledge of this exception, and instead naively uses Display.contains(Object) to check.<br />
</p>
<p>
This can result in problems; e.g., DisplayPostprocessor never detects when an ImageDisplay already exists that contains a particular Dataset output. We have not noticed the problem because our plugins that work with Dataset objects essentially always call Dataset.update() to signal that the Dataset has changed, which triggers the Display to update in any case. But for the purpose of ticket <a class="closed ticket" href="1020.html" title="task: Use ItemIO.BOTH where relevant in plugins (closed: fixed)">#1020</a> this architectural oddity may be a problem.<br />
</p>
</div>
</div>
</div>
<div>
<h2 class="foldable">Change History</h2>
<div id="changelog">
<div class="change" id="trac-change-1">
<h3 class="change">
<span class="threading">
<span id="comment:1" class="cnum">
<a href="#comment:1">comment:1</a>
</span>
</span>
Changed 2012-05-11T12:24:15-05:00 by curtis
</h3>
<ul class="changes">
<li>
<strong>Status</strong>
changed from <em>new</em> to <em>closed</em>
</li><li>
<strong>Resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<div class="comment searchable">
<p>
(In <a class="missing changeset" title="No default repository defined">[5456]</a>) Add Display.isDisplaying(Object) method<br />
</p>
<p>
This is a general method similar to contains(Object) from the<br />
collections API, except that it is more flexible. In particular, in the<br />
case of an ImageDisplay, it will work as expected when asking about a<br />
particular Data object. Since ImageDisplay actually displays<br />
DataView objects, not Data objects, ImageDisplay.contains(Object) will<br />
always return false, and rightly so according to the collections API.<br />
</p>
<p>
This change allows the DisplayPostprocessor to properly query whether<br />
outputs of type Data are currently being displayed; previously, a new<br />
display would always be created.<br />
</p>
<p>
Fixes <a class="closed ticket" href="1157.html" title="task: Decide how to handle ImageDisplay.contains with Data object argument (closed: fixed)">#1157</a>.<br />
</p>
</div>
</div>
<div class="change" id="trac-change-2">
<h3 class="change">
<span class="threading">
<span id="comment:2" class="cnum">
<a href="#comment:2">comment:2</a>
</span>
</span>
Changed 2012-05-15T09:39:07-05:00 by curtis
</h3>
<ul class="changes">
<li>
<strong>Milestone</strong>
changed from <em>imagej-2.0.0-beta3</em> to <em>imagej-2.0.0-beta2</em>
</li>
</ul>
<div class="comment searchable">
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>