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