public class BasicAtomGenerator extends Object implements IGenerator<IAtomContainer>
IRenderingElement
s for atoms in an atom container.Modifier and Type | Class and Description |
---|---|
static class |
BasicAtomGenerator.AtomColor
Class to hold the color by which atom labels are drawn.
|
static class |
BasicAtomGenerator.AtomColorer
IAtomColorer used to draw elements. |
static class |
BasicAtomGenerator.AtomRadius
Magic number with unknown units that defines the radius
around an atom, e.g.
|
static class |
BasicAtomGenerator.ColorByType
Boolean property that triggers atoms to be colored by type
when set to true.
|
static class |
BasicAtomGenerator.CompactAtom
Boolean parameters that will cause atoms to be drawn as
filled shapes when set to true.
|
static class |
BasicAtomGenerator.CompactShape
Shape to be used when drawing atoms in compact mode,
as defined by the
BasicAtomGenerator.CompactAtom parameter. |
static class |
BasicAtomGenerator.KekuleStructure
Determines whether structures should be drawn as Kekule structures, thus
giving each carbon element explicitly, instead of not displaying the
element symbol.
|
static class |
BasicAtomGenerator.Shape
When atoms are selected or in compact mode, they will
be covered by a shape determined by this enumeration.
|
static class |
BasicAtomGenerator.ShowEndCarbons
Boolean parameters that will show carbons with only one
(non-hydrogen) neighbor to be drawn with an element symbol.
|
static class |
BasicAtomGenerator.ShowExplicitHydrogens
Boolean property that triggers explicit hydrogens to be
drawn if set to true.
|
Constructor and Description |
---|
BasicAtomGenerator()
An empty constructor necessary for reflection.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canDraw(IAtom atom,
IAtomContainer container,
RendererModel model)
Checks an atom to see if it should be drawn.
|
IRenderingElement |
generate(IAtomContainer atomContainer,
IAtom atom,
RendererModel model)
Generate the rendering element(s) for a particular atom.
|
IRenderingElement |
generate(IAtomContainer container,
RendererModel model)
Converts a
IChemObject from the chemical data model into
something that can be drawn in the chemical drawing. |
IRenderingElement |
generateCompactElement(IAtom atom,
RendererModel model)
Generate a compact element for an atom, such as a circle or a square,
rather than text element.
|
AtomSymbolElement |
generateElement(IAtom atom,
int alignment,
RendererModel model)
Generate an atom symbol element.
|
protected Color |
getAtomColor(IAtom atom,
RendererModel model)
Returns the drawing color of the given atom.
|
List<IGeneratorParameter<?>> |
getParameters()
Returns the list of
IGeneratorParameter for this particular
generator. |
protected boolean |
hasCoordinates(IAtom atom)
Checks an atom to see if it has 2D coordinates.
|
protected boolean |
invisibleCarbon(IAtom atom,
IAtomContainer atomContainer,
RendererModel model)
Checks an atom to see if it is an 'invisible carbon' - that is, it is:
a) a carbon atom and b) this carbon should not be shown.
|
protected boolean |
invisibleHydrogen(IAtom atom,
RendererModel model)
Checks an atom to see if it is an 'invisible hydrogen' - that is, it
is a) an (explicit) hydrogen, and b) explicit hydrogens are set to off.
|
protected boolean |
isHydrogen(IAtom atom)
Determines if the atom is a hydrogen.
|
protected boolean |
showCarbon(IAtom carbonAtom,
IAtomContainer container,
RendererModel model)
Checks a carbon atom to see if it should be shown.
|
public BasicAtomGenerator()
public IRenderingElement generate(IAtomContainer container, RendererModel model)
IChemObject
from the chemical data model into
something that can be drawn in the chemical drawing.generate
in interface IGenerator<IAtomContainer>
container
- the chemical entity to be depictedmodel
- the rendering parametersprotected boolean hasCoordinates(IAtom atom)
atom
- the atom to checkprotected boolean isHydrogen(IAtom atom)
atom
- IAtom
to be testedprotected boolean invisibleHydrogen(IAtom atom, RendererModel model)
atom
- the atom to checkmodel
- the renderer modelprotected boolean invisibleCarbon(IAtom atom, IAtomContainer atomContainer, RendererModel model)
atom
- the atom to checkatomContainer
- the atom container the atom is part ofmodel
- the renderer modelprotected boolean canDraw(IAtom atom, IAtomContainer container, RendererModel model)
atom
- the atom to checkcontainer
- the atom container the atom is part ofmodel
- the renderer modelpublic IRenderingElement generate(IAtomContainer atomContainer, IAtom atom, RendererModel model)
atomContainer
- the atom container that the atom is fromatom
- the atom to generate the rendering element formodel
- the renderer modelpublic IRenderingElement generateCompactElement(IAtom atom, RendererModel model)
atom
- the atom to generate the compact element formodel
- the renderer modelpublic AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model)
atom
- the atom to usealignment
- the alignment of the atom's labelmodel
- the renderer modelprotected boolean showCarbon(IAtom carbonAtom, IAtomContainer container, RendererModel model)
carbonAtom
- the carbon atom to checkcontainer
- the atom containermodel
- the renderer modelprotected Color getAtomColor(IAtom atom, RendererModel model)
public List<IGeneratorParameter<?>> getParameters()
IGeneratorParameter
for this particular
generator.getParameters
in interface IGenerator<IAtomContainer>
List
of IGeneratorParameter
sCopyright © 2021. All rights reserved.