当前位置: 首页>>代码示例>>Java>>正文


Java Event.getSource方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:sebastienscout,项目名称:Himalaya-JavaFX,代码行数:26,代码来源:ActionsFXMLController.java

示例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());
}
 
开发者ID:ForJ-Latech,项目名称:fwm,代码行数:10,代码来源:TabControlled.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:JavaFxRecorderHook.java

示例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));
        }

    }
 
开发者ID:tillind,项目名称:pandemie,代码行数:16,代码来源:BoardController.java

示例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();
}
 
开发者ID:jarolrod,项目名称:java-solitaire,代码行数:15,代码来源:root.java

示例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();
}
 
开发者ID:jarolrod,项目名称:java-solitaire,代码行数:15,代码来源:root.java

示例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();
}
 
开发者ID:jarolrod,项目名称:java-solitaire,代码行数:15,代码来源:root.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:6,代码来源:JavaFxRecorderHook.java

示例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);

        }

   }
 
开发者ID:tillind,项目名称:pandemie,代码行数:20,代码来源:BoardController.java

示例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);

        }

   }
 
开发者ID:tillind,项目名称:pandemie,代码行数:20,代码来源:BoardController.java

示例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());

        }

    }
 
开发者ID:tillind,项目名称:pandemie,代码行数:30,代码来源:BoardController.java

示例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?

                    }

                }

            };

        }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:40,代码来源:HeatMap.java


注:本文中的javafx.event.Event.getSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。