當前位置: 首頁>>代碼示例>>Java>>正文


Java Insets類代碼示例

本文整理匯總了Java中javafx.geometry.Insets的典型用法代碼示例。如果您正苦於以下問題:Java Insets類的具體用法?Java Insets怎麽用?Java Insets使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Insets類屬於javafx.geometry包,在下文中一共展示了Insets類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import javafx.geometry.Insets; //導入依賴的package包/類
@Override
public void start(Stage stage) {
  this.stage = stage;

  stage.initStyle(StageStyle.TRANSPARENT);

  VBox box = new VBox(20);
  box.setMaxWidth(Region.USE_PREF_SIZE);
  box.setMaxHeight(Region.USE_PREF_SIZE);
  box.setBackground(Background.EMPTY);
  String style = "-fx-background-color: rgba(255, 255, 255, 0.5);";
  box.setStyle(style);

  box.setPadding(new Insets(50));
  BorderPane root = new BorderPane(box);
  root.setStyle(style);
  root.setBackground(Background.EMPTY);
  Scene scene = new Scene(root);
  scene.setFill(Color.TRANSPARENT);
  stage.setScene(scene);

  ImageView splashView = new ImageView(splashImage);
  box.getChildren().addAll(splashView, new Label("ST Verification Studio is loading.."));
  stage.show();
  Rectangle2D primScreenBounds = Screen.getPrimary().getVisualBounds();
  stage.setX((primScreenBounds.getWidth() - stage.getWidth()) / 2);
  stage.setY((primScreenBounds.getHeight() - stage.getHeight()) / 2);
}
 
開發者ID:VerifAPS,項目名稱:stvs,代碼行數:29,代碼來源:StvsPreloader.java

示例2: start

import javafx.geometry.Insets; //導入依賴的package包/類
@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    scene.setFill(Color.ALICEBLUE);
    stage.setScene(scene);
    stage.show();

    stage.setTitle("ChoiceBox Sample");
    stage.setWidth(300);
    stage.setHeight(200);
  
    label.setFont(Font.font("Arial", 25));
    label.setLayoutX(40);

   final String[] greetings = new String[]{"Hello", "Hola", "Привет", "你好",
       "こんにちは"};
   final ChoiceBox cb = new ChoiceBox(FXCollections.observableArrayList(
       "English", "Español", "Русский", "簡體中文", "日本語")
   );
                                 
   cb.getSelectionModel().selectedIndexProperty().addListener(
       (ObservableValue<? extends Number> ov,
            Number old_val, Number new_val) -> {
                label.setText(greetings[new_val.intValue()]);            
    });
         
    cb.setTooltip(new Tooltip("Select the language"));
    cb.setValue("English");
    HBox hb = new HBox();
    hb.getChildren().addAll(cb, label);
    hb.setSpacing(30);
    hb.setAlignment(Pos.CENTER);
    hb.setPadding(new Insets(10, 0, 0, 10));

    ((Group) scene.getRoot()).getChildren().add(hb);
    
   
   
    
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:41,代碼來源:ChoiceBoxSample.java

示例3: start

import javafx.geometry.Insets; //導入依賴的package包/類
@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 260, 80);
    stage.setScene(scene);
    stage.setTitle("Password Field Sample");

    VBox vb = new VBox();
    vb.setPadding(new Insets(10, 0, 0, 10));
    vb.setSpacing(10);
    HBox hb = new HBox();
    hb.setSpacing(10);
    hb.setAlignment(Pos.CENTER_LEFT);

    Label label = new Label("Password");
    final PasswordField pb = new PasswordField();  
    pb.setText("Your password");

    pb.setOnAction((ActionEvent e) -> {
        if (!pb.getText().equals("T2f$Ay!")) {
            message.setText("Your password is incorrect!");
            message.setTextFill(Color.rgb(210, 39, 30));
        } else {
            message.setText("Your password has been confirmed");
            message.setTextFill(Color.rgb(21, 117, 84));
        }
        pb.clear();
    });

    hb.getChildren().addAll(label, pb);
    vb.getChildren().addAll(hb, message);

    scene.setRoot(vb);
    stage.show();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:36,代碼來源:PasswordFiledSample.java

示例4: overlay

import javafx.geometry.Insets; //導入依賴的package包/類
protected Parent overlay(int window, int yCode) {
    EncoderParameters params = getEncoderParameters();
    double ye = params.matrix.fromLumaCode(yCode);
    double yo = params.transfer.eotf(ye);
    CIExy xy = getColor(yo);

    String text = format("HDR10 grayscale CIE(x=%.4f, y=%.4f) %.1f%% Y%d,"
            + " %.1f nit", xy.x, xy.y, ye * 100.0, yCode, yo * 10000.0);

    Label label = new Label(text);
    label.setFont(font(40));
    label.setTextFill(gray(max(0.25, min(0.5, ye))));

    BorderPane.setMargin(label, new Insets(20));
    BorderPane layout = new BorderPane();
    layout.setBackground(EMPTY);
    layout.setBottom(label);
    return layout;
}
 
