本文整理了Java中javafx.scene.control.Button.fire()
方法的一些代码示例,展示了Button.fire()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.fire()
方法的具体详情如下:
包路径:javafx.scene.control.Button
类名称:Button
方法名:fire
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
private ScrollPane allGlyphs() {
List<SVGGlyph> glyphs = SVGGlyphLoader.getAllGlyphsIDs()
.stream()
.map(glyphName -> {
try {
return SVGGlyphLoader.getIcoMoonGlyph(glyphName);
} catch (Exception e) {
return null;
}
})
.collect(Collectors.toList());
glyphs.sort(Comparator.comparing(SVGGlyph::getName));
glyphs.forEach(glyph -> glyph.setSize(16));
List<Button> iconButtons = glyphs.stream().map(this::createIconButton).collect(Collectors.toList());
// important to improve the performance of animation in scroll pane so buttons are treated as images
iconButtons.forEach(button -> button.setCache(true));
Platform.runLater(()->iconButtons.get(0).fire());
FlowPane glyphLayout = new FlowPane();
glyphLayout.setHgap(10);
glyphLayout.setVgap(10);
glyphLayout.setPadding(new Insets(10));
glyphLayout.getChildren().setAll(iconButtons);
glyphLayout.setPrefSize(600, 300);
ScrollPane scrollableGlyphs = new ScrollPane(glyphLayout);
scrollableGlyphs.setFitToWidth(true);
return scrollableGlyphs;
}
代码示例来源:origin: org.copper-engine/copper-monitoring-client
@Override
public void handle(KeyEvent event) {
if (event.getCode() == KeyCode.ENTER) {
if (!startButton.isDisabled()) {
startButton.fire();
}
}
}
};
代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx
/**
* animate this wizard for testing purposes
*
* @param showTime
* @throws Exception
*/
public void animate(int showTime) throws Exception {
int pageTime = showTime / this.pages.size();
for (WizardPane page : this.pages) {
if (page instanceof JFXWizardPane) {
JFXWizardPane jfxpage = (JFXWizardPane) page;
if (jfxpage.selector != null) {
animateSelections(jfxpage.selector, pageTime);
} else {
Thread.sleep(pageTime);
}
ButtonType buttonType = ButtonType.NEXT;
if (jfxpage.getStep() == jfxpage.getSteps()) {
buttonType = ButtonType.FINISH;
}
final ButtonType buttonToClick = buttonType;
Platform.runLater(() -> jfxpage.findButton(buttonToClick).fire());
}
}
}
代码示例来源:origin: org.tentackle/tentackle-fx
@Override
public void fire() {
if (!isFocusTraversable() && !isCancelButton()) {
/*
* If the button is not focus traversable, it will not receive the focus when clicked.
* As a consequence, an opposite FxComponent will not lose its focus which in turn
* means, that the model is not updated. If the action handler of this button
* depends on it, it will not see the last user's input.
* In such cases we must perform the model update explicitly before firering the event.
*/
Node node = getScene().getFocusOwner();
if (node instanceof FxComponent) {
FxUtilities.getInstance().focusLost((FxComponent) node);
}
}
super.fire();
}
代码示例来源:origin: com.powsybl/powsybl-gse-util
downButton.fire();
ke.consume();
} else if (previousKeyCombination.match(ke)) {
upButton.fire();
ke.consume();
代码示例来源:origin: com.powsybl/powsybl-gse-util
nodeChooser.doubleClick().addListener((observable, oldValue, newValue) -> {
if (Boolean.TRUE.equals(newValue)) {
button.fire();
内容来源于网络,如有侵权,请联系作者删除!