123 |
buoymanager = self.states.fenPDF.views.getBuoyManager() |
buoymanager = self.states.fenPDF.views.getBuoyManager() |
124 |
if mainNode != buoymanager.getLastMain(): return |
if mainNode != buoymanager.getLastMain(): return |
125 |
|
|
|
# draw cursor |
|
126 |
mainNode = buoymanager.getLastMain() |
mainNode = buoymanager.getLastMain() |
127 |
canvas = ff.util.lava.view.getView(mainNode, ff.view.CanvasView2D) |
canvas = ff.util.lava.view.getView(mainNode, ff.view.CanvasView2D) |
128 |
if not isinstance(canvas, ff.view.CanvasView2D): return |
if not isinstance(canvas, ff.view.CanvasView2D): return |
129 |
|
|
130 |
xy = jarray.zeros(2, 'f') |
xy = jarray.zeros(2, 'f') |
131 |
|
# XXX ugly |
132 |
|
height = 23 |
133 |
|
|
134 |
|
|
135 |
|
# draw scissor points |
136 |
|
node = self.states.fenPDF.uistate.textScissor.begin.node |
137 |
|
if node != None: |
138 |
|
containerCS = canvas.getContainerCS(vs, into) |
139 |
|
cs = vs.matcher.getCS(containerCS, node) |
140 |
|
if cs < 2: return |
141 |
|
|
142 |
|
viewFunction = self.states.fenPDF.views.getMultiplexerNodeContentFunction() |
143 |
|
placeable = viewFunction.f(self.states.fen.graph, node) |
144 |
|
p('offset:',self.states.fenPDF.uistate.textScissor.begin.offset) |
145 |
|
if isinstance(placeable, vob.lava.placeable.TextPlaceable): |
146 |
|
placeable.getCursorXY(self.states.fenPDF.uistate.textScissor.begin.offset, xy) |
147 |
|
|
148 |
|
cs = vs.coords.ortho(cs, 0,xy[0],xy[1], height, -height) |
149 |
|
vs.put(vob.vobs.ContinuousLineVob(5, [.3,-.3,0 , 0,0,0 , 0,1,0 , .3,1.3,0], 0, 100, java.awt.Color.blue), cs) |
150 |
|
|
151 |
|
node = self.states.fenPDF.uistate.textScissor.end.node |
152 |
|
if node != None: |
153 |
|
containerCS = canvas.getContainerCS(vs, into) |
154 |
|
cs = vs.matcher.getCS(containerCS, node) |
155 |
|
if cs < 2: return |
156 |
|
|
157 |
|
viewFunction = self.states.fenPDF.views.getMultiplexerNodeContentFunction() |
158 |
|
placeable = viewFunction.f(self.states.fen.graph, node) |
159 |
|
if isinstance(placeable, vob.lava.placeable.TextPlaceable): |
160 |
|
placeable.getCursorXY(self.states.fenPDF.uistate.textScissor.end.offset, xy) |
161 |
|
|
162 |
|
cs = vs.coords.ortho(cs, 0,xy[0],xy[1], height, -height) |
163 |
|
vs.put(vob.vobs.ContinuousLineVob(5, [-.3,-.3,0 , 0,0,0 , 0,1,0 , -.3,1.3,0], 0, 100, java.awt.Color.blue), cs) |
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
# draw cursor |
169 |
if not self.states.cursor.hasAccursed(): |
if not self.states.cursor.hasAccursed(): |
170 |
focus = mainNode.getFocus() |
focus = mainNode.getFocus() |
171 |
cs = vs.matcher.getCS(into, 'canvasview_conc') |
cs = vs.matcher.getCS(into, 'canvasview_conc') |
177 |
if cs < 0: return |
if cs < 0: return |
178 |
|
|
179 |
viewFunction = self.states.fenPDF.views.getMultiplexerNodeContentFunction() |
viewFunction = self.states.fenPDF.views.getMultiplexerNodeContentFunction() |
180 |
p = viewFunction.f(self.states.fen.graph, self.states.cursor.getAccursed()) |
pl = viewFunction.f(self.states.fen.graph, self.states.cursor.getAccursed()) |
181 |
if isinstance(p, vob.lava.placeable.TextPlaceable): |
if isinstance(pl, vob.lava.placeable.TextPlaceable): |
182 |
p.getCursorXY(self.states.cursor.getCursorOffset(), xy) |
pl.getCursorXY(self.states.cursor.getCursorOffset(), xy) |
183 |
else: return |
else: return |
184 |
|
|
|
# XXX ugly |
|
|
height = 24 |
|
185 |
cs = vs.coords.ortho(cs, 0,xy[0],xy[1], 1, -height) |
cs = vs.coords.ortho(cs, 0,xy[0],xy[1], 1, -height) |
186 |
vs.put(vob.vobs.ContinuousLineVob(5, [0,0,0 , 0,1,0]), cs) |
vs.put(vob.vobs.ContinuousLineVob(5, [0,0,0 , 0,1,0]), cs) |
187 |
|
|