From: SourceForge.net <no...@so...> - 2005-03-01 02:19:08
|
Feature Requests item #949751, was opened at 2004-05-07 17:43 Message generated for change (Comment added) made by cpudney You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=370024&aid=949751&group_id=20024 Category: cdk.render Group: None >Status: Open Priority: 5 Submitted By: cpudney (cpudney) Assigned to: Egon Willighagen (egonw) Summary: Renderer2DModel.set/getAtomColorer() Initial Comment: G'day, Currently, it's not possible to override the Renderer2DModel (atom) colorer field. To do so would be fairly straightforward - simply add the following: private void AtomColorer colorer; ... /** * Gets the current atom colorer. * @return The AtomColorer. */ public AtomColorer getAtomColorer() { return colorer; } /** * Sets the current atom colorer. * @param colorer the new atom colorer. */ public void setAtomColorer(AtomColorer colorer) { this.colorer = colorer; } There is a problem in that the AtomColorer can't know what default colour to provide, e.g. the CDKAtomColorer uses black. This can be a problem if the background colour is dark. Therefore, I suggest that the AtomColorer interface be modified to use/include the following method signature: public Color getAtomColor(Atom a, Color default); Then the Renderer2DModel can instead call atomColor = colorer.getAtomColor(atom, backColor); and the AtomColorer can use the specified default rather than a fixed colour. Similar treatment for Renderer3DModel might also be useful. Thanks, Chris. ---------------------------------------------------------------------- >Comment By: cpudney (cpudney) Date: 2005-03-01 10:19 Message: Logged In: YES user_id=624072 G'day, I've reopened this because the get/setAtomColorer() methods haven't been added to Renderer2D/3DModel. These are needed to support the original request. Attached are modified versions of Renderer2DModel.java and Renderer3DModel.java that support these methods. Also included is a CPKAtomColors class that colours atoms according to the popular plastic spacefilling models which were developed by Corey, Pauling and later improved by Kultun. E.g. model = new Renderer3DModel(); model.setAtomColorer(new CPKAtomColors()); Regards, Chris. ---------------------------------------------------------------------- Comment By: cpudney (cpudney) Date: 2004-05-28 09:28 Message: Logged In: YES user_id=624072 > atomColor = colorer.getAtomColor(atom, foreColor); > Correct? Correct. ---------------------------------------------------------------------- Comment By: Egon Willighagen (egonw) Date: 2004-05-28 01:50 Message: Logged In: YES user_id=25678 Applied, btw, I guess "Then the Renderer2DModel can instead call: atomColor = colorer.getAtomColor(atom, backColor);" should be atomColor = colorer.getAtomColor(atom, foreColor); Correct? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=370024&aid=949751&group_id=20024 |