Class StandardGenerator

    • Field Detail

      • HIGHLIGHT_COLOR

        public static final String 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 with SymbolVisibility.
        
         atom.setProperty(StandardGenerator.HIGHLIGHT_COLOR, Color.RED);
         
        See Also:
        Constant Field Values
      • ANNOTATION_LABEL

        public static final String 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:
        Constant Field Values
      • ITALIC_DISPLAY_PREFIX

        public static final String 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:
        Constant Field Values
      • HIDDEN

        public static final String HIDDEN
        Marks atoms and bonds as being hidden from the actual depiction. Set this property to non-null to indicate this.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StandardGenerator

        public StandardGenerator​(Font font)
        Create a new standard generator that utilises the specified font to display atom symbols.
        Parameters:
        font - the font family, size, and style
    • Method Detail

      • embedText

        public static IRenderingElement embedText​(Font font,
                                                  String text,
                                                  Color color,
                                                  double scale)
        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 embedded
        text - the text label
        color - the color
        scale - the resize, should include the model scale
        Returns:
        pre-rendered element