javafx.scene.control.Label#setId ( )源码实例Demo

下面列出了javafx.scene.control.Label#setId ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: SONDY   文件: EventDetectionUI.java
public final void availabeMethodsUI(){
    initializeAvailableMethodList();
    methodDescriptionLabel = new Label("Selected method description");
    methodDescriptionLabel.setId("smalltext");
    UIUtils.setSize(methodDescriptionLabel,Main.columnWidthLEFT,24);
    VBox methodsLEFT = new VBox();
    methodsLEFT.getChildren().addAll(methodList,new Rectangle(0,3),methodDescriptionLabel);
    // Right part
    applyButton = createApplyMethodButton();
    UIUtils.setSize(applyButton, Main.columnWidthRIGHT, 24);
    parameterTable = new TableView<>();
    UIUtils.setSize(parameterTable, Main.columnWidthRIGHT, 64);
    initializeParameterTable();
    VBox methodsRIGHT = new VBox();
    methodsRIGHT.getChildren().addAll(parameterTable,new Rectangle(0,3),applyButton);
    // Both parts
    HBox methodsBOTH = new HBox(5);
    methodsBOTH.getChildren().addAll(methodsLEFT,methodsRIGHT);
    grid.add(methodsBOTH,0,2);
}
 
源代码2 项目: SONDY   文件: InfluenceAnalysisUI.java
public final void availabeMethodsUI(){
    initializeAvailableMethodList();
    methodDescriptionLabel = new Label("Selected method description");
    methodDescriptionLabel.setId("smalltext");
    UIUtils.setSize(methodDescriptionLabel,Main.columnWidthLEFT,24);
    VBox methodsLEFT = new VBox();
    methodsLEFT.getChildren().addAll(methodList,new Rectangle(0,3),methodDescriptionLabel);
    // Right part
    applyButton = createApplyMethodButton();
    UIUtils.setSize(applyButton, Main.columnWidthRIGHT, 24);
    parameterTable = new TableView<>();
    UIUtils.setSize(parameterTable, Main.columnWidthRIGHT, 64);
    initializeParameterTable();
    VBox methodsRIGHT = new VBox();
    methodsRIGHT.getChildren().addAll(parameterTable,new Rectangle(0,3),applyButton);
    // Both parts
    HBox methodsBOTH = new HBox(5);
    methodsBOTH.getChildren().addAll(methodsLEFT,methodsRIGHT);
    grid.add(methodsBOTH,0,2);
}
 
源代码3 项目: SONDY   文件: DataCollectionUI.java
public final void availableSourcesUI(){
    availableSources = new DataSources();
    availableSources.update();
    sourceListView = new ListView<>();
    sourceListView.setOrientation(Orientation.HORIZONTAL);
    sourceListView.setItems(availableSources.list);
    sourceListView.getSelectionModel().selectedItemProperty().addListener((ObservableValue<? extends String> ov, String old_val, String new_val) -> {
        
    });
    UIUtils.setSize(sourceListView,Main.columnWidthLEFT,64);
    Label sourceDescriptionLabel = new Label("https://dev.twitter.com/overview/api");
    sourceDescriptionLabel.setId("smalltext");
    UIUtils.setSize(sourceDescriptionLabel,Main.columnWidthLEFT,24);
    VBox availableSourcesLEFT = new VBox();
    availableSourcesLEFT.getChildren().addAll(sourceListView,new Rectangle(0,3),sourceDescriptionLabel);
    
    HBox availableSourcesBOTH = new HBox(5);
    availableSourcesBOTH.getChildren().addAll(availableSourcesLEFT,new Rectangle(Main.columnWidthRIGHT,0));
    grid.add(availableSourcesBOTH,0,2);
}
 
