当前位置: 首页>>代码示例>>Java>>正文


Java Gauge.calcAutoScale方法代码示例

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


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

示例1: SlimSkin

import eu.hansolo.medusa.Gauge; //导入方法依赖的package包/类
public SlimSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    minValue             = gauge.getMinValue();
    range                = gauge.getRange();
    angleStep            = ANGLE_RANGE / range;
    colorGradientEnabled = gauge.isGradientBarEnabled();
    noOfGradientStops    = gauge.getGradientBarStops().size();
    sectionsVisible      = gauge.getSectionsVisible();
    sections             = gauge.getSections();
    currentValueListener = o -> setBar(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: BarSkin

import eu.hansolo.medusa.Gauge; //导入方法依赖的package包/类
public BarSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    range                = gauge.getRange();
    angleStep            = -ANGLE_RANGE / range;
    currentValueListener = o -> redraw();
    barColorListener     = o -> {
        Color barColor = gauge.getBarColor();
        gauge.setGradientBarStops(new Stop(0.0, barColor),
                                  new Stop(0.01, barColor),
                                  new Stop(0.75, barColor.deriveColor(-10, 1, 1, 1)),
                                  new Stop(1.0, barColor.deriveColor(-20, 1, 1, 1)));
        resize();
    };
    titleListener = o -> {
        titleText.setText(gauge.getTitle());
        resizeTitleText();
    };
    unitListener = o -> {
        unitText.setText(gauge.getUnit());
        resizeUnitText();
    };

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

示例8: 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

示例9: 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

示例10: 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

示例11: IndicatorSkin

import eu.hansolo.medusa.Gauge; //导入方法依赖的package包/类
public IndicatorSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    angleRange                   = Helper.clamp(90.0, 180.0, gauge.getAngleRange());
    startAngle                   = getStartAngle();
    oldValue                     = gauge.getValue();
    minValue                     = gauge.getMinValue();
    range                        = gauge.getRange();
    angleStep                    = angleRange / range;
    colorGradientEnabled         = gauge.isGradientBarEnabled();
    noOfGradientStops            = gauge.getGradientBarStops().size();
    sectionsAlwaysVisible        = gauge.getSectionsAlwaysVisible();
    sectionsVisible              = gauge.getSectionsVisible();
    sections                     = gauge.getSections();
    formatString                 = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    locale                       = gauge.getLocale();
    barColor                     = gauge.getBarColor();
    currentValueListener         = o -> rotateNeedle(gauge.getCurrentValue());
    sectionAlwaysVisibleListener = o -> bar.setVisible(!gauge.getSectionsAlwaysVisible());

    initGraphics();
    registerListeners();

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

示例12: TileTextKpiSkin

import eu.hansolo.medusa.Gauge; //导入方法依赖的package包/类
public TileTextKpiSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    minValue             = gauge.getMinValue();
    maxValue             = gauge.getMaxValue();
    range                = gauge.getRange();
    stepSize             = PREFERRED_WIDTH / range;
    formatString         = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    locale               = gauge.getLocale();
    sections             = gauge.getSections();
    sectionsVisible      = gauge.getSectionsVisible();
    barColor             = gauge.getBarColor();
    currentValueListener = o -> setBar(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

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

示例13: FlatSkin

import eu.hansolo.medusa.Gauge; //导入方法依赖的package包/类
public FlatSkin(Gauge gauge) {
    super(gauge);
    if (gauge.isAutoScale()) gauge.calcAutoScale();
    minValue             = gauge.getMinValue();
    range                = gauge.getRange();
    angleStep            = ANGLE_RANGE / range;
    colorGradientEnabled = gauge.isGradientBarEnabled();
    noOfGradientStops    = gauge.getGradientBarStops().size();
    sectionsVisible      = gauge.getSectionsVisible();
    sections             = gauge.getSections();
    currentValueListener = o -> setBar(gauge.getCurrentValue());

    initGraphics();
    registerListeners();

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

示例14: 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

示例15: 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


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