public class SimpleAlignmentStyler extends AbstractAlignmentStyler
SHOW_ALL - returns the default style for all given residues.
SHOW_SAME - only returns a markup style if the styles for both
characters are the same.
SHOW_DIFF - only returns a markup style if the styles for both
are different.
Styles can be easily defined in two ways.
1. Add each style by calling addStyle( poChar, poColour )
For example,
String oRed = "FFA2A2";
oStyler.addStyle( "-", oRed );
oStyler.addStyle( "N", oRed );
oStyler.addStyle( "A", oRed );
oStyler.addStyle( "T", oRed );
oStyler.addStyle( "C", oRed );
oStyler.addStyle( "G", oRed );
2. Alternatively the styles could be specified in a java properties file
and loaded by calling readColourMapFromProperties( poFilename )
,
or readColourMap()
and setting the system property 'colourMap'
to the correct filename.
This file should be in java properties format, mapping
characters to colours, specified in HEX RGB.
For example:
# set everything red - = FFA2A2 N = FFA2A2 A = FFA2A2 T = FFA2A2 C = FFA2A2 G = FFA2A2Note this is simply character based, so if you want to colour gaps then you need to specify a colour for the gap character.
If no colour is specified for a character then it is uncoloured. 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.
Modifier and Type | Field and Description |
---|---|
static int |
SHOW_ALL
Return default styles
|
static int |
SHOW_DIFF
As NORMAL except only return if the two colour classes for
query and subject are the different
|
static int |
SHOW_SAME
Only return if the two colour classes for
query and subject are the same
|
iNumberOfColours, oColourClassMap, oColourMap, oColourSet
Constructor and Description |
---|
SimpleAlignmentStyler(int piStyle)
Creates a new
SimpleAlignmentStyler instance. |
Modifier and Type | Method and Description |
---|---|
void |
getStyle(String poFirst,
String poSecond,
String[] poStyleHolder)
Returns the styles for the two aligned characters in the form
of predefined font classes.
|
protected void |
readColourMap()
Read the the properties file that specifies the character/colour mapping.
|
protected void |
readColourMapFromProperties(String poFileName)
Setup styles from java property file.
|
addStyle, getAlignmentStyles, getColourClass
public static int SHOW_ALL
public static int SHOW_SAME
public static int SHOW_DIFF
public SimpleAlignmentStyler(int piStyle)
SimpleAlignmentStyler
instance.The int flag should be one of SimpleAlignmentStyler.SHOW_ALL, SimpleAlignmentStyler.SHOW_SAME or SimpleAlignmentStyler.SHOW_DIFF.
piStyle
- (one of SimpleAlignmentStyler.SHOW_SAME or SimpleAlignmentStyler.SHOW_DIFF).IllegalArgumentException
- - if style not one of allowed valuesprotected void readColourMapFromProperties(String poFileName)
poFileName
- - the file name of the property file.protected void readColourMap()
public void getStyle(String poFirst, String poSecond, String[] poStyleHolder)
Null is acceptable value for no style.
getStyle
in class AbstractAlignmentStyler
poFirst
- - the first char in the alignmentpoSecond
- - the second char in the alignmentpoStyleHolder
- - an array to hold the styles, [0] = first etcCopyright © 2014 BioJava. All rights reserved.