本文整理汇总了Java中org.controlsfx.control.PopOver类的典型用法代码示例。如果您正苦于以下问题:Java PopOver类的具体用法?Java PopOver怎么用?Java PopOver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PopOver类属于org.controlsfx.control包,在下文中一共展示了PopOver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: DatePopOver
import org.controlsfx.control.PopOver; //导入依赖的package包/类
/**
* Constructs a new popover for the given date.
*
* @param control the date control where the popover is being used
* @param date the date for which to show the entries
*/
public DatePopOver(DateControl control, LocalDate date) {
this.dateControl = requireNonNull(control);
this.date = requireNonNull(date);
EntriesPane entriesPane = new EntriesPane();
getRoot().getStylesheets().add(CalendarView.class.getResource("calendar.css").toExternalForm());
getRoot().getStyleClass().add("root");
List<Entry<?>> entries = findEntries();
if (entries == null || entries.isEmpty()) {
Label label = new Label();
label.setText("No Entries"); //$NON-NLS-1$
label.getStyleClass().add("no-entries-label"); //$NON-NLS-1$
setContentNode(label);
} else {
entriesPane.getEntries().setAll(entries);
setContentNode(entriesPane);
}
getStyleClass().add("date-popover"); //$NON-NLS-1$
setArrowIndent(4);
setDetachable(false);
setArrowLocation(PopOver.ArrowLocation.LEFT_CENTER);
setCornerRadius(4);
}
示例3: 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();
}
});
}
示例4: createPopOver
import org.controlsfx.control.PopOver; //导入依赖的package包/类
private void createPopOver(final TMAEntry entry, final boolean isOverlay) {
// Request full resolution image
Image image = isOverlay ? cache.getOverlay(entry, -1) : cache.getImage(entry, -1);
if (image == null)
return;
// Create PopOver to show larger image
ImageView imageView = new ImageView(image);
imageView.setPreserveRatio(true);
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
// TODO: Consider setting max width/height elsewhere, so user can adjust?
imageView.setFitWidth(Math.min(primaryScreenBounds.getWidth()*0.5, image.getWidth()));
imageView.setFitHeight(Math.min(primaryScreenBounds.getHeight()*0.75, image.getHeight()));
// Enable copying to clipboard
miCopy.setOnAction(e -> {
ClipboardContent content = new ClipboardContent();
content.putImage(image);
Clipboard.getSystemClipboard().setContent(content);
});
imageView.setOnContextMenuRequested(e -> menu.show(this, e.getScreenX(), e.getScreenY()));
popOver = new PopOver(imageView);
String name = this.getTreeTableRow().getItem() == null ? null : this.getTreeTableRow().getItem().getName();
if (name != null)
popOver.setTitle(name);
}
示例5: 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.");
}
});
}
示例6: 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);
}
示例7: 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();
});
}
示例8: updateUser
import org.controlsfx.control.PopOver; //导入依赖的package包/类
/**
* Helper method to show a popover about a branch type
* @param branchType the type of branch that there is a status about
*/
private void updateUser(String message, BranchModel.BranchType branchType) {
Platform.runLater(() -> {
Text txt = new Text(message);
PopOver popOver = new PopOver(txt);
popOver.setTitle("");
Button buttonToShowOver;
ComboBox<? extends BranchHelper> dropdownToReset;
if (branchType == BranchModel.BranchType.LOCAL) {
buttonToShowOver = deleteButton;
dropdownToReset = localBranchesDropdown;
} else {
buttonToShowOver = deleteButton2;
dropdownToReset = remoteBranchesDropdown;
}
System.out.println("here i am " + message);
popOver.show(buttonToShowOver);
System.out.println("showed");
popOver.detach();
popOver.setAutoHide(true);
dropdownToReset.getSelectionModel().clearSelection();
});
}
示例9: HttpSettingsPopOver
import org.controlsfx.control.PopOver; //导入依赖的package包/类
public HttpSettingsPopOver() {
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/popover.http.settings.fxml"));
Parent root = loader.load();
httpSettingsController = loader.getController();
setContentNode(root);
} catch (IOException e) {
LOGGER.error("Error load headers pop over: {}", e.getMessage());
}
// Pop over settings
setDetachable(false);
setArrowLocation(PopOver.ArrowLocation.TOP_LEFT);
setOnHidden(event -> {
getMainController().getHttpSettings().setSelected(false);
httpSettingsController.getHeadersListView().getSelectionModel().clearSelection();
httpSettingsController.getParametersListView().getSelectionModel().clearSelection();
});
}
示例10: 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();
}
});
}
示例11: call
import org.controlsfx.control.PopOver; //导入依赖的package包/类
@Override
public Node call(DateControl.EntryDetailsPopOverContentParameter param) {
PopOver popOver = param.getPopOver();
GoogleEntry entry = (GoogleEntry) param.getEntry();
InvalidationListener listener = obs -> {
if (entry.isFullDay() && !popOver.isDetached()) {
popOver.setDetached(true);
}
};
entry.fullDayProperty().addListener(listener);
popOver.setOnHidden(evt -> entry.fullDayProperty().removeListener(listener));
return new GoogleEntryPopOverContentPane(entry, param.getDateControl().getCalendars());
}
示例12: ASTSqlCodeAreaHelper
import org.controlsfx.control.PopOver; //导入依赖的package包/类
public ASTSqlCodeAreaHelper(CodeArea codeArea, ConnectionSupplier connectionSupplier) {
this.codeArea = codeArea;
this.connectionSupplier = connectionSupplier;
view = createResourceView();
codeArea.setPopupWindow(new PopOver(view));
codeArea.setPopupAlignment(PopupAlignment.SELECTION_TOP_CENTER);
codeArea.addEventHandler(KeyEvent.KEY_PRESSED, ev -> {
if (ev.isControlDown() && ev.getCode() == KeyCode.SPACE) {
if (ev.isConsumed())
return;
String string = markText(codeArea);
view.getTxtFilter().setText(string);
replaceTarget.set(string);
codeArea.getPopupWindow().show(codeArea.getScene().getWindow());
codeArea.getPopupWindow().requestFocus();
view.getTxtFilter().requestFocus();
view.getTxtFilter().selectEnd();
ev.consume();
}
});
}
示例13: 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();
}
}
示例14: 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();
}
}
示例15: 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();
}
}