本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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()));
}
示例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:
}
示例11: setupMessageText
import javafx.scene.text.Text; //导入方法依赖的package包/类
private void setupMessageText() {
message = new Text();
message.setId("message");
bindProgressMessageTo(taskMessage());
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}