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

项目:Capstone2016    文件:GluonMapLoadingService.java   
@Override
public ReadOnlyIntegerProperty preloadMapTiles(double minLatitude, double maxLatitude, double minLongitude, double maxLongitude) {
    ReadOnlyIntegerWrapper remainingCount = new ReadOnlyIntegerWrapper();
    int minX = getTileX(minLongitude, ZOOM);
    int maxX = getTileX(maxLongitude, ZOOM);
    int minY = getTileY(minLatitude, ZOOM);
    int maxY = getTileY(maxLatitude, ZOOM);
    int totalCount = (maxX-minX+1)*(maxY-minY+1);
    if (totalCount > MAX_TILES) {
        throw new IllegalArgumentException("The number of tiles required ("+totalCount+") is greater than the maximum allowed ("+MAX_TILES+")");
    }
    int remaining = 0;
    for (int x = minX; x <= maxX; x++) {
        for (int y = minY; y <= maxY; y++) {
            File f = getCacheFile(ZOOM, x, y);
            if (!f.exists()) {
                remaining++;
                fetchAndStoreTile(remainingCount, ZOOM, x, y);
            }
        }
    }
    remainingCount.set(remaining);
    return remainingCount;
}
项目:reduxfx    文件:TabPaneSelectionModelAccessor.java   
@SuppressWarnings("unchecked")
@Override
public void set(Consumer<Object> dispatcher, Object node, String name, VProperty vProperty) {
    if(! (node instanceof TabPane)) {
        throw new IllegalStateException("Trying to set selectionModel of node " + node);
    }

    final TabPane tabPane = (TabPane) node;

    final ReadOnlyIntegerProperty selectedIndexProperty = tabPane.getSelectionModel().selectedIndexProperty();

    clearListeners(node, selectedIndexProperty);

    if (vProperty.isValueDefined()) {
        tabPane.getSelectionModel().select((int) vProperty.getValue());
    }

    if(vProperty.getChangeListener().isDefined()) {
        setChangeListener(dispatcher, node, selectedIndexProperty, vProperty.getChangeListener().get());
    }

    if(vProperty.getInvalidationListener().isDefined()) {
        setInvalidationListener(dispatcher, node, selectedIndexProperty, vProperty.getInvalidationListener().get());
    }
}
项目:Tourney    文件:TournamentModuleEditorDialog.java   
private void bindPossibleScoringButtons() {
    ReadOnlyIntegerProperty selectedIndex = this.tablePossibleScores
            .getSelectionModel().selectedIndexProperty();
    ReadOnlyObjectProperty<PossibleScoring> selectedItem = this.tablePossibleScores
            .getSelectionModel().selectedItemProperty();

    // only enable move-up button if an item other than the topmost is
    // selected
    this.buttonMoveScoreUp.disableProperty().bind(
            selectedIndex.isEqualTo(0).or(selectedItem.isNull()));

    // only enable move-down button if an item other than the last one is
    // selected
    // index < size - 1 && selected != null
    this.buttonMoveScoreDown.disableProperty().bind(
            selectedIndex.greaterThanOrEqualTo(
                    Bindings.size(this.tablePossibleScores.getItems())
                            .subtract(1)).or(selectedItem.isNull()));

    // only enable remove button if an item is selected
    this.buttonRemoveScore.disableProperty().bind(selectedItem.isNull());

    // only enable edit button if an item is selected
    this.buttonEditScore.disableProperty().bind(selectedItem.isNull());
}
项目:afc    文件:Rectangle2ifxTest.java   
@Test
public void widthProperty() {
    assertEpsilonEquals(10, this.shape.getWidth());

    ReadOnlyIntegerProperty property = this.shape.widthProperty();
    assertNotNull(property);
    assertEpsilonEquals(10, property.get());

    this.shape.setMinX(7);
    assertEpsilonEquals(8, property.get());

    this.shape.setMinX(-5);
    assertEpsilonEquals(20, property.get());

    this.shape.setMaxX(0);
    assertEpsilonEquals(5, property.get());
}
项目:afc    文件:Rectangle2ifxTest.java   
@Test
public void heightProperty() {
    assertEpsilonEquals(5, this.shape.getHeight());

    ReadOnlyIntegerProperty property = this.shape.heightProperty();
    assertNotNull(property);
    assertEpsilonEquals(5, property.get());

    this.shape.setMinY(9);
    assertEpsilonEquals(4, property.get());

    this.shape.setMinY(-5);
    assertEpsilonEquals(18, property.get());

    this.shape.setMaxY(0);
    assertEpsilonEquals(5, property.get());
}
项目:afc    文件:RectangularPrism3ifxTest.java   
@Test
public void widthProperty() {
    assertEpsilonEquals(10, this.shape.getWidth());

    ReadOnlyIntegerProperty property = this.shape.widthProperty();
    assertNotNull(property);
    assertEpsilonEquals(10, property.get());

    this.shape.setMinX(7);
    assertEpsilonEquals(8, property.get());

    this.shape.setMinX(-5);
    assertEpsilonEquals(20, property.get());

    this.shape.setMaxX(0);
    assertEpsilonEquals(5, property.get());
}
项目:afc    文件:RectangularPrism3ifxTest.java   
@Test
public void heightProperty() {
    assertEpsilonEquals(5, this.shape.getHeight());

    ReadOnlyIntegerProperty property = this.shape.heightProperty();
    assertNotNull(property);
    assertEpsilonEquals(5, property.get());

    this.shape.setMinY(9);
    assertEpsilonEquals(4, property.get());

    this.shape.setMinY(-5);
    assertEpsilonEquals(18, property.get());

    this.shape.setMaxY(0);
    assertEpsilonEquals(5, property.get());
}
项目:Paradinc-FX    文件:Form.java   
public boolean validate() {
    boolean isValid = true;
    String emptyError = "Ce champ ne peut pas être vide";
    clearErrors();
    if(languageName.getText().isEmpty()){
        isValid = false;
        languageNameError.setText(emptyError);
    }
    if(Double.isNaN(robustness.getValue())) {
        isValid = false;
        robustnessError.setText(emptyError);
    }

    if(Double.isNaN(facility.getValue())) {
        isValid = false;
        facilityError.setText(emptyError);
    }

    ReadOnlyIntegerProperty platformIndex = platforms.getSelectionModel().selectedIndexProperty();
    if(platformIndex.get() == -1) {
        isValid = false;
        platformsError.setText(emptyError);
    }

    ReadOnlyIntegerProperty paradygmIndex = paradygmChoice.getSelectionModel().selectedIndexProperty();
    if(paradygmIndex.get() == -1){
        isValid = false;
        paraDygmeChoiceError.setText(emptyError);
    }

    return isValid;
}
项目:megan-ce    文件:LRInspectorController.java   
/**
 * create a horizontal axis
 *
 * @param maxReadLength
 * @return axis
 */
