How can i get the text value?

User a83cdfbe8a

14-10-2009 03:34:10

Hi,i have a problem:I draw a reaction with marvin plug,there is a agent is inserted as text,How Can I get the value of text?


RxMolecule rx=new RxMolecule();


.............


int counst=rx.getAgentcount();


ArrayList list=new ArrayList();


for(int i=0;i<counts;i++){


 list.add(rx.getAgent(i)); 



 in the list ,I can find "NaHSO3".How Can I get it?  


The Image as following。 Thanks。

ChemAxon e500b51457

15-10-2009 20:41:12

 


Hello,


After adding a text box, the text box object (MTextBox) is
available from the object list of the MDocument attached to the reaction
molecule:


MDocument
doc = rx.getDocument();


for (int i = 0; i <
doc.getObjectCount(); i++) {


if
(doc.getObject(i)
instanceof MTextBox) {


. .
.


}


}


Best Regards,


Erika