本文整理汇总了Java中org.controlsfx.control.PropertySheet类的典型用法代码示例。如果您正苦于以下问题:Java PropertySheet类的具体用法?Java PropertySheet怎么用?Java PropertySheet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertySheet类属于org.controlsfx.control包,在下文中一共展示了PropertySheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.controlsfx.control.PropertySheet; //导入依赖的package包/类
@FXML
void initialize() {
Callback<Item, PropertyEditor<?>> oldFactory = propertySheet.getPropertyEditorFactory();
propertySheet.setPropertyEditorFactory(new Callback<PropertySheet.Item, PropertyEditor<?>>() {
@Override
public PropertyEditor<?> call(PropertySheet.Item item) {
if (item.getValue() instanceof Image) {
return ImagePropertyEditor.createImageEditor(item);
}
return oldFactory.call(item);
}
});
customCssArea.textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
if (newValue != null) {
getProject().setCss(newValue);
MainWindow.touch();
queuePreviewUpdate();
}
}
});
updateFields();
}
示例2: createTab
import org.controlsfx.control.PropertySheet; //导入依赖的package包/类
private Tab createTab(Field listField) {
Tab tab = new Tab(listField.getName());
SplitPane pane = new SplitPane();
TextField filter = TextFields.createClearableTextField();
VBox.setMargin(filter, new Insets(2));
TreeView<Object> elements = createTreeView(listField, filter.textProperty());
VBox.setVgrow(elements, Priority.ALWAYS);
PropertySheet properties = createPropertySheet(elements);
pane.getItems().addAll(new VBox(filter, elements), properties);
pane.setDividerPositions(0.3);
tab.setContent(wrap(pane));
return tab;
}
示例3: 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();
}
示例4: ParameterSheetView
import org.controlsfx.control.PropertySheet; //导入依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
public ParameterSheetView(ParameterSet parameters, ValidationSupport validationSupport) {
super((ObservableList) FXCollections.observableList(parameters.getParameters()));
this.parameters = parameters;
setModeSwitcherVisible(false);
setSearchBoxVisible(false);
setMode(PropertySheet.Mode.NAME);
setPrefSize(600.0, 400.0);
// Set editor factory to keep track of which editing component belongs
// to which parameter
this.editorFactory = new ParameterEditorFactory(validationSupport);
setPropertyEditorFactory(editorFactory);
}
示例5: 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;
}
示例6: PercentEditor
import org.controlsfx.control.PropertySheet; //导入依赖的package包/类
public PercentEditor(PropertySheet.Item parameter) {
if (!(parameter instanceof PercentParameter))
throw new IllegalArgumentException();
// The percent field
percentField = new TextField();
// The percent sign
Label signLabel = new Label("%");
// FlowPane setting
setHgap(10);
// Add the elements
getChildren().addAll(percentField, signLabel);
}
示例7: 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;
}
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例14: 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);
}
示例15: DataManipulationUI
import org.controlsfx.control.PropertySheet; //导入依赖的package包/类
public DataManipulationUI(){
StyleManager.getInstance().addUserAgentStylesheet(PropertySheet.class.getResource("propertysheet.css").toExternalForm());
// Initializing the main grid
grid = new GridPane();
grid.setPadding(new Insets(5,5,5,5));
// Adding separators
grid.add(new Text("Available datasets"),0,0);
grid.add(new Separator(),0,1);
grid.add(new Text("Import a dataset"),0,3);
grid.add(new Separator(),0,4);
grid.add(new Text("Preprocess the selected dataset"),0,6);
grid.add(new Separator(),0,7);
grid.add(new Text("Filter the selected preprocessed dataset"),0,9);
grid.add(new Separator(),0,10);
// Initializing specific UIs
availableDatasetsUI();
newDatasetProperties = new HashMap<>();
importUI();
preprocessUI();
filterUI();
}