本文整理汇总了Java中javafx.beans.property.LongProperty类的典型用法代码示例。如果您正苦于以下问题:Java LongProperty类的具体用法?Java LongProperty怎么用?Java LongProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LongProperty类属于javafx.beans.property包,在下文中一共展示了LongProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: normalize
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
static Object normalize(Property<?> prop, Class<?> clz) {
if (clz.isAssignableFrom(IntegerProperty.class)) {
return toInteger((Property<Integer>) prop);
} else if (clz.isAssignableFrom(LongProperty.class)) {
return toLong((Property<Long>) prop);
} else if (clz.isAssignableFrom(FloatProperty.class)) {
return toFloat((Property<Float>) prop);
} else if (clz.isAssignableFrom(DoubleProperty.class)) {
return toDouble((Property<Double>) prop);
} else if (clz.isAssignableFrom(StringProperty.class)) {
return toString((Property<String>) prop);
} else if (clz.isAssignableFrom(ObjectProperty.class)) {
return toObject((Property<Object>) prop);
}
return prop;
}
示例2: registerWatchResult
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Subscribe
public void registerWatchResult(RegWatchResponseEvent e) {
if (!e.isSuccess())
throw new IllegalArgumentException("There isn't a register with the name "
+ e.getRegisterName());
String id = e.getRegisterID();
String registerName = e.getRegisterName();
LongProperty register = e.getRegObject();
register.addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
watchedRegisters.refresh();
}
});
RegisterRow row = new RegisterRow(registerName, id, register);
registers.add(row);
}
示例3: memoryWatchResult
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Subscribe
public void memoryWatchResult(MemWatchResponseEvent e) {
if (!e.isSuccess())
return;
long address = e.getWatchedAddress();
LongProperty value = e.getMemObject();
value.addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
watchedAddresses.refresh();
}
});
MemoryRow row = new MemoryRow(address, value);
memoryAddresses.add(row);
}
示例4: getMemoryValueProperty
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Override
public LongProperty getMemoryValueProperty(long addr)
{
if(addr < startAddress || addr > endAddress)
{
//Error
return null;//Constants.PLP_SIM_OUT_ADDRESS_OUT_OF_RANGE;
}
else if(wordAligned && addr % 4 != 0)
{
return null;//Constants.PLP_SIM_OUT_UNALIGNED_MEMORY;
}
else if(!values.containsKey(addr))
{
return null;//Constants.PLP_SIM_UNINITIALIZED_MEMORY;
}
else
return values.get(addr);
}
示例5: PLPRegFile
import javafx.beans.property.LongProperty; //导入依赖的package包/类
/***
* PLPRegFile constructor. It creates all the registers and initializes to default value
*/
public PLPRegFile()
{
this.registers = new LongProperty[NUMBER_OF_REGISTERS];
this.regInstructions = new BooleanProperty[NUMBER_OF_REGISTERS];
for(int i = 0; i < NUMBER_OF_REGISTERS; i++)
this.registers[i] = new SimpleLongProperty(DEFAULT_REGISTER_VALUE);
for(int i = 0; i < NUMBER_OF_REGISTERS; i++)
this.regInstructions[i] = new SimpleBooleanProperty(false);
this.namedRegisters = buildNamedRegistersMap();
EventRegistry.getGlobalRegistry().register(this);
}
示例6: registerWatchResult
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@SuppressWarnings("restriction")
@Subscribe
public void registerWatchResult(RegWatchResponseEvent e) {
if (!e.isSuccess())
throw new IllegalArgumentException("There isn't a register with the name "
+ e.getRegisterName());
String id = e.getRegisterID();
String registerName = e.getRegisterName();
LongProperty register = e.getRegObject();
System.out.println("suc" + id + " -- " + registerName + " -- " + register);
register.addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
//watchedRegisters.refresh();
System.out.println("Success" + id + " -- " + registerName + " -- " + register);
session.setAttribute("idd", register.getValue());
//System.out.println("id is: " + session.getAttribute("idd"));
}
});
}
示例7: refreshPingTime
import javafx.beans.property.LongProperty; //导入依赖的package包/类
public void refreshPingTime() {
XYChart.Data<String, Number> point = new XYChart.Data<>();
point.setXValue(String.valueOf(counter));
LongProperty responseTime = new SimpleLongProperty();
Runnable doneListener = () -> {
Platform.runLater(() -> {
final long timeInMs = responseTime.get();
System.out.println("Ping time: " + timeInMs);
point.setYValue(timeInMs);
pingSeries.getData().add(point);
});
};
service.ping("http://" + uri, responseTime::set, errorSink::setText, doneListener);
}
示例8: testGeneratedOutputTypes
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Test
public void testGeneratedOutputTypes() throws Exception {
ObjectFactory of = new ObjectFactory();
TestType cut = of.createTestType();
assertTrue("StringProperty expected!", cut.aStringProperty() instanceof StringProperty);
assertTrue("ObjectProperty expected!", cut.aBooleanProperty() instanceof ObjectProperty);
assertTrue("ObjectProperty expected!", cut.aDoubleProperty() instanceof ObjectProperty);
assertTrue("ObjectProperty expected!", cut.aFloatProperty() instanceof ObjectProperty);
assertTrue("ObjectProperty expected!", cut.aLongProperty() instanceof ObjectProperty);
cut.getAList();
assertTrue("ListProperty expected!", cut.aListProperty() instanceof ListProperty);
assertTrue("ObjectProperty expected!", cut.anIntegerProperty() instanceof ObjectProperty);
assertTrue("BooleanProperty expected!", cut.aPrimitiveBooleanProperty() instanceof BooleanProperty);
assertTrue("DoubleProperty expected!", cut.aPrimitiveDoubleProperty() instanceof DoubleProperty);
assertTrue("FloatProperty expected!", cut.aPrimitiveFloatProperty() instanceof FloatProperty);
assertTrue("LongProperty expected!", cut.aPrimitiveLongProperty() instanceof LongProperty);
assertTrue("IntegerProperty expected!", cut.aPrimitiveIntegerProperty() instanceof IntegerProperty);
}
示例9: testSaveLong
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Test
public void testSaveLong() {
// given
String name = "long";
long value = Long.MAX_VALUE;
LongProperty property = new SimpleLongProperty(null, name, value);
// when
PreferencesUtils.save(property, preferences);
// then
long saved = preferences.getLong(name, -1);
assertEquals(value, saved);
}
示例10: testReadLong
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Test
public void testReadLong() {
// given
String name = "long";
long value = Long.MIN_VALUE;
LongProperty property = new SimpleLongProperty(null, name, -value);
// when
preferences.putLong(name, value);
// then
PreferencesUtils.read(property, preferences);
assertEquals(property.getValue().longValue(), value);
}
示例11: PLPToolIOMemoryModule
import javafx.beans.property.LongProperty; //导入依赖的package包/类
/**
* The constructor for the superclass requires the address space and
* whether the registers of the module are word-aligned
*
* @param startAddr Starting address of the module's address space
* @param endAddr Final address of the module's address space
* @param wordAligned Whether the module's address space is word aligned
*/
PLPToolIOMemoryModule(long startAddr, long endAddr, boolean wordAligned)
{
values = new TreeMap<Long, LongProperty>();
isInstruction = new TreeMap<Long, Boolean>();
this.startAddress = startAddr;
this.endAddress = endAddr;
this.wordAligned = wordAligned;
enabled = false;
phantom = false;
}
示例12: setNewParameters
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Override
public synchronized void setNewParameters(long startAddr, long endAddr, boolean isWordAligned) {
values = new TreeMap<Long, LongProperty>();
isInstruction = new TreeMap<Long, Boolean>();
startAddress = startAddr;
endAddress = endAddr;
wordAligned = isWordAligned;
}
示例13: receivedWatchRequest
import javafx.beans.property.LongProperty; //导入依赖的package包/类
@Subscribe
public void receivedWatchRequest(MemWatchRequestEvent e) {
long address = e.getMemoryAddress();
if (!validateAddress(address))
return;
LongProperty valueProperty = null;
for(HashMap.Entry<String, IOMemoryModule> entry : modules.entrySet())
{
IOMemoryModule mod = entry.getValue();
if(mod.isAddressWithModule(address))
{
if(!mod.isPhantom())
valueProperty = mod.getMemoryValueProperty(address);
else
{
//verify: why are we even calling read of the module if not interested in its value
//mod.read(addr);
}
break;
}
}
EventRegistry.getGlobalRegistry().post(new MemWatchResponseEvent(true, address, valueProperty));
}
示例14: build
import javafx.beans.property.LongProperty; //导入依赖的package包/类
public final ChartItem build() {
final ChartItem ITEM = new ChartItem();
for (String key : properties.keySet()) {
if ("name".equals(key)) {
ITEM.setName(((StringProperty) properties.get(key)).get());
} else if ("value".equals(key)) {
ITEM.setValue(((DoubleProperty) properties.get(key)).get());
} else if("fill".equals(key)) {
ITEM.setFill(((ObjectProperty<Color>) properties.get(key)).get());
} else if("stroke".equals(key)) {
ITEM.setStroke(((ObjectProperty<Color>) properties.get(key)).get());
} else if("textColor".equals(key)) {
ITEM.setTextColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if("timestamp".equals(key)) {
ITEM.setTimestamp(((ObjectProperty<Instant>) properties.get(key)).get());
} else if ("timestampDateTime".equals(key)) {
ITEM.setTimestamp(((ObjectProperty<ZonedDateTime>) properties.get(key)).get());
} else if("symbol".equals(key)) {
ITEM.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
} else if("animated".equals(key)) {
ITEM.setAnimated(((BooleanProperty) properties.get(key)).get());
} else if("animationDuration".equals(key)) {
ITEM.setAnimationDuration(((LongProperty) properties.get(key)).get());
}
}
return ITEM;
}
示例15: propertyValueClass
import javafx.beans.property.LongProperty; //导入依赖的package包/类
/**
* Provides the underlying value class for a given {@link Property}
*
* @param property
* the {@link Property} to check
* @return the value class of the {@link Property}
*/
@SuppressWarnings("unchecked")
protected static <T> Class<T> propertyValueClass(final Property<T> property) {
Class<T> clazz = null;
if (property != null) {
if (StringProperty.class.isAssignableFrom(property.getClass())) {
clazz = (Class<T>) String.class;
} else if (IntegerProperty.class.isAssignableFrom(property
.getClass())) {
clazz = (Class<T>) Integer.class;
} else if (BooleanProperty.class.isAssignableFrom(property
.getClass())) {
clazz = (Class<T>) Boolean.class;
} else if (DoubleProperty.class.isAssignableFrom(property
.getClass())) {
clazz = (Class<T>) Double.class;
} else if (FloatProperty.class
.isAssignableFrom(property.getClass())) {
clazz = (Class<T>) Float.class;
} else if (LongProperty.class.isAssignableFrom(property.getClass())) {
clazz = (Class<T>) Long.class;
} else if (ListProperty.class.isAssignableFrom(property.getClass())) {
clazz = (Class<T>) List.class;
} else if (MapProperty.class.isAssignableFrom(property.getClass())) {
clazz = (Class<T>) Map.class;
} else {
clazz = (Class<T>) Object.class;
}
}
return clazz;
}