本文整理汇总了Java中eu.hansolo.medusa.Gauge类的典型用法代码示例。如果您正苦于以下问题:Java Gauge类的具体用法?Java Gauge怎么用?Java Gauge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gauge类属于eu.hansolo.medusa包,在下文中一共展示了Gauge类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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");
}
示例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");
}
示例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;
}
示例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();
}
示例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());
}
示例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();
}
示例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();
}
示例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());
}
示例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();
}
示例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());
}