Java 类javafx.beans.property.SimpleObjectProperty 实例源码

项目:fxutils    文件:FXLocalization.java   
/**
 * 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));
}
项目:OneClient    文件:UpdateDialog.java   
@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);
}
项目:hygene    文件:QueryTest.java   
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);
}
项目:CSS-Editor-FX    文件:MainFrameController.java   
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);
}
项目:CSS-Editor-FX    文件:SimpleOption.java   
SimpleOption(T defaultValue, String describe) {
  this.property = new SimpleObjectProperty<>();
  this.defaultValue = defaultValue;
  this.describe = describe;

  property.setValue(defaultValue);
}
项目:MineIDE    文件:WizardStepBuilder.java   
@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;
}
项目:JavaFX-EX    文件:BeanUtil.java   
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;
}
项目:CSS-Editor-FX    文件:OptionsController.java   
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))));
  }
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
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);
}
项目:can4eve    文件:CANPropertyManager.java   
/**
 * 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);
}
项目:stvs    文件:ConstraintSpecificationValidatorTest.java   
@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)));
}
项目:ScrabbleGame    文件:Scrabble.java   
/**
 * 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();
}
项目:H-Uppaal    文件:ComponentController.java   
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());
}
项目:Squid    文件:RunsViewModel.java   
public ReadOnlyObjectProperty<ObservableList<PrawnFile.Run>> shrimpRunsProperty() {
    return new SimpleObjectProperty<>(shrimpRuns);
}
项目:charts    文件:PixelMatrixBuilder.java   
public final B pixelOnColor(final Color COLOR) {
    properties.put("pixelOnColor", new SimpleObjectProperty(COLOR));
    return (B)this;
}
项目:worldheatmap    文件:WorldBuilder.java   
public final B maxSize(final double WIDTH, final double HEIGHT) {
    properties.put("maxSize", new SimpleObjectProperty<>(new Dimension2D(WIDTH, HEIGHT)));
    return (B)this;
}
项目:charts    文件:AxisBuilder.java   
public final B zoneId(final ZoneId  ID) {
    properties.put("zoneId", new SimpleObjectProperty<>(ID));
    return (B)this;
}
项目:charts    文件:WorldBuilder.java   
public final B strokeColor(final Color COLOR) {
    properties.put("strokeColor", new SimpleObjectProperty<>(COLOR));
    return (B)this;
}
项目:hygene    文件:GraphDimensionsCalculator.java   
/**
 * Create a new instance of {@link GraphDimensionsCalculator}.
 *
 * @param graphStore the {@link GraphStore} who's {@link org.dnacronym.hygene.parser.GfaFile} is observed
 */
