be.ac.ulg.montefiore.run.totem.visualtopo.graph
Interface ColorLegend

All Known Implementing Classes:
DefaultLinkLoadLegend, UpDownLinkLegend, UpDownNodeLegend

public interface ColorLegend

A ColorLegend is a set of colors associated with names. The ColorLegend associates colors with floats.

Creation date: 15 mars 2006

Author:
Ga�l Monfort (monfort@run.montefiore.ulg.ac.be)
See Also:
LinkColorShower

Method Summary
 java.awt.Color getColor(float value)
          Returns the color for the given float value.
 java.awt.Color getColor(int index)
          Returns the color at specified index.
 java.lang.String getName(int index)
          Returns the legend associated with the color at specified index.
 int getNbColors()
          Returns the number of colors.
 void setColor(int index, java.awt.Color color)
          Sets the color color at index index
 void setName(int index, java.lang.String name)
          Sets the name of the color at index index
 

Method Detail

getColor

java.awt.Color getColor(float value)
Returns the color for the given float value.

Parameters:
value -
Returns:

getColor

java.awt.Color getColor(int index)
Returns the color at specified index.

Parameters:
index -
Returns:

getNbColors

int getNbColors()
Returns the number of colors.

Returns:

getName

java.lang.String getName(int index)
Returns the legend associated with the color at specified index. The name of the color should reflect its use (ex: "10-20%")

Parameters:
index -
Returns:

setColor

void setColor(int index,
              java.awt.Color color)
Sets the color color at index index

Parameters:
index -
color -

setName

void setName(int index,
             java.lang.String name)
Sets the name of the color at index index

Parameters:
index -
name -


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.