當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。