Java Code Examples for javafx.scene.control.Label#setMaxSize()

The following examples show how to use javafx.scene.control.Label#setMaxSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AlarmAreaView.java    From phoebus with Eclipse Public License 1.0 6 votes vote down vote up
private Label newAreaLabel(final String item_name)
{
    final Label label = new Label(item_name);
    label.setBorder(border);
    label.setAlignment(Pos.CENTER);
    label.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    label.setFont(font);
    GridPane.setHgrow(label, Priority.ALWAYS);
    GridPane.setVgrow(label, Priority.ALWAYS);
    return label;
}
 
Example 2
Source File: ViewNumberProgress.java    From helloiot with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected Node constructContent() {
    VBox vboxroot = new VBox();
    vboxroot.setSpacing(10.0);        
            
    boxview = new HBox();
    boxview.setSpacing(6.0);
    
    level = new Label();
    level.setAlignment(Pos.CENTER_RIGHT);
    level.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    level.getStyleClass().add("unitmaintext");
    HBox.setHgrow(level, Priority.SOMETIMES);
    
    boxview.getChildren().add(level);
    
    // Get all data

    progress = new ProgressBar();
    progress.getStyleClass().add("unitbar");
    progress.setFocusTraversable(false);
    progress.setMaxWidth(Double.MAX_VALUE);
    StackPane.setAlignment(progress, Pos.BOTTOM_CENTER);          

    StackPane stack = new StackPane(progress);
    VBox.setVgrow(stack, Priority.SOMETIMES);   
    vboxroot.getChildren().addAll(boxview, stack);
    
    initialize();
    return vboxroot;
}
 
Example 3
Source File: ViewSimple.java    From helloiot with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected Node constructContent() {
    content = new Label(null);
    content.setContentDisplay(ContentDisplay.TOP);
    content.setAlignment(Pos.CENTER);
    content.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    VBox.setVgrow(content, Priority.SOMETIMES);
    return content;
}
 
Example 4
Source File: SliderSimple.java    From helloiot with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Node constructContent() {
    
    VBox vboxroot = new VBox();
    vboxroot.setSpacing(10.0);
    
    boxview = new HBox();
    boxview.setSpacing(6.0);
    
    level = new Label();
    level.setAlignment(Pos.CENTER_RIGHT);
    level.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    level.getStyleClass().add("unitmaintext");
    HBox.setHgrow(level, Priority.SOMETIMES);
    
    boxview.getChildren().add(level);
    
    slider = new Slider();
    slider.setFocusTraversable(false);
    StackPane.setAlignment(slider, Pos.BOTTOM_CENTER);        
    
    StackPane stack = new StackPane(slider);
    VBox.setVgrow(stack, Priority.SOMETIMES);
    vboxroot.getChildren().addAll(boxview, stack);
    
    initialize();
    
    return vboxroot;
}
 
Example 5
Source File: ViewText.java    From helloiot with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected Node constructContent() {
    VBox vboxroot = new VBox();
    vboxroot.setSpacing(10.0);        
    
    level = new Label();
    level.setAlignment(Pos.CENTER_RIGHT);
    level.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    level.getStyleClass().add("unitmaintext");
    
    vboxroot.getChildren().add(level);
    
    initialize();
    return vboxroot;
}
 
Example 6
Source File: UnitsContainerEmpty.java    From helloiot with GNU General Public License v3.0 5 votes vote down vote up
public UnitsContainerEmpty(String label) {
    message = new Label(label);
    message.setAlignment(Pos.TOP_CENTER);
    message.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    message.getStyleClass().add("unitsempty");
    VBox.setVgrow(message, Priority.SOMETIMES);                    
}
 
Example 7
Source File: ViewNumberChart.java    From helloiot with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected Node constructContent() {
    VBox vboxroot = new VBox();
    vboxroot.setSpacing(10.0);   
    
    boxview = new HBox();
    boxview.setSpacing(6.0);
    
    level = new Label();
    level.setAlignment(Pos.CENTER_RIGHT);
    level.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    level.getStyleClass().add("unitmaintext");
    HBox.setHgrow(level, Priority.SOMETIMES);
    
    boxview.getChildren().add(level);
    
    areachart = new ChartNode();
    StackPane chart = areachart.getNode();
    chart.setMinSize(40.0, 50.0);
    chart.setPrefSize(40.0, 50.0);
    chart.setPadding(Insets.EMPTY);
    
    StackPane stack = new StackPane(chart);
    VBox.setVgrow(stack, Priority.SOMETIMES);   
    stack.setPadding(new Insets(0.0, 0.0, 0.0, 3.0));
    vboxroot.getChildren().addAll(boxview, stack);
    
    initialize();
    return vboxroot;
}
 
Example 8
Source File: ButtonsSpinner.java    From helloiot with GNU General Public License v3.0 4 votes vote down vote up
@Override
    public Node constructContent() {
        
        VBox vboxroot = new VBox();
        vboxroot.setSpacing(10.0);        
        
        boxview = new HBox();
        boxview.setSpacing(6.0);
        
        level = new Label();
        level.setAlignment(Pos.CENTER_RIGHT);
        level.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
        level.getStyleClass().add("unitmaintext");
        HBox.setHgrow(level, Priority.SOMETIMES);
        
        boxview.getChildren().add(level);
        
        HBox hbox = new HBox();
        hbox.setSpacing(6.0);
        hbox.setAlignment(Pos.BOTTOM_CENTER);
//        StackPane.setAlignment(hbox, Pos.BOTTOM_CENTER);
        
        godown = new Button();
        godown.setFocusTraversable(false);
        godown.setMnemonicParsing(false);
        godown.getStyleClass().add("buttonbase");
        godown.setOnAction(this::onGoDown);
        
        goup = new Button();
        goup.setFocusTraversable(false);
        goup.setMnemonicParsing(false);
        goup.getStyleClass().add("buttonbase");
        goup.setOnAction(this::onGoUp);
        
        hbox.getChildren().addAll(godown, goup);
        
        StackPane stack = new StackPane(hbox);     
        VBox.setVgrow(stack, Priority.SOMETIMES);
        
        vboxroot.getChildren().addAll(boxview, stack);
        
        initialize();
        return vboxroot;
    }