本文整理匯總了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?
}
}
};
}