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


Java PopOver.setArrowLocation方法代码示例

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


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

示例1: updateNotificationBubble

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
/**
 * Updates the notification alert
 * @param notification new alert
 * @return new PopOver
 */
private PopOver updateNotificationBubble(String notification) {
    Text notifcationText = new Text(notification);
    notifcationText.setWrappingWidth(230);
    notifcationText.setStyle("-fx-font-weight: bold");

    HBox hBox = new HBox(notifcationText);
    hBox.setPadding(new Insets(0, 5, 0, 5));
    hBox.setOnMouseClicked(event -> showNotificationList());

    PopOver popOver = new PopOver(hBox);
    popOver.setTitle("New Notification");
    popOver.setArrowLocation(PopOver.ArrowLocation.BOTTOM_RIGHT);
    popOver.setAnchorLocation(PopupWindow.AnchorLocation.CONTENT_BOTTOM_RIGHT);

    return popOver;
}
 
开发者ID:dmusican,项目名称:Elegit,代码行数:22,代码来源:NotificationController.java

示例2: initialize

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public void initialize()
{
    packList = new VBox();
    packList.setMinWidth(400);
    packList.setPrefWidth(400);
    packList.setMaxWidth(400);
    packList.setAlignment(Pos.CENTER);
    searchPopOver = new PopOver(packList);
    searchPopOver.setArrowLocation(PopOver.ArrowLocation.TOP_CENTER);
    searchPopOver.setAutoHide(false);
    txtSearch.textProperty().addListener((observable, oldValue, newValue) -> search());
    txtSearch.focusedProperty().addListener((observable, oldValue, newValue) ->
    {
        if (newValue)
        {
            search();
        }
        else
        {
            searchPopOver.hide();
        }
    });
}
 
开发者ID:PaleoCrafter,项目名称:CurseSync,代码行数:24,代码来源:MainController.java

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

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

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

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

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

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

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

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

示例11: createBasePopOver

import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private static PopOver createBasePopOver(final String title) {
	final PopOver popOver = new PopOver();
	popOver.getRoot().getStylesheets().add(Settings.getInstance().getCurrentStyleSheet());
	popOver.setArrowLocation(ArrowLocation.TOP_LEFT);
	popOver.setCornerRadius(CORDER_RADIUS);
	popOver.setTitle(title);
	return popOver;
}
 
开发者ID:westerwave,项目名称:livestreamer_twitch_gui,代码行数:9,代码来源:PopOverUtil.java

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

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

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


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