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


Java PopOver.setContentNode方法代码示例

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


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

示例1: setupPopover

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
/**
 * Helper method to attach a pop-over to a button (so it appears/disappears when you
 * click the button).
 *
 * @param content
 * @param popOverTitle
 * @param buttonToAttachTo
 */
private void setupPopover(Node content, String popOverTitle, Button buttonToAttachTo) {

    // This creates the popover, but is not shown until
    // show() is called.
    PopOver popover = new PopOver();
    popover.setContentNode(content);
    popover.setArrowLocation(PopOver.ArrowLocation.LEFT_CENTER);
    popover.setCornerRadius(4);
    popover.setTitle(popOverTitle);

    buttonToAttachTo.setOnAction(event -> {

        if (popover.isShowing()) {
            popover.hide();
        } else if (!popover.isShowing()) {
            showPopover(buttonToAttachTo, popover);
        } else {
            new RuntimeException("isShowing() state not recognised.");
        }
    });
}
 
开发者ID:mbedded-ninja,项目名称:NinjaTerm,代码行数:30,代码来源:TxRxViewController.java

示例2: setPopOverTooltipToNode

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
/**
 * Sets {@link PopOver} as tooltip to a specified node to show specified content.
 * 
 * @param nodeToTooltip
 *            The node over which to show the PopOver.
 * @param popoverContent
 *            The node to show inside PopOver.
 * @param offset
 *            The offset of PopOver relative to nodeToTooltip.
 */
public static void setPopOverTooltipToNode(Node nodeToTooltip, Node popoverContent,
		double offset) {
	PopOver over = new PopOver();
	over.setConsumeAutoHidingEvents(false);
	over.setAutoHide(false);
	over.setDetachable(true);
	over.setArrowLocation(ArrowLocation.BOTTOM_CENTER);
	over.setContentNode(popoverContent);
	// This tooltip's behavior of showing will be used to show popover at right time.
	Tooltip invisibleTooltip = new Tooltip();
	invisibleTooltip.setAutoHide(false);
	invisibleTooltip.setConsumeAutoHidingEvents(false);
	invisibleTooltip.setOpacity(0.0);
	invisibleTooltip.setOnShown((e) -> {
		over.show(nodeToTooltip, offset);
	});
	invisibleTooltip.setOnHidden((e) -> {
		over.hide();
	});
	Tooltip.install(nodeToTooltip, invisibleTooltip);
}
 
开发者ID:ubershy,项目名称:StreamSis,代码行数:32,代码来源:GUIUtil.java

示例3: setPopOver

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public void setPopOver(ImageView imageView, Image image) {
    PopOver popOver = new PopOver();
    popOver.setAnimated(false);

    VBox root = new VBox();
    root.setSpacing(3);
    root.setPadding(new Insets(10));

    root.getChildren().add(new Label(" image: " + image.getImageName()));

    if(image.getPosition() != -1)
        root.getChildren().add(new Label(" position: " + image.getPosition()));

    if(image.getScore() != -1)
        root.getChildren().add(new Label(" score: " + image.getScore()));

    popOver.setContentNode(root);
    popOver.setArrowLocation(PopOver.ArrowLocation.TOP_CENTER);

    imageView.hoverProperty().addListener((observable, wasHovering, isHovering) -> {
        if(isHovering && !popOver.isShowing()) {
            popOver.show(imageView);
        } else if(popOver.isShowing()) {
            popOver.hide();
        }
    });
}
 
开发者ID:AntonioGabrielAndrade,项目名称:LIRE-Lab,代码行数:28,代码来源:ToolTipProvider.java

