本文整理汇总了Java中javafx.event.Event.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java Event.getSource方法的具体用法?Java Event.getSource怎么用?Java Event.getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.event.Event
的用法示例。
在下文中一共展示了Event.getSource方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: comboBoxValueChanged
import javafx.event.Event; //导入方法依赖的package包/类
@FXML
public void comboBoxValueChanged(Event evt) {
ComboBox actionBox = ((ComboBox) evt.getSource());
switch (actionBox.getId()) {
case "action1":
region1.setDisable(!actionBox.getValue().equals("Delegation"));
break;
case "action2":
region2.setDisable(!actionBox.getValue().equals("Delegation"));
break;
case "action3":
region3.setDisable(!actionBox.getValue().equals("Delegation"));
break;
case "action4":
region4.setDisable(!actionBox.getValue().equals("Delegation"));
break;
case "action5":
region5.setDisable(!actionBox.getValue().equals("Delegation"));
break;
case "action6":
region6.setDisable(!actionBox.getValue().equals("Delegation"));
break;
}
}
示例2: handle
import javafx.event.Event; //导入方法依赖的package包/类
public void handle(Event event) {
Tab source = (Tab)event.getSource();
int index = findTabIndex(source);
if (index != -1)
{
tabControllers.remove(index);
}
log.debug("tab controller size after removall:" + tabControllers.size());
}
示例3: handleFileChooser
import javafx.event.Event; //导入方法依赖的package包/类
private void handleFileChooser(Event event) {
Node source = (Node) event.getSource();
CommonDialogs.FileChooserResult files = (CommonDialogs.FileChooserResult) source.getProperties()
.get("marathon.selectedFiles");
List<File> selectedFiles = null;
if (files != null) {
selectedFiles = files.getFiles();
}
new RFXFileChooser(recorder).record(selectedFiles);
}
示例4: clickPseudoHandle
import javafx.event.Event; //导入方法依赖的package包/类
@FXML
public void clickPseudoHandle(Event event){
Label lbl = (Label) event.getSource();
if(!this.joueurSelected.equals(lbl.getText())){
this.joueurSelected= null;
lbl.setFont(Font.font(null, FontWeight.NORMAL, 24));
}else{
this.joueurSelected = lbl.getText();
lbl.setFont(Font.font(null, FontWeight.BOLD, 24));
}
}
示例5: freecellButtonClick
import javafx.event.Event; //导入方法依赖的package包/类
@FXML protected void freecellButtonClick(Event e) throws IOException {
Node node = (Node) e.getSource();
Stage main = (Stage) node.getScene().getWindow();
Parent freecellFXML = FXMLLoader.load(getClass().getResource("/fxml/freecellGame.fxml"));
freecellFXML.getStylesheets().add("/stylesheets/freecellGame.css");
Scene freecellScene = new Scene(freecellFXML);
main.setOnCloseRequest(b -> {
boolean response = ExitWindow.display("Confirm", "Are you sure you want to quit now?");
if(response) main.close();
b.consume();
});
main.setScene(freecellScene);
main.show();
}
示例6: bakersDozenButtonClick
import javafx.event.Event; //导入方法依赖的package包/类
@FXML protected void bakersDozenButtonClick(Event e) throws IOException {
Node node = (Node) e.getSource();
Stage main = (Stage) node.getScene().getWindow();
Parent bakersDozenFXML = FXMLLoader.load(getClass().getResource("/fxml/bakersDozenGame.fxml"));
bakersDozenFXML.getStylesheets().add("/stylesheets/bakersDozenGame.css");
Scene bakersDozenScene = new Scene(bakersDozenFXML);
main.setOnCloseRequest(b -> {
boolean response = ExitWindow.display("Confirm", "Are you sure you want to quit now?");
if(response) main.close();
b.consume();
});
main.setScene(bakersDozenScene);
main.show();
}
示例7: acesUpButtonClick
import javafx.event.Event; //导入方法依赖的package包/类
@FXML protected void acesUpButtonClick(Event e) throws IOException {
Node node = (Node) e.getSource();
Stage main = (Stage) node.getScene().getWindow();
Parent acesUpFXML = FXMLLoader.load(getClass().getResource("/fxml/acesUpGame.fxml"));
acesUpFXML.getStylesheets().add("/stylesheets/acesUpGame.css");
Scene acesUpScene = new Scene(acesUpFXML);
main.setOnCloseRequest(b -> {
boolean response = ExitWindow.display("Confirm", "Are you sure you want to quit now?");
if(response) main.close();
b.consume();
});
main.setScene(acesUpScene);
main.show();
}
示例8: handleFolderChooser
import javafx.event.Event; //导入方法依赖的package包/类
private void handleFolderChooser(Event event) {
Node source = (Node) event.getSource();
File folder = (File) source.getProperties().get("marathon.selectedFolder");
new RFXFolderChooser(recorder).record(folder);
}
示例9: traiterMaladieClick
import javafx.event.Event; //导入方法依赖的package包/类
@FXML
public void traiterMaladieClick(Event event){
MenuItem mi = (MenuItem) event.getSource();
String color = mi.getText();
try {
this.cdGame.retirerCubeMaladie(this.param.getName(),color.toUpperCase());
} catch (RemoteException ex) {
Logger.getLogger(BoardController.class.getName()).log(Level.SEVERE, null, ex);
}
}
示例10: decouvrirRemedeClick
import javafx.event.Event; //导入方法依赖的package包/类
@FXML
public void decouvrirRemedeClick(Event event){
MenuItem mi = (MenuItem) event.getSource();
String color = mi.getText();
try {
this.cdGame.decouvrirRemede(this.param.getName(),carteSelected,color);
} catch (RemoteException ex) {
Logger.getLogger(BoardController.class.getName()).log(Level.SEVERE, null, ex);
}
}
示例11: clickSelectCardHandle
import javafx.event.Event; //导入方法依赖的package包/类
@FXML
public void clickSelectCardHandle(Event event){
ImageView tmp = (ImageView) event.getSource();
LocatedImage img = (LocatedImage) tmp.getImage();
this.carteClicked = img.getURL();
if(this.carteSelected.contains(img.getURL())){
tmp.setEffect(null);
this.carteSelected.remove( img.getURL());
}else{
DropShadow ds = new DropShadow(20,Color.AQUA);
tmp.setEffect(ds);
this.carteSelected.add( img.getURL());
}
}
示例12: buildEvent
import javafx.event.Event; //导入方法依赖的package包/类
private EventHandler<Event> buildEvent () {
return new EventHandler<Event>() {
@Override
public void handle(Event e) {
int row=0, col =0, j=0;
Object source = e.getSource();
ImageView x = (ImageView)source;
int y =Integer.parseInt(x.getId());
row = y/ 13;
col = y% 13;
if (e.getEventType() == MouseEvent.MOUSE_ENTERED || e.getEventType() == GazeEvent.GAZE_ENTERED) {
System.out.println("I entered");
count[row][col]++;
//System.out.println("count["+row+"]["+col+"] = "+count[row][col]);
} else if (e.getEventType() == MouseEvent.MOUSE_MOVED || e.getEventType() == GazeEvent.GAZE_MOVED) {
System.out.println("I moved");
count[row][col]++;
//System.out.println("count["+row+"]["+col+"] = "+count[row][col]);
} else if (e.getEventType() == MouseEvent.MOUSE_EXITED || e.getEventType() == GazeEvent.GAZE_EXITED) {
//nothing happens with the count
//what to put?
}
}
};
}