當前位置: 首頁>>代碼示例>>Java>>正文


Java Slider.setPrefSize方法代碼示例

本文整理匯總了Java中javafx.scene.control.Slider.setPrefSize方法的典型用法代碼示例。如果您正苦於以下問題:Java Slider.setPrefSize方法的具體用法?Java Slider.setPrefSize怎麽用?Java Slider.setPrefSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.Slider的用法示例。


在下文中一共展示了Slider.setPrefSize方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSlider

import javafx.scene.control.Slider; //導入方法依賴的package包/類
protected Slider createSlider(double min, double max, boolean vertical) {
    Slider slider = createSliderNoSizes(min, max, vertical);
    slider.setPrefSize(SLOT_WIDTH, SLOT_HEIGHT);
    slider.setMaxSize(SLOT_WIDTH, SLOT_HEIGHT);
    slider.setMinSize(SLOT_WIDTH, SLOT_HEIGHT);
    return slider;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:8,代碼來源:SliderApp.java

示例2: buildRoadPanel

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildRoadPanel() {
	roadAttributes = new VBox();

	roadColorLabel = new Label("Color");
	roadColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));

	roadColorPicker = new ColorPicker();
	roadColorPicker.setValue(Color.BLACK);

	roadWidthLabel = new Label("Pixel Width : ");
	roadWidthLabel.setAlignment(Pos.CENTER);
	roadWidthLabel.setPrefSize(202, 17.0); 
	roadWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));

	roadWidthSlider = new Slider();
	roadWidthSlider.setBlockIncrement(3);
	roadWidthSlider.setPrefSize(202, 5.0); 

	roadAttributes.getChildren().addAll(roadColorLabel, roadColorPicker, roadWidthLabel, roadWidthSlider);

   	road = new TitledPane("Road", roadAttributes);
   	road.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
   	road.prefWidthProperty().bind(widthProperty());
   	road.setExpanded(false);

       roadWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
       	roadWidthLabel.setText("Pixel Width : " + t1.intValue());
       });
	
}
 
開發者ID:sanke69,項目名稱:eDigitalWorld,代碼行數:31,代碼來源:RightPanel.java

示例3: buildBuildingPanel

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildBuildingPanel() {
	buildingAttributes = new VBox();

	buildingColorLabel = new Label("Color");
	buildingColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));

	buildingColorPicker = new ColorPicker();
	buildingColorPicker.setValue(Color.BLACK);

	buildingWidthLabel = new Label("Pixel Width : ");
	buildingWidthLabel.setAlignment(Pos.CENTER);
	buildingWidthLabel.setPrefSize(202, 17.0); 
	buildingWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));

	buildingWidthSlider = new Slider();
	buildingWidthSlider.setBlockIncrement(3);
	buildingWidthSlider.setPrefSize(202, 5.0); 

	buildingAttributes.getChildren().addAll(buildingColorLabel, buildingColorPicker, buildingWidthLabel, buildingWidthSlider);

   	building = new TitledPane("Buildings", buildingAttributes);
   	building.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
   	building.prefWidthProperty().bind(widthProperty());
   	building.setExpanded(false);

   	buildingWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
       	buildingWidthLabel.setText("Pixel Width : " + t1.intValue());
       });
}
 
開發者ID:sanke69,項目名稱:eDigitalWorld,代碼行數:30,代碼來源:RightPanel.java

示例4: buildReliefPanel

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildReliefPanel() {
	reliefAttributes = new VBox();

	reliefColorLabel = new Label("Color");
	reliefColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));

	reliefColorPicker = new ColorPicker();
	reliefColorPicker.setValue(Color.BLACK);

	reliefWidthLabel = new Label("Pixel Width : ");
	reliefWidthLabel.setAlignment(Pos.CENTER);
	reliefWidthLabel.setPrefSize(202, 17.0); 
	reliefWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));

	reliefWidthSlider = new Slider();
	reliefWidthSlider.setBlockIncrement(3);
	reliefWidthSlider.setPrefSize(202, 5.0); 

	reliefAttributes.getChildren().addAll(reliefColorLabel, reliefColorPicker, reliefWidthLabel, reliefWidthSlider);

   	relief = new TitledPane("Reliefs", reliefAttributes);
   	relief.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
   	relief.prefWidthProperty().bind(widthProperty());
   	relief.setExpanded(false);

   	reliefWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
   		reliefWidthLabel.setText("Pixel Width : " + t1.intValue());
       });
}
 
開發者ID:sanke69,項目名稱:eDigitalWorld,代碼行數:30,代碼來源:RightPanel.java

示例5: buildPOIPanel

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildPOIPanel() {
	poiAttributes = new VBox();

	poiColorLabel = new Label("Color");
	poiColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));

	poiColorPicker = new ColorPicker();
	poiColorPicker.setValue(Color.BLACK);

	poiWidthLabel = new Label("Pixel Width : ");
	poiWidthLabel.setAlignment(Pos.CENTER);
	poiWidthLabel.setPrefSize(202, 17.0); 
	poiWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));

	poiWidthSlider = new Slider();
	poiWidthSlider.setBlockIncrement(3);
	poiWidthSlider.setPrefSize(202, 5.0); 

	poiAttributes.getChildren().addAll(poiColorLabel, poiColorPicker, poiWidthLabel, poiWidthSlider);

   	poi = new TitledPane("POI", poiAttributes);
   	poi.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
   	poi.prefWidthProperty().bind(widthProperty());
   	poi.setExpanded(false);

   	poiWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
   		poiWidthLabel.setText("Pixel Width : " + t1.intValue());
       });
}
 
開發者ID:sanke69,項目名稱:eDigitalWorld,代碼行數:30,代碼來源:RightPanel.java

示例6: buildROIPanel

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildROIPanel() {
	roiAttributes = new VBox();

	roiColorLabel = new Label("Color");
	roiColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));

	roiColorPicker = new ColorPicker();
	roiColorPicker.setValue(Color.BLACK);

	roiWidthLabel = new Label("Pixel Width : ");
	roiWidthLabel.setAlignment(Pos.CENTER);
	roiWidthLabel.setPrefSize(202, 17.0); 
	roiWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));

	roiWidthSlider = new Slider();
	roiWidthSlider.setBlockIncrement(3);
	roiWidthSlider.setPrefSize(202, 5.0); 

	roiAttributes.getChildren().addAll(roiColorLabel, roiColorPicker, roiWidthLabel, roiWidthSlider);

   	roi = new TitledPane("ROI", roiAttributes);
   	roi.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
   	roi.prefWidthProperty().bind(widthProperty());
   	roi.setExpanded(false);

   	roiWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
   		roiWidthLabel.setText("Pixel Width : " + t1.intValue());
       });
}
 
開發者ID:sanke69,項目名稱:eDigitalWorld,代碼行數:30,代碼來源:RightPanel.java


注:本文中的javafx.scene.control.Slider.setPrefSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。