Java 类javafx.scene.layout.Region 实例源码

项目:fx-animation-editor    文件:TitledBoxComponent.java   
private void initUi() {
    super.getChildren().addAll(titleBar, outerStackPane);
    outerStackPane.getChildren().add(innerStackPane);
    innerStackPane.getChildren().add(noElementSelectedLabel);
    content.addListener((v, o, n) -> onContentChanged(o, n));

    outerStackPane.setMinHeight(0);
    outerStackPane.setAlignment(Pos.TOP_CENTER);
    innerStackPane.setMinHeight(Region.USE_PREF_SIZE);

    noElementSelectedLabel.visibleProperty().bind(showingProperty().not());
    noElementSelectedLabel.setText(LABEL_TEXT);
    noElementSelectedLabel.getStyleClass().setAll(LABEL_STYLE_CLASS);

    collapseAnimator.apply(titleBar.expandedProperty(), titleBar.animatedProperty(), outerStackPane);
}
项目:fx-animation-editor    文件:TitleBarComponent.java   
private void createUi() {
    getStyleClass().add(TITLE_BAR_STYLE_CLASS);
    setAlignment(Pos.CENTER_RIGHT);
    setMaxWidth(Double.MAX_VALUE);

    Region selectedBar = new Region();
    selectedBar.getStyleClass().add(HIGHLIGHT_STYLE_CLASS);
    selectedBar.setMinWidth(Region.USE_PREF_SIZE);
    selectedBar.setMaxHeight(Region.USE_PREF_SIZE);
    selectedBar.setMaxWidth(Double.MAX_VALUE);
    StackPane.setAlignment(selectedBar, Pos.BOTTOM_CENTER);

    StackPane labelPane = new StackPane(label, selectedBar);
    labelPane.setMaxHeight(Double.MAX_VALUE);
    labelPane.setMaxWidth(Region.USE_PREF_SIZE);

    Region filler = new Region();
    HBox.setHgrow(filler, Priority.ALWAYS);
    rightLabel.getStyleClass().setAll(RIGHT_LABEL_STYLE_CLASS);

    new FadeInAnimator().apply(expanded, selectedBar);
    new FadeInAnimator().apply(expanded, rightLabel);

    getChildren().addAll(labelPane, filler, rightLabel);
}
项目:javafx-dataviewer    文件:TopMenu.java   
private void createAndShowTableWindow(ComboBox<String> traceNameComboBox) {
    openedWindowsCtr++;
    List<String> traceNames = new ArrayList<>();
    for (int i = 0; i < plotData.getAllTraces().size(); i++) {
        traceNames.add(plotData.getAllTraces().get(i).getTraceName());
    }
    traceNameComboBox.setItems(FXCollections.observableList(traceNames));
    traceNameComboBox.getSelectionModel().select(0);

    HBox hbox = new HBox();

    traceNameComboBox.getSelectionModel().select(0);
    Region spacer = new Region();
    HBox.setHgrow(spacer, Priority.ALWAYS);
    hbox.getChildren().addAll(new Label("Please Select a trace :"), spacer, traceNameComboBox);

    updateTableValues(traceNameComboBox);

    Scene scene = new Scene(new Group());
    VBox vbox = new VBox();
    VBox.setVgrow(table, Priority.ALWAYS);
    vbox.setSpacing(5);
    vbox.setPadding(new Insets(10, 10, 10, 10));
    vbox.prefWidthProperty().bind(scene.widthProperty());
    vbox.prefHeightProperty().bind(scene.heightProperty());
    vbox.getChildren().addAll(hbox, table);

    ((Group) scene.getRoot()).getChildren().addAll(vbox);

    Stage stage = new Stage();
    stage.setOnCloseRequest(e -> closeTableWindow());
    stage.setWidth(300);
    stage.setHeight(400);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.showAndWait();
}
项目:marathonv5    文件:AddPropertiesView.java   
public AddPropertiesView(TestPropertiesInfo issueInfo) {
    this.issueInfo = issueInfo;
    initComponents();
 // @formatter:off
    Label severityLabel = new Label("Severity: ");
    severityLabel.setMinWidth(Region.USE_PREF_SIZE);
    tmsLink.setOnAction((e) -> {
        try {
            Desktop.getDesktop().browse(new URI(tmsLink.getText()));
        } catch (Exception e1) {
            FXUIUtils._showMessageDialog(null, "Unable to open link: " + tmsLink.getText(), "Unable to open link",
                    AlertType.ERROR);
            e1.printStackTrace();
        }
    });
    formPane.addFormField("Name: ", nameField)
            .addFormField("Description: ", descriptionField)
            .addFormField("ID: ", idField, severityLabel, severities);
    String tmsPattern = System.getProperty(Constants.PROP_TMS_PATTERN);
    if (tmsPattern != null && tmsPattern.length() > 0) {
        tmsLink.textProperty().bind(Bindings.format(tmsPattern, idField.textProperty()));
        formPane.addFormField("", tmsLink);
    }
    // @formatter:on
    setCenter(content);
}
项目:marathonv5    文件:FixtureSelection.java   
private void initComponents() {
    VBox.setVgrow(fixtureList, Priority.ALWAYS);
    fixtureList.setId("fixture-list-view");
    fixtureList.setItems(fixtuers);
    fixtureList.setOnMouseClicked((e) -> {
        if (e.getClickCount() == 2)
            onSelect(fixtureList.getSelectionModel().getSelectedItem());
    });
    fixtureList.getSelectionModel().select(selectedFixture);
    fixtureList.getSelectionModel().selectedIndexProperty().addListener((listener) -> {
        updateButtonState();
    });

    selectButton.setOnAction((e) -> onSelect(fixtureList.getSelectionModel().getSelectedItem()));
    cancelButton.setOnAction((e) -> onCancel());
    buttonBar.getButtons().addAll(selectButton, cancelButton);
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
    updateButtonState();
}
项目:marathonv5    文件:FileSelectionStage.java   
private HBox createBrowserField() {
    HBox browseFieldBox = new HBox(5);
    dirField = new TextField();
    dirField.setId("DirectoryField");
    dirField.textProperty().addListener((observable, oldValue, newValue) -> updateOKButton());
    HBox.setHgrow(dirField, Priority.ALWAYS);
    Button browseButton = FXUIUtils.createButton("browse", "Browse directory", true, "Browse");
    FileSelectionHandler browserListener;
    String fileType = fileSelectionInfo.getFileType();
    if (fileType != null) {
        browserListener = new FileSelectionHandler(this,
                new ExtensionFilter(fileType, Arrays.asList(fileSelectionInfo.getExtensionFilters())), this, null,
                fileSelectionInfo.getTitle());
    } else {
        browserListener = new FileSelectionHandler(this, null, this, null, fileSelectionInfo.getTitle());
        browserListener.setMode(FileSelectionHandler.DIRECTORY_CHOOSER);
    }
    browserListener.setPreviousDir(new File(System.getProperty(Constants.PROP_PROJECT_DIR, ProjectLayout.projectDir)));
    browseButton.setOnAction(browserListener);
    Label label = createLabel("Name: ");
    label.setMinWidth(Region.USE_PREF_SIZE);
    label.setId("FileSelectedLabel");
    browseFieldBox.getChildren().addAll(label, dirField, browseButton);
    VBox.setMargin(browseFieldBox, new Insets(5, 5, 5, 5));
    return browseFieldBox;
}
项目:marathonv5    文件:FXUIUtils.java   
public static ButtonBase _initButtonBase(String name, String toolTip, boolean enabled, String buttonText, ButtonBase button) {
    button.setId(name + "Button");
    button.setTooltip(new Tooltip(toolTip));
    Node enabledIcon = getImageFrom(name, "icons/", FromOptions.NULL_IF_NOT_EXISTS);
    if (enabledIcon != null) {
        button.setText(null);
        button.setGraphic(enabledIcon);
    }
    if (buttonText != null) {
        button.setText(buttonText);
    } else if (enabledIcon == null) {
        button.setText(name);
    }
    button.setDisable(!enabled);
    button.setMinWidth(Region.USE_PREF_SIZE);
    return button;
}
项目:marathonv5    文件:RunHistoryStage.java   
private void initComponents() {
    VBox.setVgrow(historyView, Priority.ALWAYS);
    historyView.setItems(FXCollections.observableArrayList(runHistoryInfo.getTests()));
    historyView.setCellFactory(new Callback<ListView<JSONObject>, ListCell<JSONObject>>() {
        @Override public ListCell<JSONObject> call(ListView<JSONObject> param) {
            return new HistoryStateCell();
        }
    });

    VBox historyBox = new VBox(5);
    HBox.setHgrow(historyBox, Priority.ALWAYS);

    countField.setText(getRemeberedCount());
    if (countNeeded) {
        form.addFormField("Max count of remembered runs: ", countField);
    }
    historyBox.getChildren().addAll(new Label("Select test", FXUIUtils.getIcon("params")), historyView, form);

    verticalButtonBar.setId("vertical-buttonbar");
    historyPane.setId("history-pane");
    historyPane.getChildren().addAll(historyBox, verticalButtonBar);

    doneButton.setOnAction((e) -> onOK());
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
    buttonBar.getButtons().addAll(doneButton);
}
项目:marathonv5    文件:ProgressIndicatorBar.java   
private void initProgressBarUI() {
    Label runLabel = new Label("Runs: ");
    runLabel.setMinWidth(Region.USE_PREF_SIZE);
    nRuns = new Text((int) progress + "/" + maxTestCount);

    Label errorLabel = new Label("Errors: ");
    errorLabel.setMinWidth(Region.USE_PREF_SIZE);
    errorLabel.setGraphic(FXUIUtils.getIcon("error"));
    errorLabel.setPadding(new Insets(0, 0, 0, 80));
    errorText = new Text(errors + "");

    Label failureLabel = new Label("Failures: ");
    failureLabel.setMinWidth(Region.USE_PREF_SIZE);
    failureLabel.setGraphic(FXUIUtils.getIcon("failure"));
    failureLabel.setPadding(new Insets(0, 0, 0, 80));
    failureText = new Text(failures + "");

    progressBarString.setAlignment(Pos.CENTER);
    progressBarString.setPadding(new Insets(5, 0, 5, 0));
    progressBarString.getChildren().addAll(runLabel, nRuns, errorLabel, errorText, failureLabel, failureText);
}
项目:marathonv5    文件:MarathonCheckListStage.java   
private void initComponents() {
    initCheckList();
    splitPane.getItems().addAll(leftPane, rightPane);
    splitPane.setDividerPositions(0.25);

    boolean insert = checkListInfo.isInsert();
    if (insert) {
        doneButton = FXUIUtils.createButton("insert", "Insert", true, "Insert");
        doneButton.setOnAction((e) -> onInsert());
        doneButton.setDisable(true);
    } else {
        doneButton = FXUIUtils.createButton("ok", "Done", true, "Done");
        doneButton.setOnAction((e) -> onDone());
    }
    buttonBar.getButtons().addAll(doneButton);
    if (insert) {
        Button cancelButton = FXUIUtils.createButton("cancel", "Cancel", true, "Cancel");
        cancelButton.setOnAction((e) -> onCancel());
        buttonBar.getButtons().add(cancelButton);
    }
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
}
项目:marathonv5    文件:MarathonCheckListStage.java   
private void initCheckList() {
    ToolBar toolBar = new ToolBar();
    toolBar.getItems().add(new Text("Check Lists"));
    toolBar.setMinWidth(Region.USE_PREF_SIZE);
    leftPane.setTop(toolBar);
    checkListElements = checkListInfo.getCheckListElements();
    checkListView = new ListView<CheckListForm.CheckListElement>(checkListElements);
    checkListView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
        CheckListElement selectedItem = checkListView.getSelectionModel().getSelectedItem();
        if (selectedItem == null) {
            doneButton.setDisable(true);
            return;
        }
        Node checkListForm = getChecklistFormNode(selectedItem, Mode.DISPLAY);
        if (checkListForm == null) {
            doneButton.setDisable(true);
            return;
        }
        doneButton.setDisable(false);
        ScrollPane sp = new ScrollPane(checkListForm);
        sp.setFitToWidth(true);
        sp.setPadding(new Insets(0, 0, 0, 10));
        rightPane.setCenter(sp);
    });
    leftPane.setCenter(checkListView);
}
项目:marathonv5    文件:Blurb.java   
private void initComponents() {
    webView.setId("webView");
    webView.getEngine().getLoadWorker().stateProperty().addListener(new HyperlinkRedirectListener(webView));
    VBox.setVgrow(webView, Priority.ALWAYS);
    WebEngine engine = webView.getEngine();
    if (blurbInfo.getURL() != null)
        engine.load(blurbInfo.getURL().toExternalForm());
    else
        engine.loadContent(blurbInfo.getHtml());

    buttonBar.setId("buttonBar");
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
    buttonBar.getButtons().add(okButton);
    if (blurbInfo.isCancelNeeded()) {
        buttonBar.getButtons().add(cancelButton);
    }
    okButton.setOnAction((e) -> onOk());
    cancelButton.setOnAction((e) -> onCancel());
}
项目:UDE    文件:TabView.java   
public TabView() {
    anchorPane.getChildren().addAll(txtDirPath, scrollPane);
    anchorPane.setTopAnchor(txtDirPath, 0.0);
    anchorPane.setLeftAnchor(txtDirPath, 0.0);
    anchorPane.setRightAnchor(txtDirPath, 0.0);
    anchorPane.setTopAnchor(scrollPane, 30.0);
    anchorPane.setLeftAnchor(scrollPane, 0.0);
    anchorPane.setRightAnchor(scrollPane, 0.0);
    anchorPane.setBottomAnchor(scrollPane, 0.0);
    scrollPane.setFitToWidth(true);
    scrollPane.setContent(tilePane);
    txtDirPath.setText(homeDir);
    txtDirPath.getStyleClass().add("fileURLField");
    tilePane.getStyleClass().add("tile-pane");
    tilePane.setMaxWidth(Region.USE_PREF_SIZE);
}
项目:atbash-octopus    文件:Footer.java   
@Override
public void initialize() {

    VersionReader versionReader = new VersionReader();
    versionReader.readInfo("jwk-util");
    Text version = new Text(String.format("Version %s (%s)", versionReader.getReleaseVersion(), versionReader.getBuildTime()));

    version.setFont(versionFont);

    HBox bottom = new HBox();
    Region spacer = new Region();
    HBox.setHgrow(spacer, Priority.ALWAYS);
    bottom.getChildren().addAll(spacer, version);
    bottom.setPadding(new Insets(10, 10, 5, 0));

    rootPane.setBottom(bottom);

}
项目:IO    文件:BaseController.java   
private static void makeScalable(Scene scene, Region region) {
    double regionWidth = region.getPrefWidth();
    double sceneWidth = scene.getWidth();
    double regionHeight = region.getPrefHeight();
    double sceneHeight = scene.getHeight();
    if (regionWidth != -1.0) {
        ChangeListener<Number> widthResizer = (arg0, oldValue, newValue) -> region.setPrefWidth(regionWidth / sceneWidth * newValue.doubleValue());
        scene.widthProperty().addListener(widthResizer);
    }
    if (regionHeight != -1.0) {
        ChangeListener<Number> heightResizer = (arg0, oldValue, newValue) -> region.setPrefHeight(regionHeight / sceneHeight * newValue.doubleValue());
        scene.heightProperty().addListener(heightResizer);
    }
}
项目:smoothcharts    文件:SmoothedChart.java   
public void setLegendSymbolFill(final Series<X, Y> SERIES, final Paint LEGEND_SYMBOL_FILL) {
    if (getData().isEmpty()) { return; }
    if (!getData().contains(SERIES)) { return; }

    int seriesIndex = getData().indexOf(SERIES);
    if (seriesIndex == -1) { return; }

    Legend legend = (Legend) getLegend();
    if (null == legend) { return; }

    LegendItem item = legend.getItems().get(seriesIndex);
    if (null == item) { return; }

    Region symbol = (Region) item.getSymbol();
    if (null == symbol) { return; }

    symbol.setBackground(new Background(new BackgroundFill(LEGEND_SYMBOL_FILL, new CornerRadii(6), Insets.EMPTY)));
}
项目:jmonkeybuilder    文件:BaseAssetEditorDialog.java   
@Override
@FXThread
protected void createContent(@NotNull final VBox root) {

    final HBox container = new HBox();

    final Region firstPart = buildFirstPart(container);
    firstPart.prefHeightProperty().bind(root.heightProperty());
    firstPart.prefWidthProperty().bind(root.widthProperty().multiply(0.5));

    final Region secondPart = buildSecondPart(container);
    secondPart.prefHeightProperty().bind(root.heightProperty());
    secondPart.prefWidthProperty().bind(root.widthProperty().multiply(0.5));

    FXUtils.addToPane(firstPart, container);
    FXUtils.addToPane(secondPart, container);
    FXUtils.addToPane(container, root);

    FXUtils.addClassTo(container, CSSClasses.DEF_HBOX);
    FXUtils.addClassTo(root, CSSClasses.ASSET_EDITOR_DIALOG);
}
项目:can4eve    文件:JFXTripletDisplay.java   
/**
 * update the given tab with the given region
 * 
 * @param view
 * @param tabId
 * @param region
 */
