本文整理匯總了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);
}
});
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}