當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。