本文整理汇总了Java中javafx.stage.Stage.isShowing方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.isShowing方法的具体用法?Java Stage.isShowing怎么用?Java Stage.isShowing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.stage.Stage
的用法示例。
在下文中一共展示了Stage.isShowing方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTitle
import javafx.stage.Stage; //导入方法依赖的package包/类
public String getTitle() {
String title = getTitle(window);
ObservableList<Stage> windows = StageHelper.getStages();
String original = title;
int index = 1;
for (Stage w : windows) {
if (w == window) {
return title;
}
if (!w.isShowing()) {
continue;
}
String wTitle = getTitle(w);
if (original.equals(wTitle)) {
title = original + "(" + index++ + ")";
}
}
return title;
}
示例2: getValidWindows
import javafx.stage.Stage; //导入方法依赖的package包/类
private Stage[] getValidWindows() {
ObservableList<Stage> stages = StageHelper.getStages();
List<Stage> valid = new ArrayList<Stage>();
for (Stage window : stages) {
if (window.isShowing()) {
valid.add(window);
}
}
return valid.toArray(new Stage[valid.size()]);
}
示例3: testGauge
import javafx.stage.Stage; //导入方法依赖的package包/类
@Test
public void testGauge() throws InterruptedException {
GridPane pane = new GridPane();
Gauge gauge = GaugeBuilder.create().minValue(0).maxValue(100)
.tickLabelDecimals(0).decimals(1).autoScale(true).animated(true)
// .backgroundPaint(Color.TRANSPARENT)
// .borderPaint(Color.LIGHTGRAY)
// .knobColor(Color.rgb(0, 90, 120))
.shadowsEnabled(true)
// .tickLabelColor(Color.rgb(0, 175, 248))
// .ledColor(Color.rgb(0, 175, 248))
.ledVisible(true).ledBlinking(true).sectionsVisible(true)
.sections(new Section(75, 100, Color.rgb(139, 195, 102, 0.5)))
.areasVisible(true)
.areas(new Section(0.00, 25, Color.rgb(234, 83, 79, 0.5)))
.majorTickMarkColor(Color.MAGENTA)
// .minorTickMarkColor(Color.rgb(0, 175, 248))
.majorTickMarkType(TickMarkType.TRAPEZOID)
.mediumTickMarkType(TickMarkType.DOT)
.minorTickMarkType(TickMarkType.LINE)
.tickLabelOrientation(TickLabelOrientation.ORTHOGONAL)
.tickMarkSections(new Section(0.25, 0.5, Color.rgb(241, 161, 71)))
.tickMarkSectionsVisible(true)
.markers(new Marker(0.5, "", Color.CYAN, MarkerType.TRIANGLE))
.markersVisible(true)
// .majorTickMarksVisible(true)
// .minorTickMarksVisible(true)
.tickLabelLocation(TickLabelLocation.INSIDE)
// .tickLabelsVisible(true)
.tickLabelSections(new Section(0.1, 0.3, Color.rgb(0, 175, 248)))
// .tickLabelSectionsVisible(true)
.title("SOC")
// .titleColor(Color.rgb(223, 223, 223))
.unit("%").lcdDesign(LcdDesign.SECTIONS).lcdVisible(true)
.lcdFont(LcdFont.STANDARD)
// .unitColor(Color.rgb(223, 223, 223))
// .valueColor(Color.rgb(223, 223, 223))
.needleSize(NeedleSize.THICK).build();
FGauge framedGauge = new FGauge(gauge, GaugeDesign.ENZO,
GaugeBackground.DARK_GRAY);
pane.add(framedGauge, 0, 0);
DoubleProperty dproperty = new SimpleDoubleProperty(85.0);
SampleApp sampleApp = new SampleApp("Gauge", pane, 67, 2, 2);
sampleApp.show();
sampleApp.waitOpen();
Stage stage = sampleApp.getStage();
framedGauge.prefWidthProperty().bind(stage.widthProperty());
framedGauge.prefHeightProperty().bind(stage.heightProperty());
gauge.valueProperty().bind(dproperty);
while (stage.isShowing()) {
Thread.sleep(15);
Platform.runLater(() -> dproperty.setValue(dproperty.getValue() - 0.1));
if (dproperty.getValue() < 45)
sampleApp.close();
}
}