当前位置: 首页>>代码示例>>Java>>正文


Java Label.setTranslateY方法代码示例

本文整理汇总了Java中javafx.scene.control.Label.setTranslateY方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setTranslateY方法的具体用法?Java Label.setTranslateY怎么用?Java Label.setTranslateY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.Label的用法示例。


在下文中一共展示了Label.setTranslateY方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: aendereReihenfolge

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void aendereReihenfolge(){
    Stage stage = new Stage();

    Label l = new Label("Reihenfolge festlegen:");
    l.setStyle("-fx-text-fill: white");
    l.setFont(Font.font(settingsFontSize));
    l.setTranslateY(25);
    l.setTranslateX(25);

    TextField tf = new TextField(String.valueOf(orderId+1));
    tf.setFont(Font.font(settingsFontSize-3));
    tf.setTranslateX(25);
    tf.setTranslateY(60);

    Button b = new Button("Speichern");
    b.setFont(Font.font(settingsFontSize));
    b.setTranslateX(25);
    b.setTranslateY(120);
    b.setOnAction(e -> {
        orderId = Integer.parseInt(tf.getText())-1;
        stage.close();
        Plugin_Gleisbelegung.sortiereGleiseListener();
    });

    Pane p = new Pane(l,tf,b);
    p.setStyle("-fx-background-color: #303030");
    p.setMinSize(500,200);
    p.setMaxSize(500, 200);

    Scene scene = new Scene(p, 300,200);

    stage.setScene(scene);
    stage.show();
    stage.setAlwaysOnTop(true);
}
 
开发者ID:manuel3108,项目名称:Gleisbelegung,代码行数:36,代码来源:Gleis.java

示例2: addMessageToErrorPane

import javafx.scene.control.Label; //导入方法依赖的package包/类
public static void addMessageToErrorPane(String message){
    Label l = new Label(message);
    l.setFont(Font.font(settingsFontSize-5));
    l.setStyle("-fx-text-fill: white;");
    l.setTranslateY(fehlerMeldungen.getChildren().size()*20);

    if(fehlerMeldungen.getChildren().size() >= 10){
        Platform.runLater(() -> {
            fehlerMeldungen.getChildren().remove(0);
            fehlerMeldungen.getChildren().add(l);

            for(int i = 0; i < fehlerMeldungen.getChildren().size(); i++){
                fehlerMeldungen.getChildren().get(i).setTranslateY(i*20);
            }
        });
    } else{
        Platform.runLater(() -> fehlerMeldungen.getChildren().add(l));
    }
}
 
开发者ID:manuel3108,项目名称:Gleisbelegung,代码行数:20,代码来源:Plugin_Gleisbelegung.java

示例3: openLogWindow

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void openLogWindow(){
    Stage stage = new Stage();

    //Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter werden deine Log-Datei und deine Anregungen anonym hochgeladen.");
    Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter wird deine Log-Datei anonym hochgeladen.");
    l.setStyle("-fx-text-fill: white");
    l.setFont(Font.font(settingsFontSize));
    l.setWrapText(true);
    l.setMaxWidth(450);
    l.setTranslateY(25);
    l.setTranslateX(25);

    /*TextField ta = new TextField();
    ta.setFont(Font.font(settingsFontSize-3));
    ta.setTranslateX(25);
    ta.setTranslateY(125);
    ta.setPrefWidth(450);
    ta.setPrefHeight(100);*/


    Button bno = new Button("Abbrechen");
    bno.setFont(Font.font(settingsFontSize));
    bno.setOnAction(e -> stage.close());
    bno.setTranslateX(250);
    bno.setTranslateY(150);

    Button byes = new Button("Weiter");
    byes.setFont(Font.font(settingsFontSize));
    byes.setTranslateX(150);
    byes.setTranslateY(150);
    byes.setOnAction(e -> {
        byes.setDisable(true);
        bno.setDisable(true);

        Runnable r = () -> {
            sendLogFile(l);
        };
        new Thread(r).start();
    });

    Pane p = new Pane(l, byes, bno);
    p.setStyle("-fx-background-color: #303030");
    p.setMinSize(500,200);
    p.setMaxSize(500, 200);

    Scene s = new Scene(p,500,200);


    stage.setScene(s);
    stage.setTitle("Log-Datei senden?");

    stage.setAlwaysOnTop(true);
    stage.show();
}
 
