/* * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any */ package demo; import javafx.scene.Node; import javafx.scene.layout.VBox; import javafx.scene.control.Button; import javafx.scene.text.Font; import utils.Utils; /** * * @author shubov */ public class Layout2xApp extends BasicButtonChooserApp { public static enum Pages { VBox } private static String IdTestButton1 = "IdTestButton1"; public Layout2xApp(int width, int height, String title, boolean showAdditionalActionButton) { super(width, height, title, showAdditionalActionButton); } public Layout2xApp() { super(800, 800, "Layout", false); // "false" stands for "additionalActionButton = " } private static final boolean withStyle = !Boolean.getBoolean("test.javaclient.jcovbackdoor"); // page with VBox layout private class slotVboxTestNode extends TestNode { VBox vbox; @Override public Node drawNode() { vbox = new VBox(); Button b1 = new Button("btn"); b1.setFont(new Font(14)); b1.setMaxWidth(85); b1.setMaxHeight(85); b1.setId(IdTestButton1); vbox.getChildren().add(b1); vbox.setPrefSize(80, 240); if (withStyle) { System.out.println("Setting VBox style withStyle true -----"); vbox.setStyle("-fx-border-color: darkgray;"); } vbox.setStyle("-fx-border-color: red;"); return vbox; } } public TestNode setup() { System.out.println("java.library.path=" + System.getProperty("java.library.path")); TestNode rootTestNode = new TestNode(); final int heightPageContentPane = 800; final int widthPageContentPane = 800; // ======== VBOX ================= final PageWithSlots vboxPage = new PageWithSlots(Pages.VBox.name(), heightPageContentPane, widthPageContentPane); vboxPage.setSlotSize(240, 180); slotVboxTestNode test = new slotVboxTestNode(); vboxPage.add(test, "defaults"); // ========= root tests list ============== rootTestNode.add(vboxPage); return rootTestNode; } public static void main(String args[]) { Utils.launch(Layout2xApp.class, args); } }