Class StandardGenerator
java.lang.Object
org.openscience.cdk.renderer.generators.standard.StandardGenerator
- All Implemented Interfaces:
IGenerator<IAtomContainer>
The standard generator creates
IRenderingElements for the atoms and bonds of a structure
diagram. These are generated together allowing the bonds to drawn cleanly without overlap. The
generate is heavily based on ideas documented in [Jonathan Brecher. Pure Appl. Chem. 2008. 80] and [Clark A.. Molecular Informatics. 2013. 32].
Atom symbols are provided as GeneralPath outlines. This allows the depiction to be
independent of the system used to view the diagram (primarily important for vector graphic
depictions). The font used to generate the diagram must be provided to the constructor.
Atoms and bonds can be highlighted by setting the HIGHLIGHT_COLOR. The style of
highlight is set with the StandardGenerator.Highlighting parameter.
The Standard Generator - CDK Wiki
page provides extended details of using and configuring this generator.- Author:
- John May
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final classThe color of the atom numbers.static final classThe distance of atom numbers from their parent atom as a percentage of bond length, default value is 0.25 (25%)static final classAnnotation font size relative to element symbols, default = 0.4 (40%).static final classDefines the color of unselected atoms (and bonds).static final classDefines the ratio of the separation between lines in double bonds as a percentage of length (BasicSceneGenerator.BondLength).static final classThe number of sections to render in a dashed 'unknown' bond, default = 4;static final classRender small delocalised rings as bonds/life buoys?static final classDisplay deuterium[2H]as 'D'.static final classModify bold wedges to be flush with adjacent bonds, default = true.static final classModify hashed wedges to be flush when there is a single adjacent bond, default = true.static final classIndicate delocalised/aromatic bonds should always be rendered, even when there is a valid Kekule structure.static final classThe preferred spacing between lines in hashed bonds.static final classParameter defines the style of highlight used to emphasis atoms and bonds.static enumEnumeration of highlight style.static final classWhether Major Isotopes e.g. 12C, 16O should be omitted.static final classThe width of outer glow as a percentage of stroke width.static final classThe default font style for pseudo-atoms, is Bold and Italic.static final classThis set of colors is used to add a colored the background box around R-Group definitions.static final classHow "deep" are brackets drawn.static final classScale Sgroup annotations relative to the normal font size (atom symbol).static final classDefines the ratio of the stroke to the width of the stroke of the font used to depict atom symbols.static final classDefines the margin between an atom symbol and a connected bond based on the stroke width.static final classDefines which atoms have their symbol displayed.static final classThe spacing of waves (semi circles) drawn in wavy bonds with.static final classRatio of the wide end of wedge compared to the narrow end (stroke width). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefines the annotation label(s) of a chem object in a depiction.static final StringMarks atoms and bonds as being hidden from the actual depiction.static final Stringstatic final StringDefines that a chem object should be highlighted in a depiction.static final StringA special markup for annotation labels that hints the generator to renderer the annotation label in italic.static final StringOverride the alignment of an atom symbol, the value should beStandardGenerator.Alignment -
Constructor Summary
ConstructorsConstructorDescriptionStandardGenerator(Font font) Create a new standard generator that utilises the specified font to display atom symbols. -
Method Summary
Modifier and TypeMethodDescriptionstatic IRenderingElementMake an embedded text label for display in a CDK renderer.generate(IAtomContainer container, RendererModel parameters) Converts aIChemObjectfrom the chemical data model into something that can be drawn in the chemical drawing.Returns the list ofIGeneratorParameterfor this particular generator.
-
Field Details
-
HIGHLIGHT_COLOR
Defines that a chem object should be highlighted in a depiction. Only atom symbols that are displayed are highlighted, the visibility of symbols can be modified withSymbolVisibility.atom.setProperty(StandardGenerator.HIGHLIGHT_COLOR, Color.RED);- See Also:
-
ANNOTATION_LABEL
Defines the annotation label(s) of a chem object in a depiction. The annotation must be a string.String number = Integer.toString(1 + container.indexOf(atom)); atom.setProperty(CDKConstants.ANNOTATION_LABEL, number);- See Also:
-
LABEL_ALIGN
Override the alignment of an atom symbol, the value should beStandardGenerator.Alignment- See Also:
-
ITALIC_DISPLAY_PREFIX
A special markup for annotation labels that hints the generator to renderer the annotation label in italic. The primary use case is for Cahn-Ingold-Prelog descriptors.String cipLabel = "R"; atom.setProperty(CDKConstants.ANNOTATION_LABEL, StandardGenerator.ITALIC_DISPLAY_PREFIX + cipLabel);- See Also:
-
HIDDEN
Marks atoms and bonds as being hidden from the actual depiction. Set this property to non-null to indicate this.- See Also:
-
HIDDEN_FULLY
- See Also:
-
-
Constructor Details
-
StandardGenerator
Create a new standard generator that utilises the specified font to display atom symbols.- Parameters:
font- the font family, size, and style
-
-
Method Details
-
generate
Converts aIChemObjectfrom the chemical data model into something that can be drawn in the chemical drawing.- Specified by:
generatein interfaceIGenerator<IAtomContainer>- Parameters:
container- the chemical entity to be depictedparameters- the rendering parameters- Returns:
- a drawable chemical depiction component
-
embedText
Make an embedded text label for display in a CDK renderer. If a piece of text contains newlines they are centred aligned below each other with a line height of 1.4.- Parameters:
font- the font to embeddedtext- the text labelcolor- the colorscale- the resize, should include the model scale- Returns:
- pre-rendered element
-
getParameters
Returns the list ofIGeneratorParameterfor this particular generator.- Specified by:
getParametersin interfaceIGenerator<IAtomContainer>- Returns:
- a
ListofIGeneratorParameters
-