public static Pane createAxis(final ReadOnlyIntegerProperty maxReadLength, final ReadOnlyDoubleProperty widthProperty) {
    final Pane pane = new Pane();
    pane.prefWidthProperty().bind(widthProperty);

    final NumberAxis axis = new NumberAxis();
    axis.setSide(Side.TOP);
    axis.setAutoRanging(false);
    axis.setLowerBound(0);
    axis.prefHeightProperty().set(20);
    axis.prefWidthProperty().bind(widthProperty.subtract(60));

    final ChangeListener<Number> changeListener = new ChangeListener<Number>() {
        @Override
        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
            int minX = Math.round(maxReadLength.get() / 2000.0f); // at most 2000 major ticks
            for (int x = 10; x < 10000000; x *= 10) {
                if (x >= minX && widthProperty.doubleValue() * x >= 50 * maxReadLength.doubleValue()) {
                    axis.setUpperBound(maxReadLength.get());
                    axis.setTickUnit(x);
                    return;
                }
            }
            axis.setTickUnit(maxReadLength.get());
            axis.setUpperBound(maxReadLength.get());
        }
    };

    maxReadLength.addListener(changeListener);
    widthProperty.addListener(changeListener);

    pane.getChildren().add(axis);
    return pane;
}
项目:reduxfx    文件:ComponentDriver.java   
public ReadOnlyIntegerProperty createReadOnlyIntegerProperty(Object bean, String name) {
    Objects.requireNonNull(bean, BEAN_MUST_NOT_BE_NULL);
    Objects.requireNonNull(name, NAME_MUST_NOT_BE_NULL);

    final Publisher<IntegerChangedCommand> propertyPublisher =
            getIntegerChangedCommandFlowable().filter(command -> name.equals(command.getPropertyName()));
    return new ReduxFXReadOnlyIntegerProperty(bean, name, propertyPublisher);
}
项目:Tourney    文件:TournamentDialog.java   
/**
 * Adds listeners to the selection property of the tournament phase table to
 * dis-/enable table buttons accordingly
 */
