javafx.scene.text.Text#setLayoutX ( )源码实例Demo

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

源代码1 项目: marathonv5   文件: HTMLEditorSample.java
public static Node createIconContent() {

        Text htmlStart = new Text("<html>");
        Text htmlEnd = new Text("</html>");
        htmlStart.setFont(Font.font(null, FontWeight.BOLD, 20));
        htmlStart.setStyle("-fx-font-size: 20px;");
        htmlStart.setTextOrigin(VPos.TOP);
        htmlStart.setLayoutY(11);
        htmlStart.setLayoutX(20);

        htmlEnd.setFont(Font.font(null, FontWeight.BOLD, 20));
        htmlEnd.setStyle("-fx-font-size: 20px;");
        htmlEnd.setTextOrigin(VPos.TOP);
        htmlEnd.setLayoutY(31);
        htmlEnd.setLayoutX(20);

        return new Group(htmlStart, htmlEnd);
    }
 
源代码2 项目: marathonv5   文件: StringBindingSample.java
public static Node createIconContent() {
    Text text = new Text("abc");
    text.setTextOrigin(VPos.TOP);
    text.setLayoutX(10);
    text.setLayoutY(11);
    text.setFill(Color.BLACK);
    text.setOpacity(0.5);
    text.setFont(Font.font(null, FontWeight.BOLD, 20));
    text.setStyle("-fx-font-size: 20px;");

    Text text2 = new Text("abc");
    text2.setTextOrigin(VPos.TOP);
    text2.setLayoutX(28);
    text2.setLayoutY(51);
    text2.setFill(Color.BLACK);
    text2.setFont(javafx.scene.text.Font.font(null, FontWeight.BOLD, 20));
    text2.setStyle("-fx-font-size: 20px;");
            
    Line line = new Line(30, 32, 45, 57);
    line.setStroke(Color.DARKMAGENTA);

    return new javafx.scene.Group(text, line, text2);
}
 
源代码3 项目: marathonv5   文件: HTMLEditorSample.java
public static Node createIconContent() {

        Text htmlStart = new Text("<html>");
        Text htmlEnd = new Text("</html>");
        htmlStart.setFont(Font.font(null, FontWeight.BOLD, 20));
        htmlStart.setStyle("-fx-font-size: 20px;");
        htmlStart.setTextOrigin(VPos.TOP);
        htmlStart.setLayoutY(11);
        htmlStart.setLayoutX(20);

        htmlEnd.setFont(Font.font(null, FontWeight.BOLD, 20));
        htmlEnd.setStyle("-fx-font-size: 20px;");
        htmlEnd.setTextOrigin(VPos.TOP);
        htmlEnd.setLayoutY(31);
        htmlEnd.setLayoutX(20);

        return new Group(htmlStart, htmlEnd);
    }
 
源代码4 项目: marathonv5   文件: StringBindingSample.java
public static Node createIconContent() {
    Text text = new Text("abc");
    text.setTextOrigin(VPos.TOP);
    text.setLayoutX(10);
    text.setLayoutY(11);
    text.setFill(Color.BLACK);
    text.setOpacity(0.5);
    text.setFont(Font.font(null, FontWeight.BOLD, 20));
    text.setStyle("-fx-font-size: 20px;");

    Text text2 = new Text("abc");
    text2.setTextOrigin(VPos.TOP);
    text2.setLayoutX(28);
    text2.setLayoutY(51);
    text2.setFill(Color.BLACK);
    text2.setFont(javafx.scene.text.Font.font(null, FontWeight.BOLD, 20));
    text2.setStyle("-fx-font-size: 20px;");
            
    Line line = new Line(30, 32, 45, 57);
    line.setStroke(Color.DARKMAGENTA);

    return new javafx.scene.Group(text, line, text2);
}
 
源代码5 项目: Quelea   文件: Pips.java
public Pips(Font font, Paint paint) {
    double width = new FXFontMetrics(font).computeStringWidth(".");
    for(int i = 0; i < 3; i++) {
        Text pip = new Text(".");
        pip.setFill(paint);
        pip.setFont(font);
        pip.setLayoutX(i * width);
        getChildren().add(pip);
    }
}
 
