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


Java ProgressIndicator.setMaxWidth方法代码示例

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


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

示例1: initView

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
/**
 * Initializes the view
 */
private void initView(){
    gridView = new GridView<>();

    gridViewPort = new GridViewViewPort(gridView);
    gridViewPort.getViewPortItemsChanged().add((sender, eventArgs) -> onVisibleItemsChanged());

    gridView.setCellFactory(control -> new MediaGridItemCell(
            mediaPlayerService,
            gridView.cellWidthProperty(),
            gridView.cellHeightProperty()
    ));

    gridView.setOnZoom(event -> {
        setItemSize(gridView.getCellWidth() * event.getTotalZoomFactor() );
        event.consume();
    });

    loadingProgress = new ProgressIndicator();
    loadingProgress.setMaxWidth(70);

    StackPane mediaGridStack = new StackPane();
    mediaGridStack.getChildren().addAll(gridView, loadingProgress);
    this.setCenter(mediaGridStack);
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:28,代码来源:MediaBrowserFX.java

示例2: createSwirlingProgressIndicator

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public static ProgressIndicator createSwirlingProgressIndicator(double width, double height)
{
	ProgressIndicator indicator = new ProgressIndicator();
	indicator.setStyle("-fx-progress-color: white;");
	indicator.setMinWidth(width);
	indicator.setMaxWidth(width);
	indicator.setMinHeight(height);
	indicator.setMaxHeight(height);
	return indicator;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:11,代码来源:JavaFxHelper.java

示例3: createProgressIndicator

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
private Node createProgressIndicator() {
    ProgressIndicator indicator = new ProgressIndicator();
    indicator.setMaxHeight(350);
    indicator.setMaxWidth(350);

    BorderPane borderPane = new BorderPane();
    BorderPane.setMargin(indicator, new Insets(5));
    borderPane.setCenter(indicator);
    borderPane.setStyle("-fx-background-color: rgba(230,230,230,0.7);");
    return borderPane;
}
 
开发者ID:factoryfx,项目名称:factoryfx,代码行数:12,代码来源:LongRunningActionExecutor.java

示例4: nodeForPercentage

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
private Node nodeForPercentage() {
	final ProgressIndicator progress = new ProgressIndicator(percentageAchieved);
	progress.getStyleClass().add("itrysql-achievement-progress");
	progress.setPrefWidth(LABEL_LOGO_FIXED_WIDTH);
	progress.setMinWidth(LABEL_LOGO_FIXED_WIDTH);
	progress.setMaxWidth(LABEL_LOGO_FIXED_WIDTH);
	return progress;
}
 
开发者ID:Silent-Fred,项目名称:iTrySQL,代码行数:9,代码来源:SingleAchievement.java

示例5: SplashScreen

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public SplashScreen(){

        Image image = loadImage("/images/vidada.png");

        ImageView splash = new ImageView(image);

        splash.setFitHeight(180);
        splash.setSmooth(true);
        splash.setPreserveRatio(true);


        loadProgress = new ProgressIndicator();
        loadProgress.setStyle(" -fx-progress-color: -fx-accent;");
        loadProgress.setMaxWidth(60);

        progressText = new Label("Loading . . .");
        progressText.setStyle("-fx-text-fill: -fx-accent;");
        splashLayout = new BorderPane();
        splashLayout.setStyle("-fx-padding: 5; -fx-background-color: -fx-background; -fx-border-width:2; -fx-border-color: -fx-accent;");
        splashLayout.setEffect(new DropShadow());

        splashLayout.setLeft(splash);
        splashLayout.setRight(loadProgress);
        BorderPane.setAlignment(loadProgress, Pos.CENTER);
        BorderPane.setMargin(loadProgress, new Insets(0,40,0,0));
        splashLayout.setBottom(progressText);

        progressText.setAlignment(Pos.CENTER);

    }
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:31,代码来源:SplashScreen.java

示例6: start

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

  try {
    // create stack pane and application scene
    StackPane stackPane = new StackPane();
    Scene scene = new Scene(stackPane);

    // set title, size, and add scene to stage
    stage.setTitle("Local Server Feature Layer Sample");
    stage.setWidth(800);
    stage.setHeight(700);
    stage.setScene(scene);
    stage.show();

    // create a view with a map and basemap
    map = new ArcGISMap(Basemap.createStreets());
    mapView = new MapView();
    mapView.setMap(map);

    // track progress of loading feature layer to map
    featureLayerProgress = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);
    featureLayerProgress.setMaxWidth(30);

    // check that local server install path can be accessed
    if (LocalServer.INSTANCE.checkInstallValid()) {
      server = LocalServer.INSTANCE;
      server.addStatusChangedListener(status -> {
        if (server.getStatus() == LocalServerStatus.STARTED) {
          // start feature service
          String featureServiceURL = new File("samples-data/local_server/PointsofInterest.mpk").getAbsolutePath();
          featureService = new LocalFeatureService(featureServiceURL);
          featureService.addStatusChangedListener(this::addLocalFeatureLayer);
          featureService.startAsync();
        }
      });
      // start local server
      server.startAsync();
    } else {
      Platform.runLater(() -> {
        Alert dialog = new Alert(AlertType.INFORMATION);
        dialog.setHeaderText("Local Server Load Error");
        dialog.setContentText("Local Geoprocessing Failed to load.");
        dialog.showAndWait();

        Platform.exit();
      });
    }

    // add view to application window
    stackPane.getChildren().addAll(mapView, featureLayerProgress);
    StackPane.setAlignment(featureLayerProgress, Pos.CENTER);
  } catch (Exception e) {
    // on any error, display the stack trace.
    e.printStackTrace();
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:58,代码来源:LocalServerFeatureLayerSample.java

示例7: start

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

  try {
    // create stack pane and application scene
    StackPane stackPane = new StackPane();
    Scene scene = new Scene(stackPane);

    // set title, size, and add scene to stage
    stage.setTitle("Local Server Map Image Layer Sample");
    stage.setWidth(APPLICATION_WIDTH);
    stage.setHeight(700);
    stage.setScene(scene);
    stage.show();

    // create a view with a map and basemap
    ArcGISMap map = new ArcGISMap(Basemap.createStreets());
    mapView = new MapView();
    mapView.setMap(map);

    // track progress of loading map image layer to map
    imageLayerProgress = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);
    imageLayerProgress.setMaxWidth(30);

    // check that local server install path can be accessed
    if (LocalServer.INSTANCE.checkInstallValid()) {
      server = LocalServer.INSTANCE;
      // start local server
      server.addStatusChangedListener(status -> {
        if (status.getNewStatus() == LocalServerStatus.STARTED) {
          // start map image service
          String mapServiceURL = new File("./samples-data/local_server/RelationshipID.mpk").getAbsolutePath();
          mapImageService = new LocalMapService(mapServiceURL);
          mapImageService.addStatusChangedListener(this::addLocalMapImageLayer);
          mapImageService.startAsync();
        }
      });
      server.startAsync();
    } else {
      Platform.runLater(() -> {
        Alert dialog = new Alert(AlertType.INFORMATION);
        dialog.setHeaderText("Local Server Load Error");
        dialog.setContentText("Local Geoprocessing Failed to load.");
        dialog.showAndWait();

        Platform.exit();
      });
    }

    // add view to application window with progress bar
    stackPane.getChildren().addAll(mapView, imageLayerProgress);
    StackPane.setAlignment(imageLayerProgress, Pos.CENTER);
  } catch (Exception e) {
    // on any error, display the stack trace.
    e.printStackTrace();
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:58,代码来源:LocalServerMapImageLayerSample.java

示例8: setParameters

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
/**
 * @see gov.va.isaac.interfaces.gui.views.commonFunctionality.XMLViewI#showView(Window, String, Supplier, int, int)
 */
@Override
public void setParameters(String title, Supplier<String> xmlContent, int width, int height)
{
	setWidth(width);
	setHeight(height);
	setTitle(title);
	getIcons().add(Images.XML_VIEW_16.getImage());
	getIcons().add(Images.XML_VIEW_32.getImage());

	BorderPane bp = new BorderPane();
	bp.setCursor(Cursor.WAIT);

	pi_ = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);
	pi_.setMaxHeight(Region.USE_PREF_SIZE);
	pi_.setMaxWidth(Region.USE_PREF_SIZE);
	bp.setCenter(pi_);

	wv_ = new WebView();

	Scene scene = new Scene(bp);
	setScene(scene);

	addEventHandler(WindowEvent.WINDOW_CLOSE_REQUEST, new EventHandler<WindowEvent>()
	{
		@Override
		public void handle(WindowEvent event)
		{
			wv_ = null;
		}
	});
	
	Utility.execute(() -> 
	{
		final StringBuilder formattedContent = new StringBuilder();
		
		try
		{
			formattedContent.append(XMLUtils.toHTML(xmlContent.get()));
		}
		catch (Exception e)
		{
			logger.error("There was an error formatting the lego as XML", e);
			formattedContent.append("There was an error formatting the XML for display");
		}
		
		Platform.runLater(() ->
		{
			WebView wv = wv_;
			if (wv != null)
			{
				wv_.getEngine().loadContent(formattedContent.toString());
				getScene().getRoot().setCursor(Cursor.DEFAULT);
				((BorderPane) getScene().getRoot()).setCenter(wv_);
				((BorderPane) getScene().getRoot()).getChildren().remove(pi_);
				pi_ = null;
			}
		});
	});
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:63,代码来源:XMLDisplayWindow.java

示例9: LegoTreeNodeGraphic

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public LegoTreeNodeGraphic()
{
	sp = new StackPane();
	sp.setMaxWidth(Double.MAX_VALUE);
	
	content = new HBox();
	content.setMinHeight(22.0);
	content.setSpacing(0.0);
	content.setMaxWidth(Double.MAX_VALUE);
	content.setAlignment(Pos.CENTER_LEFT);
	content.setFillHeight(true);
	sp.getChildren().add(content);
	StackPane.setAlignment(content, Pos.CENTER_LEFT);
	StackPane.setMargin(content, new Insets(0.0, 0, 0, 8.0));
	
	
	errorImage = new ImageView(Images.EXCLAMATION.getImage());
	errorImage.setFitWidth(12.0);
	errorImage.setFitHeight(12.0);
	errorImage.setVisible(false);
	errorImage.setTranslateX(-1.0);
	sp.getChildren().add(errorImage);
	StackPane.setAlignment(errorImage, Pos.TOP_LEFT);
	StackPane.setMargin(errorImage, new Insets(5.0, 0, 0, 0));

	tt = new Tooltip("");
	Tooltip.install(errorImage, tt);
	
	pi = new ProgressIndicator(-1.0);
	//note, can't get it any smaller than ~22 for some reason, hence, the scaling - but there is a bug in javafx, and it still thinks its bounds is 22, so have to have the row 22.
	pi.setMaxWidth(22.0);
	pi.setMaxHeight(22.0);
	pi.setVisible(false);
	pi.setMouseTransparent(true);
	pi.setScaleX(.5); 
	pi.setScaleY(.5);
	pi.setTranslateX(-6.0);
	sp.getChildren().add(pi);
	StackPane.setAlignment(pi, Pos.TOP_LEFT);
	
	//Need to do some subtle adjustments when the cell is tall, vs default size.
	content.heightProperty().addListener(new InvalidationListener()
	{
		@Override
		public void invalidated(Observable observable)
		{
			if (content.getHeight() <= 22)
			{
				StackPane.setMargin(errorImage, new Insets(5.0, 0, 0, 0));
				pi.setTranslateY(0.0);
			}
			else
			{
				StackPane.setMargin(errorImage, new Insets(2.0, 0, 0, 0));
				pi.setTranslateY(-3.0);
			}
			
		}
	});
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:61,代码来源:LegoTreeNodeGraphic.java


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