From: Miguel H. <mt...@mt...> - 2004-03-17 16:04:17
|
Christoph had previously inquired off-list about displaying arbitrary ato= m properties in labels. Text of that message is below. Christoph, I have completed the work to allow the display of arbitrary user-defined properties using the 'label' tags in Jmol. This should allow you to display your nmrshift property ... or any other property associated with = a cdk.Atom object. The syntax is: label My custom property value is %=7BpropertyName=7D The curly brackets are required to delimit the property name. Currently, only the CDKJmolModelAdapter implements this method. Q: Are there file types that store arbitrary property values for atoms? Miguel >> Miguel, >> >> if I want to keep my plugin code as application-independent as >> possible, >> I cannot include code for sending script commands to Jmol, since >> JChemPaint e.g. will not be able to understand them. > > OK > >> If course, the user can be instructed to use these script command once= >> a >> certain structure was loaded in order to activate display of certain >> atom properties. These atom or better ChemObject properties *are* >> already part of a ChemFile passed to Jmol, but there is not way to >> acces >> them. > > Well, yes and no. > > Jmol does not use the ChemFile/ChemObjects directly. Rather, Jmol > extracts the data that it wants, builds its own data structures, and > releases the references. All of this happens when the molecule first > gets loaded. > >> Of course, one would need a placeholder like %n for nmr shifts, >> which again doesn't make much sense since there could be tons of >> potential properties for which we will not want to make %-tags each. > > Agreed. > >> The solution would be a script command to display cdk.ChemObject >> properties by label: >> >> select carbon; label =22nmr shift =3D %nmrshift=22 > > That is a good suggestion. > >> where the latter is a dynamically generated variable based on an >> existing cdk.ChemObject property. Do you think this is doable? > > I think that there should be a way to handle this. > > I will need to think about extending the JmolModelAdapter interface so > that it can support user-defined properties. > > >> BTW, sending an EditBus command =22showChemFile()=22 (or so) does not= >> work in the current HEAD (stackTrace attached). If I walk down this >> hierarchy, I do indeed not find any code for handling cdk.ChemFiles. >> It worked in b6. > > I have never looked at the EditBus code ... Egon probably needs to take= > a look at it. > > > Miguel -------------------------------------------------- Miguel Howard miguel=40howards.org c/Pe=F1a Primera 11-13 esc dcha 6B 37002 Salamanca Espa=F1a Spain -------------------------------------------------- telefono casa 923 27 10 82 movil 650 52 54 58 -------------------------------------------------- To call from the US dial 9:00 am Pacific US =3D home 011 34 923 27 10 82 12:00 noon Eastern US =3D cell 011 34 650 52 54 58 6:00 pm Spain -------------------------------------------------- |