001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021
022
023package org.biojava.bio.gui;
024
025import java.awt.Paint;
026
027import org.biojava.bio.symbol.IllegalSymbolException;
028import org.biojava.bio.symbol.Symbol;
029
030/**
031 * The interface for things that say how to paint a symbol.
032 * <p>
033 * Given a symbol, this allows you to get the color to outline or fill the
034 * glyphs for rendering the symbol. This may be something as simple as colouring
035 * dots on a scatter-plot, or labeling a key, or it may be as complicated as
036 * sequence logos.
037 *
038 * @author Matthew Pocock
039 */
040public interface SymbolStyle {
041  /**
042   * Return the outline paint for a symbol.
043   *
044   * @param s the symbol to outline
045   * @return the Paint to use
046   * @throws IllegalSymbolException if this SymbolStyle can not handle the
047   *         symbol
048   */
049  Paint outlinePaint(Symbol s) throws IllegalSymbolException;
050
051  /**
052   * Return the fill paint for a symbol.
053   *
054   * @param s the symbol to fill
055   * @return the Paint to use
056   * @throws IllegalSymbolException if this SymbolStyle can not handle the
057   *         symbol
058   */
059  Paint fillPaint(Symbol s) throws IllegalSymbolException;
060}