本文整理汇总了Java中org.controlsfx.control.PopOver.setDetachable方法的典型用法代码示例。如果您正苦于以下问题:Java PopOver.setDetachable方法的具体用法?Java PopOver.setDetachable怎么用?Java PopOver.setDetachable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.controlsfx.control.PopOver
的用法示例。
在下文中一共展示了PopOver.setDetachable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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();
}
}
示例3: 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();
}
}
示例4: 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();
}
}
示例5: 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);
}
示例6: createErrorPopOver
import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private static void createErrorPopOver(String errorMessage) {
Label errorLabel = new AutoTooltipLabel(errorMessage);
errorLabel.setId("validation-error");
errorLabel.setPadding(new Insets(0, 10, 0, 10));
errorLabel.setOnMouseClicked(e -> hideErrorMessageDisplay());
errorMessageDisplay = new PopOver(errorLabel);
errorMessageDisplay.setDetachable(true);
errorMessageDisplay.setDetachedTitle(Res.get("shared.close"));
errorMessageDisplay.setArrowIndent(5);
}
示例7: 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);
}
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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());
}