• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Gauge类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中eu.hansolo.medusa.Gauge的典型用法代码示例。如果您正苦于以下问题:Java Gauge类的具体用法?Java Gauge怎么用?Java Gauge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Gauge类属于eu.hansolo.medusa包,在下文中一共展示了Gauge类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: start

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
@Override public void start(Stage stage) {
    StackPane pane = new StackPane(gauge);
    pane.setPadding(new Insets(20));
    pane.setBackground(new Background(new BackgroundFill(Gauge.DARK_COLOR, CornerRadii.EMPTY, Insets.EMPTY)));

    Scene scene = new Scene(pane);

    stage.setTitle("Medusa MultiGauge");
    stage.setScene(scene);
    stage.show();

    timer.start();

    // Calculate number of nodes
    calcNoOfNodes(pane);
    System.out.println(noOfNodes + " Nodes in SceneGraph");
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:18,代码来源:MultiGaugeDemo.java


示例2: InteractiveGaugeSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public InteractiveGaugeSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    startAngle        = gauge.getStartAngle();
    angleRange        = gauge.getAngleRange();
    angleStep         = gauge.getAngleStep();
    oldValue          = gauge.getValue();
    minValue          = gauge.getMinValue();
    maxValue          = gauge.getMaxValue();
    formatString      = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    locale            = gauge.getLocale();
    sections          = gauge.getSections();
    highlightSections = gauge.isHighlightSections();
    sectionsVisible   = gauge.getSectionsVisible();
    areas             = gauge.getAreas();
    highlightAreas    = gauge.isHighlightAreas();
    areasVisible      = gauge.getAreasVisible();
    tickLabelLocation = gauge.getTickLabelLocation();
    scaleDirection    = gauge.getScaleDirection();
    needleBehavior    = gauge.getNeedleBehavior();
    mouseHandler      = event -> handleMouseEvent(event);
    updateMarkers();

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:27,代码来源:InteractiveGaugeSkin.java


示例3: getVBox

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
private VBox getVBox(final String TEXT, final Color COLOR, final Gauge GAUGE) {
    Rectangle bar = new Rectangle(200, 3);
    bar.setArcWidth(6);
    bar.setArcHeight(6);
    bar.setFill(COLOR);

    Label label = new Label(TEXT);
    label.setTextFill(COLOR);
    label.setAlignment(Pos.CENTER);
    label.setPadding(new Insets(0, 0, 10, 0));

    GAUGE.setBarColor(COLOR);

    VBox vBox = new VBox(bar, label, GAUGE);
    vBox.setSpacing(3);
    vBox.setAlignment(Pos.CENTER);
    return vBox;
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:19,代码来源:ActivityDashboard.java


示例4: CustomGaugeSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public CustomGaugeSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    range              = gauge.getRange();
    stepSize           = NO_OF_LEDS / range;
    barBackgroundColor = gauge.getBarBackgroundColor();
    barColor           = gauge.getBarColor();
    sectionsVisible    = gauge.getSectionsVisible();
    sections           = gauge.getSections();
    ledSize            = PREFERRED_WIDTH * 0.5;
    ledSpacer          = PREFERRED_WIDTH * 0.05;
    ledBorder          = PREFERRED_WIDTH * 0.25;

    init();
    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:18,代码来源:CustomGaugeSkin.java


示例5: getHBox

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
private HBox getHBox(final String TEXT, final Gauge GAUGE) {
    Label label = new Label(TEXT);
    label.setPrefWidth(150);
    label.setFont(Font.font(26));
    label.setTextFill(MaterialDesign.GREY_800.get());
    label.setAlignment(Pos.CENTER_LEFT);
    label.setPadding(new Insets(0, 10, 0, 0));

    GAUGE.setBarBackgroundColor(Color.rgb(232, 231, 223));
    GAUGE.setAnimated(true);
    GAUGE.setAnimationDuration(1000);

    HBox hBox = new HBox(label, GAUGE);
    hBox.setSpacing(20);
    hBox.setAlignment(Pos.CENTER_LEFT);
    return hBox;
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:18,代码来源:PollenDashboard.java


示例6: start

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
@Override public void start(Stage stage) {
    Pane pane = new Pane(bigGauge, smallGauge);
    pane.setBackground(new Background(new BackgroundFill(Gauge.DARK_COLOR, CornerRadii.EMPTY, Insets.EMPTY)));
    bigGauge.relocate(0, 0);
    smallGauge.relocate(0, 230);

    Scene scene = new Scene(pane);

    stage.setScene(scene);
    stage.show();

    timer.start();

    // Calculate number of nodes
    calcNoOfNodes(pane);
    System.out.println(noOfNodes + " Nodes in SceneGraph");
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:18,代码来源:CombinedGauges.java


示例7: start

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
@Override public void start(Stage stage) {
    HBox pane = new HBox(gauge0, gauge1, gauge2, gauge3, gauge4, gauge5, gauge6, gauge7, gauge8, gauge9);
    pane.setBackground(new Background(new BackgroundFill(Gauge.DARK_COLOR, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setPadding(new Insets(10));

    Scene scene = new Scene(pane);

    stage.setTitle("Medusa Custom Gauge Skin");
    stage.setScene(scene);
    stage.show();

    timer.start();

    // Calculate number of nodes
    calcNoOfNodes(pane);
    System.out.println(noOfNodes + " Nodes in SceneGraph");
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:18,代码来源:CustomGaugeSkinDemo.java


示例8: createBar

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
private Gauge createBar() {
    Gauge gauge = GaugeBuilder.create()
                              .backgroundPaint(Gauge.DARK_COLOR)
                              .barBackgroundColor(Color.DARKRED)
                              .barColor(Color.RED)
                              .minValue(0)
                              .maxValue(100)
                              .sectionsVisible(true)
                              .sections(new Section(0, 70, Color.LIME),
                                        new Section(70,85, Color.YELLOW),
                                        new Section(85, 100, Color.RED))
                              .build();

    gauge.setSkin(new CustomGaugeSkin(gauge));
    return gauge;
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:17,代码来源:CustomGaugeSkinDemo.java


示例9: BulletChartSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public BulletChartSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    orientation              = gauge.getOrientation();
    barTooltip               = new Tooltip();
    thresholdTooltip         = new Tooltip();
    sectionListener          = c -> redraw();
    markerListener           = c -> redraw();
    currentValueListener     = o -> updateBar();
    paneSizeListener         = o -> handleEvents("RESIZE");

    if (Orientation.VERTICAL == orientation) {
        preferredWidth  = 64;
        preferredHeight = 400;
    } else {
        preferredWidth  = 400;
        preferredHeight = 64;
    }
    gauge.setPrefSize(preferredWidth, preferredHeight);

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:24,代码来源:BulletChartSkin.java


示例10: SimpleDigitalSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public SimpleDigitalSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    minValue             = gauge.getMinValue();
    maxValue             = gauge.getMaxValue();
    range                = gauge.getRange();
    angleStep            = ANGLE_RANGE / range;
    barColor             = gauge.getBarColor();
    valueColor           = gauge.getValueColor();
    unitColor            = gauge.getUnitColor();
    isStartFromZero      = gauge.isStartFromZero();
    sectionsVisible      = gauge.getSectionsVisible();
    sections             = gauge.getSections();
    thresholdVisible     = gauge.isThresholdVisible();
    thresholdColor       = gauge.getThresholdColor();
    decimalListener      = o -> handleEvents("DECIMALS");
    currentValueListener = o -> setBar(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

    setBar(gauge.getCurrentValue());
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:24,代码来源:SimpleDigitalSkin.java


示例11: TileSparklineSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public TileSparklineSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    low                  = gauge.getMaxValue();
    high                 = gauge.getMinValue();
    minValue             = gauge.getMinValue();
    maxValue             = gauge.getMaxValue();
    range                = gauge.getRange();
    stdDeviation         = 0;
    formatString         = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    locale               = gauge.getLocale();
    noOfDatapoints       = gauge.getAveragingPeriod();
    dataList             = new LinkedList<>();
    currentValueListener = o -> handleEvents("VALUE");
    averagingListener    = o -> handleEvents("AVERAGING_PERIOD");
    for (int i = 0; i < noOfDatapoints; i++) { dataList.add(minValue); }

    // To get smooth lines in the chart we need at least 4 values
    if (noOfDatapoints < 4) throw new IllegalArgumentException("Please increase the averaging period to a value larger than 3.");

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:24,代码来源:TileSparklineSkin.java


示例12: AmpSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public AmpSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    angleStep            = gauge.getAngleRange() / gauge.getRange();
    oldValue             = gauge.getValue();
    formatString         = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    locale               = gauge.getLocale();
    sectionListener      = c -> redraw();
    currentValueListener = o -> rotateNeedle();
    needleRotateListener = o -> handleEvents("ANGLE");
    markerListener       = c -> {
        updateMarkers();
        redraw();
    };

    updateMarkers();

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:21,代码来源:AmpSkin.java


示例13: DashboardSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public DashboardSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    range                = gauge.getRange();
    angleStep            = ANGLE_RANGE / range;
    colorGradientEnabled = gauge.isGradientBarEnabled();
    noOfGradientStops    = gauge.getGradientBarStops().size();
    sectionsVisible      = gauge.getSectionsVisible();
    sections             = gauge.getSections();
    currentValueAngle    = 0;
    formatString         = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    otherFormatString    = new StringBuilder("%.").append(Integer.toString(gauge.getTickLabelDecimals())).append("f").toString();
    locale               = gauge.getLocale();
    currentValueListener = o -> setBar(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

    setBar(gauge.getValue());
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:21,代码来源:DashboardSkin.java


示例14: ModernSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public ModernSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    angleStep            = ANGLE_RANGE / (gauge.getRange());
    mouseHandler         = event -> handleMouseEvent(event);
    buttonTooltip        = new Tooltip();
    locale               = gauge.getLocale();
    sectionsVisible      = gauge.getSectionsVisible();
    sections             = gauge.getSections();
    barColor             = gauge.getBarColor();
    thresholdColor       = gauge.getThresholdColor();
    animatedListener     = o -> handleEvents("ANIMATED");
    sectionListener      = c -> handleEvents("RESIZE");
    currentValueListener = o -> rotateNeedle(gauge.getCurrentValue());

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:19,代码来源:ModernSkin.java


示例15: TileKpiSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public TileKpiSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    angleRange           = Helper.clamp(90.0, 180.0, gauge.getAngleRange());
    oldValue             = gauge.getValue();
    minValue             = gauge.getMinValue();
    threshold            = gauge.getThreshold();
    thresholdColor       = gauge.getThresholdColor();
    range                = gauge.getRange();
    angleStep            = angleRange / range;
    formatString         = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    locale               = gauge.getLocale();
    sectionsVisible      = gauge.getSectionsVisible();
    highlightSections    = gauge.isHighlightSections();
    sections             = gauge.getSections();
    sectionMap           = new HashMap<>(sections.size());
    currentValueListener = o -> rotateNeedle(gauge.getCurrentValue());
    for(Section section : sections) { sectionMap.put(section, new Arc()); }

    initGraphics();
    registerListeners();

    rotateNeedle(gauge.getCurrentValue());
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:25,代码来源:TileKpiSkin.java


示例16: LcdSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public LcdSkin(Gauge gauge) {
    super(gauge);
    width                 = PREFERRED_WIDTH;
    height                = PREFERRED_HEIGHT;
    valueOffsetLeft       = 0.0;
    valueOffsetRight      = 0.0;
    digitalFontSizeFactor = 1.0;
    backgroundTextBuilder = new StringBuilder();
    valueFormatString     = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    otherFormatString     = new StringBuilder("%.").append(Integer.toString(gauge.getTickLabelDecimals())).append("f").toString();
    locale                = gauge.getLocale();
    sections              = gauge.getSections();
    sectionColorMap       = new HashMap<>(sections.size());
    currentValueListener  = o -> handleEvents("REDRAW");
    updateSectionColors();
    FOREGROUND_SHADOW.setOffsetX(0);
    FOREGROUND_SHADOW.setOffsetY(1);
    FOREGROUND_SHADOW.setColor(Color.rgb(0, 0, 0, 0.5));
    FOREGROUND_SHADOW.setBlurType(BlurType.TWO_PASS_BOX);
    FOREGROUND_SHADOW.setRadius(2);

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:25,代码来源:LcdSkin.java


示例17: DigitalSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public DigitalSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    minValue             = gauge.getMinValue();
    maxValue             = gauge.getMaxValue();
    range                = gauge.getRange();
    angleStep            = ANGLE_RANGE / range;
    locale               = gauge.getLocale();
    barColor             = gauge.getBarColor();
    valueColor           = gauge.getValueColor();
    titleColor           = gauge.getTitleColor();
    subTitleColor        = gauge.getSubTitleColor();
    unitColor            = gauge.getUnitColor();
    isStartFromZero      = gauge.isStartFromZero();
    sectionsVisible      = gauge.getSectionsVisible();
    sections             = gauge.getSections();
    thresholdVisible     = gauge.isThresholdVisible();
    thresholdColor       = gauge.getThresholdColor();
    currentValueListener = o -> setBar(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

    setBar(gauge.getCurrentValue());
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:26,代码来源:DigitalSkin.java


示例18: KpiSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public KpiSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    angleRange           = Helper.clamp(90.0, 180.0, gauge.getAngleRange());
    oldValue             = gauge.getValue();
    minValue             = gauge.getMinValue();
    range                = gauge.getRange();
    angleStep            = angleRange / range;
    locale               = gauge.getLocale();
    currentValueListener = o -> rotateNeedle(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

    rotateNeedle(gauge.getCurrentValue());
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:17,代码来源:KpiSkin.java


示例19: LinearSkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public LinearSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    orientation           = gauge.getOrientation();
    tickLabelFormatString = new StringBuilder("%.").append(Integer.toString(gauge.getTickLabelDecimals())).append("f").toString();
    locale                = gauge.getLocale();
    sections              = gauge.getSections();
    areas                 = gauge.getAreas();
    currentValueListener  = o -> setBar(gauge.getCurrentValue());
    paneSizeListener      = o -> handleEvents("RESIZE");

    if (Orientation.VERTICAL == orientation) {
        preferredWidth  = 140;
        preferredHeight = 350;
    } else {
        preferredWidth  = 350;
        preferredHeight = 140;
    }

    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:23,代码来源:LinearSkin.java


示例20: TinySkin

import eu.hansolo.medusa.Gauge; //导入依赖的package包/类
public TinySkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    oldValue             = gauge.getValue();
    minValue             = gauge.getMinValue();
    maxValue             = gauge.getMaxValue();
    range                = gauge.getRange();
    angleStep            = ANGLE_RANGE / range;
    colorGradientEnabled = gauge.isGradientBarEnabled();
    noOfGradientStops    = gauge.getGradientBarStops().size();
    sections             = gauge.getSections();
    formatString         = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    locale               = gauge.getLocale();
    currentValueListener = o -> rotateNeedle(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

    rotateNeedle(gauge.getCurrentValue());

    redraw();
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:23,代码来源:TinySkin.java



注:本文中的eu.hansolo.medusa.Gauge类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContainerListener类代码示例发布时间:2022-05-21
下一篇:
Java Topic类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap