本文整理了Java中javafx.event.ActionEvent
类的一些代码示例,展示了ActionEvent
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActionEvent
类的具体详情如下:
包路径:javafx.event.ActionEvent
类名称:ActionEvent
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
protected void handleControlPropertyChanged(String p) {
if ("DEFAULT_COLOR".equals(p)) {
((JFXTextField) getEditor()).setFocusColor(jfxTimePicker.getDefaultColor());
} else if ("CONVERTER".equals(p)) {
updateDisplayNode();
} else if ("EDITOR".equals(p)) {
getEditableInputNode();
} else if ("SHOWING".equals(p)) {
if (jfxTimePicker.isShowing()) {
show();
} else {
hide();
}
} else if ("VALUE".equals(p)) {
updateDisplayNode();
jfxTimePicker.fireEvent(new ActionEvent());
} else {
super.handleControlPropertyChanged(p);
}
}
代码示例来源:origin: speedment/speedment
public static EventHandler<ActionEvent> newCloseHandler() {
return event -> {
final Node source = (Node) event.getSource();
final Stage stage = (Stage) source.getScene().getWindow();
stage.close();
};
}
代码示例来源:origin: eu.binjr/binjr-adapter-rrd4j
File selectedFile = displayFileChooser((Node) event.getSource());
if (selectedFile != null) {
pathsField.setText(selectedFile.getPath());
} catch (CannotInitializeDataAdapterException e) {
Dialogs.notifyError("Error initializing adapter to source", e, Pos.CENTER, pathsField);
ae.consume();
} catch (DataAdapterException e) {
Dialogs.notifyError("Error with the adapter to source", e, Pos.CENTER, pathsField);
ae.consume();
} catch (Throwable e) {
Dialogs.notifyError("Unexpected error while retrieving data adapter", e, Pos.CENTER, pathsField);
ae.consume();
代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx
@Override
public void handle(final ActionEvent actionEvent) {
linker.browse(help);
actionEvent.consume();
}
});
代码示例来源:origin: ssaring/sportstracker
@Override
protected void addCustomButtons(final DialogPane dialogPane) {
// add 'Calculate' button to button bar
final ButtonType bTypeCalculate = new ButtonType(context.getResources().getString(
"st.dlg.statistic.calculate.Action.text"), ButtonBar.ButtonData.OK_DONE);
dialogPane.getButtonTypes().add(bTypeCalculate);
final Button buttonCalculate = (Button) dialogPane.lookupButton(bTypeCalculate);
// set action event filter for this custom button
// => the event must be consumed, otherwise the dialog will be closed
buttonCalculate.addEventFilter(ActionEvent.ACTION, (event) -> {
event.consume();
onCalculate(event);
});
}
代码示例来源:origin: jfoenixadmin/JFoenix
public void selectColor(KeyEvent event) {
if (rectangle.getFill() != null) {
if (rectangle.getFill() instanceof Color) {
colorPicker.setValue((Color) rectangle.getFill());
colorPicker.fireEvent(new ActionEvent());
}
event.consume();
}
colorPicker.hide();
}
}
代码示例来源:origin: com.github.almasb/fxgl-base
public void onTrackClicks(ActionEvent event) {
CheckMenuItem item = (CheckMenuItem) event.getSource();
if (item.isSelected()) {
//app.getGameScene().addEventHandler(MouseEvent.MOUSE_PRESSED, clickTracker);
} else {
//app.getGameScene().removeEventHandler(MouseEvent.MOUSE_PRESSED, clickTracker);
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* @param configuration
* @param controller
* @param contextualTo
*/
public void build(List<VLViewComponentXML> configuration, AbstractViewController controller, CriteriaContext criteriaContext, Node contextualTo) {
contextMenu = new ContextMenu(controller, configuration, criteriaContext);
contextMenu.setContextualTo(contextualTo);
ellipsisButton.managedProperty().bind(ellipsisButton.visibleProperty());
ellipsisButton.setOnAction(e -> {
e.consume();
if (contextMenu.isShowing()) {
contextMenu.hide();
return;
}
contextMenu.show(ellipsisButton);
});
}
代码示例来源:origin: jfoenixadmin/JFoenix
content.updateValues();
jfxDatePicker.fireEvent(new ActionEvent());
} else {
super.handleControlPropertyChanged(p);
代码示例来源:origin: com.aquafx-project/aquafx
@Override public void handle(ActionEvent event) {
ToggleButton btn = (ToggleButton) event.getSource();
setRetinaMode(btn.isSelected());
}
}).build();
代码示例来源:origin: no.tornado/tornadofx-controls
private void createDatePicker() {
datePicker = new DatePicker(getItem());
datePicker.converterProperty().bind(converterProperty());
datePicker.setOnAction(event -> {
commitEdit(datePicker.getValue());
event.consume();
});
datePicker.setOnKeyReleased(t -> {
if (t.getCode() == KeyCode.ESCAPE) {
cancelEdit();
t.consume();
}
});
}
代码示例来源:origin: jfoenixadmin/JFoenix
Color fill = (Color) rectangle.getFill();
colorPicker.setValue(fill);
colorPicker.fireEvent(new ActionEvent());
updateSelection(fill);
event.consume();
代码示例来源:origin: PhoenicisOrg/phoenicis
/**
* An event filter to prevent the deselection of all buttons
*
* @param event The input event to be filtered
*/
private void eventFilter(ActionEvent event) {
ToggleButton source = (ToggleButton) event.getSource();
if (source.getToggleGroup() == null || !source.isSelected()) {
source.fire();
}
}
}
代码示例来源:origin: ssaring/sportstracker
event.consume();
代码示例来源:origin: jfoenixadmin/JFoenix
if (colorPickerGrid.getBoundsInLocal().contains(t.getX(), t.getY())) {
updateSelection(colorPicker.getValue());
colorPicker.fireEvent(new ActionEvent());
colorPicker.hide();
} else {
代码示例来源:origin: PhoenicisOrg/phoenicis
/**
* An event filter to prevent the deselection of all buttons
*
* @param event The input event to be filtered
*/
private static void eventFilter(ActionEvent event) {
ToggleButton source = (ToggleButton) event.getSource();
if (source.getToggleGroup() == null || !source.isSelected()) {
source.fire();
}
}
代码示例来源:origin: pmd/pmd
autoCompletePopup.getItems().get(focusIdx).getOnAction().handle(new ActionEvent());
代码示例来源:origin: org.jrebirth.af/component
/**
* {@inheritDoc}
*/
@Override
public void action(final ActionEvent actionEvent) {
final ToggleButton b = (ToggleButton) actionEvent.getSource();
final Dockable t = (Dockable) b.getUserData();
controller().view().selectTab(t);
// if(actionEvent.){
// getController().getModel().removeTab(model, wave);
// getController().getModel().getObject().tabs().remove(t);
// }
}
代码示例来源:origin: jfoenixadmin/JFoenix
colorPicker.getCustomColors().add(customColor);
updateSelection(customColor);
Event.fireEvent(colorPicker, new ActionEvent());
colorPicker.hide();
});
colorPicker.getCustomColors().add(customColor);
updateSelection(customColor);
Event.fireEvent(colorPicker, new ActionEvent());
colorPicker.hide();
});
代码示例来源:origin: com.github.almasb/fxgl-base
public void onShowPosition(ActionEvent event) {
CheckMenuItem item = (CheckMenuItem) event.getSource();
FXGL.getSettings().getDevShowPosition().setValue(item.isSelected());
}
内容来源于网络,如有侵权,请联系作者删除!