源代码6 项目: marathonv5   文件: StopWatchSample.java
private Text createNumber(String number, double layoutX, double layoutY) {
    Text text = new Text(number);
    text.setLayoutX(layoutX);
    text.setLayoutY(layoutY);
    text.setTextAlignment(TextAlignment.CENTER);
    text.setFill(FILL_COLOR);
    text.setFont(NUMBER_FONT);
    return text;
}
 
源代码7 项目: marathonv5   文件: StopWatchSample.java
private Text createDot(String string) {
    Text text = new Text(string);
    text.setFill(Color.web("#000000"));
    text.setFont(FONT);
    text.setTextOrigin(VPos.TOP);
    text.setLayoutX(1);
    text.setLayoutY(-4);
    return text;
}
 
源代码8 项目: marathonv5   文件: CustomNodeSample.java
public MyEnsembleNode(String name) {
  text = new Text(name);
  text.setTextOrigin(VPos.TOP);
  text.setLayoutX(4);
  text.setLayoutY(2);
  rectangle = new Rectangle(50, 20, Color.WHITESMOKE);
  rectangle.setStroke(Color.BLACK);
  //add nodes as childrens, order matters, first is on the bottom
  getChildren().addAll(rectangle, text);
}
 
源代码9 项目: marathonv5   文件: CustomNodeSample.java
public static Node createIconContent() {
    MyEnsembleNode myNode = new MyEnsembleNode("MyNode");
    myNode.setLayoutY(50);
    MyEnsembleNode parent = new MyEnsembleNode("Parent");
    Polygon arrow = createUMLArrow();
    arrow.setLayoutY(20);
    arrow.setLayoutX(25-7.5);
    Text text = new Text("<<extends>>");
    text.setTextOrigin(VPos.TOP);
    text.setLayoutY(31);
    text.setLayoutX(30);
    return new Group(parent, arrow, text, myNode);
}
 
源代码10 项目: marathonv5   文件: StopWatchSample.java
private Text createNumber(String number, double layoutX, double layoutY) {
    Text text = new Text(number);
    text.setLayoutX(layoutX);
    text.setLayoutY(layoutY);
    text.setTextAlignment(TextAlignment.CENTER);
    text.setFill(FILL_COLOR);
    text.setFont(NUMBER_FONT);
    return text;
}
 
源代码11 项目: marathonv5   文件: StopWatchSample.java
private Text createDot(String string) {
    Text text = new Text(string);
    text.setFill(Color.web("#000000"));
    text.setFont(FONT);
    text.setTextOrigin(VPos.TOP);
    text.setLayoutX(1);
    text.setLayoutY(-4);
    return text;
}
 
源代码12 项目: marathonv5   文件: CustomNodeSample.java
public MyEnsembleNode(String name) {
  text = new Text(name);
  text.setTextOrigin(VPos.TOP);
  text.setLayoutX(4);
  text.setLayoutY(2);
  rectangle = new Rectangle(50, 20, Color.WHITESMOKE);
  rectangle.setStroke(Color.BLACK);
  //add nodes as childrens, order matters, first is on the bottom
  getChildren().addAll(rectangle, text);
}
 
源代码13 项目: marathonv5   文件: CustomNodeSample.java
public static Node createIconContent() {
    MyEnsembleNode myNode = new MyEnsembleNode("MyNode");
    myNode.setLayoutY(50);
    MyEnsembleNode parent = new MyEnsembleNode("Parent");
    Polygon arrow = createUMLArrow();
    arrow.setLayoutY(20);
    arrow.setLayoutX(25-7.5);
    Text text = new Text("<<extends>>");
    text.setTextOrigin(VPos.TOP);
    text.setLayoutY(31);
    text.setLayoutX(30);
    return new Group(parent, arrow, text, myNode);
}
 
源代码14 项目: netbeans   文件: StopWatch.java
private Text createNumber(String number, double layoutX, double layoutY) {
    Text text = new Text(number);
    text.setLayoutX(layoutX);
    text.setLayoutY(layoutY);
    text.setTextAlignment(TextAlignment.CENTER);
    text.setFill(FILL_COLOR);
    text.setFont(NUMBER_FONT);
    return text;
}
 
