11 |
Abstract |
Abstract |
12 |
-------- |
-------- |
13 |
|
|
14 |
In the past we did have usually text to show for user. |
In the past we did usually have only text to show for user. |
15 |
Today we have more medias: pagespans and images at least. |
Today we have more media types: pagespans and images at least. |
16 |
Views has been designed too much for text only. |
The View framework has been designed too much for text only. |
17 |
Text based design is also very deeply seen in Space where we have |
Text based design is also very deeply seen in Space where we have |
18 |
*VStreamNodeTexter* but that's an another story. |
*VStreamNodeTexter* but that's an another story. |
19 |
Although text is the most common view media we should |
Although text is the most common view media we should |
20 |
easily show any content in nodes. |
easily be able to show any content in nodes. |
21 |
|
|
22 |
|
|
23 |
Issues |
Paragraph |
24 |
------ |
--------- |
25 |
|
|
26 |
- How this PEG affect to view_split--tjl ? |
The Idea |
27 |
|
"""""""" |
28 |
|
|
29 |
- How this PEG affect to cellview_naming--benja? |
We need abstract layer where we can just place a node and |
30 |
|
where we shouldn't need to know what kind of types of spans |
31 |
|
are in the node's enfilade. |
32 |
|
|
|
- What's view? I think view is buzzword. It says too much and nothing. |
|
|
In Loom there are simple and wheel view but the change between them is |
|
|
just about geometry. The reason I'm raising this issue now is about |
|
|
package naming and future where I think it's more common to view |
|
|
heap of nodes(you can image them as links also) instead of just one node. |
|
33 |
|
|
34 |
|
NodeView |
35 |
|
"""""""" |
36 |
|
- org.fenfire.nodeview |
37 |
|
|
38 |
|
The idea is to give a node to NodeView and let it put |
39 |
|
the right media type in the vobscene without of the fear of wrong span. |
40 |
|
|
|
Changes |
|
|
------- |
|
41 |
|
|
42 |
Abstract ViewContext to NodeViewContext and ViewContext. |
ContentHandler |
43 |
|
"""""""""""""" |
44 |
Reason: In zz/Loom like views it is necessarily to have such methods as: |
- org.fenfire.nodeview.handler |
|
|
|
|
-isMarked |
|
45 |
|
|
46 |
-getCursorColors |
For different media types there must be handlers which can |
47 |
|
present the given enfilade right way. |
48 |
|
|
49 |
|
Let's start with: |
50 |
|
|
51 |
|
- TextHandler |
52 |
|
- ImageHandler |
53 |
|
- PageSpanHandler |
54 |
|
|
55 |
|
which implements ContentHandler. One important thing is that |
56 |
|
handlers do not work with nodes but enfilades. |
57 |
|
|
|
Which are not very important in generality of NodeViewContext. |
|
|
In focus+context views such as buoyoing we are only interested in |
|
|
the focus. In NodeViewContext I would propouse the following methods: |
|
58 |
|
|
59 |
-getAccursed |
NodeView.Attrib |
60 |
|
""""""""""""""" |
61 |
|
- org.fenfire.nodeview |
62 |
|
|
63 |
-setAccursed |
So, if texthandler wants to know the cursoroffset to render cursor, |
64 |
|
texthandler must ask it from NodeView.text or if PageSpanHandler |
65 |
|
wants to know the position for page spans pagespanhandler must ask it from NodeView.pagespan |
66 |
|
|
67 |
-getCursorOffset |
NodeView.text and NodeView.pagespan are extended of the NodeView's subclass NodeView.Attrib. |
68 |
|
|
69 |
The last one is important because of frequency of textspans. |
TextAttr which extends NodeView.Attributes would have methods get/set cursorOffset. |
70 |
The rest of ViewContext would stay as it is. |
Otoh, PageSpanAttr would have methods best for it. |
71 |
|
|
72 |
Drop CellView and make content handler instead of it. |
Suitable NodeView.Attrib will be passed to ContentHandler among other attributes. |
|
ContentHandler can place content in vobscene. |
|
|
We would have own handlers for different spans, i.e., TextHandler and ImageHandler. |
|
|
Handlers do not work with nodes but enfilades. |
|
|
This is needed in future where we need to split enfilades to different handlers |
|
|
because of multicontent nodes. |
|
73 |
|
|
|
NodeView is abstract class which encloses the whole thing. |
|
74 |
|
|
75 |
I hope the uml explains more ;) |
NodeViewContext |
76 |
|
""""""""""""""" |
77 |
|
- org.fenfire.nodeview |
78 |
|
|
79 |
|
There's continuous need to identify the accursed node. |
80 |
|
For example text could be reddish if it is focused or |
81 |
|
different box can be drawn in Loom like view if node is accursed. |
82 |
|
|
83 |
|
That's why NodeView implements NodeViewContext which has only ''get/set accursed node'' interface. |
84 |
|
|
85 |
|
|
86 |
|
Multicontent and Future |
87 |
|
""""""""""""""""""""""" |
88 |
|
|
89 |
|
By splitting nodeview to handlers we also ensure the future about multicontent nodeviews. |
90 |
|
Multicontent node view can now be easily extended from NodeView, make it split enfilades to |
91 |
|
adequate handler and there it is! |
92 |
|
|
93 |
|
get"Size" |
94 |
|
--------- |
95 |
|
|
96 |
|
You can ask from NodeContent to get width and height. |
97 |
|
|
98 |
|
|
99 |
|
Issues |
100 |
|
------ |
101 |
|
|
102 |
|
- How this PEG affect to view_split--tjl ? |
103 |
|
|
104 |
|
- How this PEG affect to cellview_naming--benja? |
105 |
|
|
106 |
|
- What's view? I think view is buzzword. It says too much and nothing. |
107 |
|
In Loom there are simple and wheel view but the change between them is |
108 |
|
just about geometry. The reason I'm raising this issue now is about |
109 |
|
package naming and future where I think it's more common to view |
110 |
|
heap of nodes(you can image them as links also) instead of just one node. |
111 |
|
|
112 |
|
|
113 |
|
Optional Changes |
114 |
|
---------------- |
115 |
|
|
116 |
|
In Loom like view extend NodeView to LoomView implementing the old ViewContext. |
117 |
|
This change makes it very easy to transfer all wanted data around without java's ugly type casting. |
118 |
|
|
119 |
|
|
120 |
UML figure |
UML figure |
126 |
methods |
methods |
127 |
RDFNode getAccursed() |
RDFNode getAccursed() |
128 |
void setRDFNode(RDFNode node) |
void setRDFNode(RDFNode node) |
129 |
int getCursorOffset(RDFNode node=null) |
|
|
|
|
130 |
class NodeContent "interface" |
class NodeContent "interface" |
131 |
methods |
methods |
132 |
+float[] getW[idth]H[eight](RDFNode node, float scale=1) |
+float[] getW[idth]H[eight](RDFNode node, float scale=1) |
140 |
+ContentHandler imageHandler |
+ContentHandler imageHandler |
141 |
+ContentHandler pageSpanHandler |
+ContentHandler pageSpanHandler |
142 |
-RDFNode accursed |
-RDFNode accursed |
143 |
-int cursorOffset |
+NodeView.Attrib text |
144 |
|
+NodeView.Attrib image |
145 |
|
+NodeView.Attrib pagespan |
146 |
|
|
147 |
|
class NodeView.Attrib SubClassOfNodeView |
148 |
|
|
149 |
class ContentHandler "interface" |
class ContentHandler "interface" |
150 |
methods |
methods |
151 |
+void place(VobScene vs, int box, Enfilade enf, NodeView nv=null) |
+void place(VobScene vs, int box, Enfilade enf, NodeView.Attrib attrib, RDFNode accursed=null) |
152 |
+float[] getW[idth]H[eight](Enfilade enf) |
+float[] getW[idth]H[eight](Enfilade enf) |
153 |
|
|
154 |
class TextHandler |
class TextHandler |
155 |
realize ContentHandler |
realize ContentHandler |
156 |
|
|
157 |
|
class TextAttrib |
158 |
|
inherit NodeView.Attrib |
159 |
|
methods |
160 |
|
int getCursorOffset(RDFNode node=null) |
161 |
|
void setCursorOffset(int offs, RFDNode node) |
162 |
|
|
163 |
class ImageHandler |
class ImageHandler |
164 |
realize ContentHandler |
realize ContentHandler |
165 |
|
|
166 |
class PageSpanHandler |
class PageSpanHandler |
167 |
realize ContentHandler |
realize ContentHandler |
168 |
|
|
169 |
dep "gets accursed or cursorOffset" ContentHandler NodeView |
class PageSpanAttrib |
170 |
|
inherit NodeView.Attrib |
171 |
|
methods |
172 |
|
int getFooo |
173 |
|
|
174 |
|
|
175 |
|
dep "gets cursorOffset or pagespan attributes etc.." ContentHandler NodeView |
176 |
|
dep "subClass" NodeView.Attrib NodeView |
177 |
|
|
178 |
----- |
----- |
179 |
horizontally(150, cont_h, TextHandler, ImageHandler, PageSpanHandler); |
horizontally(150, cont_h, TextHandler, ImageHandler, PageSpanHandler); |
180 |
horizontally(150, node_h, NodeViewContext, NodeContent); |
horizontally(150, node_h, NodeViewContext, NodeContent); |
181 |
vertically(200, all, ImageHandler, ContentHandler, NodeView, NodeViewContext); |
vertically(200, all, ImageHandler, ContentHandler, NodeView, NodeViewContext); |
182 |
|
|
183 |
|
horizontally(100, nodeview_h, NodeView, NodeView.Attrib, TextAttrib); |
184 |
|
vertically(50, attrib, TextAttrib, PageSpanAttrib) |