public class PherogramFormats extends java.lang.Object
PherogramComponent
and PherogramHeadingView
to format
their output.
Changes to all properties can be tracked using PropertyChangeListener
s during runtime. Note that
separate listeners could be added to the nested ZoomableFont
objects, but their events are also
forwarded to listeners registered with this objects. The forwarded events then have the font property name
as a prefix (e.g. "baseCallFont.name"
if the "name"
property of getBaseCallFont()
was changed).
Modifier and Type | Class and Description |
---|---|
static class |
PherogramFormats.QualityOutputType
Enumeration that determines the way quality scores are displays in an
|
Modifier and Type | Field and Description |
---|---|
static float |
BASE_CALL_LINE_COLOR_FACTOR
Used to calculate the default base call line color.
|
static float |
CUT_COLOR_FACTOR
Used to calculate the default background color for the cut off areas.
|
static double |
FONT_HEIGHT_FACTOR
Used to determine the line spacing around base calls, indices or probabilities.
|
Constructor and Description |
---|
PherogramFormats(PherogramComponent owner)
Creates a new instance of this class with default values.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
double |
calculateFontZoomFactor()
Calculates the factor to multiply font heights with to fit to the current size of the owning component.
|
void |
changeQualityOutputType()
Changes the current quality output type to the next value in the order defined by
PherogramFormats.QualityOutputType . |
ZoomableFont |
getAnnotationFont()
Returns the font used to print the base call quality scores and probability values.
|
java.awt.Color |
getBackgroundColor()
Returns the background color for displaying the central part of the pherogram (the positions that have not
been cut off).
|
ZoomableFont |
getBaseCallFont()
Returns the font used to print the characters of the base call sequence.
|
java.awt.Color |
getBaseCallLineColor()
Returns the color used to paint the vertical lines at each base call position in the background of the trace
curve output in the center area that has not been cut off by the user.
|
java.awt.Color |
getCutBackgroundColor()
Returns the background color for displaying the parts of the pherogram on the left and right end that have
been cut off by the user.
|
java.awt.Color |
getCutBaseCallLineColor()
Returns the color used to paint the vertical lines at each base call position in the background of the trace
curve output at the left and right areas that have been cut off by the user.
|
java.awt.Color |
getHeadingBackgroundColor()
Returns the background color for the heading of the pherogram (displaying the base call sequence and nucleotide
indices).
|
ZoomableFont |
getIndexFont()
Returns the font used to print the nucleotide indices.
|
java.awt.Color |
getNucleotideColor(char nucleotide)
Returns the color associated with the specified token representation.
|
PherogramComponent |
getOwner()
Returns the owning trace curve view or pherogram data area using this instance.
|
java.awt.Color |
getProbabilityColor()
Returns the font color for displaying probability values.
|
PherogramFormats.QualityOutputType |
getQualityOutputType()
Determines the way quality scores shall be displayed.
|
boolean |
isShowBaseCallLines()
Determines if base call lines (vertical lines at each base call position in the background of the trace
curve output) shall be painted.
|
boolean |
isShowProbabilityValues()
Determines whether probability values (substitution, overcall and undercall) should be displayed
in the pherogram heading.
|
double |
qualityOutputHeight()
Returns the height of the quality score output depending on the current output type for the current
zoom factor.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
setBackgroundColor(java.awt.Color backgroundColor)
Sets a new background color for displaying the central part of the pherogram (the positions that have not
been cut off).
|
void |
setBaseCallLineColor(java.awt.Color baseCallLineColor)
Sets a new color used to paint the vertical lines at each base call position in the background of the trace
curve output in the center area that has not been cut off by the user.
|
void |
setCutBackgroundColor(java.awt.Color cutBackgroundColor)
Sets a new background color for displaying the parts of the pherogram on the left and right end that have
been cut off by the user.
|
void |
setCutBaseCallLineColor(java.awt.Color cutBaseCallLineColor)
Sets a new color used to paint the vertical lines at each base call position in the background of the trace
curve output at the left and right areas that have been cut off by the user.
|
void |
setHeadingBackgroundColor(java.awt.Color headingBackgroundColor)
Sets a new background color for the heading of the pherogram (displaying the base call sequence and nucleotide
indices).
|
void |
setNucleotideColor(char nucleotide,
java.awt.Color color)
Sets a new color for a nucleotide representation in the internal color map of this instance.
|
void |
setProbabilityColor(java.awt.Color probabilityColor)
Sets a new font font color for displaying probability values.
|
void |
setQualityOutputType(PherogramFormats.QualityOutputType qualityOutputType) |
void |
setShowBaseCallLines(boolean showBaseCallLines)
Allows to define if base call lines (vertical lines at each base call position in the background of the
trace curve output) shall be painted.
|
void |
setShowProbabilityValues(boolean showProbabilityValues)
Allows to specify whether probability values (substitution, overcall and undercall) should be displayed
in the pherogram heading.
|
void |
toggleShowBaseCallLines()
Toggles whether base call lines (vertical lines at each base call position in the background of the
trace curve output) shall be painted.
|
void |
toggleShowProbabilityValues()
Toggles whether probability values (substitution, overcall and undercall) should be displayed
in the pherogram heading.
|
public static final float CUT_COLOR_FACTOR
public static final float BASE_CALL_LINE_COLOR_FACTOR
public static final double FONT_HEIGHT_FACTOR
public PherogramFormats(PherogramComponent owner)
public PherogramComponent getOwner()
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
backgroundColor
- the new background color for the center positionspublic java.awt.Color getCutBackgroundColor()
public void setCutBackgroundColor(java.awt.Color cutBackgroundColor)
backgroundColor
- the new background color for the cut off positionspublic java.awt.Color getHeadingBackgroundColor()
public void setHeadingBackgroundColor(java.awt.Color headingBackgroundColor)
headingBackgroundColor
- the new background color for the heading information areapublic java.awt.Color getBaseCallLineColor()
public void setBaseCallLineColor(java.awt.Color baseCallLineColor)
baseCallLineColor
- the new base call line color for the centerpublic java.awt.Color getCutBaseCallLineColor()
public void setCutBaseCallLineColor(java.awt.Color cutBaseCallLineColor)
baseCallLineColor
- the new base call line color for the cut off areaspublic java.awt.Color getNucleotideColor(char nucleotide)
If this instance is owned by a PherogramArea
, this method will first try to determine the color
from the associated token painter. If that produces no result, it will return a default color from its
own nucleotide color map. If that map has no entry for the specified representation as well,
getProbabilityColor()
will be returned as the default color.
nucleotide
- the token representation (nucleotide characters or the gap or unknown character are valid here)public void setNucleotideColor(char nucleotide, java.awt.Color color)
Note that that color is only used if this instance is owned by a PherogramTraceCurveView
or if the token painter associated with the owning PherogramArea
does not specify an
according color.
nucleotide
- the nucleotide (or gap, ...) representationcolor
- the color to put in the map (Specify null
here to remove the association for
nucleotide
from the map.)public boolean isShowBaseCallLines()
true
if the lines are painted, false
otherwisepublic void setShowBaseCallLines(boolean showBaseCallLines)
showBaseCallLines
- Specify true
here if lines shall be painted or false
if not.toggleShowBaseCallLines()
public void toggleShowBaseCallLines()
setShowBaseCallLines(boolean)
public ZoomableFont getBaseCallFont()
public ZoomableFont getIndexFont()
public ZoomableFont getAnnotationFont()
public PherogramFormats.QualityOutputType getQualityOutputType()
public void setQualityOutputType(PherogramFormats.QualityOutputType qualityOutputType)
public void changeQualityOutputType()
PherogramFormats.QualityOutputType
.
If the end of the enum
has been reached this method will start with the first value again.setQualityOutputType(QualityOutputType)
public double qualityOutputHeight()
public boolean isShowProbabilityValues()
true
the values shall be displayed, false
otherwisepublic void setShowProbabilityValues(boolean showProbabilityValues)
showProbabilityValues
- Specify true
here if the values shall be displayed from now on or
false
otherwise.toggleShowProbabilityValues()
public void toggleShowProbabilityValues()
setShowProbabilityValues(boolean)
public java.awt.Color getProbabilityColor()
public void setProbabilityColor(java.awt.Color probabilityColor)
probabilityColor
- the new color for probability valuespublic double calculateFontZoomFactor()
java.lang.IllegalStateException
- if the owner is neither an instance of PherogramArea
or
PherogramTraceCurveView
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)