示例4: setupFactoid

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public void setupFactoid() {
        factoidSelector.setItems(FXCollections.observableArrayList(DataManager.getFactiodTypes()));
        factoidSelector.setValue(DataManager.getFactiodTypes()[0]);
        factoidSelector.valueProperty().addListener((observe,old,neo)->updateFactoid());
        categorySelector.valueProperty().addListener((observe,old,neo)->updateFactoid());
        chartNumOfFacts.setLegendVisible(false);
        chartAverageFactRating.setLegendVisible(false);
        
        // Pop Overs
        numOfFactsPopOver = new PopOver();
        numOfFactsPopOver.setAutoHide(true);
//        reviewPerYearPopOver.setAutoFix(true);
        numOfFactsPopOver.setHideOnEscape(true);
        numOfFactsPopOver.setDetachable(false);
        numOfFactsPopOver.setArrowLocation(PopOver.ArrowLocation.LEFT_CENTER);
        chartNumOfFacts.setOnMouseClicked(e -> {
            if (e.getClickCount() == 2) {
                numOfFactsPopOver.show(chartNumOfFacts);
            }
        });

        try {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/retrospector/fxml/chart/FactoidChartPopup.fxml"));
            Parent root = (Parent) fxmlLoader.load();
            numOfFactsSettings = fxmlLoader.getController();
            numOfFactsSettings.setup(this::updateFactoid);
            numOfFactsPopOver.setContentNode(root);
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }
 
开发者ID:NonlinearFruit,项目名称:Retrospector,代码行数:32,代码来源:StatsTabController.java

示例5: setupCategory

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public void setupCategory() {
        ObservableList<String> categories = FXCollections.observableArrayList(DataManager.getCategories());
        categories.add(0,universalCategory);
        categorySelector.setItems(categories);
        categorySelector.setValue(DataManager.getCategories()[0]);
        categorySelector.valueProperty().addListener((observe,old,neo)->updateCategory());
        chartReviewsPerRating.setLegendVisible(false);
        chartRprX.setLabel("Rating");
        chartRprY.setLabel("Reviews");
        chartRpyX.setLabel("Month");
        chartRpyY.setLabel("Reviews");
        
        // Pop Overs
        reviewPerYearPopOver = new PopOver();
        reviewPerYearPopOver.setAutoHide(true);
//        reviewPerYearPopOver.setAutoFix(true);
        reviewPerYearPopOver.setHideOnEscape(true);
        reviewPerYearPopOver.setDetachable(false);
        reviewPerYearPopOver.setArrowLocation(PopOver.ArrowLocation.LEFT_CENTER);
        chartReviewsPerYear.setOnMouseClicked(e->{
            if (e.getClickCount() == 2)
                reviewPerYearPopOver.show(chartReviewsPerYear);
        });
        
        try {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/retrospector/fxml/chart/ChartPopup.fxml"));
            Parent root = (Parent) fxmlLoader.load();
            reviewPerYearSettings = fxmlLoader.getController();
            reviewPerYearSettings.setup(this::updateCategory);
            reviewPerYearPopOver.setContentNode(root);
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }
 
开发者ID:NonlinearFruit,项目名称:Retrospector,代码行数:35,代码来源:StatsTabController.java

示例6: setupOverall

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public void setupOverall() {
        for (String user : DataManager.getUsers()) {
            addUserToOverallUserList(user);
        }
        overallUserList.setCellFactory(CheckBoxListCell.forListView(Stroolean::booleanProperty));
        overallUserList.setOnMouseClicked(e -> {
            if (e.getClickCount() == 2) {
                Stroolean me = overallUserList.getSelectionModel().getSelectedItem();
                for (Stroolean stroolean : strooleans)
                    stroolean.setBoolean(false);
                me.setBoolean(true);
            }
        });
        chartRpdX.setLabel("Day");
        chartRpdY.setLabel("Reviews");
        chartMediaPerCategory.setLegendVisible(true);
        
        // Pop Overs
        mediaPerCategoryPopOver = new PopOver();
        mediaPerCategoryPopOver.setAutoHide(true);
//        mediaPerCategoryPopOver.setAutoFix(true);
        mediaPerCategoryPopOver.setHideOnEscape(true);
        mediaPerCategoryPopOver.setDetachable(false);
        mediaPerCategoryPopOver.setArrowLocation(PopOver.ArrowLocation.LEFT_CENTER);
        chartMediaPerCategory.setOnMouseClicked(e -> {
            if (e.getClickCount() == 2)
                mediaPerCategoryPopOver.show(chartMediaPerCategory);
        });
        
        try {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/retrospector/fxml/chart/ChartPopup.fxml"));
            Parent root = (Parent) fxmlLoader.load();
            mediaPerCategorySettings = fxmlLoader.getController();
            mediaPerCategorySettings.setup(this::updateOverall);
            mediaPerCategoryPopOver.setContentNode(root);
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }
 
开发者ID:NonlinearFruit,项目名称:Retrospector,代码行数:40,代码来源:StatsTabController.java

示例7: initializeTodoPopOver

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private void initializeTodoPopOver() {
	popOver = new PopOver();
	popOver.autoHideProperty().set(true);
	popOver.detachedTitleProperty().set("Todos");
	
	popOver.setContentNode(createPopOverContent());
}
 
开发者ID:chilloutman,项目名称:photo-flow,代码行数:8,代码来源:ProjectController.java

示例8: initialize

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
@Override
public void initialize(final URL location, final ResourceBundle resources) {

    popOver = new PopOver();

    popOver.setTitle("Artist info");
    popOver.setDetachable(false);
    popOver.setAnimated(true);
    popOver.setArrowLocation(TOP_CENTER);
    popOver.setContentNode(gridPane);

    similarArtistList = FXCollections.emptyObservableList();

    similarArtistsTableView = new TableView<>();
    List<TableColumn<Artist, String>> colNames = new ArrayList<>();
    for (String string : COL_NAMES) {
        TableColumn<Artist, String> cell = new TableColumn<>(string);
        cell.setCellValueFactory(new PropertyValueFactory<>(string));
        // itt állítom le az oszlop érték szerinti rendezését
        cell.setSortable(false);
        colNames.add(cell);
    }
    similarArtistsTableView.getColumns().addAll(colNames);

    // megoldja, hogy ne lehessen a táblázatban az oszlopokat felcserélni
    // hozzáad egy listenert, ami figyeli hogy változtatták -e a táblázatot
    similarArtistsTableView.widthProperty().addListener((source, oldWidth, newWidth) -> {
        // megkeresi a fejlécet
        TableHeaderRow header = (TableHeaderRow) similarArtistsTableView.lookup("TableHeaderRow");
        // ha meglett a fejléc annak az újrarendezhetőségét akadályozza
        // meg
        header.reorderingProperty().addListener((observable, oldValue, newValue) -> header.setReordering(false));
    });

    similarArtistsTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    similarArtistsTableView.setPlaceholder(new Label("No similar artists found!"));
    gridPane.getChildren().add(similarArtistsTableView);
}
 
开发者ID:djazz90,项目名称:LightningPlayer,代码行数:39,代码来源:ArtistInfoController.java

示例9: 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

示例10: 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

示例11: 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

示例12: createMultipleSelectedBottom

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private void createMultipleSelectedBottom() {
  BorderPane help = new BorderPane();
  help.getStyleClass().add(Constants.CSS_INSPECTIONPART);

  HBox top = new HBox();
  top.getStyleClass().add(Constants.CSS_HBOX);
  top.setPadding(new Insets(5, 15, 10, 15));

  Label title = new Label(I18n.t(Constants.I18N_INSPECTIONPANE_MULTIPLE_SELECTED_HELP_TITLE).toUpperCase());
  title.setPadding(new Insets(5, 0, 0, 0));
  title.getStyleClass().add(Constants.CSS_TITLE);
  top.getChildren().add(title);
  help.setTop(top);

  Label multSelectedHelp = new Label(I18n.t(Constants.I18N_INSPECTIONPANE_MULTIPLE_SELECTED_HELP));
  multSelectedHelp.setPadding(new Insets(10, 10, 10, 10));
  multSelectedHelp.setStyle(Constants.CSS_FX_TEXT_FILL_BLACK);
  multSelectedHelp.setWrapText(true);

  help.setCenter(multSelectedHelp);

  BorderPane confirm = new BorderPane();
  confirm.getStyleClass().add(Constants.CSS_INSPECTIONPART);

  HBox confirmTop = new HBox();
  confirmTop.getStyleClass().add(Constants.CSS_HBOX);
  confirmTop.setPadding(new Insets(5, 15, 10, 15));

  Label confirmTitle = new Label(I18n.t(Constants.I18N_APPLY).toUpperCase());
  confirmTitle.setAlignment(Pos.CENTER_LEFT);
  confirmTitle.setPadding(new Insets(5, 0, 0, 0));
  confirmTitle.getStyleClass().add(Constants.CSS_TITLE);
  confirmTop.getChildren().add(confirmTitle);
  confirm.setTop(confirmTop);

  PopOver applyPopOver = new PopOver();
  applyPopOver.setDetachable(false);
  applyPopOver.setArrowLocation(PopOver.ArrowLocation.BOTTOM_RIGHT);

  HBox popOverContent = new HBox(10);
  popOverContent.setPadding(new Insets(5, 15, 5, 15));
  popOverContent.setAlignment(Pos.CENTER);
  HBox.setHgrow(popOverContent, Priority.ALWAYS);
  Label popOverTitle = new Label(I18n.t(Constants.I18N_INSPECTIONPANE_MULTIPLE_SELECTED_APPLIED_MESSAGE));
  popOverTitle.setStyle(Constants.CSS_FX_FONT_SIZE_16PX);
  Platform.runLater(() -> {
    ImageView iv = new ImageView(FontAwesomeImageCreator.generate(FontAwesomeImageCreator.CHECK, Color.GREEN, 32));
    popOverContent.getChildren().addAll(popOverTitle, iv);
  });
  applyPopOver.setContentNode(popOverContent);

  HBox multSelectedSaveBox = new HBox(5);
  multSelectedSaveBox.setPadding(new Insets(10, 10, 10, 10));
  multSelectedSaveBox.getStyleClass();
  multSelectedSaveBox.setStyle(Constants.CSS_FX_TEXT_FILL_BLACK);
  Label confirmationLabel = new Label(I18n.t(Constants.I18N_INSPECTIONPANE_MULTIPLE_SELECTED_CONFIRM));
  confirmationLabel.setStyle(Constants.CSS_FX_TEXT_FILL_BLACK);
  Button save = new Button(I18n.t(Constants.I18N_APPLY));
  save.setOnAction(event -> {
    applyMetadatasToMultipleItems();
    applyPopOver.show(save);
  });

  HBox space = new HBox();
  HBox.setHgrow(space, Priority.ALWAYS);

  multSelectedSaveBox.getChildren().addAll(confirmationLabel, space, save);
  confirm.setCenter(multSelectedSaveBox);

  multSelectedBottom = new VBox(10);
  multSelectedBottom.getChildren().addAll(help, confirm);
}
 
开发者ID:keeps,项目名称:roda-in,代码行数:73,代码来源:InspectionPane.java

示例13: update

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
/**
 * Updates the UI using a SchemaNode.
 * <p/>
 * <p>
 * Uses the metadata and rule list to update the UI. The rule list is used to
 * create a ListView of RuleCell.
 * </p>
 *
 * @param node
 *          The SchemaNode used to update the UI.
 * @see RuleCell
 * @see SchemaNode
 */
public void update(SchemaNode node) {
  setTop(topBox);
  currentDescOb = node.getDob();
  currentSIPNode = null;
  selectedItems = null;
  currentSchema = node;
  if (contentTask != null && contentTask.isRunning()) {
    contentTask.cancel(true);
  }
  if (metadataTask != null && metadataTask.isRunning()) {
    metadataTask.cancel(true);
  }

  HBox space = new HBox();
  HBox.setHgrow(space, Priority.ALWAYS);
  PopOver editPopOver = new PopOver();
  editPopOver.setDetachable(false);
  editPopOver.setArrowLocation(PopOver.ArrowLocation.TOP_RIGHT);

  editButton = new Button();
  Platform.runLater(() -> {
    ImageView iv = new ImageView(FontAwesomeImageCreator.generate(FontAwesomeImageCreator.PENCIL, Color.WHITE, 16));
    editButton.setGraphic(iv);
  });
  editButton.getStyleClass().add(Constants.CSS_TOP_SUBTITLE);
  editButton.setGraphicTextGap(5);
  editButton.setContentDisplay(ContentDisplay.RIGHT);
  editButton.setWrapText(true);
  editButton.setOnAction(event -> editPopOver.show(editButton));

  HBox popOverContent = new HBox(10);
  popOverContent.getStyleClass().add(Constants.CSS_INSPECTIONPART);
  popOverContent.setPadding(new Insets(5, 15, 5, 15));
  popOverContent.setAlignment(Pos.CENTER);
  HBox.setHgrow(popOverContent, Priority.ALWAYS);
  Label sipTypeLabel = new Label(I18n.t(Constants.I18N_INSPECTIONPANE_SIP_TYPE_TOOLTIP));
  sipTypeLabel.setStyle(Constants.CSS_FX_TEXT_FILL_BLACK);
  popOverContent.getChildren().addAll(sipTypeLabel, createTypeComboBox(node.getDob()));
  editPopOver.setContentNode(popOverContent);

  representationTypeBox.getChildren().clear();
  representationTypeBox.getChildren().addAll(space, editButton);

  topBox.getChildren().remove(representationTypeBox);
  topBox.getChildren().add(representationTypeBox);

  topBox.setPadding(new Insets(15, 15, 15, 15));
  ImageView iconView = new ImageView(node.getIconWhite());
  node.graphicProperty()
    .addListener((observable, oldValue, newValue) -> iconView.setImage(((ImageView) newValue).getImage()));
  createTopSubtitle(iconView, node.getValue());

  /* center */
  center.getChildren().clear();
  metadata.getChildren().clear();
  metadata.getChildren().addAll(metadataTopBox, metadataLoadingPane);
  updateMetadataCombo(false);

  // rules
  updateRuleList();

  center.getChildren().addAll(metadata, rules);
  setCenter(center);
  setBottom(exportBox);
}
 
开发者ID:keeps,项目名称:roda-in,代码行数:79,代码来源:InspectionPane.java

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