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


Java PopOver.show方法代码示例

本文整理汇总了Java中org.controlsfx.control.PopOver.show方法的典型用法代码示例。如果您正苦于以下问题:Java PopOver.show方法的具体用法?Java PopOver.show怎么用?Java PopOver.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.controlsfx.control.PopOver的用法示例。


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

示例1: chooseRecentReposToDelete

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
/**
 * Shows a popover with all repos in a checklist
 */
public void chooseRecentReposToDelete() {
    logger.info("Remove repos button clicked");

    // creates a CheckListView with all the repos in it
    List<RepoHelper> repoHelpers = this.theModel.getAllRepoHelpers();
    CheckListView<RepoHelper> repoCheckListView = new CheckListView<>(FXCollections.observableArrayList(repoHelpers));

    // creates a popover with the list and a button used to remove repo shortcuts
    Button removeSelectedButton = new Button("Remove repository shortcuts from Elegit");
    PopOver popover = new PopOver(new VBox(repoCheckListView, removeSelectedButton));
    popover.setTitle("Manage Recent Repositories");

    // shows the popover
    popover.show(dropdownController.removeRecentReposButton);

    removeSelectedButton.setOnAction(e -> {
        this.handleRemoveReposButton(repoCheckListView.getCheckModel().getCheckedItems());
        popover.hide();
    });
}
 
开发者ID:dmusican,项目名称:Elegit,代码行数:24,代码来源:SessionController.java

示例2: if

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
/**
     * Updates the text wrapping to the current user-selected settings.
     * Called from both the checkbox and wrapping width textfield listeners.
     */
    /*private void updateTextWrapping() {

        if (terminal.txRx.display.wrappingEnabled.get()) {
            logger.debug("\"Wrapping\" checkbox is currently checked, applying wrapping value.");

            // Set the width of the TextFlow UI object. This will set the wrapping width
            // (there is no wrapping object)
            rxDataTextFlow.setMaxWidth(terminal.txRx.display.wrappingWidth.get());

        } else {
            logger.debug("\"Wrapping\" checkbox is current unchecked, not apply wrapping value.");
            rxDataTextFlow.setMaxWidth(Double.MAX_VALUE);
        }
    }*/
    public void showPopover(Button button, PopOver popOver) {

        logger.debug(".showPopover() called.");

        //==============================================//
        //=============== DECODING POPOVER =============//
        //==============================================//

        double clickX = button.localToScreen(button.getBoundsInLocal()).getMinX();
        double clickY = (button.localToScreen(button.getBoundsInLocal()).getMinY() +
                button.localToScreen(button.getBoundsInLocal()).getMaxY()) / 2;

        popOver.show(button.getScene().getWindow());
        // Show on left
//        popOver.setX(clickX - popOver.getWidth());
//        popOver.setY(clickY - popOver.getHeight() / 2);
        // Show on right
        popOver.setX(clickX + 40.0);
        popOver.setY(clickY - popOver.getHeight() / 2);
    }
 
开发者ID:mbedded-ninja,项目名称:NinjaTerm,代码行数:39,代码来源:TxRxViewController.java

