Class AbstractAlignmentStyler
- Direct Known Subclasses:
SimpleAlignmentStyler
Abstract implementation of AlignmentStyler
, contains
utility methods for generating a set of HTML styles from a list of
RGB colours.
Thus getAlignmentStyles()
is implemented and all that
remains to be implemented is the getStyle
method.
Primary author - Colin Hardman (CAT) Other authors - Tim Dilks (CAT) Simon Brocklehurst (CAT) Stuart Johnston (CAT) Lawerence Bower (CAT) Derek Crockford (CAT) Neil Benn (CAT) Copyright 2001 Cambridge Antibody Technology Group plc.
This code released to the biojava project, May 2001 under the LGPL license.
- Version:
- 1.0
- Author:
- Cambridge Antibody Technology Group plc, Greg Cox
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a colour style to this Styler.Returns a fragment of HTML that defines the FONT styles to be used in the alignment markup.protected String
getColourClass
(String poColour) Returns the colour class for the specified colour (in hex).abstract void
Return the styles for the two aligned characters.
-
Field Details
-
oColourSet
Store the unique colours for markup. -
oColourClassMap
Stores mapping from a Colour to a FONT Class.
For example:
Key Value --- ----- #000000 C1-S
-
iNumberOfColours
The number of unique colours. -
oColourMap
Map between Char and the Colour class.
Eg.
Key Value --- ----- A C1-S
-
-
Constructor Details
-
AbstractAlignmentStyler
public AbstractAlignmentStyler()
-
-
Method Details
-
getAlignmentStyles
Returns a fragment of HTML that defines the FONT styles to be used in the alignment markup.
For example:
FONT.C2-S{background-color:#FFFC50;color:#000000} FONT.C4-S{background-color:#FC50FF;color:#000000} FONT.C3-S{background-color:#FF7272;color:#000000} FONT.C0-S{background-color:#50FF78;color:#000000} FONT.C1-S{background-color:#FFCA50;color:#000000} FONT.C5-S{background-color:#A5A5FF;color:#000000}
- Returns:
- String - the HTML
-
getStyle
Return the styles for the two aligned characters. (in the form of predefined font classes).
Null is acceptable value for no style.
- Parameters:
poFirst
- - the first char in the alignmentpoSecond
- - the second char in the alignmentpoStyleHolder
- - an array to hold the styles, [0] = first etc
-
addStyle
Add a colour style to this Styler.- Parameters:
poChar
- the char for which this colour applies.poColour
- the color in hex eg 'FFA2A2' for a nice red ( R = FF, G = A2 and B = A2 )
-
getColourClass
Returns the colour class for the specified colour (in hex). If one is not already defined for that colour then a new class is created and returned.
Colour specification is R G B in hex ie FF00FF is r = 255, g = 0, b = 255.
- Parameters:
poColour
- - a colour, eg 'C8FFC8'- Returns:
- String - the colour class, eg 'C1-S'
-