private void updateTab(String tabId, Region region) {
  Tab tab = super.getTab(tabId);
  if (tab != null && region != null) {
    tab.setContent(region);
  } else {
    String problem = "";
    String delim = "";
    if (tab == null) {
      problem += "tab is null";
      delim = ", ";
    }
    if (region == null) {
      problem += delim + "region is null";
    }
    LOGGER.log(Level.SEVERE,
        String.format("updateTab %s: %s", tabId, problem));
  }
}
项目:CalendarFX    文件:MonthSheetViewSkin.java   
private void updateRowConstraints() {
    int rowCount = 32; // header + 31 days
    if (getSkinnable().getWeekDayLayout() == WeekDayLayoutStrategy.ALIGNED) {
        rowCount += 6; // 6 = max number of empty slots / cells at the top
    }

    List<RowConstraints> rowConstraints = new ArrayList<>();
    for (int i = 0; i <= rowCount; i++) {
        RowConstraints con = new RowConstraints();
        con.setFillHeight(true);
        con.setPrefHeight(Region.USE_COMPUTED_SIZE);
        con.setMinHeight(Region.USE_PREF_SIZE);
        con.setMaxHeight(Double.MAX_VALUE);
        con.setVgrow(i == 0 ? Priority.NEVER : Priority.ALWAYS);
        rowConstraints.add(con);
    }

    grid.getRowConstraints().setAll(rowConstraints);
}
项目:Clipcon-Client    文件:Notification.java   
protected void initGraphics(Stage stage) {
    scene = new Scene(new Region());
    scene.setFill(null);

    stage.setMaxWidth(1);
    stage.setMaxHeight(1);
    stage.setWidth(1);
    stage.setHeight(1);
    stage.getIcons().add(new javafx.scene.image.Image("resources/Logo.png"));

    stage.setResizable(false);
    stage.setAlwaysOnTop(true);
}
项目:fwm    文件:App.java   
public static void main(String[] args) throws Exception {       
    // PRODUCTION mode needs to be determined before we get here... 
    AppConfig.firstInit();
    prod = AppConfig.getProd();
    appFileUtil = new AppFileUtil();
    if(!appFileUtil.success()){
        System.err.println(appFileUtil.getErrorMessage());
        Platform.runLater(new Runnable(){
            public void run(){
                Alert al = new Alert(AlertType.ERROR);
                al.setResizable(true);
                for(Node n : al.getDialogPane().getChildren()){
                    if(n instanceof Label){
                        ((Label)n).setMinHeight(Region.USE_PREF_SIZE);
                    }
                }
                al.setContentText(appFileUtil.getErrorMessage());
                al.setHeaderText("FWM Startup Error");
                al.showAndWait();
                System.exit(-1);
            }
        });
        return;
    }
    // ignore everything else because this means that we're in a jar file, so the app won't work
    // if it doesn't think that we're prod. 
    PropertyConfigurator.configure(appFileUtil.getLog4JFile().getAbsolutePath());
    AppConfig.init();
    HotkeyController.init();
    log.debug("Currently prod? "  + prod);
    log.debug(retGlobalResource("/src/main/webapp/WEB-INF/images/FWM-icon.png").getFile());
    launch(args);
}
项目:desktop-gmail-client    文件:MainUI3Controller.java   
private void setFolderButtons(){
    inboxButton = new Region();
    sentButton = new Region();
    draftButton = new Region();
    trashButton = new Region();

    inboxButtonParent.getChildren().add(setRippler(inboxButton));
    sentButtonParent.getChildren().add(setRippler(sentButton));
    draftButtonParent.getChildren().add(setRippler(draftButton));
    trashButtonParent.getChildren().add(setRippler(trashButton));
}
项目:jmonkeybuilder    文件:Advanced3DFileEditorWithSplitRightTool.java   
/**
 * Build split component.
 *
 * @param first the first component.
 * @param second the second component.
 * @param root the root.
 * @return the result component.
 */
