[brailleblaster] Re: Dynamic translation

  • From: "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Fri, 4 Jan 2013 09:10:41 -0600

As Michael suggested, retranslating at each keystroke is not a good 
idea. We might retranslate when the spacebar is pressed or when the user 
stops typing for a brief time. 

Finding out which node is being edited will be done by keeping a record 
of the starting and ending points of the text for the node. This record 
is kept in the semanticsList ArrayList in Semantics.java The StyledText 
control has a method for determining the current cursor location. I'm 
not quite sure how to tetermine the starting and ending points of a 
block of text, but I'm pretty sure it can be done. Also, we can write 
out own version of the StyledTextContent class. It is in the SWT custom 
package along with StyledText and some other useful classes. The 
abstract classes in the wordprocessor package may also be worth looking 
at.

I can change the name of the documentmodel package to document. You also 
did not like the name Semantics. What would you suggest as a 
replacement?

Thanks,
John

On Fri, Jan 04, 2013 at 01:18:33PM +0000, Keith Creasy wrote:
> This makes sense. I still wonder how we can know which text node is being 
> edited. Any ideas?
> 
> Also, where do the views access the DOM and where does the document update 
> the views? I also think all this needs to be in a Document class so that it 
> makes sense when one is just exploring the source code.
> 
> 
> Keith Creasy
> Software Developer
> American Printing House for the Blind
> KCreasy@xxxxxxx
> Phone: 502.895.2405
> Skype: keith537
> 
> 
> -----Original Message-----
> From: brailleblaster-bounce@xxxxxxxxxxxxx 
> [mailto:brailleblaster-bounce@xxxxxxxxxxxxx] On Behalf Of John J. Boyer
> Sent: Thursday, January 03, 2013 4:42 PM
> To: brailleblaster@xxxxxxxxxxxxx
> Subject: [brailleblaster] Dynamic translation
> 
> As I see it dynamic or on-the-fly translation will apply to the text node 
> courrently being edited. Each time a character key is pressed a new 
> liblouisutdml function will be called to trranslate the node. 
> liblouisuteml is needed because we are working with an xml document and the 
> configuration parameters used for the original rendering should be applied. 
> The function will not be diffiecult to implement. It might be called 
> something like translateTextNode . There should be no noticeable performance 
> lag for text nodes of reasonable size. However, I have seen some with tens of 
> thousands of characters, so dynamic translation may be turned off for such 
> huge nodes. 
> 
> The dynamic translation may make pagination and other things invalid, so the 
> user can retranslate (actually, re-render) the documennt. 
> 
> John
> 
> --
> John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc.
> http://www.abilitiessoft.com
> Madison, Wisconsin USA
> Developing software for people with disabilities
> 
> 

-- 
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities


Other related posts: