當前位置: 首頁>>代碼示例>>Java>>正文


Java Text.setId方法代碼示例

本文整理匯總了Java中javafx.scene.text.Text.setId方法的典型用法代碼示例。如果您正苦於以下問題:Java Text.setId方法的具體用法?Java Text.setId怎麽用?Java Text.setId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.text.Text的用法示例。


在下文中一共展示了Text.setId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: constructContainer

import javafx.scene.text.Text; //導入方法依賴的package包/類
@Override
public Parent constructContainer() {
	// CSS formatierte Meldung auf BS bringen (mit div. Schrifteffekten)
	Text t = new Text("Starting Demo (please wait)...");
	t.setId("fancytext");

	// Button f�r Zur�ck zum Hauptmenue:
	Button b = new Button("Zur�ck...");
	b.setOnAction(e -> getFXController().showMainView());

	// Erstellt VBox Layout f�r beide obige Elemente:
	myLayout.setSpacing(50);
	myLayout.getChildren().addAll(t, b);
	
	// VBox in neuem Borderpane einf�gen, zwingend wenn Hintergrund neu sein soll
	// CSS liefert neue Darstellung:
	BorderPane bp = new BorderPane();
	bp.setCenter(myLayout);
	bp.setId("gamebg");
	
	// BP in Scene einf�gen:
	// TODO Auto-generated method stub
	return bp;
}
 
開發者ID:CoffeeCodeSwitzerland,項目名稱:Lernkartei_2017,代碼行數:25,代碼來源:TestView.java

示例2: simulationSpeedSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private Node simulationSpeedSelection( SimulatorSettingDetails settingDetails )
{
	VBox vBox = new VBox();

	Text simulationSpeedLabel = new Text("Simulation Speed (milliseconds / cycle)");
	simulationSpeedLabel.setId(UIConstants.TEXT_COLOR);

	//TODO take in settings for slider
	Slider simulationSpeedSlider = new Slider(0, 1000, 100);
	simulationSpeedSlider.setShowTickMarks(true);
	simulationSpeedSlider.setShowTickLabels(true);
	simulationSpeedSlider.setMajorTickUnit(100);
	simulationSpeedSlider.setBlockIncrement(100);

	simulationSpeedModel = simulationSpeedSlider.valueProperty();

	vBox.getChildren().addAll(simulationSpeedLabel, simulationSpeedSlider);

	return vBox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:21,代碼來源:SimulatorSettingsPanel.java

示例3: editorModeSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private Node editorModeSelection( EditorSettingDetails settingDetails, ObservableList<String> editorModes )
{
	HBox hBox = new HBox();

	Text editorModeLabel = new Text("Editor Mode: ");
	editorModeLabel.setId(UIConstants.TEXT_COLOR);

	ComboBox<String> editorModeComboBox = new ComboBox<>(editorModes);
	editorModeComboBox.getSelectionModel().select(settingDetails.getEditorMode());

	editorModeSelectionModel = editorModeComboBox.getSelectionModel();

	hBox.getChildren().addAll(editorModeLabel, editorModeComboBox);
	hBox.setAlignment(Pos.CENTER_LEFT);

	return hBox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:18,代碼來源:EditorSettingsPanel.java

示例4: maximumChunkSizeSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private Node maximumChunkSizeSelection( ProgrammerSettingDetails settingDetails )
{
	HBox hBox = new HBox();

	//TODO ensure numerical values only
	Text maxChunkSizeLabel = new Text("Maximum chunk size: ");
	maxChunkSizeLabel.setId(UIConstants.TEXT_COLOR);

	TextField maxChunkSizeTextField = new TextField();
	maxChunkSizeTextField.setText(settingDetails.getMaximumChunkSize());

	maxChunkSizeTextField.textProperty().addListener(( observable, oldValue, newValue ) -> {
		if ( !newValue.isEmpty() )
			UIStyle.applyError(VerifyUtil.simpleIntegerCheck(newValue), maxChunkSizeTextField);
	});

	maximumChunkSizeSelectionModel = maxChunkSizeTextField.textProperty();

	hBox.getChildren().addAll(maxChunkSizeLabel, maxChunkSizeTextField);

	return hBox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:23,代碼來源:ProgrammerSettingsPanel.java

示例5: timeoutSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private Node timeoutSelection( ProgrammerSettingDetails settingDetails )
{
	HBox hBox = new HBox();

	Text receiveTimeoutLabel = new Text("Receive timout (ms): ");
	receiveTimeoutLabel.setId(UIConstants.TEXT_COLOR);

	TextField receiveTimeoutTextField = new TextField();
	receiveTimeoutTextField.setText(settingDetails.getReceiveTimeoutMilliseconds());

	receiveTimeoutTextField.textProperty().addListener(( observable, oldValue, newValue ) -> {
		if ( !newValue.isEmpty() )
			UIStyle.applyError(VerifyUtil.simpleIntegerCheck(newValue), receiveTimeoutTextField);
	});

	receiveTimeoutSelectionModel = receiveTimeoutTextField.textProperty();

	hBox.getChildren().addAll(receiveTimeoutLabel, receiveTimeoutTextField);

	return hBox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:22,代碼來源:ProgrammerSettingsPanel.java

示例6: fontSizeSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private Node fontSizeSelection( EditorSettingDetails settingDetails )
{
	HBox hBox = new HBox();

	Text fontSizeLabel = new Text("Font Size: ");
	fontSizeLabel.setId(UIConstants.TEXT_COLOR);

	List<String> fontSizes = Arrays.asList("6", "8", "12", "14", "16", "20", "32", "48", "60", "72");

	ObservableList<String> fontSizeList = FXCollections.observableArrayList(fontSizes);

	ComboBox<String> fontSizesComboBox = new ComboBox<>(fontSizeList);
	fontSizesComboBox.setEditable(true);
	fontSizesComboBox.editorProperty().getValue().textProperty().addListener(( observable, oldValue, newValue )
																					 -> {
		if ( !newValue.isEmpty() )
			UIStyle.applyError(VerifyUtil.simpleIntegerCheck(newValue), fontSizesComboBox);
	});

	fontSizesComboBox.getSelectionModel().select(settingDetails.getFontSize());
	fontSizesComboBox.autosize();

	fontSizeSelectionModel = fontSizesComboBox.getSelectionModel();

	hBox.getChildren().addAll(fontSizeLabel, fontSizesComboBox);
	hBox.setAlignment(Pos.CENTER_LEFT);

	return hBox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:30,代碼來源:EditorSettingsPanel.java

示例7: configureBox

import javafx.scene.text.Text; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void configureBox(HBox root) {
	StackPane container = new StackPane();
	//container.setPrefHeight(700);
	container.setPrefSize(boxBounds.getWidth(), boxBounds.getHeight());
	container.setStyle("-fx-border-width:1px;-fx-border-style:solid;-fx-border-color:#999999;");

	table= new TableView<AttClass>();
	Label lview= new Label();
	lview.setText("View Records");
	lview.setId("lview");
	bottomPane= new VBox();

	tclock= new Text(); 
	tclock.setId("lview");
	//tclock.setFont(Font.font("Calibri", 20));
	final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {  
		@Override  
		public void handle(ActionEvent event) {  
			tclock.setText(DateFormat.getDateTimeInstance().format(new Date()));
		}  
	}));  
	timeline.setCycleCount(Animation.INDEFINITE);  
	timeline.play();

	bottomPane.getChildren().addAll(tclock,lview);
	bottomPane.setAlignment(Pos.CENTER);

	//table pane
	namecol= new TableColumn<>("First Name");
	namecol.setMinWidth(170);
	namecol.setCellValueFactory(new PropertyValueFactory<>("name"));

	admcol= new TableColumn<>("Identication No.");
	admcol.setMinWidth(180);
	admcol.setCellValueFactory(new PropertyValueFactory<>("adm"));

	typecol= new TableColumn<>("Type");
	typecol.setMinWidth(130);
	typecol.setCellValueFactory(new PropertyValueFactory<>("type"));

	timecol= new TableColumn<>("Signin");
	timecol.setMinWidth(140);
	timecol.setCellValueFactory(new PropertyValueFactory<>("timein"));

	datecol= new TableColumn<>("Date");
	datecol.setMinWidth(180);
	datecol.setCellValueFactory(new PropertyValueFactory<>("date"));

	table.getColumns().addAll(namecol, admcol, typecol, timecol, datecol);
	table.setItems(getAtt());
	att= getAtt();
	table.setItems(FXCollections.observableArrayList(att));
	table.setMinHeight(500);

	btnrefresh = new Button("Refresh");
	btnrefresh.setOnAction(new EventHandler<ActionEvent>() {
		public void handle(ActionEvent t) {
			table.setItems(getAtt());
		}
	});
	laytable= new VBox(10);
	laytable.getChildren().addAll(table, btnrefresh);
	laytable.setAlignment(Pos.TOP_LEFT);

	container.getChildren().addAll(bottomPane,laytable);
	setAnimation();
	sc.setContent(container);
	root.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672)");
	root.getChildren().addAll(getActionPane(),sc);

	//service.start();
}
 
開發者ID:mikemacharia39,項目名稱:gatepass,代碼行數:74,代碼來源:AllAttendance.java

示例8: configureBox

import javafx.scene.text.Text; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void configureBox(HBox root) {
	  StackPane container = new StackPane();
	  //container.setPrefHeight(700);
	  container.setPrefSize(boxBounds.getWidth(), boxBounds.getHeight());
	  container.setStyle("-fx-border-width:1px;-fx-border-style:solid;-fx-border-color:#999999;");

	 table= new TableView<OfficeClass>();
	  Label lview= new Label();
	  lview.setText("View Records");
	  lview.setId("lview");
	  bottomPane= new VBox();
	  
	  tclock= new Text(); 
	  tclock.setId("lview");
		//tclock.setFont(Font.font("Calibri", 20));
		final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {  
		     @Override  
		     public void handle(ActionEvent event) {  
		          tclock.setText(DateFormat.getDateTimeInstance().format(new Date()));
		     }  
		}));  
		timeline.setCycleCount(Animation.INDEFINITE);  
		timeline.play();
	  
	  bottomPane.getChildren().addAll(tclock, lview);
	  bottomPane.setAlignment(Pos.CENTER);
	  
	  nocol= new TableColumn<>("no");
	  nocol.setMinWidth(130);
	  nocol.setCellValueFactory(new PropertyValueFactory<>("no"));
		
	  
	  namecol= new TableColumn<>("First Name");
		namecol.setMinWidth(170);
		namecol.setCellValueFactory(new PropertyValueFactory<>("name"));
		
		admcol= new TableColumn<>("Admission Number");
		admcol.setMinWidth(180);
		admcol.setCellValueFactory(new PropertyValueFactory<>("adm"));
		
		
		timecol= new TableColumn<>("Signin");
		timecol.setMinWidth(140);
		timecol.setCellValueFactory(new PropertyValueFactory<>("timein"));
		
		datecol= new TableColumn<>("Date");
		datecol.setMinWidth(180);
		datecol.setCellValueFactory(new PropertyValueFactory<>("date"));
		
		table.getColumns().addAll(nocol,namecol, admcol, timecol, datecol);
		table.setItems(getAtt());
		att= getAtt();
        table.setItems(FXCollections.observableArrayList(att));
        table.setMinHeight(500);
       
        btnrefresh = new Button("Refresh");
        btnrefresh.setOnAction(new EventHandler<ActionEvent>() {
            public void handle(ActionEvent t) {
            	table.setItems(getAtt());
            }
        });
        laytable= new VBox(10);
        laytable.getChildren().addAll(table, btnrefresh);
        laytable.setAlignment(Pos.TOP_LEFT);
        
        container.getChildren().addAll(bottomPane,laytable);
		setAnimation();
		sc.setContent(container);
		root.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672)");
		root.getChildren().addAll(getActionPane(),sc);
		
		//service.start();
	 }
 
開發者ID:mikemacharia39,項目名稱:gatepass,代碼行數:75,代碼來源:Office_Entry.java

示例9: show

import javafx.scene.text.Text; //導入方法依賴的package包/類
private void show() {
	BorderPane bp = new BorderPane();
	bp.setPadding(new Insets(10,50,50,50));
	HBox hb = new HBox();
	hb.setPadding(new Insets(20,20,20,30));		
	//Implementing Nodes for GridPane
	Label lblUserName = new Label("Username");		
	Label lblPassword = new Label("Password");
	Label lblLanguage = new Label("Language");	

	Button btnReset = createButton("Reset", "btnLogin");
	Button btnRegister = createButton("Register", "btnReset");
	Button btnLogin = createButton("Login", "btnReset");

	//Adding GridPane
	GridPane gridPane = createGridPane(lblUserName, lblPassword, lblLanguage, btnLogin, btnReset, btnRegister);
	gridPane.setId("root");
	Text text = createText("Game Login");
	text.setId("text");
	//Adding text to HBox
	hb.getChildren().add(text);
	//Add ID's to Nodes
	bp.setId("bp");	
	//Add HBox and GridPane layout to BorderPane Layout
	bp.setTop(hb);
	bp.setCenter(gridPane); 				
	//Adding BorderPane to the scene and loading CSS
	scene = new Scene(bp);
	scene.getStylesheets().setAll(CSS_LOCATION);		
	//Action for btnLogin
	btnLogin.setOnAction(e -> buttonLoginAction());
	//Action for btnReset
	btnReset.setOnAction(e -> buttonResetAction());		
	//Action for btnRegister
	btnRegister.setOnAction(p -> {
		tempCheckUser = txtUserName.getText().toString();
		tempCheckPw = pf.getText().toString();
		if(tempCheckUser.length() < LENGTH_OF_USER || tempCheckPw.length() < LENGTH_OF_PASSWORD ){
			MessageShowing unsuccess = new MessageShowing();
			unsuccess.show("failure");
			tempCheckUser="";
			tempCheckPw = "";
			buttonResetAction();
			return;
		}
		usersModel.addUser(tempCheckUser, tempCheckPw);

		writer.write(tempCheckUser, tempCheckPw);
		((PopUpMessage) p).show("success");
		buttonResetAction();});	

	scene.setOnKeyPressed(e -> handleKeyInput(e.getCode()));
}
 
開發者ID:LtubSalad,項目名稱:voogasalad-ltub,代碼行數:54,代碼來源:PasswordManager.java

示例10: constructContainer

import javafx.scene.text.Text; //導入方法依賴的package包/類
@Override
public Parent constructContainer() {
	text = new Text("Starting game...");
	text.setId("fancytext"); // CSS formatierte Meldung auf BS bringen (mit
								// div. Schrifteffekten)

	// Button for back to main:
	btnBacktoKartei.setOnAction(e -> getFXController().showMainView()); 

	// Other buttons:
	btnJumNRun.setOnAction(e -> getFXController().getModel("game").doAction(Command.NEW)); 
	btnInfoJump.setOnAction(e -> getFXController().showView("gameoptionview")); 
	btnTutto.setOnAction(e -> getFXController().getModel("tutto").doAction(Command.NEW));
	btnInfoTutto.setOnAction(e -> getFXController().showView("tuttohelpview"));

	// Erstellt VBox Layout f�r beide obige Elemente:
	JumpNRun.getChildren().addAll( btnJumNRun, btnInfoJump);
	
	JumpNRun.setPadding(new Insets(10)); 
	JumpNRun.setSpacing(15);
	JumpNRun.setAlignment(Pos.CENTER_LEFT);
	
	
	tutto.getChildren().addAll( btnTutto, btnInfoTutto);
	tutto.setPadding(new Insets(10)); 
	tutto.setSpacing(15);
	tutto.setAlignment(Pos.CENTER_LEFT);
	
	life.getChildren().addAll(lifes);
	life.setAlignment(Pos.CENTER);
	 
	gridpane.setAlignment(Pos.CENTER);
	gridpane.add(tutto, 90, 2);
	gridpane.add(JumpNRun, 30, 2);
	gridpane.add(grund,35,1);
	gridpane.add( btnBacktoKartei,35,25);
	gridpane.add(life,35,2);
	
	MainLayout maLay = new MainLayout(gridpane,null);
	
	((GameModel) getFXController().getModel("game")).registerView(this, getFXController());
	return maLay;

	// VBox in neuem Borderpane einf�gen, zwingend wenn Hintergrund neu sein
	// soll
	// CSS liefert neue Darstellung:
	
	
}
 
開發者ID:CoffeeCodeSwitzerland,項目名稱:Lernkartei_2017,代碼行數:50,代碼來源:GameView.java

示例11: setupMessageText

import javafx.scene.text.Text; //導入方法依賴的package包/類
private void setupMessageText() {
    message = new Text();
    message.setId("message");
    bindProgressMessageTo(taskMessage());
}
 
開發者ID:AntonioGabrielAndrade,項目名稱:LIRE-Lab,代碼行數:6,代碼來源:ProgressDialog.java

示例12: applicationThemeSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private HBox applicationThemeSelection( ApplicationSettingDetails details,
		ObservableList<String> applicationThemes )
{
	HBox hbox = new HBox();

	Text themeLabel = new Text("Application Theme: ");
	themeLabel.setId(UIConstants.TEXT_COLOR);

	ObservableList<String> list = applicationThemes;

	ComboBox<String> themes = new ComboBox<>(list);
	themes.getSelectionModel().select(details.getApplicationTheme());

	applicationThemeSelectionModel = themes.getSelectionModel();


	hbox.getChildren().addAll(themeLabel, themes);
	hbox.setAlignment(Pos.CENTER_LEFT);

	return hbox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:22,代碼來源:ApplicationSettingsPanel.java

示例13: editorThemeSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private HBox editorThemeSelection( ApplicationSettingDetails details, ObservableList<String> editorsThemes )
{
	HBox hbox = new HBox();

	Text themeLabel = new Text("Editor Theme: ");
	themeLabel.setId(UIConstants.TEXT_COLOR);

	ObservableList<String> list = editorsThemes;

	ComboBox<String> themes = new ComboBox<>(list);
	themes.getSelectionModel().select(0);

	editorThemeSelectionModel = themes.getSelectionModel();

	hbox.getChildren().addAll(themeLabel, themes);
	hbox.setAlignment(Pos.CENTER_LEFT);

	return hbox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:20,代碼來源:ApplicationSettingsPanel.java

示例14: fontListSelection

import javafx.scene.text.Text; //導入方法依賴的package包/類
private Node fontListSelection( EditorSettingDetails settingDetails, ObservableList<String> fontList )
{
	HBox hBox = new HBox();

	Text fontLabel = new Text("Font: ");
	fontLabel.setId(UIConstants.TEXT_COLOR);

	ComboBox<String> fonts = new ComboBox<>(fontList);
	fonts.getSelectionModel().select(settingDetails.getFontName());

	fontSelectionModel = fonts.getSelectionModel();


	hBox.getChildren().addAll(fontLabel, fonts);
	hBox.setAlignment(Pos.CENTER_LEFT);

	return hBox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:19,代碼來源:EditorSettingsPanel.java

示例15: addToGrid

import javafx.scene.text.Text; //導入方法依賴的package包/類
private static void addToGrid(GridPane grid, AtomicInteger currentFormRow, Text label, Control input) {

        final int COLUMN_INDEX_LABEL = 0;
        final int COLUMN_INDEX_INPUT = 1;

        final int currentRowIndex = currentFormRow.incrementAndGet();

        label.setId("item");
        // label.setFont(Font.font("Tahoma", FontWeight.NORMAL, 14)); //should be managed with css

        grid.add(label, COLUMN_INDEX_LABEL, currentRowIndex);
        grid.add(input, COLUMN_INDEX_INPUT, currentRowIndex);

        GridPane.setHalignment(label, HPos.LEFT);
        GridPane.setHalignment(input, HPos.LEFT);
    }
 
開發者ID:schwabdidier,項目名稱:GazePlay,代碼行數:17,代碼來源:ConfigurationContext.java


注:本文中的javafx.scene.text.Text.setId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。