當前位置: 首頁>>代碼示例>>Java>>正文


Java Label.setAlignment方法代碼示例

本文整理匯總了Java中javafx.scene.control.Label.setAlignment方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setAlignment方法的具體用法?Java Label.setAlignment怎麽用?Java Label.setAlignment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.Label的用法示例。


在下文中一共展示了Label.setAlignment方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PremisesAndConclusion

import javafx.scene.control.Label; //導入方法依賴的package包/類
public PremisesAndConclusion(String sPremises, String sConclusion) {
    premises = new TextField(sPremises);
    premises.textProperty().addListener((ov, oldValue, newValue) -> {
        parseAndStyle(premises, newValue);
    });
    parseAndStyle(premises, sPremises);
    premises.getStyleClass().add("myText");
    turnstile = new Label("⊢");
    turnstile.setPrefHeight(25);
    turnstile.setPrefWidth(26.0);
    turnstile.setPadding(new Insets(5,0,0,0));
    turnstile.setAlignment(Pos.CENTER);
    conclusion = new TextField(sConclusion);
    conclusion.textProperty().addListener((ov, oldValue, newValue) -> {
        parseAndStyle(conclusion, newValue);
    });
    parseAndStyle(conclusion, sConclusion);
    conclusion.getStyleClass().add("myText");
    consumeKeys(premises);
    consumeKeys(conclusion);
    this.getChildren().addAll(premises, turnstile, conclusion);
    setPrefs();
}
 
開發者ID:nonilole,項目名稱:Conan,代碼行數:24,代碼來源:PremisesAndConclusion.java

示例2: createTimeLeftInfoBox

import javafx.scene.control.Label; //導入方法依賴的package包/類
private HBox createTimeLeftInfoBox( final TileViewModel build ) {
    final HBox lastBuildInfoPart = new HBox( );
    lastBuildInfoPart.setAlignment( Pos.CENTER );

    final ImageView lastBuildIcon = new ImageView( UIUtils.createImage( "icons/timeLeft.png" ) );
    lastBuildIcon.setPreserveRatio( true );
    lastBuildIcon.setFitWidth( 32 );

    final Label timeLeftLabel = new Label( );
    timeLeftLabel.setMinWidth( 110 );
    timeLeftLabel.setTextAlignment( CENTER );
    timeLeftLabel.setAlignment( Pos.CENTER );
    timeLeftLabel.setFont( UIUtils.font( 32, FontWeight.BOLD ) );
    timeLeftLabel.setTextFill( Color.WHITE );
    timeLeftLabel.setWrapText( true );
    timeLeftLabel.setEffect( UIUtils.shadowEffect( ) );
    timeLeftLabel.textProperty( ).bind( createStringBinding( ( ) -> {
        final java.time.Duration timeLeft = build.timeLeftProperty( ).get( );
        return ( timeLeft.isNegative( ) ? "+ " : "" ) + ( abs( timeLeft.toMinutes( ) ) + 1 ) + "\nmin";
    }, build.timeLeftProperty( ) ) );

    lastBuildInfoPart.getChildren( ).addAll( lastBuildIcon, timeLeftLabel );
    return lastBuildInfoPart;
}
 
開發者ID:u2032,項目名稱:wall-t,代碼行數:25,代碼來源:TileView.java

示例3: init

import javafx.scene.control.Label; //導入方法依賴的package包/類
public void init() {
    ImageView splash = new ImageView(new Image(
            SPLASH_IMAGE
    ));
    loadProgress = new ProgressBar();
    loadProgress.setPrefWidth(SPLASH_WIDTH - 20);
    loadProgress.setStyle("-fx-padding: 10; ");
    progressText = new Label("Loading Chess Bot");
    splashLayout = new VBox();
    splashLayout.getChildren().addAll(splash, loadProgress, progressText);
    progressText.setAlignment(Pos.CENTER);
    splashLayout.setStyle(
            "-fx-padding: 10; "
            + "-fx-background-color: white; "
            + "-fx-border-width:3; "
            + "-fx-border-color: "
            + "linear-gradient("
            + "to bottom, "
            + "chocolate, "
            + "derive(chocolate, 50%)"
            + ");"
    );
    splashLayout.setEffect(new DropShadow());
}
 
