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


Java Event类代码示例

本文整理汇总了Java中javafx.event.Event的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Event类属于javafx.event包,在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showPrefWindow

import javafx.event.Event; //导入依赖的package包/类
/**
 * Mostra la finestra per impostare le preferenze dell'animazione.
 * @param e evento scatenante.
 * @return Void.
 */
public static Void showPrefWindow(Event e) {

	try {
		Parent root = FXMLLoader.load(Singleton.getInstance().mainViewController.getClass().getResource("applicationSettingsView.fxml"));
		Stage stage = new Stage();
		stage.setTitle("Animation Settings");
		stage.setScene(new Scene(root, 400, 150));
		stage.show();
		stage.setResizable(false);
	} catch (IOException exc) {
		exc.printStackTrace();
	}
	
	return null;
}
 
开发者ID:steppp,项目名称:Breadth-First-Search,代码行数:21,代码来源:MainController.java

示例2: getAllRelations

import javafx.event.Event; //导入依赖的package包/类
public void getAllRelations(){
	log.debug("in get all relations.");
	for(Npc n: (List<Npc>)(List<?>)npcRelation.getList()){
		log.debug("\t" + n.getID());
	}
	region.setInteractions(new ArrayList<Interaction>((List<Interaction>)(List<?>)interactionController.getAllInteractions()));
	region.setGods(new ArrayList<God>((List<God>)(List<?>)godRelation.getList()));
	region.setNpcs(new ArrayList<Npc>((List<Npc>)(List<?>)npcRelation.getList()));
	region.setSubRegions(new ArrayList<Region>((List<Region>)(List<?>)regionRelation.getList()));
	region.setEvents(new ArrayList<com.forj.fwm.entity.Event>((List<com.forj.fwm.entity.Event>)(List<?>)eventRelation.getList()));
	region.setTemplates(new ArrayList<Template>((List<Template>)(List<?>)templateRelation.getList()));
	if (!superRelation.getList().isEmpty()){
		Region newRegion = (new ArrayList<Region>((List<Region>)(List<?>)superRelation.getList())).get(0);
		region.setSuperRegion(newRegion);
		log.debug("spitting out super region IDS.");
		log.debug(newRegion.getID());
	}
	log.debug("spitting out sub region IDS.");
	for(Region r: region.getSubRegions()){
		log.debug(r.getID());
	}
}
 
开发者ID:ForJ-Latech,项目名称:fwm,代码行数:23,代码来源:RegionTabController.java

示例3: addMemberAction

import javafx.event.Event; //导入依赖的package包/类
private void addMemberAction(Event e) {
	AddMemberDialog dialog = new AddMemberDialog(organization);

	Optional<Member> result = dialog.showAndWait();

	if (result.isPresent()) {
		try {
			organization.addMember(result.get().getId());
			forceUpdateMemberList();
		} catch (JSONException | WebApiException | IOException | HttpException e1) {
			ErrorUtils.getAlertFromException(e1).show();
			e1.printStackTrace();
		}
	}


}
 
开发者ID:ScreachFr,项目名称:titanium,代码行数:18,代码来源:MemberPane.java

示例4: removeAction

import javafx.event.Event; //导入依赖的package包/类
private void removeAction(Event e) {
	Alert conf = new Alert(AlertType.CONFIRMATION, "Do you really want to delete this organization ?\n"
			+ "Every server and member association will be lost.");

	Optional<ButtonType> result = conf.showAndWait();

	if (result.isPresent() && result.get().equals(ButtonType.OK)) {
		try {
			wsp.removeOrganization(orgas.selectionModelProperty().get().getSelectedItem().getOrganization());
			forceOrganizationListRefresh();
			App.getCurrentInstance().refreshWSPTabs();
		} catch(Exception e1) {
			ErrorUtils.getAlertFromException(e1).show();
		}
	}
}
 
开发者ID:ScreachFr,项目名称:titanium,代码行数:17,代码来源:OrganizationManagerStage.java

示例5: searchAction

import javafx.event.Event; //导入依赖的package包/类
private void searchAction(Event e) {
	String query = queryField.getText();
	
	searchList.clear(); 
	try {
		List<Member> orgaMemberList = organization.getMemberList();
		ArrayList<MemberView> result = new ArrayList<>(organization.getWsp().searchMembers(query, 0, RESULT_SIZE).stream().map(m -> new MemberView(m)).collect(Collectors.toList()));
		result.forEach(mv -> {
			if (!orgaMemberList.stream().anyMatch(m -> m.getId() == mv.getId())) {
				searchList.add(mv);
			}
		});
		
		resultCount.setText(getResultCountText(searchList.size()));
		
	} catch (JSONException | IOException | HttpException | WebApiException e1) {
		new Alert(AlertType.ERROR, "Error while fetching member list. " + e1.getClass() + " : " + e1.getMessage()).show();
		e1.printStackTrace();
	}
	
}
 
