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


Java DoubleStringConverter类代码示例

本文整理汇总了Java中javafx.util.converter.DoubleStringConverter的典型用法代码示例。如果您正苦于以下问题:Java DoubleStringConverter类的具体用法?Java DoubleStringConverter怎么用?Java DoubleStringConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: initializeTable

import javafx.util.converter.DoubleStringConverter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void initializeTable () {
    this.setEditable(true);
    this.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    
    TableColumn<IVariable, String> nameColumn = new TableColumn<IVariable, String>("Name");
    TableColumn<IVariable, Double> valueColumn = new TableColumn<IVariable, Double>("Value");
    
    // set where to read values from
    nameColumn.setCellValueFactory(new PropertyValueFactory<IVariable, String>("name"));
    valueColumn.setCellValueFactory(new PropertyValueFactory<IVariable, Double>("value"));
    
    // set editable column (valueColumn)
    valueColumn.setCellFactory(TextFieldTableCell
            .<IVariable, Double> forTableColumn(new DoubleStringConverter()));
    
    // Set listener to execute when on edit commit runs
    valueColumn.setOnEditCommit( (CellEditEvent<IVariable, Double> event) -> setVariableValue(event));
    valueColumn.setEditable(true);

    this.getColumns().addAll(nameColumn, valueColumn);
}
 
开发者ID:adisrini,项目名称:slogo,代码行数:23,代码来源:Variables.java

示例2: initializeTable

import javafx.util.converter.DoubleStringConverter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void initializeTable () {
    this.setEditable(true);
    this.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    
    TableColumn<Object, String> nameColumn = new TableColumn<Object, String>("Name");
    TableColumn<Object, Double> valueColumn = new TableColumn<Object, Double>("Value");
    
    // set where to read values from
    nameColumn.setCellValueFactory(new PropertyValueFactory<Object, String>("name"));
    valueColumn.setCellValueFactory(new PropertyValueFactory<Object, Double>("value"));
    
    // set editable column (valueColumn)
    valueColumn.setCellFactory(TextFieldTableCell.<Object, Double> forTableColumn(new DoubleStringConverter()));
    
    // Set listener to execute when on edit commit runs
    valueColumn.setOnEditCommit( (CellEditEvent<Object, Double> event) -> setVariableValue(event));
    valueColumn.setEditable(true);

    this.getColumns().addAll(nameColumn, valueColumn);
}
 
开发者ID:adisrini,项目名称:slogo,代码行数:22,代码来源:TableWindow.java

示例3: makeInteractivity

import javafx.util.converter.DoubleStringConverter; //导入依赖的package包/类
protected void makeInteractivity() {
	// default field values and format
	postOfficeStreet.setText(PathController.getWalkingPO().getStreet());
	postOfficeCity.setText(PathController.getWalkingPO().getCity());
	maxTime.setTextFormatter(new TextFormatter<Double>(new DoubleStringConverter(), PathController.getMaxTime()));

	// genBtn disabled state
	genBtn.setDisable(postOfficeStreet.getLength() == 0 || postOfficeCity.getLength() == 0 || maxTime.getLength() == 0);
	postOfficeStreet.setOnKeyReleased(e -> {
		genBtn.setDisable(postOfficeStreet.getLength() == 0 || postOfficeCity.getLength() == 0 || maxTime.getLength() == 0);
	});
	postOfficeCity.setOnKeyReleased(e -> {
		genBtn.setDisable(postOfficeStreet.getLength() == 0 || postOfficeCity.getLength() == 0 || maxTime.getLength() == 0);
	});
	maxTime.setOnKeyReleased(e -> {
		genBtn.setDisable(postOfficeStreet.getLength() == 0 || postOfficeCity.getLength() == 0 || maxTime.getLength() == 0);
	});

	// genBtn action
	genBtn.setOnAction(e -> {
		PathController.setPostOffice(new Shipment(postOfficeStreet.getText(), postOfficeCity.getText(), false));
		PathController.setMaxTime(Double.parseDouble(maxTime.getText()));
		PathController.generate();
		PathController.display();
	});

	// wView config
	wView.getEngine().load("https://www.google.fr/maps");
}
 
