ChemWriter v1.3.0

com.metamolecular.chemwriter.paint
Interface PaintStyler

All Known Implementing Classes:
BaseApplet, EditorApplet, PainterApplet

public interface PaintStyler

Unified paint settings management.

All measurements are reported in terms of the displayed Molecule's median bond length. As this length changes, measurements such as atom label height and line thickness will scale proportionally. This ensures that features will remain proportional to each other regardless of display resolution.

Author:
Richard L. Apodaca

Method Summary
 void clearAtomColors()
          Clears all atom coloring, making all atoms appear in the bond color.
 void copyStyle(PaintStyler styler)
          Copies all settings from styler to this PaintStyler.
 java.awt.Color getAtomColor(java.lang.String atomSymbol)
          Returns the color for atoms of atomic symbol atomSymbol.
 java.lang.String getAtomLabelFont()
          Returns the name of the font being used to render atom labels.
 java.lang.String[] getAtomLabelFonts()
          Returns an array containing the names of the fonts that can be used for Atom labels.
 double getAtomLabelHeight()
          Returns the atom label height, as a ratio of the median bond length.
 java.awt.Color getBackgroundColor()
          Returns the background color.
 java.awt.Color getBondColor()
          Returns the bond color.
 java.lang.String getCapStyle()
          Returns the line cap style.
 java.lang.String[] getColoredAtoms()
          Returns an array of atom labels that this PaintStyler will color.
 double getLineEndPadding()
          Returns the end line padding.
 double getLineOffset()
          Returns the multiple bond line offset as a ratio of the median bond length.
 double getLineWidth()
          Returns the line width, as a ratio of the median bond length.
 double getStereoWidth()
          Returns the maximum width of a stereo bond, as a ratio of the bond length.
 boolean isAntialiasing()
          Returns true if antialiasing is activated or false otherwise.
 boolean isAtomColoringEnabled()
          Returns true if atom coloring is enabled, or false otherwise.
 boolean isCarbonVisible()
          Returns true if carbon atoms and their associated virutal hydrogens are rendered or false otherwise.
 boolean isRenderVirtualHydrogens()
          Returns true if heteroatom virtual hydrogens are rendered or false otherwise.
 void setAntialiasing(boolean antialiasing)
          Determines whether antialiasing is used.
 void setAtomColor(java.lang.String atomSymbol, java.awt.Color color)
          Sets the color for atoms of atomic symbol atomicSymbol to color
 void setAtomColor(java.lang.String atomSymbol, int red, int green, int blue)
          Sets the color for atoms of atomic symbol atomicSymbol to the color represented by the values red, green, and blue.
 void setAtomColoringEnabled(boolean enabled)
          Turns atom coloring on and off.
 void setAtomLabelFont(java.lang.String font)
          Sets the name of the font being used to render atom labels.
 void setAtomLabelHeight(double height)
          Sets the atom label height, as a ratio of the median bond length.
 void setBackgroundColor(java.awt.Color color)
          Sets the background color to color.
 void setBackgroundColor(int red, int green, int blue)
          Sets the background color to that represented by the red green, and blue values.
 void setBondColor(java.awt.Color color)
          Sets the bond color to color.
 void setBondColor(int red, int green, int blue)
          Sets the bond color to that represented by the red, green, and blue values.
 void setCapStyle(java.lang.String endCap)
          Sets the line cap style: "square", "round", or "none".
 void setCarbonVisible(boolean visible)
          Determines whether carbon atoms and their associated virtual hydrogens will be rendered.
 void setLineEndPadding(double padding)
          Sets line end padding to padding.
 void setLineOffset(double offset)
          Sets the multiple bond line offset, as a ratio of the bond length.
 void setLineWidth(double width)
          Sets the line width, as a ratio of the median bond length.
 void setRenderVirtualHydrogens(boolean visible)
          Determines whether heteroatom virtual hydrogens will be rendered.
 void setStereoWidth(double width)
          Sets the maximum width of a stereo bond, as a ratio of the bond length.
 

Method Detail

setLineEndPadding

void setLineEndPadding(double padding)
Sets line end padding to padding. Line end padding is the spacing between a single bond terminus and a visible atom label, relative to the median bond length. For example, a value of 0.05 sets the distance between the edge of a single bond and a nitrogen atom label to be 5% of the median bond length.

Parameters:
padding - the spacing between a single bond terminus and a visible atom label, relative to the median bond length

getLineEndPadding

double getLineEndPadding()
Returns the end line padding. Line end padding is the spacing between a single bond terminus and a visible atom label, relative to the median bond length. For example, a value of 0.05 sets the distance between the edge of a single bond and a nitrogen atom label to be 5% of the median bond length.

Returns:
the spacing between a single bond terminus and a visible atom label, relative to the median bond length

getColoredAtoms

java.lang.String[] getColoredAtoms()
Returns an array of atom labels that this PaintStyler will color.

Returns:
an array of atom labels that this PaintStyler will color

clearAtomColors

void clearAtomColors()
Clears all atom coloring, making all atoms appear in the bond color.


setAtomColoringEnabled

void setAtomColoringEnabled(boolean enabled)
Turns atom coloring on and off. When atom coloring is disabled, all atom labels appear with the same color as bonds.

Parameters:
enabled - enables atom coloring if true

isAtomColoringEnabled

boolean isAtomColoringEnabled()
Returns true if atom coloring is enabled, or false otherwise.

Returns:
true if atom coloring is enabled, or false otherwise

setBondColor

void setBondColor(java.awt.Color color)
Sets the bond color to color.

Parameters:
color - the new bond color

setBondColor

void setBondColor(int red,
                  int green,
                  int blue)
