本文整理匯總了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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
示例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();
}
示例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;
}
示例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);
}