38 |
print head, params |
print head, params |
39 |
return type(head(), params) |
return type(head(), params) |
40 |
|
|
41 |
|
def action(list, win=1): |
42 |
|
return gzz.client.PotionFallbackBinder.Action(call(list), win) |
43 |
|
|
44 |
class Gzz(java.lang.Runnable): |
class Gzz(java.lang.Runnable): |
45 |
"""The main Gzz client class.""" |
"""The main Gzz client class.""" |
46 |
|
|
49 |
|
|
50 |
def run(self): |
def run(self): |
51 |
self.style = self.graphicsAPI.getTextStyle("SansSerif", java.awt.Font.PLAIN, 13); |
self.style = self.graphicsAPI.getTextStyle("SansSerif", java.awt.Font.PLAIN, 13); |
52 |
self.views = [gzz.view.VobVanishingClient(), |
self.views = [gzz.view.VobVanishingClient(), |
53 |
gzz.view.RowColView(0), gzz.view.RowColView(1), |
gzz.view.RowColView(0), gzz.view.RowColView(1), |
54 |
] |
] |
55 |
self.viewSpecificBinders = java.util.HashMap() |
self.viewSpecificBinders = java.util.HashMap() |
65 |
elif 'double-size' in self.flags: |
elif 'double-size' in self.flags: |
66 |
self.cellContentView = \ |
self.cellContentView = \ |
67 |
gzz.view.CellMagnifier(self.cellContentView, 2) |
gzz.view.CellMagnifier(self.cellContentView, 2) |
68 |
|
|
69 |
if self.gl: |
if self.gl: |
70 |
xubuoy = gzz.view.xubuoy.XuPDF_ViewBinder() |
xubuoy = gzz.view.xubuoy.XuPDF_ViewBinder() |
71 |
self.views.append(xubuoy) |
self.views.append(xubuoy) |
73 |
self.cellContentView = gzz.view.MultitypeCellContentView( |
self.cellContentView = gzz.view.MultitypeCellContentView( |
74 |
self.cellContentView, gzz.view.pagespanview.ContentView(), |
self.cellContentView, gzz.view.pagespanview.ContentView(), |
75 |
gzz.view.ImageCellContentView()) |
gzz.view.ImageCellContentView()) |
76 |
|
|
77 |
if 'lollipop' not in self.flags: |
if 'lollipop' not in self.flags: |
78 |
self.cellViews = [gzz.view.BoxCellView(self.cellContentView)] |
self.cellViews = [gzz.view.BoxCellView(self.cellContentView)] |
79 |
else: |
else: |
80 |
self.cellViews = [gzz.view.LollipopCellView(self.cellContentView)] |
self.cellViews = [gzz.view.LollipopCellView(self.cellContentView)] |
81 |
|
|
82 |
gzz.client.Fallback(self.space.getHomeCell(), self.linkSpace, |
gzz.client.Fallback(self.space.getHomeCell(), self.linkSpace, |
83 |
self.binder, self.dimensions, self.decorators, |
self.binder, self.dimensions, self.decorators, |
84 |
self.views, self.viewSpecificBinders, |
self.views, self.viewSpecificBinders, |
85 |
self.cellViews, self.filers) |
self.cellViews, self.filers) |
113 |
import bindings |
import bindings |
114 |
self.binder = gzz.client.pythonbinder.PythonBinder( |
self.binder = gzz.client.pythonbinder.PythonBinder( |
115 |
bindings.normal_mode, bindings.edit_mode, bindings.search_mode) |
bindings.normal_mode, bindings.edit_mode, bindings.search_mode) |
116 |
|
|
117 |
elif 'potion-bindings' in self.flags: |
elif 'potion-bindings' in self.flags: |
118 |
arr = gzz.client.PotionFallbackBinder.Arrow |
arr = gzz.client.PotionFallbackBinder.Arrow |
119 |
def map(dict): |
def map(dict): |
121 |
for k,v in dict.items(): m.put(k, v) |
for k,v in dict.items(): m.put(k, v) |
122 |
return m |
return m |
123 |
|
|
124 |
from gzz.potion.potions import NewCell, Connect, PrefixOrOther |
from gzz.potion.potions import NewCell, Connect, PrefixOrOther, \ |
125 |
|
Hop2, Put, PrefixOrRight, PrefixOrLeft, \ |
126 |
|
RightWindow, LeftWindow, Go, Clone,ToggleMark |
127 |
bindings = { |
bindings = { |
128 |
'Up': arr(1,1,-1), 'i': arr(1,1,-1), 'e': arr(0,1,-1), |
'Up': arr(1,1,-1), 'i': arr(1,1,-1), 'e': arr(0,1,-1), |
129 |
'Down': arr(1,1,1), ',': arr(1,1,1), 'c': arr(0,1,1), |
'Down': arr(1,1,1), ',': arr(1,1,1), 'c': arr(0,1,1), |
131 |
'Right': arr(1,0,1), 'l': arr(1,0,1), 'f': arr(0,0,1), |
'Right': arr(1,0,1), 'l': arr(1,0,1), 'f': arr(0,0,1), |
132 |
'k': arr(1,2,1), 'K': arr(1,2,-1), |
'k': arr(1,2,1), 'K': arr(1,2,-1), |
133 |
'd': arr(0,2,1), 'D': arr(0,2,-1), |
'd': arr(0,2,1), 'D': arr(0,2,-1), |
134 |
'n': call([NewCell, None]), |
'n': action([NewCell, None]), |
135 |
'-': call([Connect, [PrefixOrOther], None]) |
'-': action([Connect, [PrefixOrOther], None]), |
136 |
} |
'h': action([Hop2, None]), |
137 |
|
'p': action([Put,[RightWindow],[PrefixOrLeft]]), |
138 |
|
'g': action([Go, [PrefixOrOther]], 1), |
139 |
|
'G': action([Go, [PrefixOrOther]], 0), |
140 |
|
't': action([Clone,[PrefixOrRight], None]), |
141 |
|
'T': action([Clone,[PrefixOrLeft], None]), |
142 |
|
'm': action([ToggleMark, [RightWindow]]), |
143 |
|
'M': action([ToggleMark, [LeftWindow]]), |
144 |
|
} |
145 |
self.binder = gzz.client.PotionFallbackBinder(map(bindings)) |
self.binder = gzz.client.PotionFallbackBinder(map(bindings)) |
146 |
self.decorators.append(gzz.view.PendingPotionDecorator()) |
self.decorators.append(gzz.view.PendingPotionDecorator()) |
147 |
else: |
else: |