private void bindTournamentPhaseTableButtons() {
    ReadOnlyIntegerProperty selectedIndex = this.tableTournamentPhases
            .getSelectionModel().selectedIndexProperty();
    ReadOnlyObjectProperty<GamePhase> selectedItem = this.tableTournamentPhases
            .getSelectionModel().selectedItemProperty();

    // only enable move-up button if an item other than the topmost is
    // selected
    this.buttonMoveTournamentPhaseUp.disableProperty().bind(
            selectedIndex.isEqualTo(0).or(selectedItem.isNull()));

    // only enable move-down button if an item other than the last
    // one is selected
    // index < size - 1 && selected != null
    this.buttonMoveTournamentPhaseDown.disableProperty().bind(
            selectedIndex.greaterThanOrEqualTo(
                    Bindings.size(this.tableTournamentPhases.getItems())
                            .subtract(1)).or(selectedItem.isNull()));

    // only enable remove button if an item is selected
    this.buttonRemoveTournamentPhase.disableProperty().bind(
            selectedItem.isNull());

    // only enable edit button if an item is selected
    this.buttonEditTournamentPhase.disableProperty().bind(
            selectedItem.isNull());
}
项目:Tourney    文件:TournamentDialog.java   
/**
 * Adds listeners to the selection property of the possible scores table to
 * dis-/enable table buttons accordingly
 */
private void bindPossibleScoresTableButtons() {
    ReadOnlyIntegerProperty selectedIndex = this.tablePossibleScores
            .getSelectionModel().selectedIndexProperty();
    ReadOnlyObjectProperty<PossibleScoring> selectedItem = this.tablePossibleScores
            .getSelectionModel().selectedItemProperty();

    // only enable move-up button if an item other than the topmost is
    // selected
    this.buttonMovePossibleScoreUp.disableProperty().bind(
            selectedIndex.isEqualTo(0).or(selectedItem.isNull()));

    // only enable move-down button if an item other than the last one is
    // selected
    // index < size - 1 && selected != null
    this.buttonMovePossibleScoreDown.disableProperty().bind(
            selectedIndex.greaterThanOrEqualTo(
                    Bindings.size(this.tablePossibleScores.getItems())
                            .subtract(1)).or(selectedItem.isNull()));

    // only enable remove button if an item is selected and there is more
    // than one possible score
    this.buttonRemovePossibleScore.disableProperty().bind(
            selectedItem.isNull());

    // only enable edit button if an item is selected
    this.buttonEditPossibleScore.disableProperty().bind(
            selectedItem.isNull());
}
项目:Tourney    文件:TournamentModuleEditorDialog.java   
private void bindTournamentPhaseButtons() {
    ReadOnlyIntegerProperty selectedPhaseIndex = this.tableTournamentPhases
            .getSelectionModel().selectedIndexProperty();
    ReadOnlyObjectProperty<GamePhase> selectedPhase = this.tableTournamentPhases
            .getSelectionModel().selectedItemProperty();

    // only enable move-up button if an item other than the topmost is
    // selected
    this.buttonMovePhaseUp.disableProperty().bind(
            selectedPhaseIndex.isEqualTo(0).or(selectedPhase.isNull()));

    // only enable move-down button if an item other than the last one is
    // selected
    // index < size - 1 && selected != null
    this.buttonMovePhaseDown.disableProperty().bind(
            selectedPhaseIndex.greaterThanOrEqualTo(
                    Bindings.size(this.tableTournamentPhases.getItems())
                            .subtract(1)).or(selectedPhase.isNull()));

    // only enable remove button if an item is selected
    this.buttonRemovePhase.disableProperty().bind(selectedPhase.isNull());

    // only enable edit button if an item is selected
    this.buttonEditPhase.disableProperty().bind(selectedPhase.isNull());

    // TODO: add bindings for the possible score table's buttons (see
    // TournamentDialog#loadTournament())
}
项目:assertj-javafx    文件:IntegerTest.java   
@Test
public void testReadOnlyIntegerProperty(){
    ReadOnlyIntegerProperty actual = new SimpleIntegerProperty(30);
    assertThat(actual).hasValue(30);

    assertThat(actual).hasSameValue(actual);
}
项目:structured-list    文件:Item.java   
Item(String id, String initText) {
      this.id = id;
      this.setText(initText);

      final ObservableList<ReadOnlyIntegerProperty> numbersOfAllSubItems = EasyBind.map(openSubItems, Item::recursiveNumberOfOpenSubItems);

      final ObservableValue<Number> sum = EasyBind.combine(numbersOfAllSubItems, stream -> stream.reduce(
              (a, b) ->
                      a.intValue() + b.intValue()).orElse(0));

      recursiveNumberOfOpenSubItems.bind(Bindings.size(openSubItems).add(asDouble(sum)));

      subItems.addListener((ListChangeListener<Item>) change -> {
          while (change.next()) {
              if (change.wasAdded()) {
                  change.getAddedSubList().forEach(item -> {
                    item.getParent().ifPresent(oldParent -> oldParent.removeSubItem(item));
                item.setParent(Item.this);
            });
              }

              if (change.wasRemoved()) {
                  change.getRemoved().forEach(item -> item.setParent(null));
              }
          }
      });


this.title.bind(Bindings.createStringBinding(() -> {
    final String text = getText() == null ? "" : getText();

    final String[] lines = text.split("\\r?\\n");

    if(lines.length > 0) {
        return lines[0];
    }
    return "";
}, this.text));
  }
