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


Java PropertySheet.Item方法代码示例

本文整理汇总了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();
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:25,代码来源:PropertySheetSkin.java

示例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;
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:19,代码来源:ParameterEditorFactory.java

示例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);

  }
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:19,代码来源:NumOfThreadsEditor.java

示例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;
  }

}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:24,代码来源:StringEditor.java

示例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);
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:20,代码来源:IntegerRangeEditor.java

示例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);
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:20,代码来源:MZRangeEditor.java

示例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);
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:22,代码来源:ToggleEditor.java

示例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);
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:26,代码来源:MZToleranceEditor.java

示例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);
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:19,代码来源:RTToleranceEditor.java

示例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);
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:24,代码来源:DoubleRangeEditor.java

示例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();
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:28,代码来源:PropertySheetDemo.java

示例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);
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:8,代码来源:PropertySheetSkin.java

示例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++;
    }

}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:39,代码来源:PropertySheetSkin.java

示例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);
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:8,代码来源:SysstringPropertyEditor.java

示例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);
    }
  });

}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:41,代码来源:FileNameEditor.java


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