源代码4 项目: marathonv5   文件: AboutStage.java
public void initComponents() {
    HBox bulrbTitleBox = createBlurbTitle();
    Label companyLabel = createLabel(versionInfo.getBlurbCompany());
    companyLabel.setId("companyName");
    Label websiteLabel = createLabel(versionInfo.getBlurbWebsite());
    websiteLabel.setId("websiteAddress");
    Label creditsLabel = createLabel(versionInfo.getBlurbCredits());
    creditsLabel.setId("creditsLabel");
    infoBox.setId("infoBox");
    infoBox.setAlignment(Pos.TOP_CENTER);
    infoBox.getChildren().addAll(bulrbTitleBox, companyLabel, websiteLabel, creditsLabel);

    creditsButton.setOnAction((e) -> onCredits());
    okButton.setOnAction((e) -> onOK());

    buttonBar.setId("buttonBar");
    buttonBar.getButtons().addAll(creditsButton, okButton);

}
 
源代码5 项目: marathonv5   文件: FileSelectionStage.java
private HBox createBrowserField() {
    HBox browseFieldBox = new HBox(5);
    dirField = new TextField();
    dirField.setId("DirectoryField");
    dirField.textProperty().addListener((observable, oldValue, newValue) -> updateOKButton());
    HBox.setHgrow(dirField, Priority.ALWAYS);
    Button browseButton = FXUIUtils.createButton("browse", "Browse directory", true, "Browse");
    FileSelectionHandler browserListener;
    String fileType = fileSelectionInfo.getFileType();
    if (fileType != null) {
        browserListener = new FileSelectionHandler(this,
                new ExtensionFilter(fileType, Arrays.asList(fileSelectionInfo.getExtensionFilters())), this, null,
                fileSelectionInfo.getTitle());
    } else {
        browserListener = new FileSelectionHandler(this, null, this, null, fileSelectionInfo.getTitle());
        browserListener.setMode(FileSelectionHandler.DIRECTORY_CHOOSER);
    }
    browserListener.setPreviousDir(new File(System.getProperty(Constants.PROP_PROJECT_DIR, ProjectLayout.projectDir)));
    browseButton.setOnAction(browserListener);
    Label label = createLabel("Name: ");
    label.setMinWidth(Region.USE_PREF_SIZE);
    label.setId("FileSelectedLabel");
    browseFieldBox.getChildren().addAll(label, dirField, browseButton);
    VBox.setMargin(browseFieldBox, new Insets(5, 5, 5, 5));
    return browseFieldBox;
}
 
源代码6 项目: marathonv5   文件: FormPane.java
public FormPane addFormField(String text, Node... fields) {
    Label label = new Label(text);
    String labelId = idText(text);
    label.setId(labelId);
    GridPane.setValignment(label, VPos.TOP);
    int column = 0;
    add(label, column++, currentRow, 1, 1);
    int colspan = columns - fields.length;
    int fieldIndex = 1;
    for (Node field : fields) {
        field.setId(labelId + "-field-" + fieldIndex);
        setFormConstraints(field);
        GridPane.setValignment(field, VPos.TOP);
        add(field, column++, currentRow, colspan, 1);
        fieldIndex++;
    }
    currentRow++;
    column = 0;
    return this;
}
 
源代码7 项目: EWItool   文件: UiFormantGrid.java
UiFormantGrid( EWI4000sPatch editPatch, MidiHandler midiHandler ) {
  
  setId( "editor-grid" );
  
  Label mainLabel = new Label( "Formant Filter" );
  mainLabel.setId( "editor-section-label" );
  GridPane.setValignment( mainLabel, VPos.TOP );
  add( mainLabel, 0, 0 );

  formantChoice = new ChoiceBox<String>();
  formantChoice.getItems().addAll( "Off", "Woodwind", "Strings" );
  formantChoice.setOnAction( (event) -> {
    midiHandler.sendLiveControl( 5, 81, formantChoice.getSelectionModel().getSelectedIndex() );
    editPatch.formantFilter = formantChoice.getSelectionModel().getSelectedIndex(); 
  });
  add( formantChoice, 0, 1 );
}
 
源代码8 项目: EWItool   文件: UiKeyTriggerGrid.java
UiKeyTriggerGrid( EWI4000sPatch editPatch, MidiHandler midiHandler ) {
  
  setId( "editor-grid" );
  
  Label mainLabel = new Label( "Key Trigger" );
  mainLabel.setId( "editor-section-label" );
  GridPane.setColumnSpan( mainLabel, 2 );
  add( mainLabel, 0, 0 );

  keyTriggerChoice = new ChoiceBox<String>();
  keyTriggerChoice.getItems().addAll( "Single", "Multi" );
  keyTriggerChoice.setOnAction( (event) -> {
    midiHandler.sendLiveControl( 7, 81, keyTriggerChoice.getSelectionModel().getSelectedIndex() );
    editPatch.formantFilter = keyTriggerChoice.getSelectionModel().getSelectedIndex(); 
  });
  add( keyTriggerChoice, 0, 1 );
  
}
 
