13 |
Issues |
Issues |
14 |
====== |
====== |
15 |
|
|
16 |
|
- How do we do non-regeneration of vobscenes on mouse events? |
17 |
|
|
18 |
|
RESOLVED: Pass the old VobScene to the mouse event handler method |
19 |
|
and use the boolean return value to determine whether |
20 |
|
regeneration is needed. |
21 |
|
|
22 |
|
This also fixes the idea that a BuoyViewNode is really a single |
23 |
|
view in a single VobScene. |
24 |
|
|
25 |
|
- Should we let keystrokes also not-regenerate the vobscene? |
26 |
|
|
27 |
|
- Who creates the nodes? What about when a node contains a link |
28 |
|
to itself? Are all nodes really the same? |
29 |
|
|
30 |
|
RESOLVED: A-ha! There was confusion because the first |
31 |
|
design treated buoy nodes and main nodes the same, |
32 |
|
when they are not at all the same. |
33 |
|
|
34 |
|
The buoy nodes know how to render themselves at a given |
35 |
|
anchor. |
36 |
|
|
37 |
|
The main node has a cursor and handles events etc. |
38 |
|
|
39 |
|
The buoy node objects can be static objects; the main node |
40 |
|
objects must be created for each view. |
41 |
|
|
42 |
Architecture |
Architecture |
43 |
============ |
============ |
44 |
|
|
45 |
|
The abstract buoy data model |
46 |
|
---------------------------- |
47 |
|
|
48 |
First of all, define the abstract buoyview model as follows: |
First of all, define the abstract buoyview model as follows: |
49 |
|
|
50 |
.. UML:: BuoyviewModel |
.. UML:: BuoyviewModel |
76 |
and the anchors and links are defined implicitly by |
and the anchors and links are defined implicitly by |
77 |
the xanalogical transclusions and xulinks. |
the xanalogical transclusions and xulinks. |
78 |
|
|
79 |
|
A PDF scrollblock, on the other hand, |
80 |
|
is very different: no cell, no cellview! |
81 |
|
The architecture needs to support all these. |
82 |
|
|
83 |
.. UML:: BuoyviewModels |
.. UML:: BuoyviewModels |
84 |
|
|
85 |
class Node |
class Node |
142 |
Anchor.c = DocFragmentAnchor.c + o; |
Anchor.c = DocFragmentAnchor.c + o; |
143 |
Link.c = TransclusionLink.c + o; |
Link.c = TransclusionLink.c + o; |
144 |
|
|
145 |
|
|
146 |
|
Implementation |
147 |
|
-------------- |
148 |
|
|
149 |
Now, the picture gets clearer: the whole structure of the current buoy view |
Now, the picture gets clearer: the whole structure of the current buoy view |
150 |
can be *defined* by a single facade: |
should be *defined* by a single facade: |
151 |
|
|
152 |
|
|
153 |
|
Important Invariant (a la ZZstructure dimension): |
154 |
|
if node A, anchor A.1 shows a link X to node B anchor B.4, |
155 |
|
hen after B.setFocus(B.4), node B will show the link X as well. |
156 |
|
|
157 |
.. UML:: BuoyviewFacade |
.. UML:: BuoyManagerBasic |
158 |
|
|
159 |
class BuoyView |
jlinkpackage gzz.view.buoy |
160 |
|
|
161 |
class BuoyViewScheme "interface" |
class RealBuoyViewManager |
162 |
|
fields |
163 |
|
BuoyViewMainNode current |
164 |
|
inherit BuoyLinkListener |
165 |
|
|
166 |
dep "use" |
class BuoyLinkListener "interface" |
167 |
|
jlink |
168 |
|
methods |
169 |
|
void link(int dir, int anchorCS, BuoyViewNodeType otherNode, Object linkId, Object otherAnchor) |
170 |
|
|
171 |
|
class BuoyViewMainNode "interface" |
172 |
|
jlink |
173 |
|
fields |
174 |
|
cursor, zoom, coordsystems... |
175 |
|
methods |
176 |
|
void renderMain(VobScene vs, int into, BuoyLinkListener l) |
177 |
|
keystroke(...) |
178 |
|
mouse(...) |
179 |
|
|
180 |
|
class BuoyViewNodeType "interface" |
181 |
|
jlink |
182 |
|
methods |
183 |
|
void renderBuoy(VobScene vs, int into, Object linkId, Object anchor) |
184 |
|
BuoyViewNodeType createMainNode(Object linkId, Object anchor) |
185 |
|
|
186 |
|
|
187 |
|
dep "calls" BuoyViewMainNode BuoyLinkListener |
188 |
|
dep "use" RealBuoyViewManager BuoyViewNodeType |
189 |
|
dep "use" RealBuoyViewManager BuoyViewMainNode |
190 |
|
dep "create" BuoyViewNodeType BuoyViewMainNode |
191 |
|
|
192 |
|
--- |
193 |
|
|
194 |
PDF scrollblock very different: no cell, no cellview! |
vertically(60, zap, BuoyViewMainNode, BuoyViewNodeType); |
195 |
|
horizontally(100, foo, RealBuoyViewManager, zap); |
196 |
|
vertically(140, bar, BuoyLinkListener, RealBuoyViewManager); |
197 |
|
|
198 |
|
The linkId passed to BuoyLinkListener must be unique for each node |
199 |
|
and the identifies the link -- it must be the same in both directions. |
200 |
|
The previous invariant in code is an invariant which the BuoyViewNode interface |
201 |
|
must obey:: |
202 |
|
|
203 |
|
buoyviewnode1.renderMain(..., l); |
204 |
|
// l.link(d, *, nodetype2, L, A) got called as callback |
205 |
|
|
206 |
|
buoyviewnode2 = nodetype2.createMainNode(L, A) |
207 |
|
buoyviewnode2.renderMain(..., l); |
208 |
|
// l.link(-d, *, nodetype1, L, B) MUST GET CALLED |
209 |
|
|
210 |
|
Of course, if the underlying |
211 |
|
data structure is modified between the calls to renderMain, |
212 |
|
the invariant need no longer hold. |
213 |
|
|
214 |
|
The coordsys the main view is being rendered into defines the extent |
215 |
|
by its (modified) unit square; this extent is not binding but more like |
216 |
|
a hint. |
217 |
|
|
218 |
.. UML:: BuoyManagerBasic |
Matcher structure can separate left&right links and know which way |
219 |
|
|
|
class BuoyViewManager |
|
|
fields |
|
|
BuoyViewNode cursor |
|
|
|
|
|
class BuoyViewNode "interface" |
|
|
methods |
|
|
void renderMain(VobScene vs, int into, ...) |
|
220 |
|
|
|
class BuoyLink |
|
221 |
|
|
|
Important Invariant (a la ZZstructure dimension): |
|
|
if node A, anchor A.1 shows a link X to node B anchor B.4, |
|
|
hen after B.setFocus(B.4), node B will show the link X as well. |
|
222 |
|
|