開發者ID:mhusam,項目名稱:ChessBot,代碼行數:25,代碼來源:ChessBotAppSplash.java

示例4: 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();
    }
}
 
開發者ID:manuel3108,項目名稱:Gleisbelegung,代碼行數:18,代碼來源:LabelContainer.java

示例5: addState

import javafx.scene.control.Label; //導入方法依賴的package包/類
private void addState(State<?,?> state, HBox line, Color color, int stateIndex, String stateDescription) {
	final Rectangle rectangle = new Rectangle(WIDTH, WIDTH, color);
	rectangle.setArcHeight(WIDTH);
	rectangle.setArcWidth(WIDTH);
	rectangle.setUserData(state);
	Label text = new Label(computeStateLabel(stateIndex));
	text.setTextOverrun(OverrunStyle.ELLIPSIS);
	text.setAlignment(Pos.CENTER);
	text.setMouseTransparent(true);
	text.setTextFill(Color.WHITE);
	text.setFont(STATE_FONT);
	text.setMaxWidth(WIDTH);
	final Tooltip tooltip = new Tooltip(stateDescription);
	Tooltip.install(rectangle, tooltip);
	StackPane layout = new StackPane();
	StackPane.setMargin(rectangle, MARGIN_INSETS);
	layout.getChildren().addAll(rectangle, text);
	line.getChildren().add(layout);
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:20,代碼來源:TimelineDiffViewerRenderer.java

示例6: initVBox

import javafx.scene.control.Label; //導入方法依賴的package包/類
private void initVBox(){
    EnumerationNode node = (EnumerationNode) getRefNode();

    vbox.setPadding(new Insets(5, 0, 5, 0));
    vbox.setSpacing(5);

    titlePane = new VBox();
    titlePane.setSpacing(5);

    firstLine = new Separator();
    firstLine.setMaxWidth(node.getWidth());

    type = new Label();
    type.setFont(Font.font("Helvetica", FontWeight.BOLD, 13));
    type.setText("<<" + node.getType().toLowerCase() + ">>");
    type.setTextFill(Color.web("#4B6299"));
    type.setAlignment(Pos.TOP_CENTER);

    title = new Label();
    title.setFont(Font.font("Verdana", FontWeight.BOLD, 12));
    title.setManaged(false);

    if(node.getTitle() != null) {
        title.setText(node.getTitle());
        title.setVisible(true);
        title.setManaged(true);
    }

    title.setAlignment(Pos.BOTTOM_CENTER);

    values = new Label(node.getValues());
    values.setFont(Font.font("Verdana", 10));

    titlePane.getChildren().add(type);
    titlePane.getChildren().add(title);
    vbox.getChildren().addAll(titlePane, firstLine, values);
}
 
開發者ID:kaanburaksener,項目名稱:octoBubbles,代碼行數:38,代碼來源:EnumerationNodeView.java

示例7: fixedLetter

import javafx.scene.control.Label; //導入方法依賴的package包/類
private void fixedLetter(final char symbol, int row, int col) {
    Label l = new Label("" + symbol);
    l.setFont(prototype.getFont());
    l.setAlignment(Pos.CENTER);
    l.setPrefWidth(prototype.getPrefWidth());
    gameField.add(l, col, row);
    game[row][col] = symbol;
}
 
開發者ID:TMihis,項目名稱:Balda,代碼行數:9,代碼來源:SceneFormController.java

示例8: initComponents

import javafx.scene.control.Label; //導入方法依賴的package包/類
private void initComponents() {
    messageLabel = new Label(message);
    messageLabel.setAlignment(Pos.CENTER);
    messageLabel.setStyle("-fx-background-color:#000000");
    messageLabel.setTextFill(javafx.scene.paint.Color.WHITE);
    messageLabel.setMaxWidth(Double.MAX_VALUE);
    setScene(new Scene(new VBox(FXUIUtils.getImage("wait"), messageLabel)));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:9,代碼來源:WaitMessageDialog.java

示例9: createBlurbTitle

import javafx.scene.control.Label; //導入方法依賴的package包/類
private HBox createBlurbTitle() {
    Label bulrbTitleLabel = createLabel(versionInfo.getBlurbTitle());
    bulrbTitleLabel.setId("blurbTitle");
    bulrbTitleLabel.setAlignment(Pos.TOP_CENTER);

    HBox titleBox = new HBox();
    titleBox.setId("titleBar");
    titleBox.setAlignment(Pos.TOP_CENTER);
    titleBox.getChildren().addAll(bulrbTitleLabel);
    return titleBox;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:12,代碼來源:AboutStage.java

示例10: createBox

import javafx.scene.control.Label; //導入方法依賴的package包/類
private Node createBox(Cursor cursor) {
    Label label = new Label(cursor.toString());
    label.setAlignment(Pos.CENTER);
    label.setPrefSize(85, 85);
    label.setStyle("-fx-border-color: #aaaaaa; -fx-background-color: #dddddd;");
    label.setCursor(cursor);
    return label;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:9,代碼來源:CursorSample.java

示例11: text

import javafx.scene.control.Label; //導入方法依賴的package包/類
private static Label text(Resolution res, YCbCr matrix, int col) {
    Label l = new Label(Integer.toString(getLuma(matrix, col)));
    l.setFont(font(res.height / 54));
    l.setTextFill(gray(matrix.fromLumaCode(matrix.YMIN * 4)));
    l.setTextAlignment(TextAlignment.CENTER);
    l.setAlignment(Pos.CENTER);
    l.setPrefSize(getW(res.width, col), getLabelH(res.height));
    return l;
}
 
開發者ID:testing-av,項目名稱:testing-video,代碼行數:10,代碼來源:BlackLevelBase.java

示例12: CalendarFXSamplerWelcome

import javafx.scene.control.Label; //導入方法依賴的package包/類
public CalendarFXSamplerWelcome() {
    super("CalendarFX", new Label(""));

    Label label = (Label) getContent();
    label.setWrapText(true);
    label.setMaxWidth(Double.MAX_VALUE);
    label.setMaxHeight(Double.MAX_VALUE);
    label.setTextAlignment(TextAlignment.CENTER);
    label.setAlignment(Pos.CENTER);
    label.setPadding(new Insets(50));
    label.setText("Welcome to the CalendarFX sampler. This application allows you to quickly browse through the "
            + "various controls that are available in this framework. In each sample you can play around with the "
            + "properties and controls shown on the right-hand side.");
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:15,代碼來源:CalendarFXSamplerWelcome.java

示例13: 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;
}
 
開發者ID:PolyphasicDevTeam,項目名稱:NoMoreOversleeps,代碼行數:15,代碼來源:JavaFxHelper.java

示例14: 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;
}
 
開發者ID:u2032,項目名稱:wall-t,代碼行數:28,代碼來源:TileView.java

示例15: createStateLabels

import javafx.scene.control.Label; //導入方法依賴的package包/類
private void createStateLabels() {
    Group overlay = map.getOverlayGroup();
    for(String state: Region.ALL_STATES) {
        Node stateNode = map.lookup("#"+state);
        if (stateNode != null) {
            Label label = new Label("+10");
            label.getStyleClass().add("heatmap-label");
            label.setTextAlignment(TextAlignment.CENTER);
            label.setAlignment(Pos.CENTER);
            label.setManaged(false);
            label.setOpacity(0);
            label.setVisible(false);
            Bounds stateBounds = stateNode.getBoundsInParent();
            if ("DE".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-25, stateBounds.getMinY(), 
                        stateBounds.getWidth()+50, stateBounds.getHeight());
            } else if ("VT".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()-25, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("NH".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()+30, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("MA".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-20, stateBounds.getMinY()-18, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("RI".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY(), 
                        stateBounds.getWidth()+40, stateBounds.getHeight());
            } else if ("ID".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()+60, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("MI".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()+60, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("FL".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()+95, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("LA".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-50, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            }
            stateLabelMap.put(state, label);
            overlay.getChildren().add(label);
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:50,代碼來源:HeatTabController.java


注:本文中的javafx.scene.control.Label.setAlignment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。