开发者ID:ScreachFr,项目名称:titanium,代码行数:22,代码来源:AddMemberDialog.java

示例6: editWSPAction

import javafx.event.Event; //导入依赖的package包/类
private void editWSPAction(Event e) {
	EditWSPDialog dialog = new EditWSPDialog(wsp);
	Optional<WebServiceProvider> result = dialog.showAndWait();

	if (result.isPresent()) {
		try {
			wsp = result.get();
			wsp.fetchConfiguration();
			writeWSP(wsp);
		} catch (JSONException | WebApiException | IOException | HttpException e1) {
			Alert a = ErrorUtils.getAlertFromException(e1);
			a.show();
			e1.printStackTrace();
		}
		
	} else {
		new Alert(AlertType.ERROR, "Wrong WSP information");
	}
}
 
开发者ID:ScreachFr,项目名称:titanium,代码行数:20,代码来源:MainPane.java

示例7: handleRequestToCloseEditor

import javafx.event.Event; //导入依赖的package包/类
@FXThread
private void handleRequestToCloseEditor(@NotNull final FileEditor editor, @NotNull final Tab tab,
                                        @NotNull final Event event) {
    if (!editor.isDirty()) {
        return;
    }

    final String question = Messages.EDITOR_AREA_SAVE_FILE_QUESTION.replace("%file_name%", editor.getFileName());

    final ConfirmDialog dialog = new ConfirmDialog(result -> {
        if (result == null) return;

        if (result) {
            editor.save(fileEditor -> getTabs().remove(tab));
        } else {
            getTabs().remove(tab);
        }

    }, question);

    dialog.show();
    event.consume();
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:24,代码来源:EditorAreaComponent.java

示例8: changeHiddenPower

import javafx.event.Event; //导入依赖的package包/类
public void changeHiddenPower(Event event) {
    if (event instanceof MouseEvent) {
        MouseEvent mouseEvent = (MouseEvent) event;
        MouseButton mouseButton = mouseEvent.getButton();
        if (mouseEvent.isShiftDown() || mouseButton.equals(MouseButton.SECONDARY)) {
            pokemon.setHiddenPower(hiddenPowerCalculator.updateToNext());
        } else if (mouseButton.equals(MouseButton.PRIMARY)) {
            pokemon.setHiddenPower(hiddenPowerCalculator.updateToPrevious());
        } else if (mouseButton.equals(MouseButton.MIDDLE)) {
            pokemon.setHiddenPower(hiddenPowerCalculator.setUnknown());
        }
    } else if (event instanceof ScrollEvent) {
        double delta = ((ScrollEvent) event).getDeltaY();
        if (delta > 0) {
            pokemon.setHiddenPower(hiddenPowerCalculator.updateToNext());
        } else if (delta < 0) {
            pokemon.setHiddenPower(hiddenPowerCalculator.updateToPrevious());
        }
    }
}
 
开发者ID:wartab,项目名称:gen7-iv-calculator,代码行数:21,代码来源:OutputPresenter.java

示例9: presentHelpWindow

import javafx.event.Event; //导入依赖的package包/类
/**
 * Öffnet ein Fenster mit einer Hilfe
 * @param e	Das Event
 * @param type	Die Hilfe, die angezeigt werden soll
 */
public void presentHelpWindow(Event e, HelpType type) {
	try {
		FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("helpWindow.fxml"));
		AnchorPane root = (AnchorPane)loader.load();

		helpController = loader.getController();
		helpController.setType(type);
		helpStage = new Stage();
		helpStage.setResizable(false);
		helpStage.setTitle("Vier Gewinnt Hilfe");
		helpStage.setScene(new Scene(root));
		helpStage.show();

		helpController.display();
	} catch (IOException exception) {
		exception.printStackTrace();
	}
}
 
开发者ID:lukasbischof,项目名称:Orsum-occulendi,代码行数:24,代码来源:Controller.java

示例10: presentConnectToServerWindow

import javafx.event.Event; //导入依赖的package包/类
/**
 * Zeigt den Connect-Dialog an
 * @param e	Das Event
 */
public void presentConnectToServerWindow(Event e) {
	try {
		FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("connectToServer.fxml"));
		GridPane root = (GridPane)loader.load();
		connectToServerController = loader.getController();

		connectToServerController.setCompletedRunnable((run) -> {
			/*String ip = connectToServerController.getIpAdressTextField().getText();
			String port = connectToServerController.getPortTextField().getText();*/
			String ip = (String) UserDefaults.sharedDefaults().valueForKey(UserDefaults.ADRESS_KEY);
			int port = (int) UserDefaults.sharedDefaults().valueForKey(UserDefaults.PORT_KEY);
			String userID = (String)UserDefaults.sharedDefaults().valueForKey(UserDefaults.NAME_KEY);

			this.client = new Client(ip, port, userID);
			this.client.setDelegate(this);
			this.client.connect();

			connectToServerCallback = run;
		});

           connectToServerStage = new Stage();
           connectToServerStage.setResizable(false);
           connectToServerStage.setTitle("Connect to server");
           connectToServerStage.setScene(new Scene(root));
           connectToServerStage.show();
	} catch (IOException e1) {
		e1.printStackTrace();
	}
}
 
