Class ColorPerLabel

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, ColorProviderHandler, Serializable

    public class ColorPerLabel
    extends AbstractMetaDataColor<XYSequencePoint>
    implements ColorProviderHandler
    Maintains an internal mapping between labels obtained from the meta-data (using the specified key) and colors obtained from the color provider.
    Makes use of color providers that implement the adams.gui.visualization.core.ColorProviderWithNameSupport interface, supplying it with the label obtained from the meta-data.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -color-provider <adams.gui.visualization.core.ColorProvider> (property: colorProvider)
        The color provider to use.
        default: adams.gui.visualization.core.DefaultColorProvider
     
    -meta-data-key <java.lang.String> (property: metaDataKey)
        The key in the meta-data to obtain the label from.
        default: 
     
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ColorProvider

        protected ColorProvider m_ColorProvider
        the color provider to use.
      • m_MetaDataKey

        protected String m_MetaDataKey
        the meta-data key to use for obtaining the label.
      • m_ColorMap

        protected Map<String,​Color> m_ColorMap
        the mapping between labels and colors.
    • Constructor Detail

      • ColorPerLabel

        public ColorPerLabel()
    • Method Detail

      • colorProviderTipText

        public String colorProviderTipText()
        Returns the tip text for this property.
        Specified by:
        colorProviderTipText in interface ColorProviderHandler
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMetaDataKey

        public void setMetaDataKey​(String value)
        Sets the key in the meta-data to obtain the label from.
        Parameters:
        value - the key
      • getMetaDataKey

        public String getMetaDataKey()
        Returns the key in the meta-data to obtain the label from.
        Returns:
        the key
      • metaDataKeyTipText

        public String metaDataKeyTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getNextColor

        protected Color getNextColor​(String label)
        Returns the next color for the label.
        Parameters:
        label - the label to get the next color for
        Returns:
        the color
      • determineLabel

        protected String determineLabel​(XYSequencePoint point)
        Determines the label for the point.
        Parameters:
        point - the point to get the label for
        Returns:
        the label, null if not available