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


Java ReadOnlyIntegerProperty类代码示例

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


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

示例1: preloadMapTiles

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
@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;
}
 
开发者ID:FrancisG-Massey,项目名称:Capstone2016,代码行数:25,代码来源:GluonMapLoadingService.java

示例2: set

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
@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());
	}
}
 
开发者ID:netopyr,项目名称:reduxfx,代码行数:26,代码来源:TabPaneSelectionModelAccessor.java

示例3: bindPossibleScoringButtons

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
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());
}
 
开发者ID:Novanoid,项目名称:Tourney,代码行数:26,代码来源:TournamentModuleEditorDialog.java

示例4: widthProperty

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
@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());
}
 
开发者ID:gallandarakhneorg,项目名称:afc,代码行数:18,代码来源:Rectangle2ifxTest.java

示例5: heightProperty

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
@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());
}
 
开发者ID:gallandarakhneorg,项目名称:afc,代码行数:18,代码来源:Rectangle2ifxTest.java

示例6: validate

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
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;
}
 
开发者ID:haris44,项目名称:Paradinc-FX,代码行数:33,代码来源:Form.java

示例7: createAxis

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:danielhuson,项目名称:megan-ce,代码行数:40,代码来源:LRInspectorController.java

示例8: createReadOnlyIntegerProperty

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
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);
}
 
开发者ID:netopyr,项目名称:reduxfx,代码行数:9,代码来源:ComponentDriver.java

示例9: bindTournamentPhaseTableButtons

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
/**
 * 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());
}
 
开发者ID:Novanoid,项目名称:Tourney,代码行数:32,代码来源:TournamentDialog.java

示例10: bindPossibleScoresTableButtons

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
/**
 * 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());
}
 
开发者ID:Novanoid,项目名称:Tourney,代码行数:33,代码来源:TournamentDialog.java

示例11: bindTournamentPhaseButtons

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
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())
}
 
开发者ID:Novanoid,项目名称:Tourney,代码行数:29,代码来源:TournamentModuleEditorDialog.java

示例12: testReadOnlyIntegerProperty

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
@Test
public void testReadOnlyIntegerProperty(){
    ReadOnlyIntegerProperty actual = new SimpleIntegerProperty(30);
    assertThat(actual).hasValue(30);

    assertThat(actual).hasSameValue(actual);
}
 
开发者ID:lestard,项目名称:assertj-javafx,代码行数:8,代码来源:IntegerTest.java

示例13: Item

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
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));
  }
 
开发者ID:lestard,项目名称:structured-list,代码行数:40,代码来源:Item.java

示例14: unitsToPrintProperty

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
public final ReadOnlyIntegerProperty unitsToPrintProperty() {
    return unitsToPrint.getReadOnlyProperty();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:4,代码来源:TimeRangeView.java

示例15: pageNumberProperty

import javafx.beans.property.ReadOnlyIntegerProperty; //导入依赖的package包/类
public final ReadOnlyIntegerProperty pageNumberProperty() {
    return pageNumber.getReadOnlyProperty();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:4,代码来源:PrintablePage.java


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