本文整理匯總了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());
}