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


Java IntegerProperty.set方法代码示例

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


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

示例1: undo

import javafx.beans.property.IntegerProperty; //导入方法依赖的package包/类
private void undo() {
    History.HistoryAction action = history.undo();
    if (action == null) {
        return;
    }
    if (action instanceof History.Stat) {
        History.Stat statAction = (History.Stat) action;
        pokemon.setStatRange(statAction);
    } else if (action instanceof History.Evolution) {
        pokemon.unevolve();
    } else if (action instanceof History.EvAdded) {
        History.EvAdded evAction = (History.EvAdded) action;
        String stat = evAction.getStat();
        IntegerProperty statProperty = pokemon.getEffortValues().get(stat);
        statProperty.set(statProperty.get() - 1);
    }
}
 
开发者ID:wartab,项目名称:gen7-iv-calculator,代码行数:18,代码来源:CalculatorPresenter.java

示例2: PLPMemoryModule

import javafx.beans.property.IntegerProperty; //导入方法依赖的package包/类
public PLPMemoryModule()
{
	this.registers = new IntegerProperty[NUMBER_OF_REGISTERS];
	for(IntegerProperty x: this.registers)
		x.set(0);
	this.namedRegisters = buildNamedRegistersMap();
	this.memoryLocations = new HashMap<>();
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:9,代码来源:PLPMemoryModule.java

示例3: updateElementsTest

import javafx.beans.property.IntegerProperty; //导入方法依赖的package包/类
@Test
public void updateElementsTest()
{
    final IntegerProperty int0 = new SimpleIntegerProperty(0);
    final IntegerProperty int1 = new SimpleIntegerProperty(1);
    final IntegerProperty int2 = new SimpleIntegerProperty(2);
    final IntegerProperty int3 = new SimpleIntegerProperty(3);
    final IntegerProperty int4 = new SimpleIntegerProperty(4);
    final IntegerProperty int5 = new SimpleIntegerProperty(5);

    final ObservableList<IntegerProperty> list1 = FXCollections.observableList(Arrays.asList(int0, int1, int2),
                                                                               e -> new Observable[] { e });
    final ObservableList<IntegerProperty> list2 = FXCollections.observableList(Arrays.asList(int3),
                                                                               e -> new Observable[] { e });
    final ObservableList<IntegerProperty> list3 = FXCollections.observableList(Arrays.asList(int4, int5),
                                                                               e -> new Observable[] { e });

    final ObservableListAggregation<IntegerProperty> listAggregation = new ObservableListAggregation<>(list1, list2,
            list3);
    final AtomicReference<Change<? extends IntegerProperty>> change = new AtomicReference<>(null);
    listAggregation.addListener((ListChangeListener<IntegerProperty>) c -> {
        change.set(c);
    });

    int4.set(6);

    assertNotNull("Change event", change.get());
    assertTrue("Has change", change.get().next());
    assertFalse("Was added", change.get().wasAdded());
    assertFalse("Was removed", change.get().wasRemoved());
    assertTrue("Was update", change.get().wasUpdated());
    assertFalse("Was permuted", change.get().wasPermutated());
    assertEquals("from", 4, change.get().getFrom());
    assertEquals("to", 5, change.get().getTo());
    assertFalse("Has more change", change.get().next());

    assertEquals("size", 6, listAggregation.size());
    assertEquals("get(0)", 0, listAggregation.get(0).get());
    assertEquals("get(1)", 1, listAggregation.get(1).get());
    assertEquals("get(2)", 2, listAggregation.get(2).get());
    assertEquals("get(3)", 3, listAggregation.get(3).get());
    assertEquals("get(4)", 6, listAggregation.get(4).get());
    assertEquals("get(5)", 5, listAggregation.get(5).get());
}
 
开发者ID:ben12,项目名称:infxnity,代码行数:45,代码来源:ObservableListAggregationTest.java


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