*
* @return DOCUMENT ME!
*/
+ @Override
public Color makeColour(float c)
{
return new Color(0, (float) (1.0 - c), c);
alignmentChanged(alignment, hiddenReps);
}
+ @Override
public void alignmentChanged(AnnotatedCollectionI alignment,
Map<SequenceI, SequenceCollectionI> hiddenReps)
{
* @param c
* @return the colour for the given character
*/
- public Color findColour(char c);
+ Color findColour(char c);
/**
*
* @return context dependent colour for the given symbol at the position in
* the given sequence
*/
- public Color findColour(char c, int j, SequenceI seq);
+ Color findColour(char c, int j, SequenceI seq);
/**
* assign the given consensus profile for the colourscheme
*/
- public void setConsensus(ProfilesI hconsensus);
+ void setConsensus(ProfilesI hconsensus);
/**
* assign the given conservation to the colourscheme
*
* @param c
*/
- public void setConservation(jalview.analysis.Conservation c);
+ void setConservation(jalview.analysis.Conservation c);
/**
* enable or disable conservation shading for this colourscheme
*
* @param conservationApplied
*/
- public void setConservationApplied(boolean conservationApplied);
+ void setConservationApplied(boolean conservationApplied);
/**
*
* @return true if conservation shading is enabled for this colourscheme
*/
- public boolean conservationApplied();
+ boolean conservationApplied();
/**
* set scale factor for bleaching of colour in unconserved regions
*
* @param i
*/
- public void setConservationInc(int i);
+ void setConservationInc(int i);
/**
*
* @return scale factor for bleaching colour in unconserved regions
*/
- public int getConservationInc();
+ int getConservationInc();
/**
*
* @return percentage identity threshold for applying colourscheme
*/
- public int getThreshold();
+ int getThreshold();
/**
* set percentage identity threshold and type of %age identity calculation for
* @param ignoreGaps
* when true, calculate PID without including gapped positions
*/
- public void setThreshold(int ct, boolean ignoreGaps);
+ void setThreshold(int ct, boolean ignoreGaps);
/**
* recalculate dependent data using the given sequence collection, taking
* @param alignment
* @param hiddenReps
*/
- public void alignmentChanged(AnnotatedCollectionI alignment,
+ void alignmentChanged(AnnotatedCollectionI alignment,
Map<SequenceI, SequenceCollectionI> hiddenReps);
/**
* @param hiddenRepSequences
* @return copy of current scheme with any inherited settings transfered
*/
- public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
-
}
try
{
// fix the launchApp user defined coloursheme transfer bug
- jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(
- "white");
+ UserColourScheme ucs = new UserColourScheme("white");
ucs.parseAppletParameter(name);
} catch (Exception e)
}
}
}
- return getColour(alignment, getColourIndexFromName(name));
+ return getColour(alignment, colindex);
}
/**
return cs;
}
+ /**
+ * Returns the Color constant for a given colour name e.g. "pink", or null if
+ * the name is not recognised
+ *
+ * @param name
+ * @return
+ */
public static Color getAWTColorFromName(String name)
{
+ if (name == null)
+ {
+ return null;
+ }
Color col = null;
name = name.toLowerCase();
- if (name.equals("black"))
+
+ // or make a static map; or use reflection on the field name
+ switch (name)
{
+ case "black":
col = Color.black;
- }
- else if (name.equals("blue"))
- {
+ break;
+ case "blue":
col = Color.blue;
- }
- else if (name.equals("cyan"))
- {
+ break;
+ case "cyan":
col = Color.cyan;
- }
- else if (name.equals("darkGray"))
- {
+ break;
+ case "darkGray":
col = Color.darkGray;
- }
- else if (name.equals("gray"))
- {
+ break;
+ case "gray":
col = Color.gray;
- }
- else if (name.equals("green"))
- {
+ break;
+ case "green":
col = Color.green;
- }
- else if (name.equals("lightGray"))
- {
+ break;
+ case "lightGray":
col = Color.lightGray;
- }
- else if (name.equals("magenta"))
- {
+ break;
+ case "magenta":
col = Color.magenta;
- }
- else if (name.equals("orange"))
- {
+ break;
+ case "orange":
col = Color.orange;
- }
- else if (name.equals("pink"))
- {
+ break;
+ case "pink":
col = Color.pink;
- }
- else if (name.equals("red"))
- {
+ break;
+ case "red":
col = Color.red;
- }
- else if (name.equals("white"))
- {
+ break;
+ case "white":
col = Color.white;
- }
- else if (name.equals("yellow"))
- {
+ break;
+ case "yellow":
col = Color.yellow;
+ break;
}
return col;
*
* @return DOCUMENT ME!
*/
+ @Override
public Color findColour(char c)
{
// System.out.println("called"); log.debug
ResidueProperties.helixmin, ResidueProperties.helixmax);
}
+ @Override
public Color makeColour(float c)
{
return new Color(c, (float) 1.0 - c, c);
*
* @return DOCUMENT ME!
*/
+ @Override
public Color makeColour(float c)
{
return new Color(c, (float) 0.0, (float) 1.0 - c);
* @return Color from purinepyrimidineIndex in
* jalview.schemes.ResidueProperties
*/
+ @Override
public Color findColour(char c)
{
return colors[ResidueProperties.purinepyrimidineIndex[c]];
super();
}
- /**
- * DOCUMENT ME!
- *
- * @param n
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
@Override
public Color findColour(char c)
{
- // System.out.println("called"); log.debug
+ // FIXME this is just a copy of NucleotideColourScheme
return colors[ResidueProperties.nucleotideIndex[c]];
}
- /**
- * DOCUMENT ME!
- *
- * @param n
- * DOCUMENT ME!
- * @param j
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
@Override
public Color findColour(char c, int j, SequenceI seq)
{
+ // FIXME this is just a copy of NucleotideColourScheme
Color currentColour;
if ((threshold == 0) || aboveThreshold(c, j))
{
import java.util.Map;
/**
- * DOCUMENT ME!
- *
- * @author $author$
- * @version $Revision$
+ * Base class for residue-based colour schemes
*/
public class ResidueColourScheme implements ColourSchemeI
{
*
* @return DOCUMENT ME!
*/
+ @Override
public Color makeColour(float c)
{
return new Color(c, c, (float) 1.0 - c);
*
* @return DOCUMENT ME!
*/
+ @Override
public Color makeColour(float c)
{
return new Color(c, 1 - c, 1 - c);