開發者ID:testing-av,項目名稱:testing-video,代碼行數:20,代碼來源:CalibrationBase.java

示例5: init

import javafx.geometry.Insets; //導入依賴的package包/類
private void init() {
	GridPane grid = new GridPane();
	grid.setPadding(new Insets(GuiConstants.padding));
	grid.setHgap(GuiConstants.padding);
	grid.setVgap(GuiConstants.padding);
	int row = 0;

	row = addRow("Owner", ownerLabel, grid, row);
	row = addRow("Name", nameLabel, grid, row);
	row = addRow("Type", typeLabel, grid, row);
	row = addRow("Access", accessLabel, grid, row);
	row = addRow("Signature", sigLabel, grid, row);
	row = addRow("Parents", parentLabel, grid, row);
	row = addRow("Children", childLabel, grid, row);
	row = addRow("Read refs", readRefLabel, grid, row);
	row = addRow("Write refs", writeRefLabel, grid, row);
	row = addRow("Comment", mapCommentLabel, grid, row);

	setContent(grid);
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:21,代碼來源:FieldInfoTab.java

示例6: start

import javafx.geometry.Insets; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
    WatchDAO.addWatcher(this);
    stage = primaryStage;
    stage.setTitle(ViewConstants.PROGRAM_TITLE);
    stage.getIcons().add(fileLoad.loadImageFile(ViewConstants.PROGRAM_ICON_LOCATION));

    gridPane = new GridPane();
    gridPane.setAlignment(Pos.TOP_LEFT);
    gridPane.setHgap(10);
    gridPane.setVgap(10);
    gridPane.setPadding(new Insets(10, 10, 10, 10));

    Scene scene = new Scene(gridPane, ViewConstants.PROGRAM_WIDTH, ViewConstants.PROGRAM_HEIGHT);
    primaryStage.setScene(scene);
    primaryStage.show();

    gridPane.getStylesheets().add(this.getClass().getClassLoader().getResource("gui/css/weatherwatch.css")
            .toExternalForm());
    loadWeatherImages();
    addGuiElements();
    TrayApp.initialize();
}
 
開發者ID:ykarim,項目名稱:WeatherWatch,代碼行數:24,代碼來源:WeatherPage.java

示例7: makeInfoGUI

import javafx.geometry.Insets; //導入依賴的package包/類
/**
    * Make Information Dialog
    * @return BorderPane
    */
   public void makeInfoGUI() {
       root = new Group();
       Scene scene = new Scene(root, 360, 185, Color.WHITE);
       ImagePattern pattern = new ImagePattern(new Image("icon/bk2.jpg"));
       scene.setFill(pattern);
       setTitle("Information");
       setScene(scene);
       Image appIcon = new Image("icon/INFO.png");
       getIcons().add(appIcon);
       BorderPane bp = new BorderPane();

       textArea = new TextArea(message);
       textArea.setEditable(false);
       textArea.setWrapText(true);
       textArea.setMaxWidth(320);
       textArea.setMaxHeight(130);
       HBox hBox = new HBox();
       hBox.setSpacing(5);
       hBox.setPadding(new Insets(5,0,0,0));
       hBox.setAlignment(Pos.BOTTOM_RIGHT);
       hBox.getChildren().addAll(okButton);
       bp.setCenter(textArea);
       bp.setBottom(hBox);
       root.getChildren().add(bp);
       sizeToScene();
       setX(owner.getX() + Math.abs(owner.getWidth() - scene.getWidth()) / 2.0);
setY(owner.getY() + Math.abs(owner.getHeight() - scene.getHeight()) / 2.0);
   }
 
開發者ID:ztan5,項目名稱:TechnicalAnalysisTool,代碼行數:33,代碼來源:TatMessageBox.java

示例8: SocialNetwork

import javafx.geometry.Insets; //導入依賴的package包/類
public SocialNetwork(String site, VBox panel)
{
    //apply the styles
    getStyleClass().add("browser");

    // load the web page
    webEngine.load(site);
    panel.setAlignment(Pos.CENTER);

    panel.setPadding(new Insets(0,50,0,100));
    flowPane.getChildren ().addAll(browser, panel);
    flowPane.setVgap(25);

    //add the web view to the scene
    getChildren().add(flowPane);

}
 
開發者ID:ksg14,項目名稱:duncan,代碼行數:18,代碼來源:SocialNetwork.java

示例9: start

import javafx.geometry.Insets; //導入依賴的package包/類
@Override public void start(Stage stage) {
    HBox pane = new HBox(imageView, matrix);
    pane.setSpacing(10);
    pane.setPadding(new Insets(10));
    pane.setBackground(new Background(new BackgroundFill(Color.rgb(10, 10, 20), CornerRadii.EMPTY, Insets.EMPTY)));
    Scene scene = new Scene(pane);

    stage.setTitle("Matrix Image");
    stage.setScene(scene);
    stage.show();

    timer.start();
}
 
開發者ID:HanSolo,項目名稱:matriximage,代碼行數:14,代碼來源:Main.java

示例10: queenWarning