@Inject
@SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops", "squid:S1188", "squid:S3776"})
public GraphDimensionsCalculator(final GraphStore graphStore) {
    observableQueryNodes = FXCollections.observableArrayList();
    readOnlyObservableNodes = new ReadOnlyListWrapper<>(observableQueryNodes);

    centerNodeIdProperty = new SimpleIntegerProperty(1);
    radiusProperty = new SimpleIntegerProperty(DEFAULT_RADIUS);

    nodeCountProperty = new SimpleIntegerProperty(1);

    centerNodeIdProperty.addListener((observable, oldValue, newValue) -> {
        if (newValue.intValue() < 1) {
            centerNodeIdProperty.set(1);
            return;
        }
        if (newValue.intValue() >= getNodeCountProperty().intValue() - 1) {
            centerNodeIdProperty.set(nodeCountProperty.intValue() - 2);
            return;
        }

        centerPointQuery.query(centerNodeIdProperty.get(), radiusProperty.get());
    });
    radiusProperty.addListener((observable, oldValue, newValue) -> {
        if (centerPointQuery == null) {
            return;
        }
        centerPointQuery.query(centerNodeIdProperty.get(), radiusProperty.get());
    });

    viewPointProperty = new SimpleLongProperty(2000);
    viewPointProperty.addListener((observable, oldValue, newValue) -> {
        if (newValue.longValue() < 0) {
            viewPointProperty.set(0);
            return;
        }
        final int sentinelId = getGraphProperty().get().getNodeArrays().length - 1;
        final long sentinelEndPosition = getGraphProperty().get().getRealEndXPosition(sentinelId);
        if (newValue.longValue() > sentinelEndPosition) {
            viewPointProperty.set(sentinelEndPosition);
            return;
        }

        centerNodeIdProperty.set(getGraphProperty().get().getNodeAtPosition(newValue.longValue()));
        calculate(subgraph);
    });
    viewRadiusProperty = new SimpleIntegerProperty(1);
    viewRadiusProperty.addListener((observable, oldValue, newValue) -> {
        calculate(subgraph);
        radiusProperty.set(((newValue.intValue() + FafospLayerer.LAYER_WIDTH - 1)
                / FafospLayerer.LAYER_WIDTH) / 2);
    });

    nodeHeightProperty = new SimpleDoubleProperty(1);
    laneHeightProperty = new SimpleDoubleProperty(1);
    laneCountProperty = new SimpleIntegerProperty(1);

    graphProperty = new SimpleObjectProperty<>();
    graphStore.getGfaFileProperty().addListener((observable, oldValue, newValue) -> setGraph(newValue.getGraph()));

    HygeneEventBus.getInstance().register(this);
}
项目:charts    文件:GridBuilder.java   
public final B padding(final Insets INSETS) {
    properties.put("padding", new SimpleObjectProperty<>(INSETS));
    return (B)this;
}
项目:charts    文件:MatrixItemSeriesBuilder.java   
public final B items(final MatrixItem... ITEMS) {
    properties.put("itemsArray", new SimpleObjectProperty<>(ITEMS));
    return (B)this;
}
项目:H-Uppaal    文件:FilePresentation.java   
public SimpleObjectProperty<Component> componentProperty() {
    return component;
}
项目:charts    文件:AxisBuilder.java   
public final B locale(final Locale LOCALE) {
    properties.put("locale", new SimpleObjectProperty<>(LOCALE));
    return (B)this;
}
项目:charts    文件:AreaHeatMapBuilder.java   
public final B colorMapping(final ColorMapping COLOR_MAPPING) {
    properties.put("colorMapping", new SimpleObjectProperty<>(COLOR_MAPPING));
    return (B)this;
}
项目:charts    文件:XYSeriesBuilder.java   
public final B items(final XYItem... ITEMS) {
    properties.put("itemsArray", new SimpleObjectProperty<>(ITEMS));
    return (B)this;
}
项目:worldheatmap    文件:WorldBuilder.java   
public final B prefSize(final double WIDTH, final double HEIGHT) {
    properties.put("prefSize", new SimpleObjectProperty<>(new Dimension2D(WIDTH, HEIGHT)));
    return (B)this;
}
项目:charts    文件:XYZSeriesBuilder.java   
public final B chartType(final ChartType TYPE) {
    properties.put("chartType", new SimpleObjectProperty<>(TYPE));
    return (B)this;
}
项目:charts    文件:StreamChartBuilder.java   
public final B category(final Category CATEGORY) {
    properties.put("category", new SimpleObjectProperty<>(CATEGORY));
    return (B)this;
}
项目:SunburstChart    文件:SunburstChartBuilder.java   
public final B brightTextColor(final Color COLOR) {
    properties.put("brightTextColor", new SimpleObjectProperty(COLOR));
    return (B)this;
}
项目:charts    文件:WorldBuilder.java   
public final B pressedColor(final Color COLOR) {
    properties.put("pressedColor", new SimpleObjectProperty<>(COLOR));
    return (B)this;
}
项目:charts    文件:ChartItemBuilder.java   
public final B stroke(final Color COLOR) {
    properties.put("stroke", new SimpleObjectProperty(COLOR));
    return (B)this;
}
项目:charts    文件:AxisBuilder.java   
public final B tickLabelFormat(final TickLabelFormat FORMAT) {
    properties.put("tickLabelFormat", new SimpleObjectProperty<>(FORMAT));
    return (B)this;
}
项目:charts    文件:SankeyPlotBuilder.java   
public final B streamFillMode(final StreamFillMode MODE) {
    properties.put("streamFillMode", new SimpleObjectProperty<>(MODE));
    return (B)this;
}
项目:worldheatmap    文件:WorldBuilder.java   
public final B mousePressHandler(final EventHandler<MouseEvent> HANDLER) {
    properties.put("mousePressHandler", new SimpleObjectProperty(HANDLER));
    return (B)this;
}
项目:charts    文件:SankeyPlotBuilder.java   
public final B streamColor(final Color COLOR) {
    properties.put("streamColor", new SimpleObjectProperty(COLOR));
    return (B)this;
}
项目:charts    文件:PixelMatrixBuilder.java   
public final B pixelOffColor(final Color COLOR) {
    properties.put("pixelOffColor", new SimpleObjectProperty(COLOR));
    return (B)this;
}
项目:charts    文件:XYZSeriesBuilder.java   
public final B items(final XYZItem... ITEMS) {
    properties.put("itemsArray", new SimpleObjectProperty<>(ITEMS));
    return (B)this;
}
项目:SunburstChart    文件:ChartDataBuilder.java   
public final B textColor(final Color COLOR) {
    properties.put("textColor", new SimpleObjectProperty<>(COLOR));
    return (B)this;
}
项目:charts    文件:XYZSeriesBuilder.java   
public final B symbolFill(final Color FILL) {
    properties.put("symbolFill", new SimpleObjectProperty<>(FILL));
    return (B)this;
}
项目:charts    文件:NestedBarChartBuilder.java   
public final B maxSize(final double WIDTH, final double HEIGHT) {
    properties.put("maxSize", new SimpleObjectProperty<>(new Dimension2D(WIDTH, HEIGHT)));
    return (B)this;
}