开发者ID:manuel3108,项目名称:Gleisbelegung,代码行数:55,代码来源:Plugin_Gleisbelegung.java

示例4: initializeLocationTypeIndicatorArrows

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializeLocationTypeIndicatorArrows() {

        // Initial indicator
        final Group initialLocationGuideContainer = controller.initialLocationGuideContainer;
        final Path initialLocationGuideArrow = controller.initialLocationGuideArrow;
        final Label initialLocationGuideLabel = controller.initialLocationGuideLabel;

        drawIndicatorArrow(initialLocationGuideArrow);
        initialLocationGuideContainer.setRotate(-45-90);
        initialLocationGuideContainer.setTranslateX(2.3 * GRID_SIZE);
        initialLocationGuideContainer.setTranslateY(3.8 * GRID_SIZE);
        initialLocationGuideLabel.setRotate(180);
        initialLocationGuideLabel.setTranslateY(10.5);
        initialLocationGuideContainer.toFront();
        initialLocationGuideContainer.setOpacity(0);

        // Final indicator
        final Group finalLocationGuideContainer = controller.finalLocationGuideContainer;
        final Path finalLocationGuideArrow = controller.finalLocationGuideArrow;
        final Label finalLocationGuideLabel = controller.finalLocationGuideLabel;

        drawIndicatorArrow(finalLocationGuideArrow);
        finalLocationGuideContainer.setRotate(45);
        finalLocationGuideContainer.setTranslateX(-2.3 * GRID_SIZE);
        finalLocationGuideContainer.setTranslateY(-3.8 * GRID_SIZE);
        finalLocationGuideLabel.setTranslateY(10.5);
        finalLocationGuideContainer.toFront();
        finalLocationGuideContainer.setOpacity(0);

        if (!controller.getComponent().isFirsTimeShown()) {
            initialLocationGuideContainer.setOpacity(1);
            finalLocationGuideContainer.setOpacity(1);
            playIndicatorAnimations(Location.Type.INITIAL, initialLocationGuideContainer);
            playIndicatorAnimations(Location.Type.FINAl, finalLocationGuideContainer);
            controller.getComponent().setFirsTimeShown(true);
        }


    }
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:40,代码来源:ComponentPresentation.java

示例5: showTrainInformations

import javafx.scene.control.Label; //导入方法依赖的package包/类
public void showTrainInformations() throws Exception{
    int heightCounter = 0;

    informations.getChildren().clear();

    for(Zug z : trains){
        debugMessage("INFORMATION: Maus befindet sich ueber " + z.getZugName() +  " und zeigt die Informationen: " + settingsShowInformations, true);



        Label trainName = new Label(z.getZugName() + z.getVerspaetungToString());
        trainName.setStyle("-fx-text-fill: white");
        trainName.setFont(Font.font(settingsFontSize-2));
        trainName.setTranslateY(heightCounter);
        if(z.getFahrplan() != null){
            for(FahrplanHalt fh : z.getFahrplan()){
                if(fh.getFlaggedTrain() != null){
                    trainName.setText(trainName.getText() + " => " + fh.getFlaggedTrain().getZugName() + fh.getFlaggedTrain().getVerspaetungToString());
                    break;
                }
            }
        }

        Label vonBis = new Label(z.getVon() + " - " + z.getNach());
        vonBis.setStyle("-fx-text-fill: white");
        vonBis.setFont(Font.font(settingsFontSize-5));
        vonBis.setTranslateY(heightCounter + 25);

        informations.getChildren().addAll(trainName, vonBis);

        for(int i = 0; i < z.getFahrplan().length; i++){
            long lAnkunft = z.getFahrplan(i).getAnkuft() + z.getVerspaetung()*1000*60;
            long lAbfahrt = z.getFahrplan(i).getAbfahrt() + z.getVerspaetung()*1000*60;
            if(z.getVerspaetung() > 3 && (lAbfahrt-lAnkunft)/1000/60 > 3){
                lAbfahrt = lAnkunft + 4*1000*60;
            }

            String durchfahrt = "";
            if(z.getFahrplan(i).isCrossing()) durchfahrt = " Df.";

            Date anunft = new Date(lAnkunft);
            Date abfahrt = new Date(lAbfahrt);
            SimpleDateFormat ft = new SimpleDateFormat("HH:mm");

            Label l = new Label("Gleis: " + z.getFahrplan(i).getGleis() + " " + ft.format(anunft) + " - " + ft.format(abfahrt) + durchfahrt);
            l.setFont(Font.font(settingsFontSize-5));
            l.setTranslateY(heightCounter + 55);
            l.setPrefWidth(settingsInformationWith-25);

            if(z.getGleis().equals(z.getFahrplan(i).getGleis()) && z.getAmGleis()){
                l.setStyle("-fx-text-fill: white; -fx-background-color: green");
            } else if(z.getFahrplan(i).getGleis().equals(bahnsteige[bahnsteig])){
                l.setStyle("-fx-text-fill: white; -fx-background-color: #505050");
            } else{
                l.setStyle("-fx-text-fill: white");
            }

            informations.getChildren().add(l);

            heightCounter += 20;
        }

        heightCounter += 75;
    }

    informations.setPrefHeight(heightCounter);
}
 