开发者ID:teamOtee,项目名称:x-facteur,代码行数:30,代码来源:MapView.java

示例4: createVisualisation

import javafx.util.converter.DoubleStringConverter; //导入依赖的package包/类
@Override
public Node createVisualisation(SimpleObjectProperty<Double> boundTo, boolean readonly) {
    TextField textField = new TextField();
    TypedTextFieldHelper.setupDoubleTextField(textField);
    textField.textProperty().bindBidirectional(boundTo, new DoubleStringConverter());
    textField.setEditable(!readonly);
    return textField;
}
 
开发者ID:factoryfx,项目名称:factoryfx,代码行数:9,代码来源:DoubleAttributeVisualisation.java

示例5: buildOptionPane

import javafx.util.converter.DoubleStringConverter; //导入依赖的package包/类
/**
 * Create a block of niche options - specifically International Dateline cropping and whether
 * there should be a graticule
 * @param cropAtIDL The mutable boolean value to which to bind the "Crop at Dateline" CheckBox
 * @param graticule The mutable double value to which to bind the "Graticule" Spinner
 * @return the full formatted Region
 */
protected Region buildOptionPane(Flag cropAtIDL, MutableDouble graticule) {
	final CheckBox cropBox = new CheckBox("Crop at International Dateline"); //the CheckBox for whether there should be shown imagery outside the International Dateline
	cropBox.setSelected(cropAtIDL.isSet());
	cropBox.setTooltip(new Tooltip("Show every point exactly once."));
	cropBox.selectedProperty().addListener((observable, old, now) -> {
			cropAtIDL.set(now);
		});
	
	final ObservableList<Double> factorsOf90 = FXCollections.observableArrayList();
	for (double f = 1; f <= 90; f += 0.5)
		if (90%f == 0)
			factorsOf90.add((double)f);
	final Spinner<Double> gratSpinner = new Spinner<Double>(factorsOf90); //spinner for the graticule value
	gratSpinner.getValueFactory().setConverter(new DoubleStringConverter());
	gratSpinner.getValueFactory().setValue(graticule.get());
	gratSpinner.setDisable(graticule.isZero());
	gratSpinner.setEditable(true);
	gratSpinner.setTooltip(new Tooltip("The spacing in degrees between shown parallels and meridians."));
	gratSpinner.setPrefWidth(SPINNER_WIDTH);
	gratSpinner.valueProperty().addListener((observable, old, now) -> {
			graticule.set(now); //which is tied to the mutable graticule spacing variable
		});
	
	final CheckBox gratBox = new CheckBox("Graticule: "); //the CheckBox for whether there should be a graticule
	gratBox.setSelected(!graticule.isZero());
	gratBox.setTooltip(new Tooltip("Overlay a mesh of parallels and meridians."));
	gratBox.selectedProperty().addListener((observable, old, now) -> {
			if (now)
				graticule.set(gratSpinner.getValue()); //set the value of graticule appropriately when checked
			else
				graticule.set(0); //when not checked, represent "no graticule" as a spacing of 0
			gratSpinner.setDisable(!now); //disable the graticule Spinner when appropriate
		});
	
	final HBox gratRow = new HBox(H_SPACE, gratBox, gratSpinner);
	gratRow.setAlignment(Pos.CENTER_LEFT);
	return new VBox(V_SPACE, cropBox, gratRow);
}
 
开发者ID:jkunimune15,项目名称:Map-Projections,代码行数:46,代码来源:MapApplication.java

示例6: initialize

import javafx.util.converter.DoubleStringConverter; //导入依赖的package包/类
public void initialize(URL location, ResourceBundle resources) {
    wrapAt.textProperty().bindBidirectional(responsiveFieldset.wrapWidthProperty(), new DoubleStringConverter());
}
 
开发者ID:edvin,项目名称:tornadofx-controls,代码行数:4,代码来源:FormFxmlDemo.java


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