源代码9 项目: bisq   文件: QRCodeWindow.java
@Override
public void show() {
    createGridPane();
    addHeadLine();
    addMessage();

    GridPane.setRowIndex(qrCodeImageView, ++rowIndex);
    GridPane.setColumnSpan(qrCodeImageView, 2);
    GridPane.setHalignment(qrCodeImageView, HPos.CENTER);
    gridPane.getChildren().add(qrCodeImageView);

    String request = bitcoinURI.replace("%20", " ").replace("?", "\n?").replace("&", "\n&");
    Label infoLabel = new AutoTooltipLabel(Res.get("qRCodeWindow.request", request));
    infoLabel.setMouseTransparent(true);
    infoLabel.setWrapText(true);
    infoLabel.setId("popup-qr-code-info");
    GridPane.setHalignment(infoLabel, HPos.CENTER);
    GridPane.setHgrow(infoLabel, Priority.ALWAYS);
    GridPane.setMargin(infoLabel, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(infoLabel, ++rowIndex);
    GridPane.setColumnIndex(infoLabel, 0);
    GridPane.setColumnSpan(infoLabel, 2);
    gridPane.getChildren().add(infoLabel);

    addButtons();
    applyStyles();
    display();
}
 
源代码10 项目: Animu-Downloaderu   文件: DonateDialog.java
public DonateDialog() {
	var buttonType = new ButtonType("Yes", ButtonData.YES);
	var dialogPane = getDialogPane();

	setTitle("Donate :3");
	dialogPane.getStylesheets().add(getClass().getResource("/css/combo.css").toExternalForm());

	var gridPane = new GridPane();

	gridPane.setVgap(10);
	String question = "Thank you for clicking the donate button!! <3\n\n"
			+ "You can donate via liberapay, paypal, or help me by subscribing to my patreon!\n\n";

	Label librapay = new Label("Liberapay");
	Label paypal = new Label("Paypal");
	Label patrion = new Label("Patreon");
	HBox donateButtons = new HBox(15);
	donateButtons.setAlignment(Pos.CENTER);
	librapay.setCursor(Cursor.HAND);
	paypal.setCursor(Cursor.HAND);
	patrion.setCursor(Cursor.HAND);
	librapay.setId("link");
	paypal.setId("link");
	patrion.setId("link");

	librapay.setOnMouseClicked(e -> handleClick("https://liberapay.com/codingotaku/donate"));
	paypal.setOnMouseClicked(e -> handleClick("https://paypal.me/codingotaku"));
	patrion.setOnMouseClicked(e -> handleClick("https://www.patreon.com/bePatron?u=13678963"));
	donateButtons.getChildren().addAll(librapay, paypal, patrion);

	dialogPane.getButtonTypes().addAll(ButtonType.CLOSE);

	var label = new Label(question);
	GridPane.setConstraints(label, 1, 2);
	GridPane.setConstraints(donateButtons, 1, 3, 2, 1);
	gridPane.getChildren().addAll(label, donateButtons);
	dialogPane.setContent(gridPane);
	setResultConverter(dialogButton -> dialogButton == buttonType);
}
 
源代码11 项目: marathonv5   文件: RubyPathLayout.java
private HBox createRubyHomeField() {
    HBox rubyHomeBox = new HBox(5);
    rubyHomeField = new TextField();
    rubyHomeField.setId("RubyHomeField");
    rubyHomeField.setPromptText("(Bundled JRuby)");
    Label label = createLabel("Ruby Home: ");
    label.setId("RubyLabel");
    label.setMinWidth(Region.USE_PREF_SIZE);
    rubyHomeBox.getChildren().addAll(label, rubyHomeField);
    HBox.setHgrow(rubyHomeField, Priority.ALWAYS);
    return rubyHomeBox;
}
 
源代码12 项目: HubTurbo   文件: UI.java
private void initUI(Stage stage) {
    apiBox = new Label("-/-");
    apiBox.setPadding(new Insets(10, 10, 5, 15));
    apiBox.setId(IdGenerator.getApiBoxId());

    mainStage = stage;
    stage.setMaximized(false);

    panels = new PanelControl(this, mainStage, prefs);
    guiController = new GUIController(this, panels, apiBox);

    Scene scene = new Scene(createRootNode());

    setupMainStage(scene);
    setupGlobalKeyboardShortcuts(scene);

    screenManager = new ScreenManager(mainStage);
    screenManager.setupStageDimensions(mainStage, panels.getPanelWidth());
    screenManager.setupPositionListener(stage);

    notificationController = new NotificationController(notificationPane);
    notificationPane.setId("notificationPane");

    loadFonts();
    String css = initCSS();
    applyCSS(css, scene);

    setApplicationIcon(stage);
}
 
源代码13 项目: cssfx   文件: BasicUI.java
private Parent buildUI() {
    container = new VBox();
    container.getStyleClass().add("container");

    Label lblWelcome = new Label("Welcome");
    Label lblCSSFX = new Label("CSSFX");
    lblCSSFX.setId("cssfx");

    container.getChildren().addAll(lblWelcome, lblCSSFX);

    String defaultURI = BasicUI.class.getResource("default.css").toExternalForm();
    String basicURI = BasicUI.class.getResource("basic.css").toExternalForm();
    container.getStylesheets().addAll(defaultURI, basicURI);
    return container;
}
 
源代码14 项目: marathonv5   文件: MarathonSplashScreen.java
private HBox createInfo() {
    Label blurbLabel = createLabel(versionInfo.getBlurbTitle());
    blurbLabel.setId("blurbLabel");

    HBox infoBox = new HBox();
    infoBox.getChildren().addAll(blurbLabel);
    infoBox.setAlignment(Pos.TOP_CENTER);
    return infoBox;
}
 
源代码15 项目: mars-sim   文件: MarsNode.java
public Label createEach(Settlement settlement) {
	Label l = new Label(settlement.getName());

	l.setPadding(new Insets(20));
	l.setAlignment(Pos.CENTER);
	l.setMaxWidth(Double.MAX_VALUE);

	l.setId("settlement-node");
	l.getStylesheets().add("/fxui/css/settlementnode.css");

	l.setOnMouseClicked(new EventHandler<MouseEvent>() {
     	PopOver popOver = null;
         @Override
         public void handle(MouseEvent evt) {
       	if (popOver == null ) {
                popOver = createPopOver(l, settlement);
         	}
       	else if (evt.getClickCount() >= 1) {
               popOver.hide(Duration.seconds(.5));
        	}
       	else if (popOver.isShowing()) {
         		popOver.hide(Duration.seconds(.5));
         	}
       	else if (!popOver.isShowing()) {
         		popOver = createPopOver(l, settlement);
         	}
         }
     });
	return l;
}
 
源代码16 项目: bisq   文件: TakeOfferView.java
private Tuple2<Label, VBox> getTradeInputBox(HBox amountValueBox, String promptText) {
    Label descriptionLabel = new AutoTooltipLabel(promptText);
    descriptionLabel.setId("input-description-label");
    descriptionLabel.setPrefWidth(170);

    VBox box = new VBox();
    box.setPadding(new Insets(10, 0, 0, 0));
    box.setSpacing(2);
    box.getChildren().addAll(descriptionLabel, amountValueBox);
    return new Tuple2<>(descriptionLabel, box);
}
 
源代码17 项目: bisq   文件: FormBuilder.java
public static Tuple2<Label, VBox> getTradeInputBox(Pane amountValueBox, String descriptionText) {
    Label descriptionLabel = new AutoTooltipLabel(descriptionText);
    descriptionLabel.setId("input-description-label");
    descriptionLabel.setPrefWidth(190);

    VBox box = new VBox();
    box.setPadding(new Insets(10, 0, 0, 0));
    box.setSpacing(2);
    box.getChildren().addAll(descriptionLabel, amountValueBox);
    return new Tuple2<>(descriptionLabel, box);
}
 
源代码18 项目: constellation   文件: DateTimeEditorFactory.java
private HBox createTimeSpinners() {
    datePicker = new DatePicker();
    datePicker.setConverter(new LocalDateStringConverter(
            TemporalFormatting.DATE_FORMATTER, TemporalFormatting.DATE_FORMATTER));
    datePicker.getEditor().textProperty().addListener((v, o, n) -> {
        update();
        updateTimeZoneList();
    });
    datePicker.setValue(LocalDate.now());
    datePicker.valueProperty().addListener((v, o, n) -> {
        update();
        updateTimeZoneList();
    });

    hourSpinner = new Spinner<>(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 23));
    minSpinner = new Spinner<>(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 59));
    secSpinner = new Spinner<>(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 59));
    milliSpinner = new Spinner<>(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 999));
    hourSpinner.getValueFactory().setValue(LocalTime.now(ZoneOffset.UTC).getHour());
    minSpinner.getValueFactory().setValue(LocalTime.now(ZoneOffset.UTC).getMinute());
    secSpinner.getValueFactory().setValue(LocalTime.now(ZoneOffset.UTC).getSecond());
    milliSpinner.getValueFactory().setValue(0);

    final HBox timeSpinnerContainer = new HBox(CONTROLS_DEFAULT_VERTICAL_SPACING);

    final Label dateLabel = new Label("Date:");
    dateLabel.setId(LABEL_ID);
    dateLabel.setLabelFor(datePicker);

    final Label hourSpinnerLabel = new Label("Hour:");
    hourSpinnerLabel.setId(LABEL_ID);
    hourSpinnerLabel.setLabelFor(hourSpinner);

    final Label minSpinnerLabel = new Label("Minute:");
    minSpinnerLabel.setId(LABEL_ID);
    minSpinnerLabel.setLabelFor(minSpinner);

    final Label secSpinnerLabel = new Label("Second:");
    secSpinnerLabel.setId(LABEL_ID);
    secSpinnerLabel.setLabelFor(secSpinner);

    final Label milliSpinnerLabel = new Label("Millis:");
    milliSpinnerLabel.setId(LABEL_ID);
    milliSpinnerLabel.setLabelFor(milliSpinner);

    hourSpinner.setPrefWidth(NUMBER_SPINNER_WIDTH);
    minSpinner.setPrefWidth(NUMBER_SPINNER_WIDTH);
    secSpinner.setPrefWidth(NUMBER_SPINNER_WIDTH);
    milliSpinner.setPrefWidth(MILLIS_SPINNER_WIDTH);

    hourSpinner.setEditable(true);
    minSpinner.setEditable(true);
    secSpinner.setEditable(true);
    milliSpinner.setEditable(true);

    hourSpinner.valueProperty().addListener((o, n, v) -> {
        update();
        updateTimeZoneList();
    });
    minSpinner.valueProperty().addListener((o, n, v) -> {
        update();
        updateTimeZoneList();
    });
    secSpinner.valueProperty().addListener((o, n, v) -> {
        update();
        updateTimeZoneList();
    });
    milliSpinner.valueProperty().addListener((o, n, v) -> {
        update();
        updateTimeZoneList();
    });

    final VBox dateLabelNode = new VBox(5);
    dateLabelNode.getChildren().addAll(dateLabel, datePicker);
    final VBox hourLabelNode = new VBox(5);
    hourLabelNode.getChildren().addAll(hourSpinnerLabel, hourSpinner);
    final VBox minLabelNode = new VBox(5);
    minLabelNode.getChildren().addAll(minSpinnerLabel, minSpinner);
    final VBox secLabelNode = new VBox(5);
    secLabelNode.getChildren().addAll(secSpinnerLabel, secSpinner);
    final VBox milliLabelNode = new VBox(5);
    milliLabelNode.getChildren().addAll(milliSpinnerLabel, milliSpinner);

    timeSpinnerContainer.getChildren().addAll(dateLabelNode, hourLabelNode, minLabelNode, secLabelNode, milliLabelNode);

    return timeSpinnerContainer;
}
 
