本文整理匯總了Java中javafx.scene.control.ProgressIndicator類的典型用法代碼示例。如果您正苦於以下問題:Java ProgressIndicator類的具體用法?Java ProgressIndicator怎麽用?Java ProgressIndicator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ProgressIndicator類屬於javafx.scene.control包,在下文中一共展示了ProgressIndicator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initData
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
@Override
public void initData(Parent node, Map<String, String> bundle) {
progressbar = (ProgressIndicator) node.lookup("#progressbar");
iv_sync = (ImageView) node.lookup("#iv_sync");
iv_down = (ImageView) node.lookup("#iv_down");
iv_sync.setOnMouseEntered(e-> {
iv_sync.setImage(sync_enter);
});
iv_sync.setOnMouseExited(e-> {
iv_sync.setImage(sync_defalt);
});
iv_down.setOnMouseEntered(e-> {
iv_down.setImage(down_enter);
});
iv_down.setOnMouseExited(e-> {
iv_down.setImage(down_default);
});
iv_down.setOnMouseClicked(e->{
download();
});
iv_sync.setOnMouseClicked(e->{
sync();
});
}
示例2: setupNotConnectedPane
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
public void setupNotConnectedPane() {
GridPane pane = new GridPane();
pane.setVgap(15);
notConnectedPane = pane;
notConnectedPane.setPadding(new Insets(15, 15, 15, 15));
Label l = new Label("Not connected");
connectButton = new Button("Connect", AssetsLoader.getIcon("connect.png"));
editButton = new Button("Edit server informations...", AssetsLoader.getIcon("edit.png"));
connectButton.setOnAction(this::connectButtonAction);
editButton.setOnAction(this::editButtonAction);
piConnect = new ProgressIndicator();
piConnect.setVisible(false);
pane.addRow(0, connectButton);
pane.addRow(1, editButton);
pane.addRow(2, piConnect);
}
示例3: start
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
@Override
public void start(Stage stage) {
Group root = new Group();
Scene scene = new Scene(root, 300, 250);
stage.setScene(scene);
stage.setTitle("Progress Controls");
for (int i = 0; i < values.length; i++) {
final Label label = labels[i] = new Label();
label.setText("progress:" + values[i]);
final ProgressBar pb = pbs[i] = new ProgressBar();
pb.setProgress(values[i]);
final ProgressIndicator pin = pins[i] = new ProgressIndicator();
pin.setProgress(values[i]);
final HBox hb = hbs[i] = new HBox();
hb.setSpacing(5);
hb.setAlignment(Pos.CENTER);
hb.getChildren().addAll(label, pb, pin);
}
final VBox vb = new VBox();
vb.setSpacing(5);
vb.getChildren().addAll(hbs);
scene.setRoot(vb);
stage.show();
}
示例4: initData
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
@Override
public void initData(Parent node, Map<String, String> bundle) {
btn_deploy = (Button) node.lookup("#btn_deploy");
progressbar = (ProgressIndicator) node.lookup("#progressbar");
btn_deploy.setOnAction(e->{
progressbar.isIndeterminate();// һ ��������ʾ�����ڷ�ȷ��ģʽ,����progressbar����һ����ֵ�и�Сbug������¡�
progressbar.setVisible(true);
progressbar.setProgress(-1f);
progressbar.setProgress(0.5f);
progressbar.setProgress(-1f);
btn_deploy.setDisable(true);// �����ظ����
AnnotationHandler.sendMessage("work",null);
});
AnnotationHandler.register(this);
}
示例5: buildProgressIndicator
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
private ProgressIndicator buildProgressIndicator(double parentWidth, double parentHeight) {
double minWidth = parentWidth / 2;
double minHeight = parentHeight / 2;
double positionX = imageRectangle.getX() + (parentWidth - minWidth) / 2;
double positionY = imageRectangle.getY() + (parentHeight - minHeight) / 2;
ProgressIndicator result = new ProgressIndicator(0);
result.setTranslateX(positionX);
result.setTranslateY(positionY);
result.setMinWidth(minWidth);
result.setMinHeight(minHeight);
result.setOpacity(0.5);
result.setVisible(false);
return result;
}
示例6: Son
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
public Son(Clavier clavier) {
this.clavier = clavier;
slider = new Slider(0, 127, 60);
slider.setOrientation(Orientation.VERTICAL);
slider.setTranslateY(35);
slider.valueProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue o, Object oldVal, Object newVal) {
clavier.requestFocus();
}
});
ProgressIndicator indicateur = new ProgressIndicator(0.0);
indicateur.progressProperty().bind(slider.valueProperty().divide(127.0));
indicateur.setTranslateX(-15);
this.getChildren().add(slider);
this.getChildren().add(indicateur);
this.setTranslateY(260);
this.setTranslateX(60);
}
示例7: showLoading
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
/**
* Show the loading process.
*/
@FXThread
private void showLoading() {
focused = getFocusOwner();
final VBox loadingLayer = getLoadingLayer();
loadingLayer.setVisible(true);
loadingLayer.toFront();
progressIndicator = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);
progressIndicator.setId(CSSIds.EDITOR_LOADING_PROGRESS);
FXUtils.addToPane(progressIndicator, loadingLayer);
final StackPane container = getContainer();
container.setDisable(true);
}
示例8: drawNode
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
@Override
public Node drawNode() {
GridPane root = new GridPane();
root.setVgap(spacing / 2);
root.setHgap(spacing);
double d, _d = -0.25;
for (int i = 0; _d < 1; i++) {
d = _d + 0.25;
_d = d;
ProgressIndicator ind = progressIndicatorCreate();
VBox box = new VBox();
box.setAlignment(Pos.CENTER);
box.getChildren().add(new Label("[" + d + "]"));
ind.setProgress(d);
if (ind.getProgress() != d) {
reportGetterFailure("progress_indicator.getProgress()");
}
box.getChildren().add(ind);
root.add(box, i % 3, i / 3);
}
return root;
}
示例9: createRoot
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
private Parent createRoot() {
StackPane stackPane = new StackPane();
BorderPane controlsPane = new BorderPane();
controlsPane.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
stackPane.getChildren().add(controlsPane);
controlsPane.setCenter(new TableView<Void>());
ProgressIndicator indicator = new ProgressIndicator();
indicator.setMaxSize(120, 120);
stackPane.getChildren().add(indicator);
StackPane.setAlignment(indicator, Pos.BOTTOM_RIGHT);
StackPane.setMargin(indicator, new Insets(20));
return stackPane;
}
示例10: 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);
}
});
}
示例11: 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;
}
示例12: TaskProgressIndicatorSkin
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
/***************************************************************************
* *
* Constructors *
* *
**************************************************************************/
public TaskProgressIndicatorSkin(ProgressIndicator control) {
super(control, new BehaviorBase<>(control, Collections.emptyList()));
this.control = control;
// register listeners
registerChangeListener(control.indeterminateProperty(), "INDETERMINATE");
registerChangeListener(control.progressProperty(), "PROGRESS");
registerChangeListener(control.visibleProperty(), "VISIBLE");
registerChangeListener(control.parentProperty(), "PARENT");
registerChangeListener(control.sceneProperty(), "SCENE");
initialize();
}
示例13: showProgressDialog
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
public static Stage showProgressDialog(ObservableValue<? extends Number> ov, String message) {
Stage progress = WSeminar.createDialog("progress", "Fortschritt", WSeminar.window, StageStyle.TRANSPARENT, Modality.NONE);
if (message == null) {
progress.getScene().setFill(null);
progress.getScene().getRoot().setStyle("-fx-background-color: transparent");
}
Label msgLabel = (Label) progress.getScene().lookup("#message");
msgLabel.setVisible(message == null);
msgLabel.setText(message);
progress.setAlwaysOnTop(true);
ProgressIndicator pi = ((ProgressIndicator) progress.getScene().lookup("#progress"));
pi.setProgress(0);
ChangeListener<Number> cl = (obs, newVal, oldVal) -> Platform.runLater(() -> {
pi.setProgress(Math.round(newVal.doubleValue() * 100) / 100.0);
});
ov.addListener(cl);
progress.setOnHiding(e -> ov.removeListener(cl));
return progress;
}
示例14: start
import javafx.scene.control.ProgressIndicator; //導入依賴的package包/類
@Override
public void start(Stage stage) throws Exception
{
stage.setTitle("ProgressIndicatorTest");
stage.setResizable(false);
BorderPane pane = new BorderPane();
VBox box = new VBox(15.0d);
box.setAlignment(Pos.CENTER);
ProgressIndicator indicator = new ProgressIndicator(
ProgressIndicator.INDETERMINATE_PROGRESS);
box.getChildren().add(indicator);
box.getChildren().add(new Label("ProgressIndicatorTest"));
pane.setCenter(box);
Scene scene = new Scene(pane, 200, 200);
scene.getStylesheets().add(
this.getClass().getResource("/niobe/metro/css/theme.css").toExternalForm());
stage.setScene(scene);
stage.show();
}
示例15: 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);
}