首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JavaFX Medusa仪表显示threshold TileKpiSkin

JavaFX Medusa仪表显示threshold TileKpiSkin
EN

Stack Overflow用户
提问于 2019-02-18 17:45:05
回答 1查看 292关注 0票数 1

我正在尝试使用Medusa JavaFX库中的这个Gauge

然而,当我尝试构建它时,我得到了这样的结果:

正如您所看到的,仪表没有显示阈值。为什么会这样呢?

这是我用来创建仪表的代码:

代码语言:javascript
复制
public static Gauge e(String name, int value, int maxValue ) {
    Gauge gauge = new Gauge();
    //gauge.setSectionIconsVisible(false);
    gauge.setPrefSize(300, 300);
    gauge.setSkin(new TileKpiSkin(gauge));
    gauge.setMaxValue(100);
    gauge.setThreshold(60);
    gauge.setTitle("this is it");
    gauge.setValue(25);
    gauge.setValueColor(Color.WHITE);  
    gauge.setTitleColor(Color.WHITE); 
    gauge.setThresholdVisible(true);
    gauge.setThresholdColor(Color.RED);
    //gauge.setSectionIconsVisible(false);
    //gauge.setSectionsVisible(false);
    return gauge;

}

任何帮助都是很棒的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-02-19 04:29:25

您应该查看您正在使用的皮肤的源代码,文本设置为透明,这就是为什么您在矩形中看不到任何东西的原因:

代码语言:javascript
复制
thresholdRect = new Rectangle();

    thresholdRect.setFill(sectionsVisible ? GRAY : gauge.getThresholdColor());

    enableNode(thresholdRect, gauge.isThresholdVisible());



    thresholdText = new Text(String.format(locale, "%." + gauge.getTickLabelDecimals() + "f", gauge.getThreshold()));

    thresholdText.setFill(sectionsVisible ? Color.TRANSPARENT : gauge.getBackgroundPaint());

    enableNode(thresholdText, gauge.isThresholdVisible());
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54744349

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档