[Biococoa-dev] KDTextView update
Koen van der Drift
kvddrift at earthlink.net
Thu Apr 13 21:28:22 EDT 2006
On Apr 13, 2006, at 8:00 PM, Alexander Griekspoor wrote:
> That's the difference between providing something for extensive
> reuse and something that fulfils specific needs in my app ;-)
> Usually, the latter evolves slowly to the first, with the pressure
> on slowly, that's why it's done that way yet, at least the "proper"
> idea is there ;-)
>>
Fair enough. I have committed the changes, including a new delegate
method for BCSequenceView: filterInputString. The Translation demo
uses it as follows, using the symbolSet of the BCSequence that is
connected to each textView:
- (NSString *)filterInputString: (NSString *) inputString textView:
(BCSequenceView *)textView
{
BCSymbolSet *symbolSet;
// need to filter for rich text here
if ( textView == theInput )
{
symbolSet = [theDNA symbolSet];
return [symbolSet stringByRemovingUnknownCharsFromString:
inputString];
}
else if (textView == theOutput)
{
symbolSet = [theProtein symbolSet];
return [symbolSet stringByRemovingUnknownCharsFromString:
inputString];
}
return inputString;
}
However, it does not have the same functionality as the filter that
Alex made, i.e. renaming all ambiguous symbols into 'N'.
We also need a method to return a plain NSString from richtext input,
though. For instance, I copy-pasted the short sequence that Alex gave
as an example (ATTAATAGATGAF ), but that was rich text from Mail.app,
so it showed up as follows in the view:
rtmacanscgccartccasbrtnttbswsscharstHvtcacrtbrdgrnbdtabardardtabnatrascA
TTAATAGATGA
I couldn't find a method in the FoundationKit, so I started a
category method in BCUtilString, but it is not working yet. This
method can then also be used in BCSequenceReader.
Finally, copy-paste within the sequenceview isn't working.
cheers,
- Koen.
More information about the Biococoa-dev
mailing list