源代码19 项目: constellation   文件: AttributeEditorDialog.java
public AttributeEditorDialog(final boolean restoreDefaultButton, final AbstractEditor<?> editor) {
    final VBox root = new VBox();
    root.setPadding(new Insets(10));
    root.setAlignment(Pos.CENTER);
    root.setFillWidth(true);

    errorLabel = new Label("");
    errorLabel.setId("error");

    okButton = new Button("Ok");
    cancelButton = new Button("Cancel");
    defaultButton = new Button("Restore Default");

    okButton.setOnAction(e -> {
        editor.performEdit();
        hideDialog();
    });

    cancelButton.setOnAction(e -> {
        hideDialog();
    });

    defaultButton.setOnAction(e -> {
        editor.setDefaultValue();
    });

    okCancelHBox = new HBox(20);
    okCancelHBox.setPadding(new Insets(10));
    okCancelHBox.setAlignment(Pos.CENTER);
    if (restoreDefaultButton) {
        okCancelHBox.getChildren().addAll(okButton, cancelButton, defaultButton);
    } else {
        okCancelHBox.getChildren().addAll(okButton, cancelButton);
    }

    okButton.disableProperty().bind(editor.getEditDisabledProperty());
    errorLabel.visibleProperty().bind(editor.getEditDisabledProperty());
    errorLabel.textProperty().bind(editor.getErrorMessageProperty());
    final Node ec = editor.getEditorControls();
    VBox.setVgrow(ec, Priority.ALWAYS);
    root.getChildren().addAll(editor.getEditorHeading(), ec, errorLabel, okCancelHBox);

    final Scene scene = new Scene(root);
    scene.setFill(Color.rgb(0, 0, 0, 0));
    scene.getStylesheets().add(AttributeEditorDialog.class.getResource(DARK_THEME).toExternalForm());
    fxPanel.setScene(scene);
}
 
