Package hudson.model
Enum BallColor
- java.lang.Object
-
- java.lang.Enum<BallColor>
-
- hudson.model.BallColor
-
- All Implemented Interfaces:
StatusIcon
,Serializable
,Comparable<BallColor>
public enum BallColor extends Enum<BallColor> implements StatusIcon
Ball color used for the build status indication.There are four basic colors, plus their animated "bouncy" versions.
Enum.ordinal()
is the sort order.Note that multiple
BallColor
instances may map to the same RGB color, to avoid the rainbow effect.Historical Note
Hudson started to overload colors — for example grey could mean either disabled, aborted, or not yet built. As a result,
BallColor
becomes more like a "logical" color, in the sense that differentBallColor
values can map to the same RGB color. See JENKINS-956.- Author:
- Kohsuke Kawaguchi
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABORTED
ABORTED_ANIME
BLUE
BLUE_ANIME
DISABLED
DISABLED_ANIME
GREY
GREY_ANIME
NOTBUILT
NOTBUILT_ANIME
RED
RED_ANIME
YELLOW
YELLOW_ANIME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BallColor
anime()
Gets the animated version.Color
getBaseColor()
Gets the RGB color of this color.String
getDescription()
Gets the human-readable description used as img/@alt.String
getHtmlBaseColor()
Returns thegetBaseColor()
in the "#RRGGBB" format.String
getIconClassName()
Get the status ball icon class spec name.String
getIconName()
Get the status ball icon name.String
getImage()
String like "red.png" that represents the file name of the image.String
getImageOf(String size)
Returns the URL to the image.boolean
isAnimated()
True if the icon is animated.BallColor
noAnime()
Gets the unanimated version.String
toString()
Also used as a final name.static BallColor
valueOf(String name)
Returns the enum constant of this type with the specified name.static BallColor[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RED
public static final BallColor RED
-
RED_ANIME
public static final BallColor RED_ANIME
-
YELLOW
public static final BallColor YELLOW
-
YELLOW_ANIME
public static final BallColor YELLOW_ANIME
-
BLUE
public static final BallColor BLUE
-
BLUE_ANIME
public static final BallColor BLUE_ANIME
-
GREY
public static final BallColor GREY
-
GREY_ANIME
public static final BallColor GREY_ANIME
-
DISABLED
public static final BallColor DISABLED
-
DISABLED_ANIME
public static final BallColor DISABLED_ANIME
-
ABORTED
public static final BallColor ABORTED
-
ABORTED_ANIME
public static final BallColor ABORTED_ANIME
-
NOTBUILT
public static final BallColor NOTBUILT
-
NOTBUILT_ANIME
public static final BallColor NOTBUILT_ANIME
-
-
Method Detail
-
values
public static BallColor[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BallColor c : BallColor.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BallColor valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getIconName
public String getIconName()
Get the status ball icon name.- Returns:
- The status ball icon name.
-
getIconClassName
public String getIconClassName()
Get the status ball icon class spec name.- Returns:
- The status ball icon class spec name.
-
getImage
public String getImage()
String like "red.png" that represents the file name of the image.
-
getImageOf
public String getImageOf(String size)
Description copied from interface:StatusIcon
Returns the URL to the image.- Specified by:
getImageOf
in interfaceStatusIcon
- Parameters:
size
- The size specified. Must support "16x16", "24x24", and "32x32" at least. For forward compatibility, if you receive a size that's not supported, consider returning your biggest icon (and let the browser rescale.)- Returns:
- The URL is rendered as is in the img @src attribute, so it must contain the context path, etc.
-
getDescription
public String getDescription()
Gets the human-readable description used as img/@alt.- Specified by:
getDescription
in interfaceStatusIcon
-
getBaseColor
public Color getBaseColor()
Gets the RGB color of this color. Animation effect is not reflected to this value.
-
getHtmlBaseColor
public String getHtmlBaseColor()
Returns thegetBaseColor()
in the "#RRGGBB" format.
-
toString
public String toString()
Also used as a final name.
-
anime
public BallColor anime()
Gets the animated version.
-
noAnime
public BallColor noAnime()
Gets the unanimated version.
-
isAnimated
public boolean isAnimated()
True if the icon is animated.
-
-