@FXThread
protected Region buildSplitComponent(@NotNull final Node first, @NotNull final Node second,
                                     @NotNull final StackPane root) {

    final SplitPane splitPane = new SplitPane(first, second);
    splitPane.prefHeightProperty().bind(root.heightProperty());
    splitPane.prefWidthProperty().bind(root.widthProperty());

    root.heightProperty().addListener((observableValue, oldValue, newValue) -> calcVSplitSize(splitPane));

    FXUtils.addClassTo(splitPane, CSSClasses.FILE_EDITOR_TOOL_SPLIT_PANE);

    return splitPane;
}
项目:jmonkeybuilder    文件:BaseFileEditorWithSplitRightTool.java   
/**
 * Build split component.
 *
 * @param first the first component.
 * @param second the second component.
 * @param root the root.
 * @return the result component.
 */
@FXThread
protected Region buildSplitComponent(@NotNull final Node first, @NotNull final Node second,
                                     @NotNull final StackPane root) {

    final SplitPane splitPane = new SplitPane(first, second);
    splitPane.prefHeightProperty().bind(root.heightProperty());
    splitPane.prefWidthProperty().bind(root.widthProperty());

    root.heightProperty().addListener((observableValue, oldValue, newValue) -> calcVSplitSize(splitPane));

    FXUtils.addClassTo(splitPane, CSSClasses.FILE_EDITOR_TOOL_SPLIT_PANE);

    return splitPane;
}
项目:jmonkeybuilder    文件:TabToolComponent.java   
/**
 * Add a new component to this tool container.
 *
 * @param component the component
 * @param name      the name
 */