开发者ID:manuel3108,项目名称:Gleisbelegung,代码行数:68,代码来源:LabelContainer.java

示例6: initializePropertyTag

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializePropertyTag() {

        final TagPresentation propertyTag = controller.propertyTag;
        final Line propertyTagLine = controller.propertyTagLine;
        propertyTag.setComponent(controller.getComponent());
        propertyTag.setLocationAware(controller.getNail());

        // Bind the line to the tag
        BindingHelper.bind(propertyTagLine, propertyTag);

        // Bind the color of the tag to the color of the component
        propertyTag.bindToColor(controller.getComponent().colorProperty(), controller.getComponent().colorIntensityProperty());

        // Updates visibility and placeholder of the tag depending on the type of nail
        final Consumer<Edge.PropertyType> updatePropertyType = (propertyType) -> {

            // If it is not a property nail hide the tag otherwise show it and write proper placeholder
            if(propertyType.equals(Edge.PropertyType.NONE)) {
                propertyTag.setVisible(false);
            } else {

                // Show the property tag since the nail is a property nail
                propertyTag.setVisible(true);

                // Set and bind the location of the property tag
                if((controller.getNail().getPropertyX() != 0) && (controller.getNail().getPropertyY() != 0)) {
                    propertyTag.setTranslateX(controller.getNail().getPropertyX());
                    propertyTag.setTranslateY(controller.getNail().getPropertyY());
                }
                controller.getNail().propertyXProperty().bind(propertyTag.translateXProperty());
                controller.getNail().propertyYProperty().bind(propertyTag.translateYProperty());

                Label propertyLabel = controller.propertyLabel;

                if(propertyType.equals(Edge.PropertyType.SELECTION)) {
                    propertyTag.setPlaceholder("Select");
                    propertyLabel.setText(":");
                    propertyLabel.setTranslateX(-3);
                    propertyLabel.setTranslateY(-8);
                    propertyTag.setAndBindString(controller.getEdge().selectProperty());
                } else if(propertyType.equals(Edge.PropertyType.GUARD)) {
                    propertyTag.setPlaceholder("Guard");
                    propertyLabel.setText("<");
                    propertyLabel.setTranslateX(-3);
                    propertyLabel.setTranslateY(-7);
                    propertyTag.setAndBindString(controller.getEdge().guardProperty());
                } else if(propertyType.equals(Edge.PropertyType.SYNCHRONIZATION)) {
                    propertyTag.setPlaceholder("Sync");
                    propertyLabel.setText("!?");
                    propertyLabel.setTranslateX(-6);
                    propertyLabel.setTranslateY(-7);
                    propertyTag.setAndBindString(controller.getEdge().syncProperty());
                } else if(propertyType.equals(Edge.PropertyType.UPDATE)) {
                    propertyTag.setPlaceholder("Update");
                    propertyLabel.setText("=");
                    propertyLabel.setTranslateX(-3);
                    propertyLabel.setTranslateY(-7);
                    propertyTag.setAndBindString(controller.getEdge().updateProperty());
                }

                propertyTag.requestTextFieldFocus();
                propertyTag.requestTextFieldFocus(); // Requesting it twice is needed for some reason
            }
        };

        // Whenever the property type updates update the tag
        controller.getNail().propertyTypeProperty().addListener((obs, oldPropertyType, newPropertyType) -> {
            updatePropertyType.accept(newPropertyType);
        });

        // Update the tag initially
        updatePropertyType.accept(controller.getNail().getPropertyType());
    }
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:74,代码来源:NailPresentation.java


注:本文中的javafx.scene.control.Label.setTranslateY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。