本文整理了Java中javafx.event.ActionEvent.getSource()
方法的一些代码示例,展示了ActionEvent.getSource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActionEvent.getSource()
方法的具体详情如下:
包路径:javafx.event.ActionEvent
类名称:ActionEvent
方法名:getSource
暂无
代码示例来源: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: 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.aquafx-project/aquafx
@Override public void handle(ActionEvent event) {
ToggleButton btn = (ToggleButton) event.getSource();
setRetinaMode(btn.isSelected());
}
}).build();
代码示例来源: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: 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: 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: com.github.almasb/fxgl-base
public void onShowPosition(ActionEvent event) {
CheckMenuItem item = (CheckMenuItem) event.getSource();
FXGL.getSettings().getDevShowPosition().setValue(item.isSelected());
}
代码示例来源:origin: com.github.almasb/fxgl-base
public void onShowBBox(ActionEvent event) {
CheckMenuItem item = (CheckMenuItem) event.getSource();
FXGL.getSettings().getDevShowBBox().setValue(item.isSelected());
}
代码示例来源:origin: com.uvic-cfar.swim/worldwind
/**
* Handles action events to enable or disable selected SWIM data list
* view items.
*/
@Override
public void handle(ActionEvent event) {
int index = this.listView.getSelectionModel().getSelectedIndex();
if (-1 != index) {
String identifier = this.listView.getItems().get(index);
MenuItem menuItem = (MenuItem) event.getSource();
if (menuItem.getText().equals(SwimDataListView.ENABLE)) {
this.activate(identifier);
} else if (menuItem.getText().equals(SwimDataListView.DISABLE)) {
this.deactivate(identifier);
}
this.listView.worldWindow.redrawNow();
}
}
代码示例来源:origin: org.jrebirth.af.showcase/todos
public void onAction(final ActionEvent event) {
if (event.getSource() == view().selectAll()) {
model().selectAll(view().selectAll().isSelected());
}
/*
* if(event.getCode() == KeyCode.ENTER){
*
* model().returnData(TodoService.class, TodoService.DO_ADD, WBuilder.waveData(TodoService.TODO, view().todoText().getText()));
*
* }
*/
}
代码示例来源:origin: com.bitplan.radolan/com.bitplan.radolan
@Override
public void handle(ActionEvent event) {
try {
Object source = event.getSource();
if (source instanceof MenuItem) {
MenuItem menuItem = (MenuItem) source;
代码示例来源:origin: eu.binjr/binjr-adapter-rrd4j
File selectedFile = displayFileChooser((Node) event.getSource());
if (selectedFile != null) {
pathsField.setText(selectedFile.getPath());
内容来源于网络,如有侵权,请联系作者删除!