本文整理汇总了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);
}
}
示例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<>();
}
示例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());
}