On 22 November 2013 13:52, John May <john.wilkinsonmay@gmail.com> wrote:
Hi Nina,

I think that class was from JChemPaint… here’s the package in 1.4.11: https://github.com/cdk/cdk/tree/cdk-1.4.11/src/main/org/openscience/cdk/renderer/generators

It's probably  be from cdk-jchempaint , not JChemPaint itself (according to maven dependencies in ambit ;)
 

I guess the short answer is that no it’s not possible to highlight atoms (with different colours) in the CDK without writing a custom generator or porting from downstream projects.

Guess so - otherwise I would not invent a custom class. 

Regards,
Nina
 

Thanks,
John

On 22 Nov 2013, at 11:45, Nina Jeliazkova <jeliazkova.nina@gmail.com> wrote:

Hi John,


On 22 November 2013 13:35, John May <john.wilkinsonmay@gmail.com> wrote:
Hi Gilleain, Nina

Thanks for the examples.  

Do you mean the text of the atom labels should be different colors, or
do you want colored circles underneath the atoms?

Circles underneath like Nina linked to in Ambit.


Hmmm the SelectAtomGenerator… doesn’t exist in 1.4.x or master?

IAtomColorer atomColorer = new IAtomColorer() { … //implement this somehow
BasicAtomGenerator atomGenerator = //etc
atomGenerator.set(BasicAtomGenerator.AtomColorer.class, atomColorer);
this version uses CDK 1.4.11  -   CDK renderers only, not JChemPaint  (JCP is a pain to have server side). The CDK renderer part might have changed in later version. 

 

This colours the atom symbol / glyph, is there a non-extension way to do the highlight.


There is a custom  MySelectAtomGenerator which does the highlighting based on atom property (in the demo link the three colors corresponds to ranks 1,2,3 as  calculated by SmartCYP) .

I think Bioclipse does the highlighting differently, may be someone from Bioclipse team could elaborate.

Regards,
Nina
 

Cheers,
John

On 22 Nov 2013, at 11:24, gilleain torrance <gilleain.torrance@gmail.com> wrote:

Ah, Nina's code seems quite comprehensive, and looks like it will do
all sorts of useful things here.

However, the 'standard' way to do things (inherited from the old JCP
code) was to use an instance of an IAtomColorer, eg:

IAtomColorer atomColorer = new IAtomColorer() { … //implement this somehow
BasicAtomGenerator atomGenerator = //etc
atomGenerator.set(BasicAtomGenerator.AtomColorer.class, atomColorer);

should work, I think?

gilleain




On 11/22/13, Nina Jeliazkova <jeliazkova.nina@gmail.com> wrote:
Hi John,


On 22 November 2013 13:01, John May <johnmay@ebi.ac.uk> wrote:

Hi All,

Does anyone know how to highlight atoms in different colours using the
CDK
renders?


Yes :)

http://apps.ideaconsult.net:8080/ambit2/dataset/1736?model_uri=http://apps.ideaconsult.net:8080/ambit2/model/48

There are several ways, ambit code is at
http://sourceforge.net/p/ambit/code/HEAD/tree/trunk/ambit2-all/ambit2-rendering/src/main/java/ambit2/rendering/CompoundImageTools.java


Regards,
Nina


Stephan and I have been scratching our heads and really looks like it’s
not possible. We have code for this in Knime but simply can’t believe
it’s
not in the main rendering code.

I always thought the ColorHash was how it was done but this (see below)
only works for bonds :/.

Map<IChemObject,Color> highlight = Maps.newHashMap();
highlight.put(m.getAtom(0), Color.green);
highlight.put(m.getAtom(1), Color.red);
renderer.getRenderer2DModel().set(RendererModel.ColorHash.class,
highlight);

Cheers,
J



------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up
now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Cdk-devel mailing list
Cdk-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-devel




------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Cdk-devel mailing list
Cdk-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-devel


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Cdk-devel mailing list
Cdk-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-devel


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk_______________________________________________
Cdk-devel mailing list
Cdk-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-devel


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Cdk-devel mailing list
Cdk-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-devel