本文整理汇总了Java中javafx.scene.control.Label.setMinWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setMinWidth方法的具体用法?Java Label.setMinWidth怎么用?Java Label.setMinWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Label
的用法示例。
在下文中一共展示了Label.setMinWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeLabel
import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializeLabel() {
LoggerFacade.getDefault().trace(this.getClass(), "Initialize Label"); // NOI18N
lSign = new Label();
lSign.setPadding(DEFAULT_PADDING);
lSign.setMinWidth(26.0d);
lSign.setStyle("-fx-background-color:POWDERBLUE"); // NOI18N
lSign.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
final Term term = new Term();
term.setTitle("" + System.currentTimeMillis()); // NOI18N
this.onActionAddTerm(term);
}
});
super.getChildren().add(0, lSign);
}
示例2: LabelContainer
import javafx.scene.control.Label; //导入方法依赖的package包/类
public LabelContainer(int labelIndex, int bahnsteig, ArrayList<LabelContainer> labelTime) throws Exception{
this.labelTime = labelTime;
this.bahnsteig = bahnsteig;
this.labelIndex = labelIndex;
trains = new ArrayList<>();
hervorhebungDurchGleis = false;
l = new Label();
l.setFont(Font.font(settingsFontSize-5));
l.setMinWidth(settingsGridWidth);
l.setMaxWidth(settingsGridWidth);
l.setAlignment(Pos.CENTER);
if(bahnsteig > -1){
updateLabel();
}
}
示例3: AddPropertiesView
import javafx.scene.control.Label; //导入方法依赖的package包/类
public AddPropertiesView(TestPropertiesInfo issueInfo) {
this.issueInfo = issueInfo;
initComponents();
// @formatter:off
Label severityLabel = new Label("Severity: ");
severityLabel.setMinWidth(Region.USE_PREF_SIZE);
tmsLink.setOnAction((e) -> {
try {
Desktop.getDesktop().browse(new URI(tmsLink.getText()));
} catch (Exception e1) {
FXUIUtils._showMessageDialog(null, "Unable to open link: " + tmsLink.getText(), "Unable to open link",
AlertType.ERROR);
e1.printStackTrace();
}
});
formPane.addFormField("Name: ", nameField)
.addFormField("Description: ", descriptionField)
.addFormField("ID: ", idField, severityLabel, severities);
String tmsPattern = System.getProperty(Constants.PROP_TMS_PATTERN);
if (tmsPattern != null && tmsPattern.length() > 0) {
tmsLink.textProperty().bind(Bindings.format(tmsPattern, idField.textProperty()));
formPane.addFormField("", tmsLink);
}
// @formatter:on
setCenter(content);
}
示例4: createBrowserField
import javafx.scene.control.Label; //导入方法依赖的package包/类
private HBox createBrowserField() {
HBox browseFieldBox = new HBox(5);
dirField = new TextField();
dirField.setId("DirectoryField");
dirField.textProperty().addListener((observable, oldValue, newValue) -> updateOKButton());
HBox.setHgrow(dirField, Priority.ALWAYS);
Button browseButton = FXUIUtils.createButton("browse", "Browse directory", true, "Browse");
FileSelectionHandler browserListener;
String fileType = fileSelectionInfo.getFileType();
if (fileType != null) {
browserListener = new FileSelectionHandler(this,
new ExtensionFilter(fileType, Arrays.asList(fileSelectionInfo.getExtensionFilters())), this, null,
fileSelectionInfo.getTitle());
} else {
browserListener = new FileSelectionHandler(this, null, this, null, fileSelectionInfo.getTitle());
browserListener.setMode(FileSelectionHandler.DIRECTORY_CHOOSER);
}
browserListener.setPreviousDir(new File(System.getProperty(Constants.PROP_PROJECT_DIR, ProjectLayout.projectDir)));
browseButton.setOnAction(browserListener);
Label label = createLabel("Name: ");
label.setMinWidth(Region.USE_PREF_SIZE);
label.setId("FileSelectedLabel");
browseFieldBox.getChildren().addAll(label, dirField, browseButton);
VBox.setMargin(browseFieldBox, new Insets(5, 5, 5, 5));
return browseFieldBox;
}
示例5: createHeader
import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
* Creates the header part for each cell. The header consists of a border pane
* with the weekday label in the "left" position and the date label in the "right"
* position.
*
* @return the header node
*/
protected Node createHeader() {
headerPane = new BorderPane();
headerPane.getStyleClass().add(AGENDA_VIEW_HEADER);
headerPane.setVisible(headerPaneVisible);
headerPane.managedProperty().bind(headerPane.visibleProperty());
weekdayLabel = new Label();
weekdayLabel.getStyleClass().add(AGENDA_VIEW_WEEKDAY_LABEL);
weekdayLabel.setMinWidth(0);
dateLabel = new Label();
dateLabel.setMinWidth(0);
dateLabel.getStyleClass().add(AGENDA_VIEW_DATE_LABEL);
headerPane.setLeft(weekdayLabel);
headerPane.setRight(dateLabel);
return headerPane;
}
示例6: createLeftHandSide
import javafx.scene.control.Label; //导入方法依赖的package包/类
protected Node createLeftHandSide() {
DayPage dayPage = getSkinnable();
// today label
todayLabel = new Label();
todayLabel.getStyleClass().add("today-label"); //$NON-NLS-1$
todayLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
todayLabel.setAlignment(Pos.TOP_LEFT);
todayLabel.setTextOverrun(OverrunStyle.CLIP);
todayLabel.setMinWidth(Region.USE_PREF_SIZE);
HBox.setHgrow(todayLabel, Priority.ALWAYS);
// year month view
yearMonthView = dayPage.getYearMonthView();
yearMonthView.setSelectionMode(SelectionMode.SINGLE);
yearMonthView.setShowMonth(false);
yearMonthView.setShowYear(false);
yearMonthView.setShowTodayButton(false);
HBox.setHgrow(yearMonthView, Priority.NEVER);
getSkinnable().bind(yearMonthView, true);
HBox header = new HBox(10);
header.setFillHeight(true);
header.getChildren().addAll(todayLabel, yearMonthView);
header.getStyleClass().add("header");
AgendaView agendaView = dayPage.getAgendaView();
getSkinnable().bind(agendaView, true);
HBox.setMargin(agendaView, new Insets(10, 0, 0, 0));
BorderPane leftHandSide = new BorderPane();
leftHandSide.getStyleClass().add("left-side");
leftHandSide.setTop(header);
leftHandSide.setCenter(agendaView);
HBox.setHgrow(leftHandSide, Priority.ALWAYS);
return leftHandSide;
}
示例7: disableCheckboxOffset
import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
* Disable the offset of checkbox control.
*/
@FXThread
public void disableCheckboxOffset() {
final CheckBox checkBox = getCheckBox();
checkBox.prefWidthProperty().unbind();
final Label propertyNameLabel = getPropertyNameLabel();
propertyNameLabel.maxWidthProperty().unbind();
propertyNameLabel.setMaxWidth(Region.USE_COMPUTED_SIZE);
propertyNameLabel.prefWidthProperty().bind(widthProperty());
propertyNameLabel.minWidthProperty().unbind();
propertyNameLabel.setMinWidth(Region.USE_COMPUTED_SIZE);
}
示例8: addRow
import javafx.scene.control.Label; //导入方法依赖的package包/类
private static int addRow(String name, Node content, GridPane grid, int row) {
Label label = new Label(name+":");
label.setMinWidth(Label.USE_PREF_SIZE);
grid.add(label, 0, row);
GridPane.setValignment(label, VPos.TOP);
grid.add(content, 1, row);
return row + 1;
}
示例9: createRubyHomeField
import javafx.scene.control.Label; //导入方法依赖的package包/类
private HBox createRubyHomeField() {
HBox rubyHomeBox = new HBox(5);
rubyHomeField = new TextField();
rubyHomeField.setId("RubyHomeField");
rubyHomeField.setPromptText("(Bundled JRuby)");
Label label = createLabel("Ruby Home: ");
label.setId("RubyLabel");
label.setMinWidth(Region.USE_PREF_SIZE);
rubyHomeBox.getChildren().addAll(label, rubyHomeField);
HBox.setHgrow(rubyHomeField, Priority.ALWAYS);
return rubyHomeBox;
}
示例10: CircularDirectionIndicator
import javafx.scene.control.Label; //导入方法依赖的package包/类
public CircularDirectionIndicator(String name, double radius){
this.name = name;
this.radius = radius;
root = new VBox();
StackPane graphicalData = new StackPane();
graphicalData.setMaxSize(radius * 2, radius * 2);
lineBox = new Canvas();
outerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius);
outerCircle.setFill(Color.TRANSPARENT);
outerCircle.setStroke(Color.BLACK);
/*innerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius * 0.5);
innerCircle.setFill(Color.TRANSPARENT);
innerCircle.setStroke(Color.BLACK);*/
lineBox.setWidth(radius * 2);
lineBox.setHeight(radius * 2);
graphicalData.getChildren().addAll(outerCircle, lineBox);
valLbl = new Label(name+": 0.0");
valLbl.setMinWidth(radius * 2);
valLbl.setTextAlignment(TextAlignment.CENTER);
HBox labalBox = new HBox();
labalBox.getChildren().add(valLbl);
labalBox.setAlignment(Pos.CENTER);
root.setAlignment(Pos.CENTER);
root.setSpacing(2.0);
root.getChildren().addAll(labalBox, graphicalData);
setValue(0);
}
示例11: createLabel
import javafx.scene.control.Label; //导入方法依赖的package包/类
public static Label createLabel(String text, Paint colour, String style, Insets insets, double width, double height)
{
Label label = createLabel(text, colour, style, insets);
label.setMinWidth(width);
label.setMaxWidth(width);
label.setMinHeight(height);
label.setMaxHeight(height);
return label;
}
示例12: createIconLabel
import javafx.scene.control.Label; //导入方法依赖的package包/类
public static Label createIconLabel(GlyphIcons icon, String iconSize, String text, ContentDisplay contentDisplay, Paint colour, String style, Pos alignment, int width)
{
Text iconLabel = GlyphsDude.createIcon(icon, iconSize);
iconLabel.setFill(colour);
Label label = new Label(text);
label.setTextFill(colour);
label.setStyle(style);
label.setGraphic(iconLabel);
label.setContentDisplay(contentDisplay);
label.setMinWidth(width);
label.setMaxWidth(width);
label.setAlignment(alignment);
return label;
}
示例13: createLastBuildInfoBox
import javafx.scene.control.Label; //导入方法依赖的package包/类
private HBox createLastBuildInfoBox( final TileViewModel build ) {
final HBox lastBuildInfoPart = new HBox( );
lastBuildInfoPart.setAlignment( Pos.CENTER );
final ImageView lastBuildIcon = new ImageView( UIUtils.createImage( "icons/lastBuild.png" ) );
lastBuildIcon.setPreserveRatio( true );
lastBuildIcon.setFitWidth( 32 );
final Label lastBuildDate = new Label( );
lastBuildDate.setMinWidth( 110 );
lastBuildDate.setTextAlignment( CENTER );
lastBuildDate.setAlignment( Pos.CENTER );
lastBuildDate.setFont( UIUtils.font( 32, FontWeight.BOLD ) );
lastBuildDate.setTextFill( Color.WHITE );
lastBuildDate.setWrapText( true );
lastBuildDate.setLineSpacing( 2 ); // TODO: Seems do not work
lastBuildDate.setEffect( UIUtils.shadowEffect( ) );
lastBuildDate.textProperty( ).bind( createStringBinding( ( ) -> {
final LocalDateTime localDateTime = build.lastFinishedDateProperty( ).get( );
if ( localDateTime == null )
return "00/00\n00:00";
return localDateTime.format( DateTimeFormatter.ofPattern( "dd/MM\nHH:mm" ) );
}, build.lastFinishedDateProperty( ) ) );
lastBuildInfoPart.getChildren( ).addAll( lastBuildIcon, lastBuildDate );
return lastBuildInfoPart;
}
示例14: addListElement
import javafx.scene.control.Label; //导入方法依赖的package包/类
public void addListElement(final String s) {
final Label label = new Label(s);
label.setStyle("-fx-padding: 8 16 8 16;");
label.getStyleClass().add("body2");
label.setMinWidth(width);
list.getChildren().add(label);
label.setOnMouseEntered(event -> canIShowSubMenu.set(false));
}
示例15: refreshView
import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public void refreshView()
{
lines.clear();
StackShowList.getChildren().clear();
ArrayList<String> names = new ArrayList<String>();
int dataLength = 8;
names.clear();
names.add("first Doorlocal");
names.add("second Doorlocal");
names.add("third Doorlocal");
names.add("fourth Doorlocal");
names.add("first Doorlocal");
names.add("second Doorlocal");
names.add("third Doorlocal");
names.add("fourth Doorlocal");
names.add("first Doorlocal");
names.add("second Doorlocal");
names.add("third Doorlocal");
names.add("fourth Doorlocal");
names.add("first Doorlocal");
names.add("second Doorlocal");
names.add("third Doorlocal");
names.add("fourth Doorlocal");
for(int i = 0; i < dataLength; i++)
{
int counter = i;
HBox entry = new HBox();
Label lblServerDoor = new Label(names.get(i));
lblServerDoor.setPadding(new Insets(15,0,0,250));
lblServerDoor.setMinWidth(590);
AppButton btnMerge = new AppButton("Overwrite");
AppButton btnInformation = new AppButton("i");
btnInformation.setOnAction(e ->
{
ArrayList<String> list = new ArrayList<String>();
list.add(names.get(counter));
getFXController().getModel("doorstackinformationmodel").setDataList(list);
getFXController().showView("doorstackinformationview");
}
);
entry.getChildren().addAll(lblServerDoor,btnInformation,btnMerge);
lines.add(entry);
}
for(HBox l : lines)
{
StackShowList.getChildren().add(l);
}
}