Class AbstractAlignmentStyler
- java.lang.Object
- 
- org.biojava.bio.program.blast2html.AbstractAlignmentStyler
 
- 
- Direct Known Subclasses:
- SimpleAlignmentStyler
 
 public abstract class AbstractAlignmentStyler extends Object 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 thegetStylemethod.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 SummaryFields Modifier and Type Field Description protected intiNumberOfColoursThe number of unique colours.protected HashMapoColourClassMapStores mapping from a Colour to a FONT Class.protected HashMapoColourMapMap between Char and the Colour class.protected HashSetoColourSetStore the unique colours for markup.
 - 
Constructor SummaryConstructors Constructor Description AbstractAlignmentStyler()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddStyle(String poChar, String poColour)Add a colour style to this Styler.StringgetAlignmentStyles()Returns a fragment of HTML that defines the FONT styles to be used in the alignment markup.protected StringgetColourClass(String poColour)Returns the colour class for the specified colour (in hex).abstract voidgetStyle(String poFirst, String poSecond, String[] poStyleHolder)Return the styles for the two aligned characters.
 
- 
- 
- 
Field Detail- 
oColourSetprotected HashSet oColourSet Store the unique colours for markup.
 - 
oColourClassMapprotected HashMap oColourClassMap Stores mapping from a Colour to a FONT Class. For example: Key Value --- ----- #000000 C1-S 
 - 
iNumberOfColoursprotected int iNumberOfColours The number of unique colours.
 - 
oColourMapprotected HashMap oColourMap Map between Char and the Colour class. Eg. Key Value --- ----- A C1-S 
 
- 
 - 
Constructor Detail- 
AbstractAlignmentStylerpublic AbstractAlignmentStyler() 
 
- 
 - 
Method Detail- 
getAlignmentStylespublic String 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
 
 - 
getStylepublic abstract void getStyle(String poFirst, String poSecond, String[] poStyleHolder) 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 alignment
- poSecond- - the second char in the alignment
- poStyleHolder- - an array to hold the styles, [0] = first etc
 
 - 
addStylepublic void addStyle(String poChar, String poColour) 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 )
 
 - 
getColourClassprotected String getColourClass(String poColour) 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'
 
 
- 
 
-