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.

There are several ways,

I thought as much :-)

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

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 colours the atom symbol / glyph, is there a non-extension way to do the highlight.

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