示例3: createInfoPopOver

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private void createInfoPopOver(Node node) {
    node.getStyleClass().add("default-text");

    infoPopover = new PopOver(node);
    if (infoIcon.getScene() != null) {
        infoPopover.setDetachable(false);
        infoPopover.setArrowLocation(PopOver.ArrowLocation.RIGHT_TOP);
        infoPopover.setArrowIndent(5);

        infoPopover.show(infoIcon, -17);
    }
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:13,代码来源:FundsTextField.java

示例4: createImportPopOver

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public static PopOver createImportPopOver(final Node root, final TwitchService service) {
	final PopOver popOver = createBasePopOver("Import followed Twitch.tv Channels");
	final VBox dialogBox = new VBox();
	final HBox buttonBox = new HBox();
	final Button submitButton = new Button("Import");
	final Button cancelButton = new Button("Cancel");
	buttonBox.getChildren().add(submitButton);
	buttonBox.getChildren().add(cancelButton);

	dialogBox.setPadding(INSETS);
	final HBox textFieldBox = new HBox();
	final Label textFieldLabel = new Label("Username");
	final TextField nameTextField = new TextField();
	textFieldBox.getChildren().add(textFieldLabel);
	textFieldBox.getChildren().add(nameTextField);
	dialogBox.getChildren().add(textFieldBox);
	dialogBox.getChildren().add(buttonBox);

	submitButton.setOnAction(event -> {
		final String username = nameTextField.getText();
		TwitchUtils.addFollowedChannelsToService(username, service);
		popOver.hide();
	});
	submitButton.setDefaultButton(true);

	cancelButton.setOnAction(event -> popOver.hide());

	popOver.setContentNode(dialogBox);
	final Point2D clickedPoint = getClickedPoint(root);
	popOver.show(root.getParent(), clickedPoint.getX(), clickedPoint.getY());
	return popOver;
}
 
开发者ID:westerwave,项目名称:livestreamer_twitch_gui,代码行数:33,代码来源:PopOverUtil.java

示例5: openEditor

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private void openEditor() {

        final PopOver popOver = new PopOver();
        final TextField textEditor = new TextField(targetText.getText());
        BorderPane editorPane = new BorderPane(textEditor);

        BorderPane.setMargin(textEditor, new Insets(12));
        textEditor.setOnKeyReleased(e -> {
            if ( KeyCode.ESCAPE.equals(e.getCode()) ) {
                popOver.hide();
            }
        });
        textEditor.setOnAction(e -> {
            try {
                setTargetValue(Double.parseDouble(textEditor.getText()));
                fireTargeValueSet();
            } catch ( NumberFormatException nfex ) {
                Toolkit.getDefaultToolkit().beep();
            } finally {
                popOver.hide();
            }
        });

        popOver.setContentNode(editorPane);
        popOver.setDetachable(false);
        popOver.setDetached(false);
        popOver.setArrowLocation(PopOver.ArrowLocation.TOP_CENTER);
        popOver.setHeaderAlwaysVisible(true);
        popOver.setHideOnEscape(true);
        popOver.setTitle("Set Target Value");
        popOver.setAnimated(true);
        popOver.setAutoHide(true);
        popOver.setCloseButtonEnabled(true);

        text.getScene().getStylesheets().stream().forEach(s -> popOver.getRoot().getStylesheets().add(s));

        Bounds bounds = getBoundsInLocal();
        Bounds screenBounds = localToScreen(bounds);
        int x = (int) screenBounds.getMinX();
        int y = (int) screenBounds.getMinY();
        int w = (int) screenBounds.getWidth();
        int h = (int) screenBounds.getHeight();

        popOver.show(this, x + w / 2, y + h / 2);
        
    }
 
开发者ID:ESSICS,项目名称:KNOBS,代码行数:47,代码来源:Knob.java

示例6: showLogPopOver

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private void showLogPopOver(Button logLink, Cache cache) {
    PopOver popOver = new PopOver();

    Window window = logLink.getScene().getWindow();

    VBox vbox = new VBox();
    vbox.setFillWidth(true);
    vbox.setMaxWidth(window.getWidth() - 420);
    vbox.setSpacing(60.0);
    vbox.setPadding(new Insets(30,20,30,20));
    vbox.setStyle("-fx-background-color: white");

    for (Log log: cache.getLogs()) {

        BorderPane borderPane = new BorderPane();

        Text icon = new MaterialDesignIconView(CHECK);
        Label date = new Label(log.getDate().toString());
        date.setStyle("-fx-font-weight: bold; -fx-font-size: 1.2em;");
        Label name = new Label(log.getFinder().getName());
        name.setStyle("-fx-font-weight: bold; -fx-font-size: 1.2em;");

        HBox.setHgrow(icon, Priority.NEVER);
        HBox.setHgrow(date, Priority.NEVER);
        HBox.setHgrow(name, Priority.ALWAYS);

        HBox header = new HBox();
        header.setSpacing(10.0);
        header.getChildren().addAll(icon, date, name);
        header.setPadding(new Insets(10, 10, 10, 10));
        header.setStyle("-fx-border-color: transparent transparent gray transparent");

        borderPane.setTop(header);

        Label logText = new Label(log.getText());
        logText.setWrapText(true);
        logText.setPadding(new Insets(10,10,10,10));
        BorderPane.setAlignment(logText, Pos.TOP_LEFT);

        borderPane.setCenter(logText);

        vbox.getChildren().add(borderPane);
    }

    ScrollPane scrollPane = new ScrollPane(vbox);
    scrollPane.setFitToWidth(true);
    AnchorPane.setBottomAnchor(scrollPane, 0.0);
    AnchorPane.setLeftAnchor(scrollPane, 0.0);
    AnchorPane.setTopAnchor(scrollPane, 0.0);
    AnchorPane.setRightAnchor(scrollPane, 0.0);

    AnchorPane anchorPane = new AnchorPane();
    anchorPane.setPrefWidth(window.getWidth()-400);
    anchorPane.setMaxWidth(window.getWidth() - 400);
    anchorPane.setStyle("-fx-background-color: white");

    anchorPane.setMaxHeight(window.getHeight() - 400);
    anchorPane.setPadding(new Insets(20, 20, 20, 20));
    anchorPane.getChildren().add(scrollPane);
    anchorPane.setStyle("-fx-background-color: transparent");

    popOver.setContentNode(anchorPane);
    popOver.setDetached(true);
    //popOver.setDetachedTitle("Log Entries");
    popOver.show(logLink.getScene().getWindow());
}
 
开发者ID:frosch95,项目名称:GeoFroggerFX,代码行数:67,代码来源:DetailsController.java

示例7: EventPopOver

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public EventPopOver(EventBoxClicked e, CalendarController controller) {
    event = e.getEvent();

    ObservableList<String> participationStatusChoice = FXCollections.observableArrayList();
    participationStatusChoice.addAll("Kanskje", "Deltar", "Deltar ikke");

    Pane pane = new Pane();
    VBox box = new VBox();
    HBox hBox = new HBox();

    ChoiceBox<String> status = new ChoiceBox<String>(participationStatusChoice);
    String sValue = event.statusToString();

    String str = String.format(formatStr, event.getName(), event.getDate(), event.getStartTime(),
            event.getEndTime(), event.getRoom().getRoomName());
    Text text = new Text(str);

    status.getSelectionModel().select(participationStatusChoice.indexOf(sValue));
    Button button = new Button("Endre");
    button.setOnAction((ActionEvent changeStatusEvent) -> {
        switch (status.getValue()) {
            case "Deltar":
                event.setStatus(Event.Status.ATTENDING);
                break;
            case "Kanskje":
                event.setStatus(Event.Status.MAYBE);
                break;
            case "Deltar ikke":
                event.setStatus(Event.Status.NOT_ATTENDING);
                break;
        }

        controller.handleChangeParticipationStatus(event);
    });
    Button editEventButton = new Button("Vis Info/Endre Avtale");
    editEventButton.setOnAction((ActionEvent editEventEvent) -> {
        controller.editEvent(event);
    });


    hBox.getChildren().addAll(status, button);



    box.getChildren().addAll(text, hBox);
    if(event.getCreator().getUsername().equals(controller.getConnectedUser().getUsername())){
        box.getChildren().add(editEventButton);
    }
    if (e.getConflictingEvents().size() != 0) {
        String conflicts = "Overlappende avtaler: ";
        for (Event conflictingEvent : e.getConflictingEvents()) {
            conflicts = conflicts + "\n" + conflictingEvent.getName();
        }
        Text conflictsText = new Text(conflicts);
        box.getChildren().add(conflictsText);
        conflictsText.setFill(Color.RED);
    }
    pane.getChildren().add(box);

    box.setPadding(new Insets(10));
    box.setSpacing(6);
    hBox.setSpacing(5);
    text.setLineSpacing(2);

    popOver = new PopOver(pane);
    popOver.setDetachable(false);
    popOver.show(controller.getRoot(), e.getScreenX(), e.getScreenY());
}
 
开发者ID:Fellesprosjekt-27,项目名称:fellesprosjekt,代码行数:69,代码来源:EventPopOver.java

示例8: createAddDialog

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public static PopOver createAddDialog(final Node root, final IService service) {
	final PopOver popOver = createBasePopOver("Add new Channel or Service");
	final VBox dialogBox = new VBox();
	final HBox buttonBox = new HBox();
	final Button submitButton = new Button("Submit");
	final Button cancelButton = new Button("Cancel");
	final HBox nameBox = new HBox();
	final Label nameLabel = new Label("Name ");
	final TextField nameTextField = new TextField();
	final Button addChannelButton = new Button("Add Channel");
	final Button addServiceButton = new Button("Add Service");
	final HBox urlBox = new HBox();
	final Label urlLabel = new Label("URL ");
	final TextField urlTextField = new TextField();
	nameBox.getChildren().add(nameLabel);
	nameBox.getChildren().add(nameTextField);

	urlBox.getChildren().add(urlLabel);
	urlBox.getChildren().add(urlTextField);

	buttonBox.getChildren().add(submitButton);
	buttonBox.getChildren().add(cancelButton);

	dialogBox.setPadding(INSETS);

	dialogBox.getChildren().add(addChannelButton);
	dialogBox.getChildren().add(addServiceButton);
	addChannelButton.setOnAction(event -> {
		dialogBox.getChildren().clear();
		dialogBox.getChildren().add(nameBox);
		dialogBox.getChildren().add(buttonBox);
	});
	addServiceButton.setOnAction(event -> {
		dialogBox.getChildren().clear();
		dialogBox.getChildren().add(nameBox);
		dialogBox.getChildren().add(urlBox);
		dialogBox.getChildren().add(buttonBox);
	});
	submitButton.setOnAction(event -> {
		if (dialogBox.getChildren().contains(urlBox)) {
			final String serviceName = nameTextField.getText();
			final String serviceUrl = urlTextField.getText();
			LsGuiUtils.addService(serviceName, serviceUrl);
		} else {
			final String channelName = nameTextField.getText();
			LsGuiUtils.addChannelToService(channelName, service);
		}
		popOver.hide();
	});
	submitButton.setDefaultButton(true);
	cancelButton.setOnAction(event -> popOver.hide());

	popOver.setContentNode(dialogBox);
	final Point2D clickedPoint = getClickedPoint(root);
	popOver.show(root.getParent(), clickedPoint.getX(), clickedPoint.getY());
	return popOver;
}
 
开发者ID:westerwave,项目名称:livestreamer_twitch_gui,代码行数:58,代码来源:PopOverUtil.java


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