源代码15 项目: netbeans   文件: StopWatch.java
private Text createDot(String string) {
    Text text = new Text(string);
    text.setFill(Color.web("#000000"));
    text.setFont(FONT);
    text.setTextOrigin(VPos.TOP);
    text.setLayoutX(1);
    text.setLayoutY(-4);
    return text;
}
 
源代码16 项目: ARMStrong   文件: LedView.java
/**
 * Creates a new instance of Node
 * @param simulator the arm simulator
 */
public LedView(ArmSimulator simulator){

    this.simulator = simulator;

    this.mainPane = new ScrollPane();
    
    ledOff = new Image(getClass().getResource("/resources/ledOff.png").toExternalForm());
    ledOn = new Image(getClass().getResource("/resources/ledOn.png").toExternalForm());
    leverOff = new Image(getClass().getResource("/resources/leverOff.png").toExternalForm());
    leverOn = new Image(getClass().getResource("/resources/leverOn.png").toExternalForm()); 
      
    gameContainer = new HBox();
    ledContainer = new VBox();
    buttonContainer = new VBox();
            
    for(int i=0 ; i < 8 ; i++) { //creating 8 leds at the start of the view
    	IOLed led = simulator.newIOLed();
    	
    	AnchorPane newLedAddress = new AnchorPane();
        ImageView newLedImage = new ImageView();
        
        ledArray.add(led);
    	ledImageArrayList.add(newLedImage);
    	
    	if(led.isOn()) {
        	newLedImage.setImage(ledOn);
        }else {
        	newLedImage.setImage(ledOff);
        }       	

        newLedImage.setLayoutX(0);
        newLedImage.setLayoutY(0);
        Text newAddress = new Text();
        newAddress.setText("0x" + Long.toHexString(led.getPortAddress()) + " Bit N°" + led.shift);
        newAddress.setLayoutX(95);
        newAddress.setLayoutY(55);
        
        newLedAddress.getChildren().addAll(newLedImage, newAddress);
        ledContainer.getChildren().add(newLedAddress);
    }
    
    for(int i=0 ; i < 2 ; i++) { //creating 3 buttons at the start of the view
    	IOButton IOpressButton = simulator.newIOButton();
    	IOSwitch IOleverButton = simulator.newIOSwitch();
    	AnchorPane buttonAndTextAndLeverAndTextAnchorPane = new AnchorPane();
    	       	
    	Text leverText = new Text();
    	leverText.setText("0x" + Long.toHexString(IOpressButton.getPortAddress()) + " Bit N°" + IOpressButton.shift);
    	leverText.setLayoutX(30);
        leverText.setLayoutY(100);

        Text pushingText = new Text();
        pushingText.setText("0x" + Long.toHexString(IOleverButton.getPortAddress()) + " Bit N°" + IOleverButton.shift);
        pushingText.setLayoutX(30);
        pushingText.setLayoutY(190);
        
        ImageView lever = new ImageView(leverOff);            
    	Button leverButton =  new Button("", lever);
    	Button pushingButton = new Button("", new ImageView(new Image(getClass().getResource("/resources/pushingButton.png").toExternalForm())));

    	leverButton.setOnAction(ActionEvent -> {
    		IOleverButton.flip();       
    		refresh();
        });
    	
    	pushingButton.setOnAction(ActionEvent -> {
    		IOpressButton.push();     
    		refresh();
        });


    	leverButton.setLayoutX(70);
        leverButton.setLayoutY(25);
    	pushingButton.setLayoutX(70);
        pushingButton.setLayoutY(115);        
        
    	leverButtonArray.add(IOleverButton);
    	pressButtonArray.add(IOpressButton);
    	leverImageArrayList.add(lever);
    	
    	buttonAndTextAndLeverAndTextAnchorPane.getChildren().addAll(leverButton, leverText, pushingButton, pushingText);
    	buttonContainer.getChildren().add(buttonAndTextAndLeverAndTextAnchorPane);
    }
    
    gameContainer.getChildren().addAll(ledContainer, buttonContainer);
    
    this.dockNode = new DockNode(mainPane, "Led Game", new ImageView(dockImage));
    
    dockNode.setPrefSize(300,666);
    
    this.mainPane.setContent(gameContainer);  
    this.mainPane.setFitToWidth(true);
    this.mainPane.setFitToHeight(true);  
    this.mainPane.setHmin(dockNode.getHeight());
}