Question
Any smart way of creating custom composer?
I'm using TLF to create an app that support multiple general
objects wrapped in TextFlow. The Objects could virtually be
anything such as images or widgets, etc.
Currently now i'm trying to do this by puting multiple containers for each line sigment which is a chunk of a line(a line may have multiple segments in order to wrap the objets). and there's a wrapping algorithm calculating each line, segments and it's container's position.
My way of composing is like following:
1. first grab FLOW_OPERATION_BEGIN and do the corresponding operation using doOperation method on the operation object and call event.preventDefault. it stops further EditManager jobs and doOperation method change the model(TextFlow) and TextFlow dispatch DAMAGE event.
2. after that i catch the damage event and remove only the damaged the containers then create new containers line by line calculating the positions then updates.
It does the compose job for every editing events like text inserstion, pasting, style change .
As i proceed, it's more complicated and bloated. So i needed to optimize the composing phase.
Also i know that using TextLineFactory to create lines make the editing not work.
It left only a way of using the existing API. I feel the EditManager and Composer are much tightly so it seems like creating a customer composer is much more difficult for developers outside the Flex Team.
Any comments or advise will be appreciated.
Thanks Chuka
Currently now i'm trying to do this by puting multiple containers for each line sigment which is a chunk of a line(a line may have multiple segments in order to wrap the objets). and there's a wrapping algorithm calculating each line, segments and it's container's position.
My way of composing is like following:
1. first grab FLOW_OPERATION_BEGIN and do the corresponding operation using doOperation method on the operation object and call event.preventDefault. it stops further EditManager jobs and doOperation method change the model(TextFlow) and TextFlow dispatch DAMAGE event.
2. after that i catch the damage event and remove only the damaged the containers then create new containers line by line calculating the positions then updates.
It does the compose job for every editing events like text inserstion, pasting, style change .
As i proceed, it's more complicated and bloated. So i needed to optimize the composing phase.
Also i know that using TextLineFactory to create lines make the editing not work.
It left only a way of using the existing API. I feel the EditManager and Composer are much tightly so it seems like creating a customer composer is much more difficult for developers outside the Flex Team.
Any comments or advise will be appreciated.
Thanks Chuka
