VBox box = new VBox(); final Scene scene = new Scene(box, 400, 300); scene.setFill(Color.LIGHTGRAY);
dialogPane.setContent(materialNode); setDialogPane(dialogPane); dialogPane.getScene().setFill(Color.TRANSPARENT);
/** * Set background of scene or subscene. * @param color */ public void setBackgroundColor(Color color) { if (scene != null) { scene.setFill(color); } else { subScene.setFill(color); } } }
@Override public void start(Stage primaryStage) { try { BorderPane root = new BorderPane(); Scene scene = new Scene(root,400,400); scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); primaryStage.initStyle(StageStyle.UNDECORATED); scene.setFill(Color.BLACK); primaryStage.setScene(scene); primaryStage.show(); } catch(Exception e) { e.printStackTrace(); } }
/** * Creates a factory that will create and setup a {@link Scene}. * @param width the width of the scene in pixels. * @param height the height of the scene in pixels. * @param depthBuffer the depth buffer flag. * @param antiAliasing the scene anti-aliasing attribute. A value of {@code null} is treated as DISABLED. * @param sceneType the type of the scene to create, i.e. {@code MAIN_SCENE} for creating a {@link Scene} or {@code SUB_SCENE} for creating a {@link SubScene}. */ public View3DFactory(double width, double height, boolean depthBuffer, SceneAntialiasing antiAliasing, SceneType sceneType) { switch (sceneType) { case MAIN_SCENE: scene = new Scene(root, width, height, depthBuffer, antiAliasing); scene.setFill(Color.GRAY); subScene = null; break; case SUB_SCENE: subScene = new SubScene(root, width, height, depthBuffer, antiAliasing); subScene.setFill(Color.GRAY); scene = null; break; default: throw new RuntimeException("Unknown sceneType: " + sceneType); } }
/** * Creates a factory that will create and setup a {@link Scene}. * @param width the width of the scene in pixels. * @param height the height of the scene in pixels. * @param depthBuffer the depth buffer flag. * @param antiAliasing the scene anti-aliasing attribute. A value of {@code null} is treated as DISABLED. * @param sceneType the type of the scene to create, i.e. {@code MAIN_SCENE} for creating a {@link Scene} or {@code SUB_SCENE} for creating a {@link SubScene}. */ public View3DFactory(double width, double height, boolean depthBuffer, SceneAntialiasing antiAliasing, SceneType sceneType) { switch (sceneType) { case MAIN_SCENE: scene = new Scene(root, width, height, depthBuffer, antiAliasing); scene.setFill(Color.GRAY); subScene = null; break; case SUB_SCENE: subScene = new SubScene(root, width, height, depthBuffer, antiAliasing); subScene.setFill(Color.GRAY); scene = null; break; default: throw new RuntimeException("Unknown sceneType: " + sceneType); } }
public void start(Stage primaryStage) { Group mainGroup = new Group(); Rectangle r = new Rectangle(0, 0, 200, 200); Stop[] stops = new Stop[] { new Stop(0, new Color(0.0, 0.0, 1.0, 1.0)), new Stop(1, new Color(1.0, 1.0, 1.0, 0.0)) }; LinearGradient lg = new LinearGradient(0, 0, 1, 1, true, CycleMethod.NO_CYCLE, stops); r.setFill(lg); mainGroup.getChildren().add(r); Scene scene = new Scene(mainGroup, 200, 200); scene.setFill(Color.TRANSPARENT); primaryStage.setScene(scene); primaryStage.show(); WritableImage image = scene.snapshot(null); PixelReader pixelReader = image.getPixelReader(); System.out.println("Color: " + pixelReader.getColor((int)image.getWidth()/2, (int)image.getHeight()/2)); }
@Override public void start(Stage stage) { Group group = new Group(); Rectangle rect = new Rectangle(0, 0, 350, 300); Rectangle clip = new Rectangle(20, 20, 200, 200); clip.setArcHeight(15); clip.setArcWidth(15); Shape shape = Shape.subtract(rect, clip); shape.setFill(Color.GRAY); group.getChildren().add(shape); Scene scene = new Scene(group); scene.setFill(Color.TRANSPARENT); stage.initStyle(StageStyle.TRANSPARENT); stage.setScene(scene); stage.show(); }
Timer tm= new Timer(); Stage ilk; int count; public void check() { ilk=new Stage(); TimerTask mission; gorev = new TimerTask() { @Override public void run() { Group root = new Group(); Scene scene; scene = new Scene(root, 960, 540); scene.setFill(Color.BLACK); ilk.setScene(scene); ilk.setTitle("Splash Screen"); sayac++; if(count==5){ tm.cancel(); ilk.show(); } } }; tm.schedule(mission, 0, 2000); }
scene.setFill(Color.WHITE); String css = Main.class.getResource("styles.css").toExternalForm(); scene.getStylesheets().clear();
/** * Basic constructor with built-in behavior * * @param stage The main stage * @param root your UI to be displayed in the Stage */ public UndecoratorScene(Stage stage, Region root) { super(root); undecorator = new Undecorator(); undecorator.buildFrom(stage, root); super.setRoot(undecorator); // Transparent scene and stage stage.initStyle(StageStyle.TRANSPARENT); super.setFill(Color.TRANSPARENT); // Default Accelerators undecorator.installAccelerators(this); }
public void initialize() { root.getChildren().add(world); root.setDepthTest(DepthTest.ENABLE); buildCamera(); buildAxes(); Scene scene = new Scene(root, 1024, 768, true); scene.setFill(Color.GREY); // handleKeyboard(scene, world); handleMouse(scene, world); setPointRadius(pointRadius); scene.setCamera(camera); setScene(scene); }
scene.setFill(Color.GHOSTWHITE);
@Override public void start(Stage stage) { stage.setTitle("CheckBoxCell Samples"); final Scene scene = new Scene(new Group(), 875, 700); scene.setFill(Color.LIGHTGRAY); Group root = (Group) scene.getRoot(); root.getChildren().add(getContent(scene)); AquaFx.style(); stage.setScene(scene); stage.show(); }
/** * setup the GUI * * @param stage */ private void setup(Stage stage) { stage.setTitle(title); Rectangle2D sceneBounds = super.getSceneBounds(screenPercent, divX, divY); dropTarget = new DropTarget(); setScene( new Scene(dropTarget, sceneBounds.getWidth(), sceneBounds.getHeight())); stage.setScene(getScene()); scene.setFill(Color.LIGHTGRAY); stage.setX(super.getScreenWidth() - sceneBounds.getMinX()); stage.setY(super.getScreenHeight() - sceneBounds.getMinY()); stage.show(); }
public DragFeedbackStage(Node n) { this.n = n; this.popupWindow = new Stage(); this.popupWindow.initStyle(StageStyle.TRANSPARENT); // this.popupWindow.initOwner(n.getScene().getWindow()); this.popupWindow.setUserData("findNodeExclude"); //$NON-NLS-1$ this.popupWindow.setAlwaysOnTop(true); StackPane root = new StackPane(); root.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY))); Scene value = new Scene(root); value.setFill(Color.TRANSPARENT); this.popupWindow.setScene(value); this.popupWindow.getScene().getStylesheets().setAll(n.getScene().getStylesheets()); this.popupWindow.getScene().setRoot(root); }
public DragFeedbackStage(Node n) { this.n = n; this.popupWindow = new Stage(); this.popupWindow.initStyle(StageStyle.TRANSPARENT); // this.popupWindow.initOwner(n.getScene().getWindow()); this.popupWindow.setUserData("findNodeExclude"); //$NON-NLS-1$ this.popupWindow.setAlwaysOnTop(true); StackPane root = new StackPane(); root.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY))); Scene value = new Scene(root); value.setFill(Color.TRANSPARENT); this.popupWindow.setScene(value); this.popupWindow.getScene().getStylesheets().setAll(n.getScene().getStylesheets()); this.popupWindow.getScene().setRoot(root); }
/** * Prepare Stage for dock feedback display */ void buildDockFeedbackStage() { dockFeedbackPopup = new Stage(StageStyle.TRANSPARENT); dockFeedback = new Rectangle(0, 0, 100, 100); dockFeedback.setArcHeight(10); dockFeedback.setArcWidth(10); dockFeedback.setFill(Color.TRANSPARENT); dockFeedback.setStroke(Color.BLACK); dockFeedback.setStrokeWidth(2); dockFeedback.setCache(true); dockFeedback.setCacheHint(CacheHint.SPEED); dockFeedback.setEffect(new DropShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 10, 0.2, 3, 3)); dockFeedback.setMouseTransparent(true); BorderPane borderpane = new BorderPane(); borderpane.setStyle("-fx-background-color:transparent"); // J8 borderpane.setCenter(dockFeedback); Scene scene = new Scene(borderpane); scene.setFill(Color.TRANSPARENT); dockFeedbackPopup.setScene(scene); dockFeedbackPopup.sizeToScene(); }
dialogStage.getScene().setFill(Color.TRANSPARENT); // Fill our scene with nothing