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


Java SimpleObjectProperty类代码示例

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


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

示例1: UpdateDialog

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public UpdateDialog(List<CurseFullProject.CurseFile> files) {
	super(files);
	TableColumn<CurseFullProject.CurseFile, String> columnName = new TableColumn<>("Files");
	columnName.setCellValueFactory(cell -> new SimpleStringProperty(cell.getValue().getFileName()));

	TableColumn<CurseFullProject.CurseFile, String> columnVersion = new TableColumn<>("Version");
	columnVersion.setCellValueFactory(cell -> new SimpleStringProperty(cell.getValue().getGameVersion().stream().collect(Collectors.joining(", "))));
	TableColumn<CurseFullProject.CurseFile, Date> columnDate = new TableColumn<>("Release Date");
	columnDate.setCellValueFactory(cell -> new SimpleObjectProperty<>(cell.getValue().getDate()));

	table.getColumns().addAll(columnName, columnVersion, columnDate);

	setTitle("File Update Dialog");
	dialogPane.setHeaderText("Please Choose a File Version");
	dialogPane.getStyleClass().add("pack-update-dialog");
	dialogPane.getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:19,代码来源:UpdateDialog.java

示例2: FXLocalization

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
/**
 * Initializes an FXLocalization object that manages the resource bundle of your app for switching between languages.
 * See also {@link ResourceBundle}.
 * 
 * @param supportedLocales A list of the language locales supported by the client app.
 * @param basePath Base path used to load the resource bundles. 
 * @param classLoader Class loader used to load the resource bundles.
 */
public FXLocalization(List<Locale> supportedLocales, String basePath, ClassLoader classLoader) {
	if(supportedLocales.isEmpty())
		supportedLocales.add(Locale.getDefault());
	
	this.supportedLocales = supportedLocales;
	this.basePath = basePath;
	this.classLoader = classLoader;
	
	languageDisplayNames = supportedLocales.stream()
			.map(loc -> loc.getDisplayLanguage(loc).toUpperCase())
			.collect(Collectors.toList());
	
	locale = new SimpleObjectProperty<>(getDefaultLocale());
	locale.addListener((obs,o,n) -> Locale.setDefault(n));
}
 
开发者ID:vibridi,项目名称:fxutils,代码行数:24,代码来源:FXLocalization.java

示例3: beforeEach

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
public void beforeEach() {
    final GraphStore graphStore = mock(GraphStore.class);
    when(graphStore.getGfaFileProperty()).thenReturn(new SimpleObjectProperty<>());
    searchQuery = mock(SearchQuery.class);

    query = new Query(graphStore);
    query.setSearchQuery(searchQuery);
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:9,代码来源:QueryTest.java

示例4: TabEntity

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
TabEntity() {
  this.tab = new Tab();
  this.manager = new CodeAreaManager(new CodeArea());
  this.codeArea = manager.getCodeArea();
  this.file = new SimpleObjectProperty<>();
  this.name = new SimpleStringProperty();
  this.icon = new FontAwesomeIconView();
  this.order = new SimpleIntegerProperty(nameOrder.next());

  init();

  CacheUtil.cache(MainFrameController.this, tab, () -> this);
}
 
开发者ID:XDean,项目名称:CSS-Editor-FX,代码行数:14,代码来源:MainFrameController.java

示例5: SimpleOption

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
SimpleOption(T defaultValue, String describe) {
  this.property = new SimpleObjectProperty<>();
  this.defaultValue = defaultValue;
  this.describe = describe;

  property.setValue(defaultValue);
}
 
开发者ID:XDean,项目名称:CSS-Editor-FX,代码行数:8,代码来源:SimpleOption.java

示例6: addFileChooser

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public WizardStepBuilder addFileChooser(final String fieldName, final String fileChooseLabel, final String startDir,
        final FileChooser.ExtensionFilter... filters)
{
    final WizardStep current = this.current;
    final HBox box = new HBox();
    final JFXButton button = new JFXButton(fileChooseLabel);
    button.setStyle("-fx-text-fill: BLACK;-fx-font-size: 18px;-fx-opacity: 0.7;");
    final FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle(fileChooseLabel);
    fileChooser.setInitialDirectory(new File(startDir));
    fileChooser.getExtensionFilters().addAll(filters);
    this.current.getData().put(fieldName, new SimpleObjectProperty<File>());

    button.setOnAction(
            e -> current.getData().get(fieldName).setValue(fileChooser.showOpenDialog(MineIDE.primaryStage)));

    final Label label = new Label(fieldName);
    GridPane.setHalignment(label, HPos.RIGHT);
    GridPane.setHalignment(button, HPos.LEFT);
    this.current.add(label, 0, this.current.getData().size() - 1);

    final JFXTextField text = new JFXTextField();
    text.setEditable(false);
    this.current.getData().get(fieldName).addListener(
            (ChangeListener<File>) (observable, oldValue, newValue) -> text.setText(newValue.getAbsolutePath()));

    box.getChildren().addAll(text, button);
    this.current.add(box, 1, this.current.getData().size() - 1);
    return this;
}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:32,代码来源:WizardStepBuilder.java

示例7: nestValue

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
public static <F, T> ObservableValue<T> nestValue(ObservableValue<F> pf, Function<F, ObservableValue<T>> func) {
  ObservableValue<T> current = func.apply(pf.getValue());
  Property<T> nestProp = new SimpleObjectProperty<>();
  nestProp.bind(current);
  pf.addListener((ob, o, n) -> {
    ObservableValue<T> pt = func.apply(n);
    nestProp.unbind();
    nestProp.bind(pt);
  });
  return nestProp;
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:12,代码来源:BeanUtil.java

示例8: initKey

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
private void initKey() {
    commandColumn.setCellValueFactory(cdf -> new SimpleStringProperty(cdf.getValue().getDescribe()));
    bindingColumn.setCellValueFactory(cdf -> CacheUtil.cache(OptionsController.this,
        cdf.getValue(), () -> new SimpleObjectProperty<>(cdf.getValue().get())));
//    bindingColumn.setCellValueFactory(cdf -> new SimpleObjectProperty<>(cdf.getValue().get()));

    bindingColumn.setEditable(true);
    bindingColumn.setCellFactory(column -> new KeyEditField());

    keyTable.getItems().setAll(Options.KEY.getChildren(KeyCombination.class));
    onSubmit.add(() -> keyTable.getItems().forEach(key -> key.set(bindingColumn.getCellData(key))));
  }
 
开发者ID:XDean,项目名称:CSS-Editor-FX,代码行数:13,代码来源:OptionsController.java

示例9: AnimatedIcon

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
public AnimatedIcon() {
    iconFill = new SimpleObjectProperty<>(Color.ORANGE);

    line1 = new Line(4, 8, 28, 8);
    line1.setStrokeWidth(3);
    line1.strokeProperty().bind(iconFill);
    line1.setManaged(false);
    line1.setStrokeLineCap(StrokeLineCap.ROUND);

    line2 = new Line(4, 16, 28, 16);
    line2.setStrokeWidth(3);
    line2.strokeProperty().bind(iconFill);
    line2.setManaged(false);
    line2.setStrokeLineCap(StrokeLineCap.ROUND);

    line3 = new Line(4, 24, 28, 24);
    line3.setStrokeWidth(3);
    line3.strokeProperty().bind(iconFill);
    line3.setManaged(false);
    line3.setStrokeLineCap(StrokeLineCap.ROUND);

    getChildren().addAll(line1, line2, line3);
    setPrefWidth(32);
    setPrefHeight(32);
    setMinWidth(USE_PREF_SIZE);
    setMinHeight(USE_PREF_SIZE);
    setMaxWidth(USE_PREF_SIZE);
    setMaxHeight(USE_PREF_SIZE);
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:30,代码来源:AnimatedIcon.java

示例10: addCanProperty

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
/**
 * add the given property
 * 
 * @param canValue
 * @param property
 */
public <T> void addCanProperty(CANValue<T> canValue,
    SimpleObjectProperty<T> property) {
  CANProperty<CANValue<T>, T> canProperty = new CANProperty<CANValue<T>, T>(
      canValue, property);
  getCanProperties().put(canValue.canInfo.getName(), canProperty);
}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:13,代码来源:CANPropertyManager.java

示例11: testProblems

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
@Test
public void testProblems() {
  JsonElement testjson = JsonTableParser.jsonFromResource(testfile, ConstraintSpecificationValidatorTest.class);

  List<CodeIoVariable> codeIoVariables = JsonTableParser.codeIoVariablesFromJson(testjson);

  List<Type> typeContext = Arrays.asList(TypeInt.INT, TypeBool.BOOL);

  FreeVariableList freeVars = JsonTableParser.freeVariableSetFromJson(testjson);

  ConstraintSpecification testSpec =
      JsonTableParser.constraintTableFromJson(testjson);

  FreeVariableListValidator validator = new FreeVariableListValidator(
      new SimpleObjectProperty<>(typeContext),
      freeVars
  );

  ConstraintSpecificationValidator recognizer = new ConstraintSpecificationValidator(
      new SimpleObjectProperty<>(typeContext),
      new SimpleObjectProperty<>(codeIoVariables),
      validator.validFreeVariablesProperty(),
      testSpec
  );

  List<Class<?>> expectedProblems = JsonTableParser.expectedSpecProblemsFromJson(testjson);

  System.out.println("Expecting problems: " + expectedProblems.stream().map(Class::getSimpleName).collect(Collectors.toList()));

  System.out.println("Actual Problems: ");
  recognizer.problemsProperty().get().forEach(System.out::println);

  assertEquals("Problem list emptiness: ",
      expectedProblems.isEmpty(),
      recognizer.problemsProperty().get().isEmpty());
  assertTrue(
      expectedProblems.stream().allMatch(aClass ->
          recognizer.problemsProperty().get().stream().anyMatch(aClass::isInstance)));
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:40,代码来源:ConstraintSpecificationValidatorTest.java

示例12: initializeScrabbleGame

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
/**
 * Initializes the ScrabbleGame with all the needed information
 *
 * @param language The language to be used during the game
 * @param players  The players
 * @param bag      The bag
 * @param board    The board
 */
protected void initializeScrabbleGame(LanguageInterface language, List<PlayerInterface> players, PlayerInterface currentPlayer, BagInterface bag, BoardInterface board) {
    this.consecutiveTurnsSkipped = 0;
    this.language = language;
    this.board = board;
    this.players = new ArrayList<>(players);
    this.currentPlayer = new SimpleObjectProperty<>(currentPlayer);
    this.bag = bag;
    this.checkIfArtificialIntelligenceShouldPlay();
}
 
开发者ID:Chrisp1tv,项目名称:ScrabbleGame,代码行数:18,代码来源:Scrabble.java

示例13: toggleDeclaration

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
public void toggleDeclaration(final MouseEvent mouseEvent) {
    final Circle circle = new Circle(0);
    circle.setCenterX(component.get().getWidth() - (toggleDeclarationButton.getWidth() - mouseEvent.getX()));
    circle.setCenterY(-1 * mouseEvent.getY());

    final ObjectProperty<Node> clip = new SimpleObjectProperty<>(circle);
    declaration.clipProperty().bind(clip);

    final Transition rippleEffect = new Transition() {
        private final double maxRadius = Math.sqrt(Math.pow(getComponent().getWidth(), 2) + Math.pow(getComponent().getHeight(), 2));

        {
            setCycleDuration(Duration.millis(500));
        }

        protected void interpolate(final double fraction) {
            if (getComponent().isDeclarationOpen()) {
                circle.setRadius(fraction * maxRadius);
            } else {
                circle.setRadius(maxRadius - fraction * maxRadius);
            }
            clip.set(circle);
        }
    };

    final Interpolator interpolator = Interpolator.SPLINE(0.785, 0.135, 0.15, 0.86);
    rippleEffect.setInterpolator(interpolator);

    rippleEffect.play();
    getComponent().declarationOpenProperty().set(!getComponent().isDeclarationOpen());
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:32,代码来源:ComponentController.java

示例14: shrimpRunsProperty

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
public ReadOnlyObjectProperty<ObservableList<PrawnFile.Run>> shrimpRunsProperty() {
    return new SimpleObjectProperty<>(shrimpRuns);
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:4,代码来源:RunsViewModel.java

示例15: pixelOnColor

import javafx.beans.property.SimpleObjectProperty; //导入依赖的package包/类
public final B pixelOnColor(final Color COLOR) {
    properties.put("pixelOnColor", new SimpleObjectProperty(COLOR));
    return (B)this;
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:5,代码来源:PixelMatrixBuilder.java


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