本文整理汇总了Java中org.controlsfx.control.HiddenSidesPane类的典型用法代码示例。如果您正苦于以下问题:Java HiddenSidesPane类的具体用法?Java HiddenSidesPane怎么用?Java HiddenSidesPane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HiddenSidesPane类属于org.controlsfx.control包,在下文中一共展示了HiddenSidesPane类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AvailableUsersPane
import org.controlsfx.control.HiddenSidesPane; //导入依赖的package包/类
/**
* Constructor for the AvailableUsersPane.
*/
public AvailableUsersPane() {
searchField = new CustomTextField();
searchField.setRight(new SVGIcon(FontAwesomeIcon.SEARCH, Constants.EXTRA_SMALL_ICON, true));
searchField.textProperty().addListener((observable, oldValue, newValue) -> search(newValue));
userPanes = new VBox(Constants.INSETS);
statusIcon = new BorderPane(new SVGIcon(MaterialDesignIcon.ACCOUNT_CIRCLE, Constants.MIDDLE_ICON, true));
final ScrollPane verticalScrollPane = new ScrollPane();
verticalScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
verticalScrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
final ScrollBar scrollBar = new ScrollBar();
scrollBar.setOrientation(Orientation.VERTICAL);
this.hiddenSidesPane = new HiddenSidesPane();
hiddenSidesPane.setContent(verticalScrollPane);
hiddenSidesPane.setRight(scrollBar);
//hiddenSidesPane.setTriggerDistance(Constants.TRIGGER_DISTANCE);
scrollBar.maxProperty().bind(verticalScrollPane.vmaxProperty());
scrollBar.minProperty().bind(verticalScrollPane.vminProperty());
verticalScrollPane.setContent(userPanes);
verticalScrollPane.setFitToWidth(true);
enableSearchField(false);
hoverProperty().addListener((observable, oldValue, newValue) -> {
enableSearchField(newValue);
});
}
示例2: ContextMenu
import org.controlsfx.control.HiddenSidesPane; //导入依赖的package包/类
/**
* Constructor for the ContextMenu.
*
* @param height Height
* @param width Width
*/
public ContextMenu(final double height, final double width) {
this.setMinHeight(height);
this.setMinWidth(width);
this.setPrefHeight(height);
this.setPrefWidth(width);
fullscreenBtn = new FloatingButton(new SVGIcon(MaterialIcon.FULLSCREEN, Constants.MIDDLE_ICON, true));
settingsBtn = new FloatingButton(new SVGIcon(MaterialDesignIcon.SETTINGS, Constants.MIDDLE_ICON, true));
HBox floatingButtons = new HBox(20.0, settingsBtn, fullscreenBtn);
floatingButtons.setAlignment(Pos.TOP_LEFT);
floatingButtons.translateYProperty().set(Constants.FLOATING_BUTTON_OFFSET_Y);
floatingButtons.translateXProperty().set(Constants.FLOATING_BUTTON_OFFSET_X);
roomInfo = new Label("Select a Room");
roomInfo.setAlignment(Pos.TOP_CENTER);
roomInfo.getStyleClass().clear();
roomInfo.getStyleClass().add("headline");
verticalScrollPane = new ScrollPane();
verticalScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
verticalScrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
final ScrollBar scrollBar = new ScrollBar();
scrollBar.setOrientation(Orientation.VERTICAL);
final HiddenSidesPane hiddenSidesPane = new HiddenSidesPane();
hiddenSidesPane.setContent(verticalScrollPane);
hiddenSidesPane.setRight(scrollBar);
hiddenSidesPane.setTriggerDistance(Constants.TRIGGER_DISTANCE);
hiddenSidesPane.getStyleClass().add("hidden-sides-pane");
scrollBar.maxProperty().bind(verticalScrollPane.vmaxProperty());
scrollBar.minProperty().bind(verticalScrollPane.vminProperty());
verticalScrollPane.vvalueProperty().bindBidirectional(scrollBar.valueProperty());
//TODO: Delete completely - at the moment it is just not added to the rest
contextSortingPane = new ContextSortingPane(width + Constants.INSETS);
contextSortingPane.setMaxWidth(Double.MAX_VALUE);
titledPaneContainer = new TitledUnitPaneContainer();
verticalScrollPane.setFitToWidth(true);
verticalScrollPane.setContent(titledPaneContainer);
//TODO: Find a nicer way to scale the size of the scroll bar thumb
scrollBar.setVisibleAmount(0.25);
this.getChildren().addAll(floatingButtons, roomInfo, hiddenSidesPane);
//VBox.setVgrow(contextSortingPane, Priority.ALWAYS);
this.getStyleClass().addAll("detail-menu");
}