32 |
cur = self.states.cursor |
cur = self.states.cursor |
33 |
acc = cur.getAccursed() |
acc = cur.getAccursed() |
34 |
offs = cur.getCursorOffset() |
offs = cur.getCursorOffset() |
35 |
alph = ff.util.AlphContent(self.states.fen) |
alphContent = ff.util.AlphContent(self.states.fen) |
36 |
|
|
37 |
### normal alphabets etc. |
### normal alphabets etc. |
38 |
if len(stroke) == 1: |
if len(stroke) == 1: |
90 |
p('delete:', offs) |
p('delete:', offs) |
91 |
pp.deleteText(note, offs - 1, offs) |
pp.deleteText(note, offs - 1, offs) |
92 |
offs = cur.setCursorOffset(offs - 1) |
offs = cur.setCursorOffset(offs - 1) |
93 |
text = alph.getText(fen.constgraph, acc) |
text = alphContent.getText(fen.constgraph, acc) |
94 |
if offs == 0 and len(text) == 0: |
if offs == 0 and len(text) == 0: |
95 |
if RDFUtil.isLinked(fen.graph, acc): |
if RDFUtil.isLinked(fen.graph, acc): |
96 |
pp.insertText(note, 0, "#") |
pp.insertText(note, 0, "#") |
100 |
elif stroke == 'Left': |
elif stroke == 'Left': |
101 |
if offs > 0: cur.setCursorOffset(offs - 1) |
if offs > 0: cur.setCursorOffset(offs - 1) |
102 |
elif stroke == 'Right': |
elif stroke == 'Right': |
103 |
text = alph.getText(acc) |
text = alphContent.getText(acc) |
104 |
if offs < len(text): |
if offs < len(text): |
105 |
cur.setCursorOffset( offs + 1) |
cur.setCursorOffset( offs + 1) |
106 |
|
|
115 |
self.spanImageFactory = spanImageFactory |
self.spanImageFactory = spanImageFactory |
116 |
self.nodeview = nodeview |
self.nodeview = nodeview |
117 |
self.pageview = None |
self.pageview = None |
|
self.alph = None |
|
118 |
|
|
119 |
# buoymanager, set with setBuoymanager() |
# buoymanager, set with setBuoymanager() |
120 |
self.buoymanager = None |
self.buoymanager = None |
378 |
views = self.states.view2d |
views = self.states.view2d |
379 |
|
|
380 |
if key == 'IMPORT': |
if key == 'IMPORT': |
381 |
f = java.awt.Frame() |
scrollBlock = ff.fenpdf.importpdf.importPDF_select( |
382 |
fd = java.awt.FileDialog(f, 'Valitse liitettava kuva', |
self.states.fen, |
383 |
java.awt.FileDialog.LOAD) |
self.states.ppActions.getTreeTime()) |
384 |
fd.setModal(1) |
p('sc: ',scrollBlock,'id: ', scrollBlock.getID()) |
385 |
fd.show() #// now wait until user makes a desicion |
if scrollBlock != None: |
386 |
fd.hide() |
buoymanager.replaceManager(0, |
387 |
p("ps/pdf to be added: "+fd.getDirectory()+fd.getFile()) |
ff.view.buoy.FisheyeMainNode2D( |
388 |
if fd.getDirectory() == None: |
scrollBlock, |
389 |
return 0 |
views.pageview, |
390 |
|
ff.view.buoy.AbstractMainNode2D.SimpleFocus(0,0), |
391 |
sc = self.states.alph.addFile( |
self.states.mainMouse)) |
|
java.io.File(fd.getDirectory()+fd.getFile()), |
|
|
'application/pdf') |
|
|
p('sc: ',sc,'foo: ', sc.getID()) |
|
|
buoymanager.replaceManager(0, |
|
|
ff.view.buoy.FisheyeMainNode2D(sc, views.pageview, |
|
|
ff.view.buoy.AbstractMainNode2D.SimpleFocus(0,0), |
|
|
self.states.mainMouse)) |
|
392 |
return 1 |
return 1 |
393 |
elif key == 'NEW_PAPER': |
elif key == 'NEW_PAPER': |
394 |
paper = self.states.ppActions.newPaper(); |
paper = self.states.ppActions.newPaper(); |