import javafx.geometry.Insets; //導入依賴的package包/類
public void queenWarning(){
    
    Dialog<ButtonType> popup = new Dialog<>();
    popup.setTitle("Ajout impossible");
    ButtonType close = new ButtonType("Fermer", ButtonBar.ButtonData.RIGHT);
    popup.getDialogPane().getButtonTypes().add(close);

    GridPane grid = new GridPane();
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(20, 150, 10, 10));

    popup.getDialogPane().setContent(grid);
    grid.add(new Label("Vous devez jouer votre reine."), 0, 0);
    popup.show();
}
 
開發者ID:Plinz,項目名稱:Hive_Game,代碼行數:17,代碼來源:GameScreenController.java

示例11: AssumptionPane

import javafx.geometry.Insets; //導入依賴的package包/類
public AssumptionPane(){
    //this.getChildren().addAll(openButton,closeButton);
    openButton.setMinWidth(100);
    openButton.setMinHeight(40);
    closeButton.setMinWidth(100);
    closeButton.setMinHeight(40);
    this.add(openButton,0,0);
    this.add(closeButton,1,0);
    openButton.setTooltip(openTip);
    closeButton.setTooltip(closeTip);

    this.setMargin(openButton, new Insets(5, 5, 5, 5));
    this.setMargin(closeButton, new Insets(5, 5, 5, 5));

//    this.setGridLinesVisible(true);
    }
 
開發者ID:nonilole,項目名稱:Conan,代碼行數:17,代碼來源:AssumptionPane.java

示例12: createIconContent

import javafx.geometry.Insets; //導入依賴的package包/類
public static Node createIconContent() {
    StackPane sp = new StackPane();
    VBox vbox = new VBox(3);
    vbox.setAlignment(Pos.CENTER);
    vbox.setPadding(new Insets(5, 5, 5, 5));

    Rectangle rectangle = new Rectangle(32, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    vbox.setPrefSize(rectangle.getWidth(), rectangle.getHeight());
    Rectangle r1 = new Rectangle(18, 14, Color.web("#1c89f4"));
    Rectangle r2 = new Rectangle(18, 14, Color.web("#349b00"));
    Rectangle r3 = new Rectangle(18, 20, Color.web("#349b00"));

    vbox.getChildren().addAll(r1, r2, r3);
    sp.getChildren().addAll(rectangle, vbox);
    return new Group(sp);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:18,代碼來源:VBoxSample.java

示例13: layoutChildren

import javafx.geometry.Insets; //導入依賴的package包/類
@Override protected void layoutChildren() {
    if (isFixedSize) {
        super.layoutChildren();
    } else {
        List<Node> managed = getManagedChildren();
        double width = getWidth();
        ///System.out.println("width = " + width);
        double height = getHeight();
        ///System.out.println("height = " + height);
        double top = getInsets().getTop();
        double right = getInsets().getRight();
        double left = getInsets().getLeft();
        double bottom = getInsets().getBottom();
        for (int i = 0; i < managed.size(); i++) {
            Node child = managed.get(i);
            layoutInArea(child, left, top,
                           width - left - right, height - top - bottom,
                           0, Insets.EMPTY, true, true, HPos.CENTER, VPos.CENTER);
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:22,代碼來源:Sample.java

示例14: initUi

import javafx.geometry.Insets; //導入依賴的package包/類
private void initUi() {
    root.setMinSize(0, 0);
    root.setPrefSize(1, 1); // Decouple from children.
    root.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    root.getStyleClass().add(STYLE_CLASS);
    root.getStylesheets().add(getClass().getResource(STYLESHEET).toExternalForm());
    root.setAlignment(Pos.TOP_LEFT);
    root.getChildren().addAll(panningComponent.getRoot(), addButton);

    panningComponent.getChildren().addAll(sceneContent, resizerComponent.getRoot(), selectionBox.getRoot());

    StackPane.setMargin(addButton, new Insets(15));
    addButton.setGraphic(Svg.PLUS_FAT.node());
    addButton.setFocusTraversable(false);

    FocusHelper.requestFocusOnPress(panningComponent.getRoot());
}
 
開發者ID:rmfisher,項目名稱:fx-animation-editor,代碼行數:18,代碼來源:SceneComponent.java

示例15: createIconContent

import javafx.geometry.Insets; //導入依賴的package包/類
public static Node createIconContent() {
    StackPane sp = new StackPane();
    FlowPane fp = new FlowPane();
    fp.setAlignment(Pos.CENTER);

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    fp.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle[] littleRecs = new Rectangle[4];
    Rectangle[] bigRecs = new Rectangle[4];
    for (int i = 0; i < 4; i++) {
        littleRecs[i] = new Rectangle(14, 14, Color.web("#1c89f4"));
        bigRecs[i] = new Rectangle(16, 12, Color.web("#349b00"));
        fp.getChildren().addAll(littleRecs[i], bigRecs[i]);
        FlowPane.setMargin(littleRecs[i], new Insets(2, 2, 2, 2));
    }
    sp.getChildren().addAll(rectangle, fp);
    return new Group(sp);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:21,代碼來源:FlowPaneSample.java


注:本文中的javafx.geometry.Insets類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。