de.unihalle.informatik.MiToBo.visualization.drawing
Class DynamicColorLUT

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.visualization.drawing.DynamicColorLUT

@ALDMetaInfo(export=ALLOWED)
public class DynamicColorLUT
extends Object

A color lookup table that generates colors dynamically and randomly for indices that do not exist.

Author:
Oliver Gress

Constructor Summary
DynamicColorLUT()
          Constructor with a (seeded) random generator and channel offset = 20.
DynamicColorLUT(Random rand)
          Constructor for a specific random generator and channel offset = 20..
DynamicColorLUT(Random rand, int channeloffset)
          Constructor for a specific random generator and a given channel offset
 
Method Summary
 int getColor(int key)
          Get the color for a given key.
 void setColor(int key, int color)
          Set the color for given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicColorLUT

public DynamicColorLUT()
Constructor with a (seeded) random generator and channel offset = 20.


DynamicColorLUT

public DynamicColorLUT(Random rand)
Constructor for a specific random generator and channel offset = 20..


DynamicColorLUT

public DynamicColorLUT(Random rand,
                       int channeloffset)
Constructor for a specific random generator and a given channel offset

Parameters:
rand - random generator
channeloffset - the minimum value of R, G and B
Method Detail

setColor

public void setColor(int key,
                     int color)
Set the color for given key.


getColor

public int getColor(int key)
Get the color for a given key. Generates a random color if key is not present.

Parameters:
key - lookup table key (or index)
Returns:
color coded into an integer (lowest byte: blue, second-lowest byte: green, third-lowest byte: red)


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.