本文整理汇总了Java中javafx.event.ActionEvent.consume方法的典型用法代码示例。如果您正苦于以下问题:Java ActionEvent.consume方法的具体用法?Java ActionEvent.consume怎么用?Java ActionEvent.consume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.event.ActionEvent
的用法示例。
在下文中一共展示了ActionEvent.consume方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSaveAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user saves the bookmark.
* <p>
* Hides the owner {@link javafx.stage.Window} afterwards.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void onSaveAction(final ActionEvent actionEvent) {
if (graphVisualizer.getSelectedSegmentProperty().isNull().get()) {
return;
}
final String baseString = baseOffset.getText().replaceAll("[^\\d]", "");
final String radiusString = radius.getText().replaceAll("[^\\d]", "");
if (!baseString.isEmpty() && !radiusString.isEmpty()) {
final GfaNode gfaNode = graphVisualizer.getSelectedSegmentProperty().get();
final Segment segment = gfaNode.getSegments().get(0);
final int baseOffsetValue = Integer.parseInt(baseString);
final int radiusValue = Integer.parseInt(radiusString);
bookmarkStore.addBookmark(new Bookmark(segment.getId(), baseOffsetValue, radiusValue,
description.getText()));
description.clear();
final Node source = (Node) actionEvent.getSource();
source.getScene().getWindow().hide();
}
actionEvent.consume();
}
示例2: handle
import javafx.event.ActionEvent; //导入方法依赖的package包/类
@Override
public void handle(ActionEvent event)
{
if(AppTabPane.BLOCK_TAB_CREATION)
event.consume();
else
{
for(int i = 0; i < tabs.length; i++)
{
if(tabs[i].getText().equals(((MenuItem)event.getSource()).getText()))
{
if(!tabPaneToAddTo.getTabs().contains(tabs[i]))
tabPaneToAddTo.getTabs().add(tabs[i]);
tabPaneToAddTo.getSelectionModel().select(tabs[i]);
}
}
}
}
示例3: okAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* The action to fire when the user clicks the "Ok" button.
* <p>
* Sets the mapped genome in {@link GraphAnnotation} to the value in the genome choice textfield.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void okAction(final ActionEvent actionEvent) {
if (genomeChoice.getText().isEmpty()) {
(new WarningDialogue("Please select a mapping.")).show();
return;
}
try {
graphAnnotation.setMappedGenome(genomeChoice.getText());
} catch (final IOException e) {
LOGGER.error("Unable to build an index for genome " + genomeChoice.getText() + ".", e);
new ErrorDialogue(e).show();
}
final Node source = (Node) actionEvent.getSource();
source.getScene().getWindow().hide();
actionEvent.consume();
LOGGER.info("Genome " + gffGenome.getText() + " from GFF will be mapped onto " + genomeChoice.getText() + ".");
}
示例4: queryAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user wants to perform a query.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void queryAction(final ActionEvent actionEvent) {
query.query(sequenceField.getText());
actionEvent.consume();
}
示例5: handleCollapse
import javafx.event.ActionEvent; //导入方法依赖的package包/类
private void handleCollapse(ActionEvent event) {
if (collapseButton.isSelected()) {
collapseButton.setText(Utils.ARROW_UP);
getChildren().add(collapsible);
//collapsible.setVisible(true);
} else {
collapseButton.setText(Utils.ARROW_DOWN);
getChildren().remove(collapsible);
//collapsible.setVisible(false);
}
event.consume();
}
示例6: goRightAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user wants to go right by a single base.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void goRightAction(final ActionEvent actionEvent) {
graphDimensionsCalculator.getViewPointProperty().set(
graphDimensionsCalculator.getViewPointProperty().get() + GO_AMOUNT);
actionEvent.consume();
}
示例7: okAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user clicks "OK" execute all actions and close the window.
*
* @param actionEvent {@link ActionEvent} associated with this action
*/
@FXML
void okAction(final ActionEvent actionEvent) {
settings.executeAll();
final Node source = (Node) actionEvent.getSource();
source.getScene().getWindow().hide();
actionEvent.consume();
}
示例8: cancelAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user clicks "Cancel" clear all commands and close the window.
*
* @param actionEvent {@link ActionEvent} associated with this action
*/
@FXML
void cancelAction(final ActionEvent actionEvent) {
settings.clearAll();
final Node source = (Node) actionEvent.getSource();
source.getScene().getWindow().hide();
actionEvent.consume();
}
示例9: goToStartAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user wants to go to the start of the sequence.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void goToStartAction(final ActionEvent actionEvent) {
sequenceVisualizer.setOffset(0);
actionEvent.consume();
}
示例10: goRightLargeAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user wants to go right by amount of onscreen bases.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void goRightLargeAction(final ActionEvent actionEvent) {
graphDimensionsCalculator.getViewPointProperty().set(
graphDimensionsCalculator.getViewPointProperty().get() + GO_AMOUNT * JUMP_AMOUNT);
actionEvent.consume();
}
示例11: zoomOutAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user wants to zoom out by a single hop.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void zoomOutAction(final ActionEvent actionEvent) {
graphMovementCalculator.onScroll(SCROLL_DELTA);
actionEvent.consume();
}
示例12: openConsoleAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* Opens an independent stage showing the console window.
*
* @param actionEvent {@link ActionEvent} associated with the event
* @throws IOException if unable to located the FXML resource
*/
@FXML
void openConsoleAction(final ActionEvent actionEvent) throws IOException {
consoleView.bringToFront();
actionEvent.consume();
}
示例13: searchAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user wants to search {@link Annotation}s.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void searchAction(final ActionEvent actionEvent) {
annotationSearch.search(queryField.getText());
actionEvent.consume();
}
示例14: goLeftAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
/**
* When the user wants to go left by a single base.
*
* @param actionEvent the {@link ActionEvent}
*/
@FXML
void goLeftAction(final ActionEvent actionEvent) {
graphDimensionsCalculator.getViewPointProperty().set(
graphDimensionsCalculator.getViewPointProperty().get() - GO_AMOUNT);
actionEvent.consume();
}
示例15: openAnnotationSearchAction
import javafx.event.ActionEvent; //导入方法依赖的package包/类
@FXML
void openAnnotationSearchAction(final ActionEvent actionEvent) throws IOException {
mainController.expandAnnotationSearchPane();
actionEvent.consume();
}