|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.afcs.warts.util.GuiUtils
The GuiUtils class defines utility methods used by GUI classes.
LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.
| Method Summary | |
static java.awt.Color |
averageColors(java.awt.Color colorOne,
java.awt.Color colorTwo)
Returns a color halfway in between the two specified colors, created by averaging the red, green, and blue components of the inputs. |
static java.lang.String |
colorToHex(java.awt.Color color)
Returns the hexidecimal representation of the specified color (e.g., ff0000), which is suitable for use in HTML. |
static java.lang.String |
generateColorKeyLabelHtml(java.awt.Color[] colors,
java.lang.String[] text)
Given two arrays of colors and labels, respectively, this method generates some HTML that can be placed on a label to generate a color-key. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.lang.String colorToHex(java.awt.Color color)
color - The color to obtain a hex representation of.
java.lang.NullPointerException - If color is null.
public static java.awt.Color averageColors(java.awt.Color colorOne,
java.awt.Color colorTwo)
colorOne - The first color.colorTwo - The second color.
java.lang.NullPointerException - If either argument is null.
public static java.lang.String generateColorKeyLabelHtml(java.awt.Color[] colors,
java.lang.String[] text)
colors - The array of colors.text - The array of labels.
java.lang.NullPointerException - If either argument is null.
java.lang.IllegalArgumentException - If the arrays are different lengths.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||