70 |
|
|
71 |
self.x = xywh[0] + .5 * xywh[2] |
self.x = xywh[0] + .5 * xywh[2] |
72 |
self.y = xywh[1] + .5 * xywh[3] |
self.y = xywh[1] + .5 * xywh[3] |
73 |
def setShift(self, vs): |
def _setShift(self, vs): |
74 |
vs.coords.setTranslateParams(self.shift, -self.x, -self.y) |
vs.coords.setTranslateParams(self.shift, -self.x, -self.y) |
75 |
|
|
76 |
|
def _linkEndCS(self, enf, key): |
77 |
|
"""Make a coordinate system for the link end and return it. |
78 |
|
""" |
79 |
|
for repr in gzz.zzutil.Media.getScrollBlockRepresentatives(enf): |
80 |
|
if repr.getScrollBlock() == self.scrollBlock: |
81 |
|
xywh = self.layout.getExtents(repr, None) |
82 |
|
return self.vs.orthoBoxCS(self.shift, key, -20, |
83 |
|
xywh[0], xywh[1], 1, 1,xywh[2], xywh[3]) |
84 |
|
|
85 |
|
raise "HELP!" |
86 |
|
|
87 |
def renderMain(self, vs, into): |
def renderMain(self, vs, into): |
88 |
self.vs = vs |
self.vs = vs |
89 |
vs.coords.getSqSize(into, size) |
vs.coords.getSqSize(into, size) |
110 |
|
|
111 |
if self.nodetype.scrollBlockLinker.xuIndex != None: |
if self.nodetype.scrollBlockLinker.xuIndex != None: |
112 |
xuIndex = self.nodetype.scrollBlockLinker.xuIndex |
xuIndex = self.nodetype.scrollBlockLinker.xuIndex |
113 |
for dir, index, otherEndName in [ |
for dir, index, thisEndName, otherEndName in [ |
114 |
(1, xuIndex.getForwardIndex(), "to"), |
(1, xuIndex.getForwardIndex(), "from", "to"), |
115 |
(-1, xuIndex.getBackwardIndex(), "from")]: |
(-1, xuIndex.getBackwardIndex(), "to", "from")]: |
116 |
for xulink in index.getMatches(self.enf): |
for xulink in index.getMatches(self.enf): |
117 |
|
myenf = getattr(xulink, thisEndName) |
118 |
|
thisEndCS = self._linkEndCS(myenf, xulink) |
119 |
endenf = getattr(xulink, otherEndName) |
endenf = getattr(xulink, otherEndName) |
120 |
for repr in gzz.zzutil.Media.getScrollBlockRepresentatives(endenf): |
for repr in gzz.zzutil.Media.getScrollBlockRepresentatives(endenf): |
121 |
self.listener.link(dir, into, |
self.listener.link(dir, thisEndCS, |
122 |
self.nodetype.scrollBlockLinker.xulinkPageSpanNodeType, |
self.nodetype.scrollBlockLinker.xulinkPageSpanNodeType, |
123 |
xulink, repr) |
xulink, repr) |
124 |
|
|