Java Code Examples for javafx.stage.StageStyle#TRANSPARENT

The following examples show how to use javafx.stage.StageStyle#TRANSPARENT . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * 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();
}
 
Example 2
public static void saveAllDigits() {
	Stage stage = new Stage(StageStyle.TRANSPARENT);
	DigitTemplate root = new DigitTemplate();
	Scene scene = new Scene(root);
	stage.setScene(scene);
	stage.show();

	SnapshotParameters snapshotParams = new SnapshotParameters();
	snapshotParams.setFill(Color.TRANSPARENT);
	root.digit.setText("-");
	for (int i = 0; i <= 10; i++) {
		WritableImage image = root.digit.snapshot(snapshotParams, null);

		File file = new File("src/" + IconFactory.RESOURCE_PATH + "/img/common/digits/" + root.digit.getText() + ".png");

		try {
			ImageIO.write(SwingFXUtils.fromFXImage(image, null), "png", file);
		} catch (IOException e) {
			e.printStackTrace();
		}
		root.digit.setText("" + i);
	}

	stage.close();
}
 
Example 3
Source Project: oim-fx   File: ScreenShotFrame.java    License: MIT License 5 votes vote down vote up
public ScreenShotFrame() {
	// super(StageStyle.UNDECORATED);
	super(StageStyle.TRANSPARENT);
	init();
	initMenu();
	initEvent();
}
 
Example 4
/**
 * UndecoratorScene constructor
 *
 * @param stage The main stage
 * @param stageStyle could be StageStyle.UTILITY or StageStyle.TRANSPARENT
 * @param root your UI to be displayed in the Stage
 * @param stageDecorationFxml Your own Stage decoration or null to use the
 * built-in one
 */
public UndecoratorScene(Stage stage, StageStyle stageStyle, Region root, String stageDecorationFxml) {
    super(root);
    myRoot = root;
    /*
     * Fxml
     */
    if (stageDecorationFxml == null) {
        if (stageStyle == StageStyle.UTILITY) {
            stageDecorationFxml = STAGEDECORATION_UTILITY;
        } else {
            stageDecorationFxml = STAGEDECORATION;
        }
    }
    undecorator = new Undecorator(stage, root, stageDecorationFxml, stageStyle);
    super.setRoot(undecorator);

    // Customize it by CSS if needed:
    if (stageStyle == StageStyle.UTILITY) {
        undecorator.getStylesheets().add(STYLESHEET_UTILITY);
    } else {
        undecorator.getStylesheets().add(STYLESHEET);
    }

    // Transparent scene and stage
    if (stage.getStyle() != StageStyle.TRANSPARENT) {
        stage.initStyle(StageStyle.TRANSPARENT);
    }
    super.setFill(Color.TRANSPARENT);

    // Default Accelerators
    undecorator.installAccelerators(this);

    // Forward pref and max size to main stage
    stage.setMinWidth(undecorator.getMinWidth());
    stage.setMinHeight(undecorator.getMinHeight());
    stage.setWidth(undecorator.getPrefWidth());
    stage.setHeight(undecorator.getPrefHeight());
}
 
Example 5
Source Project: FxDock   File: DragAndDropHandler.java    License: Apache License 2.0 5 votes vote down vote up
protected static Stage createDragWindow(FxDockPane client)
{
	Window owner = FX.getParentWindow(client);
	Image im = createDragImage(client);
	Pane p = new Pane(new ImageView(im));
	Stage s = new Stage(StageStyle.TRANSPARENT);
	s.initOwner(owner);
	s.setScene(new Scene(p, im.getWidth(), im.getHeight()));
	s.setOpacity(DRAG_WINDOW_OPACITY);
	return s;
}
 
Example 6
public final boolean isDecorated() {
  return stageStyle != StageStyle.TRANSPARENT && stageStyle != StageStyle.UNDECORATED;
}
 
Example 7
/**
 * 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) {
    this(stage, StageStyle.TRANSPARENT, root, STAGEDECORATION);
}