开发者ID:lukasbischof,项目名称:Orsum-occulendi,代码行数:34,代码来源:Controller.java

示例11: nextStep

import javafx.event.Event; //导入依赖的package包/类
/**
 * Esegue uno step dell'animazione
 * @param e	evento per cui è stato richiamato il metodo.
 * @return Void
 */
public static Void nextStep(Event e) {
	if (!Singleton.getInstance().isAnimating)
		return null;
	
	// ottengo il thread
	GraphVisiter bfs = (GraphVisiter) Singleton.getInstance().getThreadByName(AnimationSettings.THREAD_NAME);
	
	// se il thread esiste ed è ancora in esecuzione, lo riprendo
	if (bfs != null && bfs.isAlive()) {
		synchronized (bfs) {
			bfs.notify();
		}
	}
	
	return null;
}
 
开发者ID:steppp,项目名称:Breadth-First-Search,代码行数:22,代码来源:MainController.java

示例12: createEditorAreaPane

import javafx.event.Event; //导入依赖的package包/类
/**
 * Create editor area pane.
 */
@FXThread
protected void createEditorAreaPane() {

    editorAreaPane = new StackPane();
    editorAreaPane.setOnDragOver(this::handleDragOverEvent);
    editorAreaPane.setOnDragDropped(this::handleDragDroppedEvent);

    editor3DArea = new BorderPane();
    editor3DArea.setOnMousePressed(event -> editor3DArea.requestFocus());
    editor3DArea.setOnKeyReleased(Event::consume);
    editor3DArea.setOnKeyPressed(Event::consume);

    FXUtils.addToPane(editor3DArea, editorAreaPane);
    FXUtils.addClassTo(editorAreaPane, CSSClasses.FILE_EDITOR_EDITOR_AREA);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:Advanced3DFileEditorWithRightTool.java

示例13: delete

import javafx.event.Event; //导入依赖的package包/类
@Override public Optional<ButtonType> delete(Optional<ButtonType> option) {
    if (!option.isPresent() || option.get() != FXUIUtils.YES_ALL) {
        option = FXUIUtils.showConfirmDialog(null, "Do you want to delete the entry `" + entry.getName() + "`?", "Confirm",
                AlertType.CONFIRMATION, ButtonType.YES, ButtonType.NO, FXUIUtils.YES_ALL, ButtonType.CANCEL);
    }
    if (option.isPresent() && (option.get() == ButtonType.YES || option.get() == FXUIUtils.YES_ALL)) {
        GroupResource parent = (GroupResource) getParent();
        parent.deleteEntry(this);
        try {
            Group.updateFile(parent.getSuite());
            Event.fireEvent(parent, new ResourceModificationEvent(ResourceModificationEvent.UPDATE, parent));
        } catch (IOException e) {
            e.printStackTrace();
            return option;
        }
    }
    return option;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:GroupEntryResource.java

示例14: buildEvent

import javafx.event.Event; //导入依赖的package包/类
private EventHandler<Event> buildEvent() {

        return e -> {

            // if((e.getEventType() == MouseEvent.MOUSE_ENTERED_TARGET ||e.getEventType() == MouseEvent.MOUSE_ENTERED ||
            // e.getEventType() == MouseEvent.MOUSE_MOVED || e.getEventType() == GazeEvent.GAZE_ENTERED ||
            // e.getEventType() == GazeEvent.GAZE_MOVED) && anniOff) {

            if (animationStopped
                    && (e.getEventType() == MouseEvent.MOUSE_ENTERED || e.getEventType() == GazeEvent.GAZE_ENTERED)) {

                animationStopped = false;
                enter(e);
            }
        };
    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:17,代码来源:Target.java

示例15: startImport

import javafx.event.Event; //导入依赖的package包/类
@FXML
public void startImport(Event event) {
    config.setBlockEnd(blockEnd.getText());
    config.setStartBlock(blockStart.getText());
    config.setBlockIndex(blockIndex.getText());
    config.setTxIndex(txIndex.getText());
    config.setBlockImport(importBlocks.isSelected());
    config.setTxImport(importTx.isSelected());
    config.setIpc(endpoint.getText());
    config.setStorage(
            ApplicationConfig.StorageType.valueOf(
                    storageType.getSelectionModel().getSelectedItem()));
    config.save();

    if (config.isBlockImport() || config.isTxImport()) {
        Async.setScene(IMPORTING_FXML);
    } else {
        Form.showInfoAlert(
                "Configuration",
                "Nothing selected for import, please select to import blocks or transactions.");
    }
}
 
开发者ID:codingchili,项目名称:ethereum-ingest,代码行数:23,代码来源:Settings.java


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