本文整理汇总了Java中hudson.model.BallColor类的典型用法代码示例。如果您正苦于以下问题:Java BallColor类的具体用法?Java BallColor怎么用?Java BallColor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BallColor类属于hudson.model包,在下文中一共展示了BallColor类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getImage
import hudson.model.BallColor; //导入依赖的package包/类
/**
* TO DO
* @param color
* @return
*/
public StatusImage getImage(BallColor color) {
StatusImage[] images = styles.get("default");
if (color.isAnimated()) {
return images[3];
}
switch (color) {
case RED:
return images[0];
case YELLOW:
return images[1];
case BLUE:
return images[2];
case ABORTED:
return images[4];
default:
return images[5];
}
}
开发者ID:SxMShaDoW,项目名称:embeddable-badges-plugin,代码行数:26,代码来源:ImageResolver.java
示例2: calculateBallColor
import hudson.model.BallColor; //导入依赖的package包/类
/**
* Calculates the color of the status ball for the owner based on its descendants.
* <br>
* Kanged from Branch API (original author Stephen Connolly).
*
* @return the color of the status ball for the owner.
*/
@Nonnull
private BallColor calculateBallColor() {
if (owner instanceof TemplateDrivenMultiBranchProject
&& ((TemplateDrivenMultiBranchProject) owner).isDisabled()) {
return BallColor.DISABLED;
}
BallColor c = BallColor.DISABLED;
boolean animated = false;
for (Job job : owner.getAllJobs()) {
BallColor d = job.getIconColor();
animated |= d.isAnimated();
d = d.noAnime();
if (d.compareTo(c) < 0) {
c = d;
}
}
if (animated) {
c = c.anime();
}
return c;
}
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:33,代码来源:BallColorFolderIcon.java
示例3: getImageOf
import hudson.model.BallColor; //导入依赖的package包/类
/**
* Delegates the image to the {@link #owner}'s {@link BallColor}.
* <br>
* {@inheritDoc}
*/
@Override
public String getImageOf(String size) {
if (owner == null) {
return BallColor.GREY.getImageOf(size);
}
return calculateBallColor().getImageOf(size);
}
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:14,代码来源:SelectJobsBallColorFolderIcon.java
示例4: getDescription
import hudson.model.BallColor; //导入依赖的package包/类
/**
* Delegates the description to the {@link #owner}'s {@link BallColor}.
* <br>
* {@inheritDoc}
*/
@Override
public String getDescription() {
if (owner == null) {
return BallColor.GREY.getDescription();
}
return calculateBallColor().getDescription();
}
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:14,代码来源:SelectJobsBallColorFolderIcon.java
示例5: calculateBallColor
import hudson.model.BallColor; //导入依赖的package包/类
/**
* Calculates the color of the status ball for the owner based on selected descendants.
* <br>
* Logic kanged from Branch API (original author Stephen Connolly).
*
* @return the color of the status ball for the owner.
*/
@Nonnull
private BallColor calculateBallColor() {
if (owner instanceof TemplateDrivenMultiBranchProject
&& ((TemplateDrivenMultiBranchProject) owner).isDisabled()) {
return BallColor.DISABLED;
}
BallColor c = BallColor.DISABLED;
boolean animated = false;
StringTokenizer tokens = new StringTokenizer(Util.fixNull(jobs), ",");
while (tokens.hasMoreTokens()) {
String jobName = tokens.nextToken().trim();
TopLevelItem item = owner.getItem(jobName);
if (item != null && item instanceof Job) {
BallColor d = ((Job) item).getIconColor();
animated |= d.isAnimated();
d = d.noAnime();
if (d.compareTo(c) < 0) {
c = d;
}
}
}
if (animated) {
c = c.anime();
}
return c;
}
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:38,代码来源:SelectJobsBallColorFolderIcon.java
示例6: perform
import hudson.model.BallColor; //导入依赖的package包/类
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
// Allowable values from build results:
//
// RED - Bad Build
// RED_ANIME
// YELLOW - Unstable Build
// YELLOW_ANIME
// BLUE - Good Build
// BLUE_ANIME
// GREY
// GREY_ANIME
// DISABLED
// DISABLED_ANIME
// ABORTED
// ABORTED_ANIME
// NOTBUILT
// NOTBUILT_ANIME
BallColor ballcolor = build.getResult().color;
for(String id : this.lightId) {
Light light = this.lightController.getLightForId(id);
switch (ballcolor) {
case RED:
this.lightController.setColor(light, "Bad Build", ConfigColorToHue(this.badBuild));
break;
case YELLOW:
this.lightController.setColor(light, "Unstable Build", ConfigColorToHue(this.unstableBuild));
break;
case BLUE:
this.lightController.setColor(light, "Good Build", ConfigColorToHue(this.goodBuild));
break;
}
}
return true;
}
开发者ID:MMore,项目名称:hue-light-plugin,代码行数:40,代码来源:LightNotifier.java
示例7: getBuildImage
import hudson.model.BallColor; //导入依赖的package包/类
public StatusImage getBuildImage( BallColor ballColor, String style )
throws IOException, FontFormatException
{
String subject = "build";
String status = "unknown";
String color;
if ( ballColor.isAnimated() )
{
status = "running";
}
switch ( ballColor )
{
case RED:
case ABORTED:
status = "failing";
// fall through
case RED_ANIME:
case ABORTED_ANIME:
color = "red";
break;
case YELLOW:
status = "unstable";
// fall through
case YELLOW_ANIME:
color = "yellow";
break;
case BLUE:
status = "passing";
// fall through
case BLUE_ANIME:
color = "brightgreen";
break;
case DISABLED:
case DISABLED_ANIME:
case GREY:
case GREY_ANIME:
case NOTBUILT:
case NOTBUILT_ANIME:
default:
color = "lightgrey";
break;
}
return new StatusImage( subject, status, color, style );
}
开发者ID:yannickcr,项目名称:jenkins-status-badges-plugin,代码行数:47,代码来源:ImageResolver.java
示例8: getBuildImage
import hudson.model.BallColor; //导入依赖的package包/类
public StatusImage getBuildImage(BallColor ballColor, String style) throws IOException, FontFormatException {
return iconResolver.getBuildImage(ballColor, style);
}
开发者ID:yannickcr,项目名称:jenkins-status-badges-plugin,代码行数:4,代码来源:BuildActionFactory.java
示例9: getBuildImage
import hudson.model.BallColor; //导入依赖的package包/类
public StatusImage getBuildImage( BallColor color, String style )
throws IOException, FontFormatException
{
return iconResolver.getBuildImage( color, style );
}
开发者ID:yannickcr,项目名称:jenkins-status-badges-plugin,代码行数:6,代码来源:StatusActionFactory.java
示例10: getIconColor
import hudson.model.BallColor; //导入依赖的package包/类
@Override
public BallColor getIconColor() {
return !isBuilding() ? getResult().color : BallColor.YELLOW_ANIME;
}
开发者ID:groupon,项目名称:DotCi,代码行数:5,代码来源:DbBackedBuild.java
示例11: getImage
import hudson.model.BallColor; //导入依赖的package包/类
/**
* TO DO
* @param color
* @return
*/
public StatusImage getImage(BallColor color) {
return iconResolver.getImage(color);
}
开发者ID:SxMShaDoW,项目名称:embeddable-badges-plugin,代码行数:9,代码来源:BadgeActionFactory.java
注:本文中的hudson.model.BallColor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论