public class BasicBondGenerator extends Object implements IGenerator<IAtomContainer>
Modifier and Type | Class and Description |
---|---|
static class |
BasicBondGenerator.BondDistance
The gap between double and triple bond lines on the screen.
|
static class |
BasicBondGenerator.BondWidth
The width on screen of a bond.
|
static class |
BasicBondGenerator.DefaultBondColor
The color to draw bonds if not other color is given.
|
static class |
BasicBondGenerator.TowardsRingCenterProportion
The proportion to move in towards the ring center.
|
static class |
BasicBondGenerator.WedgeWidth
The width on screen of the fat end of a wedge bond.
|
Modifier and Type | Field and Description |
---|---|
protected IRingSet |
ringSet
Necessary for calculating inner-ring bond elements.
|
Constructor and Description |
---|
BasicBondGenerator()
An empty constructor necessary for reflection.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
bindsHydrogen(IBond bond)
Check to see if any of the atoms in this bond are hydrogen atoms.
|
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 |
generate(IBond currentBond,
RendererModel model)
Generate rendering element(s) for the current bond, including ring
elements if this bond is part of a ring.
|
IRenderingElement |
generateBond(IBond bond,
RendererModel model)
Generate stereo or bond elements for this bond.
|
IRenderingElement |
generateBondElement(IBond bond,
IBond.Order type,
RendererModel model)
Generate a LineElement or an ElementGroup of LineElements for this bond.
|
IRenderingElement |
generateBondElement(IBond bond,
RendererModel model)
Generate rendering elements for a bond, without ring elements but
considering the type of the bond (single, double, triple).
|
LineElement |
generateInnerElement(IBond bond,
IRing ring,
RendererModel model)
Make the inner ring bond, which is slightly shorter than the outer bond.
|
IRenderingElement |
generateRingElements(IBond bond,
IRing ring,
RendererModel model)
Generate ring elements, such as inner-ring bonds or ring stereo elements.
|
Color |
getColorForBond(IBond bond,
RendererModel model)
Determine the color of a bond, returning either the default color,
the override color or whatever is in the color hash for that bond.
|
List<IGeneratorParameter<?>> |
getParameters()
Returns the list of
IGeneratorParameter for this particular
generator. |
protected IRingSet |
getRingSet(IAtomContainer atomContainer)
Determine the ring set for this atom container.
|
double |
getWidthForBond(IBond bond,
RendererModel model)
Determine the width of a bond, returning either the width defined
in the model, or the override width.
|
void |
setOverrideBondWidth(double bondWidth)
Set the width to use for all bonds, overriding any standard bond widths.
|
void |
setOverrideColor(Color color)
Set the color to use for all bonds, overriding the standard bond colors.
|
protected IRingSet ringSet
public BasicBondGenerator()
public void setOverrideColor(Color color)
color
- the override colorpublic void setOverrideBondWidth(double bondWidth)
bondWidth
- protected IRingSet getRingSet(IAtomContainer atomContainer)
atomContainer
- the atom container to find rings in.public Color getColorForBond(IBond bond, RendererModel model)
bond
- the bond we are generating an element formodel
- the rendering modelpublic double getWidthForBond(IBond bond, RendererModel model)
bond
- the bond to determine the width formodel
- the renderer modelpublic 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 parameterspublic IRenderingElement generate(IBond currentBond, RendererModel model)
currentBond
- the bond to use when generating elementsmodel
- the renderer modelpublic IRenderingElement generateBondElement(IBond bond, RendererModel model)
bond
- the bond to use when generating elementsmodel
- the renderer modelpublic IRenderingElement generateBondElement(IBond bond, IBond.Order type, RendererModel model)
bond
- the bond to generate fortype
- the type of the bond - single, double, etcmodel
- the renderer modelpublic IRenderingElement generateRingElements(IBond bond, IRing ring, RendererModel model)
bond
- the ring bond to use when generating elementsring
- the ring that the bond is inmodel
- the renderer modelpublic LineElement generateInnerElement(IBond bond, IRing ring, RendererModel model)
bond
- the ring bondring
- the ring that the bond is inmodel
- the renderer modelprotected boolean bindsHydrogen(IBond bond)
bond
- the bond to checkpublic IRenderingElement generateBond(IBond bond, RendererModel model)
bond
- the bond to use when generating elementsmodel
- the renderer modelpublic List<IGeneratorParameter<?>> getParameters()
IGeneratorParameter
for this particular
generator.getParameters
in interface IGenerator<IAtomContainer>
List
of IGeneratorParameter
sCopyright © 2021. All rights reserved.