org.peace_tools.views.overlap
Interface ClusterColorMapper

All Known Implementing Classes:
OverlapView

public interface ClusterColorMapper

A simple interface to map a clusterID to a Color object. This interface was introduced to streamline the process of creating, managing, and using colors (defined by the user) for fragments that are part of different clusters. This interface provides methods to set and get colors given a cluster ID. Currently only the OverlapView implements this interface. The OverlapPanel uses the colors while the ClusterList class changes them.


Method Summary
 java.awt.Color getColor(java.lang.Integer clusterID)
          Return the Color associated with a given cluster ID.
 void setColor(java.lang.Integer clusterID, java.awt.Color color)
          Set a color to be used for rendering fragments in the given cluster.
 

Method Detail

getColor

java.awt.Color getColor(java.lang.Integer clusterID)
Return the Color associated with a given cluster ID. This method provides the currently used Color for a given cluster.

Parameters:
clusterID - The ID of the cluster whose current color is to be returned.
Returns:
If the cluster ID is valid then this method returns a valid Color object. Otherwise it returns null.

setColor

void setColor(java.lang.Integer clusterID,
              java.awt.Color color)
Set a color to be used for rendering fragments in the given cluster. This method must be used to set the color to be used for rendering the fragments in this cluster. Note that this method merely sets the color but does not trigger a refresh or an update.

Parameters:
clusterID - The cluster ID whose color is to be set.
color - The color to be set for the given cluster ID.