本文整理汇总了Java中org.controlsfx.control.PropertySheet.Item方法的典型用法代码示例。如果您正苦于以下问题:Java PropertySheet.Item方法的具体用法?Java PropertySheet.Item怎么用?Java PropertySheet.Item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.controlsfx.control.PropertySheet
的用法示例。
在下文中一共展示了PropertySheet.Item方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private Node getEditor(PropertySheet.Item item) {
PropertyEditor editor = getSkinnable().getPropertyEditorFactory().call(item);
if (editor == null) {
editor = new AbstractPropertyEditor<Object, TextField>(item, new TextField(), true) {
{
getEditor().setEditable(false);
getEditor().setDisable(true);
}
@Override
protected ObservableValue getObservableValue() {
return getEditor().textProperty();
}
@Override
public void setValue(Object value) {
getEditor().setText(value == null ? "" : value.toString());
}
};
}
editor.setValue(item.getValue());
return editor.getEditor();
}
示例2: call
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
@Override
public PropertyEditor<?> call(PropertySheet.Item item) {
if (!(item instanceof Parameter))
throw new IllegalArgumentException(
"This ParameterEditorFactory can be only used for Parameter instances");
PropertyEditor<?> editor = super.call(item);
// Save the reference for the editor
editorsMap.put(item, editor);
if (editor instanceof ParameterEditor) {
addValidator(validationSupport, (Parameter<?>) item, (ParameterEditor<?>) editor);
}
return editor;
}
示例3: NumOfThreadsEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public NumOfThreadsEditor(PropertySheet.Item parameter) {
// HBox properties
setSpacing(10);
setAlignment(Pos.CENTER_LEFT);
numField = new SpinnerAutoCommit<>(1, 999999, 4);
numField.setPrefWidth(80.0);
numField.setEditable(true);
optionCombo = new ComboBox<>(options);
optionCombo.setOnAction(e -> {
numField.setVisible(optionCombo.getSelectionModel().getSelectedIndex() == 1);
});
getChildren().addAll(optionCombo, numField);
}
示例4: StringEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public StringEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof StringParameter))
throw new IllegalArgumentException();
this.stringParameter = (StringParameter) parameter;
// The text field
this.textField = new TextField();
setCenter(textField);
// The Add button
EventHandler<ActionEvent> autoSetAction = stringParameter.getAutoSetAction();
if (autoSetAction != null) {
autoButton = new Button("Auto");
setRight(autoButton);
setMargin(autoButton, new Insets(0, 0, 0, 10.0));
autoButton.setOnAction(autoSetAction);
autoButton.setFocusTraversable(false);
} else {
autoButton = null;
}
}
示例5: IntegerRangeEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public IntegerRangeEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof IntegerRangeParameter))
throw new IllegalArgumentException();
// The minimum value field
minTxtField = new TextField();
// The separator label
Label separatorLabel = new Label("-");
// The maximum value field
maxTxtField = new TextField();
// Spacing setting
setSpacing(10);
// Add the elements
getChildren().addAll(minTxtField, separatorLabel, maxTxtField);
}
示例6: MZRangeEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public MZRangeEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof MZRangeParameter))
throw new IllegalArgumentException();
// The minimum value field
minTxtField = new TextField();
// The separator label
Label separatorLabel = new Label("-");
// The maximum value field
maxTxtField = new TextField();
// Spacing setting
setSpacing(10);
// Add the elements
getChildren().addAll(minTxtField, separatorLabel, maxTxtField);
}
示例7: ToggleEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public ToggleEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof ToggleParameter))
throw new IllegalArgumentException();
this.toggleParameter = (ToggleParameter<ValueType>) parameter;
// The segmented button
this.segmentedButton = new SegmentedButton();
segmentedButton.getStyleClass().add(SegmentedButton.STYLE_CLASS_DARK);
// The toggle buttons
toggleValues = this.toggleParameter.getToggleValues();
for (ValueType toggleValue : toggleValues) {
segmentedButton.getButtons().add(new ToggleButton(toggleValue.toString()));
}
// Default set to first choice
setValue(toggleValues.get(0));
setLeft(segmentedButton);
}
示例8: MZToleranceEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public MZToleranceEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof MZToleranceParameter))
throw new IllegalArgumentException();
// The m/z value field
fieldMZ = new TextField();
// The m/z label
Label mzLabel = new Label("m/z");
// The 'or' label
Label orLabel = new Label(" or ");
// The ppm value field
fieldPPM = new TextField();
// The m/z label
Label ppmLabel = new Label("ppm");
// FlowPane setting
setHgap(7);
// Add the elements
getChildren().addAll(fieldMZ, mzLabel, orLabel, fieldPPM, ppmLabel);
}
示例9: RTToleranceEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public RTToleranceEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof RTToleranceParameter))
throw new IllegalArgumentException();
// The value field
valueField = new TextField();
// The combo box
ObservableList<String> options =
FXCollections.observableArrayList("Absolute (sec)", "Relative (%)");
comboBox = new ComboBox<String>(options);
// FlowPane setting
setHgap(10);
// Add the elements
getChildren().addAll(valueField, comboBox);
}
示例10: DoubleRangeEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public DoubleRangeEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof DoubleRangeParameter))
throw new IllegalArgumentException();
// Get the number formatter
DoubleRangeParameter drp = (DoubleRangeParameter) parameter;
this.numberFormat = drp.getNumberFormat();
// The minimum value field
minTxtField = new TextField();
// The separator label
Label separatorLabel = new Label("-");
// The maximum value field
maxTxtField = new TextField();
// Spacing setting
setSpacing(10);
// Add the elements
getChildren().addAll(minTxtField, separatorLabel, maxTxtField);
}
示例11: start
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
Media media = new Media();
media.setAudioCodec("audio/aac");
media.setVideoCodec("video/mp4");
media.setCameraId("Tiburon");
media.setContainer("video/quicktime");
media.setDescription("");
media.setFrameRate(30D);
media.setHeight(1080);
media.setWidth(1920);
media.setDuration(Duration.ofMillis(3030303));
media.setSha512(new byte[]{1, 2, 3});
media.setSizeBytes(345678L);
media.setStartTimestamp(Instant.now());
media.setUri(new URI("http://www.mbari.org"));
media.setVideoReferenceUuid(UUID.randomUUID());
media.setVideoSequenceName("Tiburon 20160606");
media.setVideoSequenceUuid(UUID.randomUUID());
media.setVideoUuid(UUID.randomUUID());
media.setVideoName("Tiburon 20160606T012345Z");
ObservableList<PropertySheet.Item> props = BeanPropertyUtils.getProperties(media);
PropertySheet ps = new PropertySheet(props);
Scene scene = new Scene(ps);
primaryStage.setScene(scene);
primaryStage.show();
}
示例12: PropertyPane
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public PropertyPane(List<PropertySheet.Item> properties, int nestingLevel) {
setVgap(5);
setHgap(5);
setPadding(new Insets(5, 15, 5, 15 + nestingLevel * 10));
getStyleClass().add("property-pane");
setItems(properties);
}
示例13: setItems
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public void setItems(List<PropertySheet.Item> properties) {
getChildren().clear();
int row = 0;
for (PropertySheet.Item item : properties) {
// filter properties
String title = item.getName();
// setup property label
Label label = new Label(title);
label.setTooltip(new Tooltip(item.getDescription()));
label.setMinWidth(MIN_COLUMN_WIDTH);
// show description as a tooltip
String description = item.getDescription();
if (description != null && !description.trim().isEmpty()) {
label.setTooltip(new Tooltip(description));
}
add(label, 0, row);
// setup property editor
Node editor = getEditor(item);
if (editor instanceof Region) {
((Region) editor).setMinWidth(MIN_COLUMN_WIDTH);
((Region) editor).setMaxWidth(Double.MAX_VALUE);
}
label.setLabelFor(editor);
add(editor, 1, row);
GridPane.setHgrow(editor, Priority.ALWAYS);
row++;
}
}
示例14: SysstringPropertyEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public SysstringPropertyEditor(PropertySheet.Item property) {
super(property, createTextField());
Tooltip tooltip = new Tooltip();
tooltip.textProperty().bind(Bindings.createStringBinding(() -> strings.containsKey(getValue()) ? strings.get(getValue()) : "", getObservableValue()));
getEditor().setTooltip(tooltip);
}
示例15: FileNameEditor
import org.controlsfx.control.PropertySheet; //导入方法依赖的package包/类
public FileNameEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof FileNameParameter))
throw new IllegalArgumentException();
this.fileNameParameter = (FileNameParameter) parameter;
// The text field
this.textField = new TextField();
setCenter(textField);
// The Browse button
browseButton = new Button("Browse");
browseButton.setFocusTraversable(false);
setRight(browseButton);
setMargin(browseButton, new Insets(0, 0, 0, 10.0));
browseButton.setOnAction(e -> {
List<FileChooser.ExtensionFilter> extensions = fileNameParameter.getExtensions();
FileChooser fileChooser = new FileChooser();
File lastOpenPath = fileNameParameter.getLastOpenPath();
if (lastOpenPath != null)
fileChooser.setInitialDirectory(lastOpenPath);
fileChooser.setTitle("Find file");
if (extensions != null) {
fileChooser.getExtensionFilters().addAll(extensions);
}
Window parentWindow = this.getScene().getWindow();
File selectedFile;
if (fileNameParameter.getFileNameParameterType() == FileNameParameter.Type.OPEN)
selectedFile = fileChooser.showOpenDialog(parentWindow);
else
selectedFile = fileChooser.showSaveDialog(parentWindow);
if (selectedFile != null) {
textField.setText(selectedFile.getPath());
File parentDir = selectedFile.getParentFile();
fileNameParameter.setLastOpenPath(parentDir);
}
});
}