Class ColorGenerator
java.lang.Object
org.openjump.core.ui.color.ColorGenerator
Class to generate a given number of color steps to
cross fade from color A to color C (and optionally
pass color B)
- Version:
- $Revision: 1.19 $
- Author:
- Ole Rahn, Stefan Ostermann
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFor java2xml which needs an empty constructor.ColorGenerator(int steps, Color[] colors) this constructor is untested, yet (but there is no predictable reason, why it should not work...)ColorGenerator(int steps, Color A, Color C) ColorGenerator(int steps, Color A, Color B, Color C) ColorGenerator(int steps, List colors) this constructor is untested, yet (but there is no predictable reason, why it should not work...) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddXMLInputColor(Color color) For java2xmlprotected voidmethod to actually generate the colorsstatic ColorGeneratorgetBlueToRedColors(int steps) getColor(int nr) Returns the nr-th color, generated by this classColor[]static ColorGeneratorgetGreenToRedColors(int steps) Color[]static ColorGeneratorgetRedToGreenColors(int steps) static ColorGeneratorgetReverseTrafficLightColors(int steps) intgetSteps()intFor java2xmlstatic ColorGeneratorgetTrafficLightColors(int steps) For java2xmlprotected voidSets the nr-th color, originally generated by this classvoidsetSteps(int steps) voidsetStepsXML(int steps) For java2xmltoString()
-
Field Details
-
inputColors
-
colorArray
-
steps
protected int steps
-
-
Constructor Details
-
ColorGenerator
public ColorGenerator()For java2xml which needs an empty constructor. -
ColorGenerator
this constructor is untested, yet (but there is no predictable reason, why it should not work...)- Parameters:
steps- number of colors wantedcolors- List containing java.awt.Color objects
-
ColorGenerator
this constructor is untested, yet (but there is no predictable reason, why it should not work...)- Parameters:
steps- number of colors wantedcolors- array containing java.awt.Color objects
-
ColorGenerator
-
ColorGenerator
-
-
Method Details
-
getTrafficLightColors
-
getGreenToRedColors
-
getRedToGreenColors
-
getReverseTrafficLightColors
-
getBlueToRedColors
-
getColorArray
- Returns:
- All generated colors in an object-array
-
getSteps
public int getSteps()- Returns:
- the given number of color steps
-
setSteps
public void setSteps(int steps) - Parameters:
steps- the number of color steps
-
getColor
Returns the nr-th color, generated by this class- Parameters:
nr- zero-based index of the color wanted- Returns:
- Color or null if the given index is out-of-bounds
-
setColor
Sets the nr-th color, originally generated by this class- Parameters:
nr- zero-based index of the color wanted
-
fillColorArray
protected void fillColorArray()method to actually generate the colors -
toString
-
getInputColorsAsArray
-
getXMLInputColors
-
addXMLInputColor
-
getStepsXML
public int getStepsXML()For java2xml- Returns:
- the number of steps to cross fade from color A to color C
-
setStepsXML
public void setStepsXML(int steps) For java2xml- Parameters:
steps- number of steps
-