当前位置: 首页>>代码示例>>Java>>正文


Java Stage.initStyle方法代码示例

本文整理汇总了Java中javafx.stage.Stage.initStyle方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.initStyle方法的具体用法?Java Stage.initStyle怎么用?Java Stage.initStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.stage.Stage的用法示例。


在下文中一共展示了Stage.initStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AboutView

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * Creates an instance of a {@link AboutView}.
 *
 * @throws IOException if unable to load the controller
 */
@Inject
public AboutView(final FXMLLoader fxmlLoader) throws UIInitialisationException, IOException {
    stage = new Stage();
    stage.initStyle(StageStyle.UNDECORATED);
    stage.setResizable(false);

    final URL resource = getClass().getResource(ABOUT_VIEW);
    fxmlLoader.setLocation(resource);
    final Scene rootScene = new Scene(fxmlLoader.load());

    rootScene.addEventHandler(KeyEvent.KEY_PRESSED, event -> {
        if (event.getCode() == KeyCode.ESCAPE) {
            stage.hide();
        }
    });

    stage.setScene(rootScene);

    stage.focusedProperty().addListener((observable, oldValue, newValue) -> {
        if (!newValue) {
            stage.hide();
        }
    });
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:30,代码来源:AboutView.java

示例2: loadImageArchiveEditor

import javafx.stage.Stage; //导入方法依赖的package包/类
@FXML
private void loadImageArchiveEditor() {
	try {
		FXMLLoader loader = new FXMLLoader(App.class.getResource("/ImageArchiveUI.fxml"));

		Parent root = loader.load();

		ImageArchiveController controller = loader.getController();

		Stage stage = new Stage();

		controller.setStage(stage);
		stage.setTitle("Image Archive Editor");
		Scene scene = new Scene(root);
		scene.getStylesheets().add(App.class.getResource("/style.css").toExternalForm());
		stage.getIcons().add(new Image(getClass().getResourceAsStream("/icons/app_icon_128.png")));
		stage.setScene(scene);
		stage.initStyle(StageStyle.TRANSPARENT);
		stage.setResizable(false);
		stage.centerOnScreen();
		stage.setTitle("Archive Editor");
		stage.show();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:nshusa,项目名称:rsam-gui,代码行数:27,代码来源:StoreController.java

示例3: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(final Stage primaryStage) throws Exception
{

    this.preloaderStage = primaryStage;

    final ImageView splash = new ImageView(new Image(Constant.IMG_DIR + "banner.png"));

    this.loadProgressPhase = new JFXProgressBar();
    this.loadProgressPhase.setPrefWidth(Constant.SPLASH_WIDTH);

    this.splashLayout = new VBox();
    this.splashLayout.getChildren().addAll(splash, this.loadProgressPhase);

    this.splashLayout.setStyle("-fx-padding: 5; " + "-fx-background-color: gainsboro; " + "-fx-border-width:2; "
            + "-fx-border-color: " + "linear-gradient(" + "to bottom, " + "MediumSeaGreen, "
            + "derive(MediumSeaGreen, 50%)" + ");");
    this.splashLayout.setEffect(new DropShadow());

    final Scene splashScene = new Scene(this.splashLayout, Color.TRANSPARENT);
    final Rectangle2D bounds = Screen.getPrimary().getBounds();

    primaryStage.setScene(splashScene);
    primaryStage.setX(bounds.getMinX() + bounds.getWidth() / 2 - Constant.SPLASH_WIDTH / 2);
    primaryStage.setY(bounds.getMinY() + bounds.getHeight() / 2 - Constant.SPLASH_HEIGHT / 2);
    primaryStage.getIcons().add(new Image(Constant.IMG_DIR + "icon.png"));
    primaryStage.setTitle(Constant.APP_NAME);

    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setAlwaysOnTop(true);
    primaryStage.show();

}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:34,代码来源:MineIDEPreloader.java

示例4: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
	App.stage = stage;
	try {
		Parent root = FXMLLoader.load(App.class.getResource("/ui/Main.fxml"));
		Scene scene = new Scene(root);
		scene.getStylesheets().add(getClass().getResource("/style.css").toExternalForm());
		stage.setTitle("OSRS Data To 317 Converter");		
		stage.centerOnScreen();
		stage.setResizable(false);
		stage.sizeToScene();
		stage.initStyle(StageStyle.UNDECORATED);
		stage.setScene(scene);	
		stage.getIcons().add(new Image(App.class.getResourceAsStream("/icons/icon.png")));
		stage.show();
	} catch(Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:nshusa,项目名称:osrs-data-converter,代码行数:20,代码来源:App.java

示例5: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
	URL location = getClass().getResource("MainFXMLDocument.fxml");
	Parent root = FXMLLoader.load(location);
	
	root.setOnMouseDragged(e -> this.dragStage(e, stage));
	root.setOnMouseMoved(e -> this.calculateGap(e, stage));
	
	Scene scene = new Scene(root, Color.TRANSPARENT);
	scene.getStylesheets().add("/com/shekkar/xpanderfx/mainStyler.css");
	
	stage.setScene(scene);
	stage.setAlwaysOnTop(true);
	stage.initStyle(StageStyle.TRANSPARENT);		
	stage.show();	
}
 
开发者ID:ShekkarRaee,项目名称:xpanderfx,代码行数:17,代码来源:XpanderFX.java

示例6: EditorDialog

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * Instantiates a new Editor dialog.
 */
public EditorDialog() {
    this.showedTime = LocalTime.now();

    container = new VBox();
    container.setAlignment(CENTER);

    final EditorConfig editorConfig = EditorConfig.getInstance();
    final CssColorTheme theme = editorConfig.getTheme();

    final Scene scene = new Scene(container);
    final ObservableList<String> stylesheets = scene.getStylesheets();
    stylesheets.addAll(CSS_REGISTRY.getAvailableCssFiles());
    stylesheets.add(theme.getCssFile());

    createControls(container);

    dialog = new Stage();
    dialog.setTitle(getTitleText());
    dialog.initStyle(StageStyle.UTILITY);
    dialog.initModality(Modality.WINDOW_MODAL);
    dialog.setResizable(isResizable());
    dialog.setScene(scene);

    configureSize(container);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:29,代码来源:EditorDialog.java

示例7: buildWindow

import javafx.stage.Stage; //导入方法依赖的package包/类
private static Stage buildWindow (String title)
{
	tempStage = new Stage();
	tempStage.initStyle(StageStyle.UTILITY);			// Einfaches Fenster
														// ohne 'minimiere'
														// und 'maximiere'
														// Buttons
	tempStage.setResizable(false);						// Verbiete �nderung
															// der Gr�sse
	tempStage.initModality(Modality.APPLICATION_MODAL);	// Blockiere alle
															// anderen
															// Fenster
	tempStage.setTitle(title);							// Setze Titel
	return tempStage;
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:16,代码来源:Alert.java

示例8: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(final Stage primaryStage) throws IOException, UIInitialisationException {
    stage = primaryStage;
    primaryStage.setTitle(Hygene.TITLE);
    primaryStage.initStyle(StageStyle.UNDECORATED);

    progress = new ProgressBar();

    final URL resource = getClass().getResource(PRELOADER_VIEW);
    final Parent root = FXMLLoader.load(resource);
    if (root == null) {
        throw new UIInitialisationException("Root of Preloader could not be found.");
    }

    final Scene rootScene = new Scene(root);
    primaryStage.setScene(rootScene);
    primaryStage.show();
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:19,代码来源:HygenePreloader.java

示例9: wait

import javafx.stage.Stage; //导入方法依赖的package包/类
public static void wait(WebView view) {
    Stage stage = new Stage();

    WebEngine engine = view.getEngine();
    engine.documentProperty().addListener((observable, o, n) -> stage.close());

    Scene scene = new Scene(view);
    stage.initStyle(StageStyle.UNDECORATED);
    stage.setWidth(1);
    stage.setHeight(1);
    stage.setScene(scene);

    stage.showAndWait();
    stage.close();
}
 
开发者ID:dzikoysk,项目名称:Netkit,代码行数:16,代码来源:WebViewUtils.java

示例10: start

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * Método responsável por tratatar e executar a cena
 */
@Override
public void start(Stage primaryStage) throws Exception {
	
	stage = primaryStage;
	Pane telaInicialStage = FXMLLoader.load(getClass().getResource("/view/LayoutTelaInicial.fxml"));
	telaInicial = new Scene(telaInicialStage, 800, 600);		

	// A linha abaixo adiciona o arquivo CSS à cena
	telaInicialStage.getStylesheets().add("css/buttonStyle.css");
	
	// A linha abaixo atribui título à Janela
	//primaryStage.setTitle("Show do Milhão");

	// A linha abaixo não permite maximizar ou minimizar a janela (false) caso a aplicação tenha borda
	//primaryStage.setResizable(false);

	// A linha abaixo tira a borda da aplicação
	primaryStage.initStyle(StageStyle.UNDECORATED);

	primaryStage.setScene(telaInicial);
	primaryStage.show();		
	
	// MÚSICA DE ABERTURA COM REPRODUÇÃO CONTÍNUA
	thePlayer = new MyAudioPlayer(path, true);
    thePlayer.start();
	
    // MÚSICA DE ABERTURA SEM REPRODUÇÃO CONTÍNUA
	//tocarMusica();					
}
 
开发者ID:tadeuespindolapalermo,项目名称:ShowMilhaoPOOJava,代码行数:33,代码来源:ApplicationShowMilhao.java

示例11: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
    
    Scene scene = new Scene(root);
    
    stage.setScene(scene);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
 
开发者ID:Amine-Smahi,项目名称:MaterialLogin.Fx,代码行数:11,代码来源:MaterialLogin.java

示例12: loadArchiveEditor

import javafx.stage.Stage; //导入方法依赖的package包/类
@FXML
private void loadArchiveEditor() {
	try {
		FXMLLoader loader = new FXMLLoader(App.class.getResource("/ArchiveUI.fxml"));

		Parent root = (Parent) loader.load();

		ArchiveController controller = (ArchiveController) loader.getController();

		Stage stage = new Stage();

		controller.setStage(stage);
		stage.setTitle("Archive Editor");
		Scene scene = new Scene(root);
		scene.getStylesheets().add(App.class.getResource("/style.css").toExternalForm());
		stage.getIcons().add(new Image(getClass().getResourceAsStream("/icons/app_icon_128.png")));
		stage.setScene(scene);
		stage.initStyle(StageStyle.TRANSPARENT);
		stage.setResizable(false);
		stage.centerOnScreen();
		stage.setTitle("Archive Editor");
		stage.show();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:nshusa,项目名称:rsam-gui,代码行数:27,代码来源:StoreController.java

示例13: showMasterDetailInWindow

import javafx.stage.Stage; //导入方法依赖的package包/类
private void showMasterDetailInWindow(final Stage stage, final Database database, final MasterDetailViewFeatures features) throws JAXBException, IOException {
    final Parent viewRoot = ViewFactory.createMasterDetailView(database, features);

    final Rectangle clip = new Rectangle();
    clip.setArcHeight(18);
    clip.setArcWidth(18);
    clip.widthProperty().bind(stage.widthProperty());
    clip.heightProperty().bind(stage.heightProperty());

    //TODO: Only clipping or PerspectiveCamera is working... :(
    features.customWindowClipProperty().addListener((obs, oldVal, newVal) -> {
        if (newVal) {
            viewRoot.setClip(clip);
        } else {
            viewRoot.setClip(null);
        }
    });

    final Scene scene = new Scene(viewRoot);

    features.useCssProperty().addListener((obs, oldVal, newVal) -> {
        updateStylesheets(scene, newVal);
    });

    updateStylesheets(scene, features.isUseCss());

    scene.setFill(Color.TRANSPARENT);
    scene.setCamera(new PerspectiveCamera());

    if (features.isCustomWindowUI()) {
        stage.initStyle(StageStyle.TRANSPARENT);
    }

    stage.setTitle("Movie Database");
    stage.setScene(scene);
    stage.setWidth(1100);
    stage.setHeight(720);
    stage.centerOnScreen();
    stage.show();

    final FeaturesDialog featuresDialog = new FeaturesDialog(stage);
    featuresDialog.addFeature(new Feature("Layout & Style", "demo2-css", features.useCssProperty()));
    featuresDialog.addFeature(new Feature("Image Background", "demo2-image-background",features.movieBackgroundProperty()));
    featuresDialog.addFeature(new Feature("List Animation", "demo2-list-animation",features.listAnimationProperty()));
    featuresDialog.addFeature(new Feature("List Shadow", "demo2-list-shadow",features.listShadowProperty()));
    // featuresDialog.addFeature(new Feature("List Cache", "demo2-list-cache",features.listCacheProperty()));
    featuresDialog.addFeature(new Feature("Poster Transform", "demo2-poster-transform",features.posterTransformProperty()));
    featuresDialog.addFeature(new Feature("Custom Window UI", "demo2-custom-window-ui",features.customWindowUIProperty()));
    featuresDialog.addFeature(new Feature("Custom Window Clip", "demo2-custom-window-clip", features.customWindowClipProperty()));
    featuresDialog.show();
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:52,代码来源:MovieApp.java

示例14: create

import javafx.stage.Stage; //导入方法依赖的package包/类
private BaseDialog create() {
        mStage = new Stage();
        mStage.initModality(Modality.WINDOW_MODAL);
        mStage.initOwner(getOwner());
        mStage.initStyle(StageStyle.DECORATED);
        mStage.setResizable(false);
        viewTuple = createContent();
        BaseView view = null;
        if(viewTuple.getView() instanceof BaseView){
            view = (BaseView) viewTuple.getView();
            view.onDialogSet(this);
            root = (Pane) viewTuple.getRoot();
            alignCenter(root.getPrefWidth(), root.getPrefHeight());
            if(isDragable)
                dragDialogAbleNode(root);
        } else {
            try {
                throw new Exception("your view is not a BaseView!");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        mScene = new Scene(viewTuple.getRoot());
//        mScene.getStylesheets().setAll(TestinStage.getInstance().getStylesheet());
        mStage.setScene(mScene);
        mStage.setTitle(view.getTitle());
        return this;
    }
 
开发者ID:cmlanche,项目名称:javafx-qiniu-tinypng-client,代码行数:29,代码来源:BaseDialog.java

示例15: create

import javafx.stage.Stage; //导入方法依赖的package包/类
public void create(Stage primaryStage) {
    this.primaryStage = primaryStage;
    FunnyCreator.getLogger().info("Creating primary view");

    ScreenUtils.to(primaryStage, 960, 480);
    ScreenUtils.center(primaryStage);

    WebView view = new WebView();
    this.engine = view.getEngine();

    engine.getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue != State.SUCCEEDED) {
            return;
        }

        FunnyCreator.getLogger().info("Showing view");
        primaryStage.show();

        FunnyCreator.getLogger().info("Injecting FGC bridge");
        JSObject window = (JSObject) engine.executeScript("window");
        window.setMember("FunnyGuildsCreator", new FunnyBridge());

        creator.runAsync(() -> {
            try {
                creator.load();
            } catch (Exception e) {
                e.printStackTrace();
                AlertUtils.alert("FunnyCreator Exception", "Cannot load creator", ExceptionUtils.getStackTrace(e), creator::shutdown);
            }
        });
    });

    String style = IOUtils.toString(getClass().getResourceAsStream("/panel/front.css"), Charset.forName("UTF-8"));
    String script = IOUtils.toString(getClass().getResourceAsStream("/panel/front.js"), Charset.forName("UTF-8"));
    String html = IOUtils.toString(getClass().getResourceAsStream("/panel/front.html"), Charset.forName("UTF-8"));

    String content = html
            .replace("{{STYLE}}", style)
            .replace("{{SCRIPT}}", script)
            .replace("{{VERSION}}", FunnyConstants.VERSION);
    engine.loadContent(content);

    Scene scene = new Scene(view, primaryStage.getWidth(), primaryStage.getHeight());
    primaryStage.getIcons().add(new Image(FunnyCreator.class.getResourceAsStream("/icon.png")));
    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setTitle("FunnyGuilds Creator " + FunnyConstants.VERSION);
    primaryStage.setScene(scene);
}
 
开发者ID:FunnyGuilds,项目名称:FunnyCreator,代码行数:49,代码来源:FunnyView.java


注:本文中的javafx.stage.Stage.initStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。