Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved the atom radius into the new rendering parameter API (renderext…

…ra module)
  • Loading branch information...
commit 8bf0d4e2176d915eff610eac92232bb31642d7a4 1 parent fde3785
@egonw egonw authored egonw committed
View
7 src/main/org/openscience/cdk/renderer/generators/LonePairGenerator.java
@@ -34,6 +34,7 @@
import org.openscience.cdk.renderer.elements.ElementGroup;
import org.openscience.cdk.renderer.elements.IRenderingElement;
import org.openscience.cdk.renderer.elements.OvalElement;
+import org.openscience.cdk.renderer.generators.BasicAtomGenerator.AtomRadius;
/**
* Generate the symbols for lone pairs.
@@ -54,9 +55,11 @@ public IRenderingElement generate(IAtomContainer ac, RendererModel model) {
// separation between centers
final double SCREEN_SEPARATION = 2.5;
final Color RADICAL_COLOR = Color.BLACK;
-
+
// XXX : is this the best option?
- final double ATOM_RADIUS = model.getAtomRadius();
+ final double ATOM_RADIUS =
+ ((AtomRadius)model.getRenderingParameter(AtomRadius.class)).
+ getValue();
double scale = model.getScale();
double modelAtomRadius = ATOM_RADIUS / scale;
View
5 src/main/org/openscience/cdk/renderer/generators/RadicalGenerator.java
@@ -34,6 +34,7 @@
import org.openscience.cdk.renderer.elements.ElementGroup;
import org.openscience.cdk.renderer.elements.IRenderingElement;
import org.openscience.cdk.renderer.elements.OvalElement;
+import org.openscience.cdk.renderer.generators.BasicAtomGenerator.AtomRadius;
/**
* Generate the symbols for radicals.
@@ -54,7 +55,9 @@ public IRenderingElement generate(IAtomContainer ac, RendererModel model) {
final Color RADICAL_COLOR = Color.BLACK;
// XXX : is this the best option?
- final double ATOM_RADIUS = model.getAtomRadius() / model.getScale();
+ final double ATOM_RADIUS =
+ ((AtomRadius)model.getRenderingParameter(AtomRadius.class)).
+ getValue();
double modelRadius = SCREEN_RADIUS / model.getScale();
for (ISingleElectron e : ac.singleElectrons()) {
Please sign in to comment.
Something went wrong with that request. Please try again.