Sets the bond color to that represented by the red, green, and blue values.

Parameters:
red - the red color component (0-255)
green - the green color component (0-255)
blue - the blue color component (0-255)

getBondColor

java.awt.Color getBondColor()
Returns the bond color.

Returns:
the bond color

setBackgroundColor

void setBackgroundColor(java.awt.Color color)
Sets the background color to color.

Parameters:
color - the new background color

setBackgroundColor

void setBackgroundColor(int red,
                        int green,
                        int blue)
Sets the background color to that represented by the red green, and blue values.

Parameters:
red - the red color component (0-255)
green - the green color component (0-255)
blue - the blue color component (0-255)

getBackgroundColor

java.awt.Color getBackgroundColor()
Returns the background color.

Returns:
the background color

setCapStyle

void setCapStyle(java.lang.String endCap)
Sets the line cap style: "square", "round", or "none".

Parameters:
endCap - one of "square", "round", or "none"

getCapStyle

java.lang.String getCapStyle()
Returns the line cap style.

Returns:
one of "square", "round", or "none"

setCarbonVisible

void setCarbonVisible(boolean visible)
Determines whether carbon atoms and their associated virtual hydrogens will be rendered.

Parameters:
visible - when true carbons and their associated virtual hydrogens will be rendered

isCarbonVisible

boolean isCarbonVisible()
Returns true if carbon atoms and their associated virutal hydrogens are rendered or false otherwise.

Returns:
true if carbon atoms and their associated virutal hydrogens are rendered or false otherwise

setRenderVirtualHydrogens

void setRenderVirtualHydrogens(boolean visible)
Determines whether heteroatom virtual hydrogens will be rendered.

Parameters:
visible - when true carbons and their associated virtual hydrogens will be rendered

isRenderVirtualHydrogens

boolean isRenderVirtualHydrogens()
Returns true if heteroatom virtual hydrogens are rendered or false otherwise.

Returns:
true if heteroatom virtual hydrogens are rendered or false otherwise

setAntialiasing

void setAntialiasing(boolean antialiasing)
Determines whether antialiasing is used. Deactivating antialiasing improves performance.

Parameters:
antialiasing - true if activated for false otherwise

isAntialiasing

boolean isAntialiasing()
Returns true if antialiasing is activated or false otherwise.

Returns:
true if antialiasing is activated or false otherwise

getAtomColor

java.awt.Color getAtomColor(java.lang.String atomSymbol)
Returns the color for atoms of atomic symbol atomSymbol.

Parameters:
atomSymbol - the case-sensitive one- or two-character atomic symbol to query
Returns:
the color of atoms having the symbol atomicSymbol

setAtomColor

void setAtomColor(java.lang.String atomSymbol,
                  java.awt.Color color)
Sets the color for atoms of atomic symbol atomicSymbol to color

Parameters:
atomSymbol - the case-sensitive one- or two-character atomic symbol to color
color - the new color for atoms of atomic symbol atomSymbol

setAtomColor

void setAtomColor(java.lang.String atomSymbol,
                  int red,
                  int green,
                  int blue)
Sets the color for atoms of atomic symbol atomicSymbol to the color represented by the values red, green, and blue.

Parameters:
atomSymbol - the case-sensitive one- or two-character atomic symbol to color
red - the red color component (0-255)
green - the green color component (0-255)
blue - the blue color component (0-255)

setLineWidth

void setLineWidth(double width)
Sets the line width, as a ratio of the median bond length.

Parameters:
width - the new line width - greater than zero

getLineWidth

double getLineWidth()
Returns the line width, as a ratio of the median bond length. Line widths apply to all bonds and stereo bond hashes.

Returns:
the line width, as a ratio of the median bond length

setLineOffset

void setLineOffset(double offset)
Sets the multiple bond line offset, as a ratio of the bond length.

Parameters:
offset - the new multiple bond line offset - greater than zero

getLineOffset

double getLineOffset()
Returns the multiple bond line offset as a ratio of the median bond length.

Returns:
the multiple bond line offset as a ratio of the median bond length

setStereoWidth

void setStereoWidth(double width)
Sets the maximum width of a stereo bond, as a ratio of the bond length.

Parameters:
width - the maximum width of a stereo bond - greater than zero

getStereoWidth

double getStereoWidth()
Returns the maximum width of a stereo bond, as a ratio of the bond length.

Returns:
the maximum width of a stereo bond, as a ratio of the bond length

setAtomLabelFont

void setAtomLabelFont(java.lang.String font)
Sets the name of the font being used to render atom labels. All system fonts are available in addition to the standard fonts "Serif", "SansSerif", and "Monospaced."

Parameters:
font - the name of the new font to be used in rendering atom labels

getAtomLabelFonts

java.lang.String[] getAtomLabelFonts()
Returns an array containing the names of the fonts that can be used for Atom labels. All members of this array can be used with setAtomLabelFont.

Returns:
an array containing the names of the fonts that can be used for Atom labels

getAtomLabelFont

java.lang.String getAtomLabelFont()
Returns the name of the font being used to render atom labels.

Returns:
the name of the font being used to render atom labels

setAtomLabelHeight

void setAtomLabelHeight(double height)
Sets the atom label height, as a ratio of the median bond length.

Parameters:
height - the new atom label height - greater than zero

getAtomLabelHeight

double getAtomLabelHeight()
Returns the atom label height, as a ratio of the median bond length.

Returns:
the atom label height

copyStyle

void copyStyle(PaintStyler styler)
Copies all settings from styler to this PaintStyler.

Parameters:
styler - the PaintStyler from which setting will be copied

ChemWriter v1.3.0

Copyright © 2007, 2008 Metamolecular, LLC. All Rights Reserved.