源代码20 项目: FxDock   文件: FX.java
/** creates a label.  accepts: CssStyle, CssID, FxCtl, Insets, OverrunStyle, Pos, TextAlignment, Color, Node, Background */
public static Label label(Object ... attrs)
{
	Label n = new Label();
	
	for(Object a: attrs)
	{
		if(a == null)
		{
			// ignore
		}
		else if(a instanceof CssStyle)
		{
			n.getStyleClass().add(((CssStyle)a).getName());
		}
		else if(a instanceof CssID)
		{
			n.setId(((CssID)a).getID());
		}
		else if(a instanceof FxCtl)
		{
			switch((FxCtl)a)
			{
			case BOLD:
				n.getStyleClass().add(CssTools.BOLD.getName());
				break;
			case FOCUSABLE:
				n.setFocusTraversable(true);
				break;
			case FORCE_MAX_WIDTH:
				n.setMaxWidth(Double.MAX_VALUE);
				break;
			case FORCE_MIN_HEIGHT:
				n.setMinHeight(Control.USE_PREF_SIZE);
				break;
			case FORCE_MIN_WIDTH:
				n.setMinWidth(Control.USE_PREF_SIZE);
				break;
			case NON_FOCUSABLE:
				n.setFocusTraversable(false);
				break;
			case WRAP_TEXT:
				n.setWrapText(true);
				break;
			default:
				throw new Error("?" + a);
			}
		}
		else if(a instanceof Insets)
		{
			n.setPadding((Insets)a);
		}
		else if(a instanceof OverrunStyle)
		{
			n.setTextOverrun((OverrunStyle)a);
		}
		else if(a instanceof Pos)
		{
			n.setAlignment((Pos)a);
		}
		else if(a instanceof String)
		{
			n.setText((String)a);
		}
		else if(a instanceof TextAlignment)
		{
			n.setTextAlignment((TextAlignment)a);
		}
		else if(a instanceof Color)
		{
			n.setTextFill((Color)a);
		}
		else if(a instanceof StringProperty)
		{
			n.textProperty().bind((StringProperty)a);
		}
		else if(a instanceof Node)
		{
			n.setGraphic((Node)a);
		}
		else if(a instanceof Background)
		{
			n.setBackground((Background)a);
		}
		else
		{
			throw new Error("?" + a);
		}			
	}
	
	return n;
}