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


Java ProgressIndicator.setPrefSize方法代码示例

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


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

示例1: DynamicTreeItem

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public DynamicTreeItem(DbTreeValue value, Node graphic, Executor executor, PopupService popupService,
    Function<DbTreeValue, List<TreeItem<DbTreeValue>>> supplier) {
  super(value, graphic);
  this.supplier = supplier;
  this.executor = executor;
  this.popupService = popupService;

  progress = new ProgressIndicator();
  progress.setPrefSize(15, 15);

  parentProperty().addListener(e -> {
    if (getParent() == null && currentLoadTask != null) {
      currentLoadTask.cancel(true);
    }
  });
}
 
开发者ID:daa84,项目名称:mongofx,代码行数:17,代码来源:DynamicTreeItem.java

示例2: createIndicatorStage

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
/**
 * 
 * Creates indicator stage instance.
 * @return the instance.
 */
public static Stage createIndicatorStage() {
	ProgressIndicator pi = new ProgressIndicator();
	pi.setPrefSize(INDICATOR_MARGINE_X, INDICATOR_MARGINE_Y);
	
	BorderPane borderPane = new BorderPane();
	borderPane.setStyle("-fx-background-radius: 10;-fx-background-color: rgba(0,0,0,0.3);");
	borderPane.setPrefSize(INDICATOR_WIDTH, INDICATOR_HEIGHT);
	borderPane.setCenter(pi);

	StackPane root = new StackPane();

	Scene scene = new Scene(root, INDICATOR_WIDTH, INDICATOR_HEIGHT);
	scene.setFill(null);
	
	root.getChildren().add(borderPane);
	
	Stage stage = new Stage(StageStyle.TRANSPARENT);
	stage.setResizable(false);
	stage.setScene(scene);
	
	stage.initModality(Modality.APPLICATION_MODAL);
	
	return stage;
}
 
开发者ID:o3project,项目名称:mlo-gui,代码行数:30,代码来源:MloClient.java

示例3: LoadingWindow

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
/**
 * Create a new LoadingWindow.<br>
 * First a progress indicator is created and set up. The progress indicator
 * will turn indefinite. Then a label and a {@link ProgressBar} are shown.
 * In the end, the WaitThread will be started which shows that still no
 * connection has been established.
 */
public LoadingWindow() {
    this.setId(LayerType.loading.toString());                               // Sets the ID as "LOADING"
    ProgressIndicator progressIndicator = new ProgressIndicator();
    progressIndicator.setPrefSize(120, 120);
    progressIndicator.setMaxSize(120, 120);
    this.getStyleClass().add("loading");
    this.setCenter(progressIndicator);

    Label loadingLabel = new Label("Connecting...");
    loadingLabel.setId("loadingLabel");
    loadingLabel.setTextAlignment(TextAlignment.RIGHT);

    StackPane sp = new StackPane();
    sp.setAlignment(Pos.CENTER);
    sp.getChildren().add(loadingLabel);

    progressBar = new ProgressBar(0.0);
    progressBar.setTranslateY(50);
    sp.getChildren().add(progressBar);

    new LoadingWindow.WaitThread().start();
    setTop(sp);
}
 
开发者ID:brad-richards,项目名称:AIGS,代码行数:31,代码来源:LoadingWindow.java

示例4: ProgressIndicatorSample

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public ProgressIndicatorSample() {
    super(400,400);
    
    GridPane g = new GridPane();

    ProgressIndicator p1 = new ProgressIndicator();
    p1.setPrefSize(50, 50);

    ProgressIndicator p2 = new ProgressIndicator();
    p2.setPrefSize(50, 50);
    p2.setProgress(0.25F);

    ProgressIndicator p3 = new ProgressIndicator();
    p3.setPrefSize(50, 50);
    p3.setProgress(0.5F);

    ProgressIndicator p4 = new ProgressIndicator();
    p4.setPrefSize(50, 50);
    p4.setProgress(1.0F);

    g.add(p1, 1, 0);
    g.add(p2, 0, 1);
    g.add(p3, 1, 1);
    g.add(p4, 2, 1);

    g.setHgap(40);
    g.setVgap(40);
    
    getChildren().add(g);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:31,代码来源:ProgressIndicatorSample.java

示例5: start

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    m_loadingLabel = new Label();
    this.m_preloaderStage = primaryStage;
    registerObservers();

    final int SPLASH_WINDOW_WIDTH = 500;
    final int SPLASH_WINDOW_HEIGHT = 300;
    final int LOADING_INDICATOR_SIZE = 60;
    final int TEXT_FONT_SIZE = 10;
    final int VBOX_SPACING = 10;
    final int VBOX_HEIGHT_ALIGNMENT = 65;
    final String SPLASH_BACKGROUND_IMAGE = "splash.png";

    BorderPane loadingPane = new BorderPane();

    ProgressIndicator progress = new ProgressIndicator();
    progress.setPrefSize(LOADING_INDICATOR_SIZE, LOADING_INDICATOR_SIZE);

    m_loadingLabel.setFont(new Font(TEXT_FONT_SIZE));
    m_loadingLabel.setTextFill(Color.CORNFLOWERBLUE);
    VBox box = new VBox(VBOX_SPACING);
    box.setAlignment(Pos.CENTER);
    box.setPadding(new Insets(VBOX_HEIGHT_ALIGNMENT, 0, 0, 0));
    box.getChildren().addAll(progress, m_loadingLabel);
    loadingPane.setCenter(box);

    Image backgroundImage = new Image(SPLASH_BACKGROUND_IMAGE);
    loadingPane.setBackground(new Background(new BackgroundImage(backgroundImage, BackgroundRepeat.REPEAT,
            BackgroundRepeat.REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT)));

    primaryStage.setTitle(APP_TITLE);
    primaryStage.getIcons().add(
        getLogoIcon()
    );

    primaryStage.setScene(new Scene(loadingPane, SPLASH_WINDOW_WIDTH, SPLASH_WINDOW_HEIGHT));
    primaryStage.initStyle(StageStyle.TRANSPARENT);
    primaryStage.show();
}
 
开发者ID:ijh165,项目名称:Gamma-Music-Manager,代码行数:41,代码来源:StartUpLoader.java


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