当前位置: 首页>>代码示例>>Java>>正文


Java Label.setTextFill方法代码示例

本文整理汇总了Java中javafx.scene.control.Label.setTextFill方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setTextFill方法的具体用法?Java Label.setTextFill怎么用?Java Label.setTextFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.Label的用法示例。


在下文中一共展示了Label.setTextFill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: setLegendTextFill

import javafx.scene.control.Label; //导入方法依赖的package包/类
public void setLegendTextFill(final Series<X, Y> SERIES, final Paint FILL) {
    if (getData().isEmpty()) { return; }
    if (!getData().contains(SERIES)) { return; }

    int seriesIndex = getData().indexOf(SERIES);
    if (seriesIndex == -1) { return; }

    Legend legend = (Legend) getLegend();
    if (null == legend) { return; }

    LegendItem item = legend.getItems().get(seriesIndex);
    if (null == item) { return; }

    String itemText = item.getText();
    for (Node node : legend.lookupAll(".chart-legend-item")) {
        if (node instanceof Label) {
            Label label = (Label) node;
            if (label.getText().equals(itemText)) { label.setTextFill(FILL); }
        }
    }
}
 
开发者ID:HanSolo,项目名称:smoothcharts,代码行数:22,代码来源:SmoothedChart.java

示例3: initializeLabel

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializeLabel() {
    final Label label = (Label) lookup("#label");

    label.setTextFill(color.getTextColor(colorIntensity.next(-5)));

    if (command != null) {
        label.setText(command.getDescription());
    } else {
        label.setText("Current state");
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:12,代码来源:UndoRedoHistoryEntryPresentation.java

示例4: createLED

import javafx.scene.control.Label; //导入方法依赖的package包/类
private LED createLED(int number)
{
	String labelText = Integer.toString(number);
	Label ledLabel = new Label(labelText);
	ledLabel.setFont(new Font(FONT_NAME, FONT_SIZE));
	ledLabel.setTextAlignment(TextAlignment.CENTER);
	ledLabel.setTextFill(FONT_COLOR);
	
	LED led = new LED();
	led.setMinHeight(DEFAULT_SIZE);
	led.setPrefWidth(DEFAULT_SIZE);
	led.setCenter(ledLabel);
	updateLEDStyle(led);
	
	return led;
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:17,代码来源:LEDDisplay.java

示例5: overlay

import javafx.scene.control.Label; //导入方法依赖的package包/类
private static Parent overlay(int version, int display,
        YCbCr params, int yCode, String suffix) {
    double ye = params.fromLumaCode(yCode);

    Label label = new Label(getLabel(version, display, params, yCode,
            suffix));
    label.setFont(font(40));
    label.setTextFill(gray(max(0.25, min(0.5, ye))));

    BorderPane.setMargin(label, new Insets(20));
    BorderPane layout = new BorderPane();
    layout.setBackground(EMPTY);
    layout.setBottom(label);
    return layout;
}
 
开发者ID:testing-av,项目名称:testing-video,代码行数:16,代码来源:Calibrate2160pHDR10_LGOLED.java

示例6: createText

import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
 * Creates the title and description text
 * @return Returns a VBox containing the texts.
 */
public VBox createText(){

    final VBox layout = new VBox(5.0f);
    layout.setAlignment(Pos.CENTER_LEFT);
    layout.setPadding(new Insets(10,10,10,10));
    layout.setMaxWidth(300.0f);

    title = new Label(content.getName());
    title.setTextFill(javafx.scene.paint.Paint.valueOf(TEXT_COLOR));
    title.setFont( javafx.scene.text.Font.font(FONT_NAME, FontWeight.EXTRA_BOLD,FONT_SIZE) );

    description = new Text(content.getDescription());
    description.setFill(Paint.valueOf("#ffffff"));
    description.setFont( javafx.scene.text.Font.font(FONT_NAME, FontWeight.BOLD,12.0f) );
    description.setBoundsType(TextBoundsType.LOGICAL_VERTICAL_CENTER);

    layout.getChildren().add(title);
    layout.getChildren().add(description);

    return layout;

}
 
开发者ID:Theldus,项目名称:PSE,代码行数:27,代码来源:ItemView.java

示例7: generate

import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
 * Generates a panel image form char.
 * <p>First, this function converts ch to upper case if ch is lower case.</p>
 * <p>Then, this generates javafx's image from ch.And return it.</p>
 * You can fix the resolution of image through {@link capslock.CharPanelGenerator#PANEL_IMAGE_SIZE}
 * and {@link capslock.CharPanelGenerator#FONT_SIZE}.
 * @param ch パネルの生成に使う1文字.
 * @param color 背景色.
 * @return 生成されたパネル.
 */
static final Image generate(char ch, Color color){
    final Label label = new Label(Character.toString(Character.toUpperCase(ch)));
    label.setMinSize(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    label.setMaxSize(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    label.setPrefSize(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    label.setFont(Font.font(FONT_SIZE));
    label.setAlignment(Pos.CENTER);
    label.setTextFill(Color.WHITE);
    label.setBackground(new Background(new BackgroundFill(color, CornerRadii.EMPTY, Insets.EMPTY)));
    final Scene scene = new Scene(new Group(label));
    final WritableImage img = new WritableImage(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    scene.snapshot(img);
    return img ;
}
 
开发者ID:chrootRISCassembler,项目名称:CapsLock,代码行数:25,代码来源:CharPanelGenerator.java

示例8: buildCircularTextImage

import javafx.scene.control.Label; //导入方法依赖的package包/类
public void buildCircularTextImage(){
    gc.setFill(Color.web(MATERIAL.get(new Random().nextInt(13))));
    gc.fillOval(0,0,50,50);
    Label l = new Label(text);
    l.setAlignment(Pos.CENTER);
    l.setFont(new Font(28));
    l.setTextFill(Color.WHITE);
    parent.getChildren().setAll(canvas,l);
}
 
开发者ID:ashoknailwal,项目名称:desktop-gmail-client,代码行数:10,代码来源:TextDraw.java

示例9: info

import javafx.scene.control.Label; //导入方法依赖的package包/类
public Label info(String value) {
	Label l = new Label(value);
	l.setTextFill(Color.web("#FFFFFF"));
	l.setId("oc-info-label");
	l.setWrapText(true);
	l.setTextAlignment(TextAlignment.JUSTIFY);
	return l;
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:9,代码来源:ModpackTile.java

示例10: createSuccessBox

import javafx.scene.control.Label; //导入方法依赖的package包/类
private StackPane createSuccessBox( ) {
    final StackPane pane = new StackPane( );
    final ImageView background = new ImageView( UIUtils.createImage( "icons/square-green.png" ) );
    background.setPreserveRatio( true );
    background.setFitHeight( 70 );

    final Label label = new Label( "8" );
    label.setFont( UIUtils.font( 32, FontWeight.BOLD ) );
    label.setTextFill( Color.WHITE );
    label.setEffect( UIUtils.shadowEffect( ) );
    label.textProperty( ).bind( _model.successCountProperty( ).asString( ) );
    pane.getChildren( ).addAll( background, label );
    return pane;
}
 
开发者ID:u2032,项目名称:wall-t,代码行数:15,代码来源:ProjectTileView.java

示例11: initializeLabel

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializeLabel() {
    final Label label = (Label) lookup("#label");

    label.setTextFill(color.getTextColor(colorIntensity.next(-5)));

    if (thread != null) {
        label.setText(thread.getName());
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:10,代码来源:BackgroundThreadEntryPresentation.java

示例12: createIconLabel

import javafx.scene.control.Label; //导入方法依赖的package包/类
public static Label createIconLabel(GlyphIcons icon, String iconSize, String text, ContentDisplay contentDisplay, Paint iconColour, Paint textColour, String style)
{
	Text iconLabel = GlyphsDude.createIcon(icon, iconSize);
	iconLabel.setFill(iconColour);
	Label label = new Label(text);
	label.setTextFill(textColour);
	label.setStyle(style);
	label.setGraphic(iconLabel);
	label.setContentDisplay(contentDisplay);
	return label;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:12,代码来源:JavaFxHelper.java

示例13: createTitle

import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
 * Setup the Header title and adjust the positions.
 * @param title Header title.
 * @return Returns a label aligned containing the title.
 */
private Label createTitle(String title){
    final Label auxTitle = new Label(title);
    auxTitle.setTextFill(Paint.valueOf("#00f6ff"));
    auxTitle.setFont( Font.font(FONT_NAME, FontWeight.EXTRA_BOLD,FONT_SIZE) );
    auxTitle.setMaxWidth( 150.0f );
    return auxTitle;
}
 
开发者ID:Theldus,项目名称:PSE,代码行数:13,代码来源:NodeBox.java

示例14: initializeIdLabel

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializeIdLabel() {
    final Location location = controller.getLocation();
    final Label idLabel = controller.idLabel;

    final DropShadow ds = new DropShadow();
    ds.setRadius(2);
    ds.setSpread(1);

    idLabel.setEffect(ds);

    idLabel.textProperty().bind((location.idProperty()));

    // Center align the label
    idLabel.widthProperty().addListener((obsWidth, oldWidth, newWidth) -> idLabel.translateXProperty().set(newWidth.doubleValue() / -2));
    idLabel.heightProperty().addListener((obsHeight, oldHeight, newHeight) -> idLabel.translateYProperty().set(newHeight.doubleValue() / -2));

    final ObjectProperty<Color> color = location.colorProperty();
    final ObjectProperty<Color.Intensity> colorIntensity = location.colorIntensityProperty();

    // Delegate to style the label based on the color of the location
    final BiConsumer<Color, Color.Intensity> updateColor = (newColor, newIntensity) -> {
        idLabel.setTextFill(newColor.getTextColor(newIntensity));
        ds.setColor(newColor.getColor(newIntensity));
    };

    updateColorDelegates.add(updateColor);

    // Set the initial color
    updateColor.accept(color.get(), colorIntensity.get());

    // Update the color of the circle when the color of the location is updated
    color.addListener((obs, old, newColor) -> updateColor.accept(newColor, colorIntensity.get()));
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:34,代码来源:LocationPresentation.java

示例15: createTraceWidget

import javafx.scene.control.Label; //导入方法依赖的package包/类
private Pane createTraceWidget(ITraceExtractor<Step<?>, State<?,?>, TracedObject<?>, Dimension<?>, Value<?>> extractor, String label, ReadOnlyDoubleProperty width) {
	final Pane pane = new Pane();
	pane.setBackground(TRANSPARENT_BACKGROUND);
	final Rectangle rectangle = new Rectangle(0, 0, 0, 12);
	rectangle.setFill(Color.LIGHTGRAY);
	rectangle.widthProperty().bind(width.subtract(10));
	rectangle.setArcHeight(12);
	rectangle.setArcWidth(12);
	Label text = new Label(label);
	text.setTextOverrun(OverrunStyle.ELLIPSIS);
	text.setAlignment(Pos.CENTER);
	text.setMouseTransparent(true);
	text.setTextFill(Color.WHITE);
	text.setFont(FONT);
	text.setMaxWidth(0);
	text.maxWidthProperty().bind(rectangle.widthProperty());
	StackPane layout = new StackPane();
	layout.getChildren().addAll(rectangle, text);
	pane.getChildren().add(layout);
	layout.setTranslateY(13);
	layout.setTranslateX(5);
	pane.setPrefHeight(25);
	pane.setMinHeight(25);
	pane.setMaxHeight(25);

	final Shape arrow1 = createCursor();
	final Shape arrow2 = createCursor();
	arrow1.setTranslateX(5);
	arrow1.setTranslateY(4);
	arrow2.translateXProperty().bind(rectangle.widthProperty().add(5));
	arrow2.setTranslateY(4);
	pane.getChildren().add(arrow1);
	pane.getChildren().add(arrow2);
	
	return pane;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:37,代码来源:TraceSectionsDialog.java


注:本文中的javafx.scene.control.Label.setTextFill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。