项目:CalendarFX    文件:TimeRangeView.java   
public final ReadOnlyIntegerProperty unitsToPrintProperty() {
    return unitsToPrint.getReadOnlyProperty();
}
项目:CalendarFX    文件:PrintablePage.java   
public final ReadOnlyIntegerProperty pageNumberProperty() {
    return pageNumber.getReadOnlyProperty();
}
项目:CalendarFX    文件:PrintablePage.java   
public final ReadOnlyIntegerProperty totalPagesProperty() {
    return totalPages.getReadOnlyProperty();
}
项目:drd    文件:Vulnerability.java   
public ReadOnlyIntegerProperty vulnerabilityProperty() {
    return vulnerability;
}
项目:drd    文件:InventoryContent.java   
public static ReadOnlyIntegerProperty getWeight() {
    return WEIGHT.getReadOnlyProperty();
}
项目:ScrabbleGame    文件:HumanPlayer.java   
@Override
public ReadOnlyIntegerProperty availableHelpsProperty() {
    return IntegerProperty.readOnlyIntegerProperty(this.availableHelps);
}
项目:ScrabbleGame    文件:Player.java   
@Override
public ReadOnlyIntegerProperty scoreProperty() {
    return IntegerProperty.readOnlyIntegerProperty(this.score);
}
项目:FxEditor    文件:StyledTextPane.java   
public ReadOnlyIntegerProperty selectionIndexProperty()
{
    return selectionIndex.getReadOnlyProperty();
}
项目:javafx-tableview-performance    文件:AsObjectModel.java   
public ReadOnlyIntegerProperty anInt() {
    return anInt;
}
项目:Capstone2016    文件:Region.java   
public ReadOnlyIntegerProperty idProperty () {
    return idProperty.getReadOnlyProperty();
}
项目:Capstone2016    文件:Trap.java   
public ReadOnlyIntegerProperty idProperty() {
    return idProperty.getReadOnlyProperty();
}
项目:Capstone2016    文件:Trapline.java   
public ReadOnlyIntegerProperty idProperty () {
    return idProperty.getReadOnlyProperty();
}
项目:ReqTraq    文件:StyledTextPane.java   
public ReadOnlyIntegerProperty selectionIndexProperty()
{
    return selectionIndex.getReadOnlyProperty();
}
项目:LoliXL    文件:DownloadCenterPresenter.java   
public ReadOnlyIntegerProperty taskCountProperty() {
    return taskCountProperty.getReadOnlyProperty();
}
项目:JFXC    文件:HourMinSecTextField.java   
public ReadOnlyIntegerProperty secondsProperty() {
    return seconds.getReadOnlyProperty();
}
项目:JFXC    文件:HourMinSecTextField.java   
public ReadOnlyIntegerProperty hoursProperty() {
    return hours.getReadOnlyProperty();
}
项目:JFXC    文件:HourMinSecTextField.java   
public ReadOnlyIntegerProperty minutesProperty() {
    return minutes.getReadOnlyProperty();
}
项目:JFXC    文件:HourMinTextField.java   
public ReadOnlyIntegerProperty hoursProperty() {
    return hours.getReadOnlyProperty();
}
项目:JFXC    文件:HourMinTextField.java   
public ReadOnlyIntegerProperty minutesProperty() {
    return minutes.getReadOnlyProperty();
}
项目:reduxfx    文件:ComponentBase.java   
public ReadOnlyIntegerProperty createReadOnlyIntegerProperty(Object bean, String name) {
    return componentDriver.createReadOnlyIntegerProperty(bean, name);
}
项目:todomvcFX    文件:ItemsStore.java   
public ReadOnlyIntegerProperty numberOfItemsLeft() {
    return numberOfItemsLeft.getReadOnlyProperty();
}
项目:FluxFX    文件:ItemsStore.java   
public ReadOnlyIntegerProperty numberOfItemsLeft() {
    return numberOfItemsLeft.getReadOnlyProperty();
}
项目:FluxFX    文件:CounterStore.java   
public ReadOnlyIntegerProperty counter() {
    return counter.getReadOnlyProperty();
}
项目:StreamSis    文件:CuteProject.java   
public ReadOnlyIntegerProperty initElementsNumberProperty() {
    return initElementsNumber.getReadOnlyProperty();
}
项目:StreamSis    文件:CuteProject.java   
public ReadOnlyIntegerProperty allElementsNumberProperty() {
    return allElementsNumber.getReadOnlyProperty();
}