25 |
import gzz.modules.pp.*; |
import gzz.modules.pp.*; |
26 |
import gzz.modules.pp.vob.*; |
import gzz.modules.pp.vob.*; |
27 |
import gzz.*; |
import gzz.*; |
28 |
|
import gzz.vob.impl.DefaultVobMatcher; |
29 |
import gzz.view.*; |
import gzz.view.*; |
30 |
import gzz.view.buoy.*; |
import gzz.view.buoy.*; |
31 |
import gzz.vob.*; |
import gzz.vob.*; |
131 |
|
|
132 |
public PPCanvasCursor(Cell c, Object content, CellPlacementHook hook, |
public PPCanvasCursor(Cell c, Object content, CellPlacementHook hook, |
133 |
AbstractViewContext avc, PPDims d, GraphicsAPI.Window w) { |
AbstractViewContext avc, PPDims d, GraphicsAPI.Window w) { |
|
super(); |
|
134 |
this.current = c; |
this.current = c; |
135 |
this.content = content; |
this.content = content; |
136 |
this.hook = hook; |
this.hook = hook; |
137 |
this.avc = avc; |
this.avc = new AbstractViewContext(); |
138 |
|
this.avc.setAccursed(avc.getAccursed()); |
139 |
this.d = d; |
this.d = d; |
140 |
this.window = w; |
this.window = w; |
141 |
} |
} |
142 |
|
|
143 |
|
|
144 |
|
/** Cause the changes to the zooming and panning variables |
145 |
|
* to be shown in the given vobscene. |
146 |
|
* This changes the parameters of the coordinate systems created by render(). |
147 |
|
*/ |
148 |
|
private void setZoomPan(VobScene vs, int mainFrame) { |
149 |
|
DefaultVobMatcher m = (DefaultVobMatcher)vs.matcher; |
150 |
|
int cs = m.getCS(mainFrame, "C2F"); |
151 |
|
vs.coords.setOrthoParams(cs, 0, -panx*zoom, -pany*zoom, zoom, zoom); |
152 |
|
} |
153 |
|
|
154 |
public void renderMain(VobScene vs, int into) { |
public void renderMain(VobScene vs, int into) { |
155 |
int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10); |
int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10); |
156 |
vs.matcher.add(into, c2fCS, "C2F"); |
vs.matcher.add(into, c2fCS, "C2F"); |
157 |
|
setZoomPan(vs, into); |
158 |
SinglePaper.i(avc, d, window, current).render(vs, into, c2fCS); |
SinglePaper.i(avc, d, window, current).render(vs, into, c2fCS); |
159 |
hook.placed(current, vs, into, (ViewContext)avc); |
|
160 |
|
Cell paper = current.h(d.contains); |
161 |
|
for (Cell c = paper.s(d.contains); c != null; c = c.s(d.contains) ) { |
162 |
|
if (c == current) continue; |
163 |
|
avc.setAccursed(c); |
164 |
|
hook.placed(c, vs, into, (ViewContext)avc); |
165 |
|
} |
166 |
} |
} |
167 |
|
|
168 |
public void keystroke(String s) { |
public void keystroke(String s) { |