本文整理了Java中javafx.scene.control.Label.setMaxHeight()
方法的一些代码示例,展示了Label.setMaxHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setMaxHeight()
方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:setMaxHeight
暂无
代码示例来源:origin: torakiki/pdfsam
public Footer(RunButton runButton, OpenButton openButton, String ownerModule) {
this.ownerModule = defaultString(ownerModule);
this.openButton = openButton;
this.runButton = runButton;
this.getStyleClass().addAll("pdfsam-container", "footer-pane");
this.statusLabel.getStyleClass().add("status-label");
this.statusLabel.setVisible(false);
this.bar.setMaxWidth(Double.MAX_VALUE);
this.bar.getStyleClass().add("pdfsam-footer-bar");
this.statusLabel.setMaxHeight(Double.MAX_VALUE);
VBox progressPane = new VBox(statusLabel, bar);
progressPane.getStyleClass().add("progress-pane");
VBox.setVgrow(statusLabel, Priority.ALWAYS);
HBox.setHgrow(bar, Priority.ALWAYS);
HBox.setHgrow(progressPane, Priority.ALWAYS);
this.failed.setVisible(false);
StackPane buttons = new StackPane(failed, openButton);
buttons.setAlignment(Pos.CENTER_LEFT);
this.getChildren().addAll(runButton, buttons, progressPane);
eventStudio().add(TaskExecutionRequestEvent.class, e -> {
if (e.getModuleId().equals(ownerModule)) {
failed.setVisible(false);
openButton.setVisible(false);
statusLabel.setVisible(true);
statusLabel.setText(DefaultI18nContext.getInstance().i18n("Requested"));
bar.setProgress(0);
}
});
eventStudio().addAnnotatedListeners(this);
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
public LineInfo() {
this.markerLabel = new Label();
this.markerLabel.setPrefWidth(20);
this.lineText = new Label();
this.lineText.getStyleClass().add("line-ruler-text"); //$NON-NLS-1$
this.lineText.setMaxWidth(Double.MAX_VALUE);
this.lineText.setMaxHeight(Double.MAX_VALUE);
this.lineText.setAlignment(Pos.CENTER_RIGHT);
HBox.setHgrow(this.lineText, Priority.ALWAYS);
getChildren().addAll(this.markerLabel, this.lineText);
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
v.setFitWidth(size(getSkinnable().getIconSize()) - 10);
v.setPreserveRatio(true);
l.setMaxHeight(size(getSkinnable().getIconSize()));
setGraphic(l);
} else {
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
v.setFitWidth(size(getSkinnable().getIconSize()) - 10);
v.setPreserveRatio(true);
l.setMaxHeight(size(getSkinnable().getIconSize()));
setGraphic(l);
} else {
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
this.minButton.visibleProperty().bind(minimizableProperty());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
maxButton.visibleProperty().bind(maximizableProperty());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
this.minButton.visibleProperty().bind(minimizableProperty());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
maxButton.visibleProperty().bind(maximizableProperty());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: org.controlsfx/controlsfx
@Override
protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) {
final double contentPrefHeight = content.prefHeight(contentWidth);
// we calculate the pref width of the expand/collapse button. We will
// ensure that the button does not get smaller than this.
final double toggleButtonPrefWidth = expandCollapseButton.prefWidth(-1);
expandCollapseButton.setMinWidth(toggleButtonPrefWidth);
// All remaining width goes to the info label
final Insets infoPanelPadding = infoPanel.getPadding();
final double infoLabelWidth = snapSize(contentWidth - toggleButtonPrefWidth -
infoPanelPadding.getLeft() - infoPanelPadding.getRight());
// we then can work out the necessary height for the info panel, based on
// whether it is expanded or not, and given the current state of the animation.
final double prefInfoPanelHeight = (snapSize(infoLabel.prefHeight(infoLabelWidth)) +
snapSpace(infoPanel.getPadding().getTop()) +
snapSpace(infoPanel.getPadding().getBottom())) *
transition.get();
infoLabel.setMaxWidth(infoLabelWidth);
infoLabel.setMaxHeight(prefInfoPanelHeight);
// position the imageView
layoutInArea(content, contentX, contentY,
contentWidth, contentHeight, -1, HPos.CENTER, VPos.TOP);
// position the infoPanel (the HBox consisting of the Label and ToggleButton)
layoutInArea(infoPanel, contentX, snapPosition(contentPrefHeight - prefInfoPanelHeight),
contentWidth, prefInfoPanelHeight, 0, HPos.CENTER, VPos.BOTTOM);
}
代码示例来源:origin: org.controlsfx/controlsfx
messageLabel.setWrapText(true);
messageLabel.setAlignment(Pos.TOP_LEFT);
messageLabel.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(messageLabel, Priority.SOMETIMES);
内容来源于网络,如有侵权,请联系作者删除!