public void addComponent(@NotNull final Region component, @NotNull final String name) {

    final Tab tab = new Tab(name);
    tab.setContent(component);
    tab.setClosable(false);

    getTabs().add(tab);

    FXUtils.bindFixedHeight(component, heightProperty());
}
项目:fx-animation-editor    文件:PlayerComponent.java   
private void initUi() {
    root.getStylesheets().add(getClass().getResource(STYLESHEET).toExternalForm());
    root.getStyleClass().add(STYLE_CLASS);

    playButton.setGraphic(Svg.PLAY.node());
    pauseButton.setGraphic(Svg.PAUSE.node());
    stopButton.setGraphic(Svg.STOP.node());

    HBox labelBox = new HBox(currentTimeLabel, finalTimeLabel);
    labelBox.setMaxWidth(Region.USE_PREF_SIZE);
    labelBox.setAlignment(Pos.CENTER_LEFT);
    StackPane.setAlignment(labelBox, Pos.CENTER_RIGHT);

    currentTimeLabel.getStyleClass().add(CURRENT_TIME_LABEL_STYLE_CLASS);

    HBox buttonBox = new HBox(playButton, pauseButton, stopButton);
    buttonBox.getStyleClass().add(BUTTON_BOX_STYLE_CLASS);
    buttonBox.setMaxWidth(Region.USE_PREF_SIZE);

    root.getChildren().addAll(buttonBox, labelBox);
}
项目:marathonv5    文件:RubyPathLayout.java   
private HBox createRubyHomeField() {
    HBox rubyHomeBox = new HBox(5);
    rubyHomeField = new TextField();
    rubyHomeField.setId("RubyHomeField");
    rubyHomeField.setPromptText("(Bundled JRuby)");
    Label label = createLabel("Ruby Home: ");
    label.setId("RubyLabel");
    label.setMinWidth(Region.USE_PREF_SIZE);
    rubyHomeBox.getChildren().addAll(label, rubyHomeField);
    HBox.setHgrow(rubyHomeField, Priority.ALWAYS);
    return rubyHomeBox;
}
项目:marathonv5    文件:PreferencesStage.java   
private void initComponents() {

        mouseTriggerField.setEditable(false);
        mouseTriggerField.setText(FXContextMenuTriggers.getContextMenuModifiers());
        mouseTriggerButton.setMinWidth(Region.USE_PREF_SIZE);
        mouseTriggerButton.setOnMousePressed((e) -> {
            mouseTriggerField.setText(OSFXUtils.mouseEventGetModifiersExText(e));
        });
        if (FXContextMenuTriggers.getContextMenuKeyModifiers().equals("")) {
            keyTriggerField.setText(FXContextMenuTriggers.getContextMenuKeyCode());
        } else {
            keyTriggerField.setText(
                    FXContextMenuTriggers.getContextMenuKeyModifiers() + "+" + FXContextMenuTriggers.getContextMenuKeyCode());
        }
        keyTriggerField.setEditable(false);
        keyTriggerField.addEventHandler(KeyEvent.KEY_PRESSED, (pressedEvent) -> onKeyPressed(pressedEvent));

        doNotHideMarathonITEBlurbs.setTooltip(new Tooltip("Hide the MarathonITE shameless plug"));
        doNotHideMarathonITEBlurbs.setSelected(Boolean.parseBoolean(prefs.optString(Constants.PREF_ITE_BLURBS, "false")));
        doNotHideMarathonITEBlurbs.setOnAction((e) -> {
            FXUIUtils.showMessageDialog(getStage(), "Restart Marathon for this option to take effect", "Information",
                    AlertType.INFORMATION);
        });

        okButton.setOnAction((e) -> onOk());
        cancelButton.setOnAction((e) -> onCancel());
        defaultsButton.setOnAction((e) -> onDefault());

        buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
        buttonBar.getButtons().addAll(okButton, cancelButton, defaultsButton);
    }
