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


Java Label.setVisible方法代码示例

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


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

示例1: MonthDayEntriesPane

import javafx.scene.control.Label; //导入方法依赖的package包/类
MonthDayEntriesPane(LocalDate date, int week, int day) {
    getStyleClass().add("entries-pane");

    this.date = date;
    this.week = week;
    this.day = day;

    entries.addListener((Observable evt) -> update());

    setMinSize(0, 0);
    setPrefSize(0, 0);

    Rectangle clip = new Rectangle();
    clip.widthProperty().bind(widthProperty());
    clip.heightProperty().bind(heightProperty());
    setClip(clip);

    moreLabel = new Label();
    moreLabel.getStyleClass().add(MONTH_DAY_MORE_LABEL);
    moreLabel.setManaged(false);
    moreLabel.setVisible(false);

    if (getSkinnable().isEnableHyperlinks()) {
        moreLabel.getStyleClass().add("date-hyperlink");
        moreLabel.setOnMouseClicked(evt -> fireEvent(new RequestEvent(this, this, date)));
    }

    getChildren().add(moreLabel);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:30,代码来源:MonthViewSkin.java

示例2: validate

import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
 * Validate the resource element.
 *
 * @param warningLabel the warning label
 * @param element      the element.
 */
@FXThread
protected void validate(@NotNull final Label warningLabel, @Nullable final T element) {

    final Function<@NotNull C, @Nullable String> validator = getValidator();
    if (validator == null) return;

    final C object = element == null ? null : getObject(element);
    final String message = object == null ? null : validator.apply(object);

    if (message == null) {
        warningLabel.setText(StringUtils.EMPTY);
        warningLabel.setVisible(false);
    } else {
        warningLabel.setText(message);
        warningLabel.setVisible(true);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:24,代码来源:BaseAssetEditorDialog.java

示例3: BadgeDateCell

import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
 * Constructs a new badge date cell.
 *
 * @param view the parent month sheet view
 * @param date the date shown by the cell (might be null for leading or trailing empty cells)
 */
public BadgeDateCell(MonthSheetView view, LocalDate date) {
    super(view, date);

    getStyleClass().add("badge-date-cell");

    counterLabel = new Label();
    counterLabel.getStyleClass().add("badge-label");
    counterLabel.setAlignment(Pos.CENTER_RIGHT);
    counterLabel.setVisible(false); // has to be initially invisible (to work with empty cells)
    getChildren().add(counterLabel);

    // this cell type can not display week numbers
    weekNumberLabel.setVisible(false);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:21,代码来源:MonthSheetView.java

示例4: getActionPane

import javafx.scene.control.Label; //导入方法依赖的package包/类
private VBox getActionPane(){
progress= new Text("Office\nEntry Progress");
progress.setTextAlignment(TextAlignment.CENTER);
progress.setFont(Font.font("Times New Roman", 35));
lname= new Label("-Your Name here-");

Image iconf= new Image(Office_Entry.class.getResourceAsStream("/pic/finger.png"));
ImageView ivconf= new ImageView(iconf);
lpic= new Label();
lpic.setGraphic(ivconf);

Image img1= new Image(PersonalReports.class.getResourceAsStream("/pic/cross.png"));
ImageView imagvw= new ImageView(img1);
imagvw.setFitHeight(70);
imagvw.setFitWidth(70);
lnotexist= new Label("",imagvw);
lnotexist.setText("\n\n\n\n\nN/A");
lnotexist.setFont(Font.font("Cooper Black", 15));
lnotexist.setVisible(false);

txtfinger= new TextField();
txtfinger.setEditable(false);
txtfinger.setMaxWidth(160);		
txtfinger.setStyle("-fx-background-radius:10; -fx-background-color:#9CD777;");

txtsearch= new TextField();
initFilter();

Button btnView= new Button("View Records");
Button btnCloseView= new Button("Hide Records");

Button btnadd= new Button("save");
btnadd.setOnAction(e -> {
	setAddAttendance();
});

btnView.setOnAction(e -> {
	timelineDown.play();
});
btnCloseView.setOnAction(e -> {
	timelineUp.play();
});


VBox laywrong= new VBox();
laywrong.getChildren().addAll(lnotexist);
laywrong.setPadding(new Insets(0,0,0,0));
laywrong.setAlignment(Pos.CENTER);

HBox laytest= new HBox(5);
laytest.getChildren().addAll(txtfinger /* btnadd*/);
laytest.setAlignment(Pos.CENTER);

VBox laybtnsearch= new VBox();
laybtnsearch.getChildren().addAll(txtsearch);
laybtnsearch.setAlignment(Pos.CENTER);
laybtnsearch.setPadding(new Insets(20,0,0,0));

HBox laybtn= new HBox(5);
laybtn.getChildren().addAll(btnView, btnCloseView);
laybtn.setAlignment(Pos.CENTER);
VBox lay1= new VBox(10);
lay1.getChildren().addAll(progress, lpic, lname, laytest);
lay1.setAlignment(Pos.CENTER);
VBox layside= new VBox(25);
layside.getChildren().addAll(lay1, laybtn, laybtnsearch, laywrong);
layside.setAlignment(Pos.TOP_CENTER);
layside.setMinWidth(230);
layside.setPadding(new Insets(20,0,10,0));
return layside;
 }
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:72,代码来源:Office_Entry.java

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

示例6: setLineIcon

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void setLineIcon(int i, FilteredList<SyntaxError> syntaxErrors, Label icon) {
  icon.setVisible(syntaxErrors.size() != 0);
  String combinedMessages = syntaxErrors.stream()
      .map(SyntaxError::getMessage)
      .reduce("", (s, s2) -> s + s2);
  icon.setTooltip(new Tooltip(combinedMessages));
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:8,代码来源:EditorPane.java

示例7: createBeforeActions

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
@FXThread
protected void createBeforeActions(@NotNull final HBox container) {
    super.createBeforeActions(container);

    warningLabel = new Label();
    warningLabel.setGraphic(new ImageView(Icons.WARNING_24));
    warningLabel.setVisible(false);

    FXUtils.addClassTo(warningLabel, CSSClasses.DIALOG_LABEL_WARNING);
    FXUtils.addToPane(warningLabel, container);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:13,代码来源:BaseAssetEditorDialog.java

示例8: validate

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
@FXThread
protected void validate(@NotNull final Label warningLabel, @Nullable final ResourceElement element) {
    super.validate(warningLabel, element);

    final Function<@NotNull Path, @Nullable String> validator = getValidator();
    final boolean visible = warningLabel.isVisible();

    if (!visible && element instanceof FolderResourceElement) {
        warningLabel.setText(Messages.ASSET_EDITOR_DIALOG_WARNING_SELECT_FILE);
        warningLabel.setVisible(true);
    } else if (validator == null) {
        warningLabel.setVisible(false);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:16,代码来源:FileAssetEditorDialog.java

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

示例10: layoutChildren

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
protected void layoutChildren(double contentX, double contentY,
                              double contentWidth, double contentHeight) {
    super.layoutChildren(contentX, contentY, contentWidth, contentHeight);

    int labelCount = labels.size();

    // now label
    LocalTime now = getSkinnable().getTime();
    currentTimeLabel.setText(now.format(formatter));
    placeLabel(currentTimeLabel, now, contentX, contentY, contentWidth,
            contentHeight);

    // hour labels
    LocalTime startTime = getSkinnable().getStartTime();
    LocalTime endTime = getSkinnable().getEndTime();

    for (int hour = 0; hour < labelCount; hour++) {
        LocalTime time = LocalTime.of(hour + 1, 0);
        Label label = labels.get(hour);

        label.getStyleClass().removeAll("early-hour-label", //$NON-NLS-1$
                "late-hour-label"); //$NON-NLS-1$

        placeLabel(label, time, contentX, contentY, contentWidth,
                contentHeight);

        Bounds localToParent1 = currentTimeLabel
                .localToParent(currentTimeLabel.getLayoutBounds());
        Bounds localToParent2 = label
                .localToParent(label.getLayoutBounds());

        if (currentTimeLabel.isVisible()
                && getSkinnable().isShowCurrentTimeMarker()
                && localToParent1.intersects(localToParent2)) {
            label.setVisible(false);
        } else {
            label.setVisible(true);
        }

        if (time.isBefore(startTime)) {
            if (!label.getStyleClass().contains("early-hour-label")) { //$NON-NLS-1$
                label.getStyleClass().add("early-hour-label"); //$NON-NLS-1$
            }
        }
        if (time.isAfter(endTime)) {
            if (!label.getStyleClass().contains("late-hour-label")) { //$NON-NLS-1$
                label.getStyleClass().add("late-hour-label"); //$NON-NLS-1$
            }
        }

        if (label.isVisible()) {
            switch (getSkinnable().getEarlyLateHoursStrategy()) {
                case HIDE:
                case SHOW_COMPRESSED:
                    if (time.isBefore(startTime) || time.isAfter(endTime)) {
                        label.setVisible(false);
                    }
                    break;
                case SHOW:
                    label.setVisible(true);
                    break;
                default:
                    break;

            }
        }
    }

    currentTimeLabel.toFront();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:72,代码来源:TimeScaleViewSkin.java

示例11: getActionPane

import javafx.scene.control.Label; //导入方法依赖的package包/类
private VBox getActionPane(){
	progress= new Text("Gate\nEntry Progress");
	progress.setTextAlignment(TextAlignment.CENTER);
	progress.setFont(Font.font("Times New Roman", 35));
	lname= new Label("-Your Name here-");

	Image iconf= new Image(AllAttendance.class.getResourceAsStream("/pic/finger.png"));
	ImageView ivconf= new ImageView(iconf);
	lpic= new Label();
	lpic.setGraphic(ivconf);

	Image img1= new Image(PersonalReports.class.getResourceAsStream("/pic/cross.png"));
	ImageView imagvw= new ImageView(img1);
	imagvw.setFitHeight(70);
	imagvw.setFitWidth(70);
	lnotexist= new Label("",imagvw);
	lnotexist.setText("\n\n\n\n\nN/A");
	lnotexist.setFont(Font.font("Cooper Black", 15));
	lnotexist.setVisible(false);

	txtfinger= new TextField();
	txtfinger.setEditable(false);
	txtfinger.setMaxWidth(160);		
	txtfinger.setStyle("-fx-background-radius:10; -fx-background-color:#9CD777;");

	txtsearch= new TextField();
	initFilter();

	Button btnadd= new Button("save");
	btnadd.setOnAction(e -> {
		setAddAttendance();
	});

	Button btnView= new Button("View Records");
	Button btnCloseView= new Button("Hide Records");

	btnView.setOnAction(e -> {
		timelineDown.play();
	});
	btnCloseView.setOnAction(e -> {
		timelineUp.play();
	});

	VBox laywrong= new VBox();
	laywrong.getChildren().addAll(lnotexist);
	laywrong.setPadding(new Insets(0,0,0,0));
	laywrong.setAlignment(Pos.CENTER);

	HBox laytest= new HBox(5);
	laytest.getChildren().addAll(txtfinger  /* btnadd*/);
	laytest.setAlignment(Pos.CENTER);
	//btnadd was beside txtfinger

	VBox laybtnsearch= new VBox();
	laybtnsearch.getChildren().addAll(txtsearch);
	laybtnsearch.setAlignment(Pos.CENTER);
	laybtnsearch.setPadding(new Insets(20,0,0,0));

	HBox laybtn= new HBox(5);
	laybtn.getChildren().addAll(btnView, btnCloseView);
	laybtn.setAlignment(Pos.CENTER);
	VBox lay1= new VBox(10);
	lay1.getChildren().addAll(progress, lpic, lname, laytest);
	lay1.setAlignment(Pos.CENTER);
	VBox layside= new VBox(25);
	layside.getChildren().addAll(lay1, laybtn, laybtnsearch, laywrong);
	layside.setAlignment(Pos.TOP_CENTER);
	layside.setMinWidth(230);
	layside.setPadding(new Insets(20,0,10,0));
	return layside;
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:72,代码来源:AllAttendance.java

示例12: initVBox

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initVBox(){
    ClassNode node = (ClassNode) 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());

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

    type = new Label();
    type.setFont(Font.font("Helvetica", FontWeight.BOLD, 13));
    type.setTextFill(Color.web("#4B6299"));

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

    if(node.getType() == null || node.getType().equals("ABSTRACT") || node.getType().equals("CLASS")) {
        type.setManaged(false);
    } else {
        type.setText("<<" + node.getType().toLowerCase() + ">>");
        type.setAlignment(Pos.TOP_CENTER);
        title.setAlignment(Pos.BOTTOM_CENTER);
        type.setVisible(true);
        type.setManaged(true);
    }

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

    title.setAlignment(Pos.CENTER);

    attributes = new Label(node.getAttributes());
    attributes.setFont(Font.font("Verdana", 10));

    operations = new Label(node.getOperations());
    operations.setFont(Font.font("Verdana", 10));

    if(operations.getText() == null || operations.getText().equals("")){
        secondLine.setVisible(false);
    }

    titlePane.getChildren().add(type);
    titlePane.getChildren().add(title);
    vbox.getChildren().addAll(titlePane, firstLine, attributes, secondLine, operations);
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:53,代码来源:ClassNodeView.java


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