项目:marathonv5    文件:StatusBar.java   
@Override public void setCaretLocation(Object row, Object col) {
    if (row == null && col == null) {
        this.rowLabel.setText("");
        this.columnLabel.setText("");
    } else {
        this.rowLabel.setText(" " + row.toString());
        this.columnLabel.setText(" " + col);
    }
    rowLabel.setMinWidth(Region.USE_PREF_SIZE);
    columnLabel.setMinWidth(Region.USE_PREF_SIZE);
}
项目:marathonv5    文件:StatusBar.java   
@Override public void setIsOverwriteEnabled(boolean isOverwriteEnabled) {
    if (isOverwriteEnabled) {
        this.insertLabel.setText("Overwrite");
    } else {
        this.insertLabel.setText("Insert    ");
    }
    insertLabel.setMinWidth(Region.USE_PREF_SIZE);
}
项目:marathonv5    文件:FixtureStage.java   
private void initComponents() {
    descriptionArea.setPrefRowCount(2);
    applicationLayout = fixtureStageInfo.getApplicationLayout(this);

    buttonBar.setId("FixtureButtonBar");
    okButton.setOnAction((e) -> onOK());
    cancelButton.setOnAction((e) -> dispose());
    testButton.setOnAction((e) -> onTest());
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
    buttonBar.getButtons().addAll(okButton, cancelButton, testButton);
}
项目:marathonv5    文件:MessageStage.java   
private void initComponents() {
    textArea = resultInfo.getNode();
    textArea.setText(resultInfo.getMessage());
    textArea.setEditable(false);

    closeButton.setOnAction((e) -> dispose());
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
    buttonBar.getButtons().add(closeButton);
}
项目:fx-animation-editor    文件:CollapseAnimator.java   
private void onExpandedChanged(boolean expanded, boolean animate, Region region) {
    if (animate && region.getScene() != null) {
        animateToTarget(expanded, region);
    } else {
        region.setMaxHeight(expanded ? Region.USE_PREF_SIZE : 0);
        notifyOnFinished();
    }
}
项目:marathonv5    文件:TaskSample.java   
public TaskSample() {
    TableView<DailySales> tableView = new TableView<DailySales>();
    Region veil = new Region();
    veil.setStyle("-fx-background-color: rgba(0, 0, 0, 0.4)");
    ProgressIndicator p = new ProgressIndicator();
    p.setMaxSize(150, 150);
    //Define table columns
    TableColumn idCol = new TableColumn();
    idCol.setText("ID");
    idCol.setCellValueFactory(new PropertyValueFactory("dailySalesId"));
    tableView.getColumns().add(idCol);
    TableColumn qtyCol = new TableColumn();
    qtyCol.setText("Qty");
    qtyCol.setCellValueFactory(new PropertyValueFactory("quantity"));
    tableView.getColumns().add(qtyCol);
    TableColumn dateCol = new TableColumn();
    dateCol.setText("Date");
    dateCol.setCellValueFactory(new PropertyValueFactory("date"));
    dateCol.setMinWidth(240);
    tableView.getColumns().add(dateCol);
    StackPane stack = new StackPane();
    stack.getChildren().addAll(tableView, veil, p);

    // Use binding to be notified whenever the data source chagnes
    Task<ObservableList<DailySales>> task = new GetDailySalesTask();
    p.progressProperty().bind(task.progressProperty());
    veil.visibleProperty().bind(task.runningProperty());
    p.visibleProperty().bind(task.runningProperty());
    tableView.itemsProperty().bind(task.valueProperty());

    getChildren().add(stack);
    new Thread(task).start();
}
项目:AlphaLab    文件:Alertas.java   
private static Alert createAlert(AlertType tipo, String titulo, String cabecalho, String corpo){
    msg=new Alert(tipo);
    msg.setTitle(titulo);
    msg.setHeaderText(cabecalho);
    msg.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
    msg.setContentText(corpo);
    return msg;
}
项目:OneClient    文件:TableDialog.java   
@SuppressWarnings("unchecked")
public TableDialog(Collection<T> files) {
    dialogPane = getDialogPane();
    setResizable(true);
    this.table = new TableView<>(FXCollections.observableArrayList(files));
    this.table.setMaxWidth(Double.MAX_VALUE);

    GridPane.setHgrow(table, Priority.ALWAYS);
    GridPane.setFillWidth(table, true);

    label = createContentLabel(dialogPane.getContentText());
    label.setPrefWidth(Region.USE_COMPUTED_SIZE);
    label.textProperty().bind(dialogPane.contentTextProperty());

    this.grid = new GridPane();
    this.grid.setHgap(10);
    this.grid.setMaxWidth(Double.MAX_VALUE);
    this.grid.setAlignment(Pos.CENTER_LEFT);

    dialogPane.contentTextProperty().addListener(o -> updateGrid());
    updateGrid();

    setResultConverter((dialogButton) -> {
        ButtonBar.ButtonData data = dialogButton == null ? null : dialogButton.getButtonData();
        return data == ButtonBar.ButtonData.OK_DONE ? table.getSelectionModel().getSelectedItem() : null;
    });
}
项目:dynamo    文件:TransformerSkin.java   
private void initGraphics() {
    background = new Region();
    background.getStyleClass().setAll("background");

    transformer = new Region();
    transformer.getStyleClass().addAll("transformer-shape");

    name = new Text(getSkinnable().getName());
    name.getStyleClass().setAll("name-text");

    pane = new Pane(background, transformer, name);

    getChildren().add(pane);
    resize();
}
项目:dynamo    文件:LoadSkin.java   
private void initGraphics() {
    background = new Region();
    background.getStyleClass().setAll("background");

    load = new Region();
    load.getStyleClass().addAll("load-shape");

    name = new Text(getSkinnable().getName());
    name.getStyleClass().setAll("name-text");

    pane = new Pane(background, load, name);

    getChildren().add(pane);
    resize();
}
项目:dynamo    文件:GeneratorSkin.java   
private void initGraphics() {
    background = new Region();
    background.getStyleClass().setAll("background");

    circleFrame = new Region();
    circleFrame.getStyleClass().setAll("circle-frame");

    circleGears = new Region();
    circleGears.getStyleClass().setAll("circle-gears");
    circleGears.setCache(true);
    circleGears.setCacheHint(CacheHint.SPEED);

    rotateTransition = new RotateTransition(Duration.millis(getSkinnable().getAnimationDuration()), circleGears);
    blinkTimeline = new Timeline(new KeyFrame(Duration.seconds(0.35), event -> circleFrame.setOpacity(circleFrame.getOpacity() == 0 ? 1 : 0)));

    sinCurve = new Region();
    sinCurve.getStyleClass().setAll("sin-curve");

    nameText = new Text(getSkinnable().getName());
    nameText.getStyleClass().setAll("name-text");

    pane = new Pane(background, circleFrame, circleGears, sinCurve, nameText);

    getChildren().add(pane);
    resize();
    updateStateAspect();
    updateAlarmStatus();
}
项目:Java-9-Programming-Blueprints    文件:DragResizerXY.java   
public static void makeResizable(Region region) {
    final DragResizerXY resizer = new DragResizerXY(region);

    region.setOnMousePressed(resizer::mousePressed);
    region.setOnMouseDragged(resizer::mouseDragged);
    region.setOnMouseMoved(resizer::mouseOver);
    region.setOnMouseReleased(resizer::mouseReleased);
}