當前位置: 首頁>>代碼示例>>Java>>正文


Java LongProperty類代碼示例

本文整理匯總了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;
}
 
開發者ID:XDean,項目名稱:JavaFX-EX,代碼行數:18,代碼來源:BeanConvertUtil.java

示例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);
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:21,代碼來源:WatcherWindow.java

示例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);
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:18,代碼來源:WatcherWindow.java

示例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);
	
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:21,代碼來源:PLPToolIOMemoryModule.java

示例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);
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:19,代碼來源:PLPRegFile.java

示例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"));
		}
		
	});

}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:25,代碼來源:PLPWebController.java

示例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);

}
 
開發者ID:AdamBien,項目名稱:floyd,代碼行數:17,代碼來源:PingPresenter.java

示例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);
}
 
開發者ID:buschmais,項目名稱:jaxbfx,代碼行數:20,代碼來源:FXBeanPropertyXJCPluginTest.java

示例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);
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:15,代碼來源:PreferencesUtilsTest.java

示例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);
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:15,代碼來源:PreferencesUtilsTest.java

示例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;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:19,代碼來源:PLPToolIOMemoryModule.java

示例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;
	
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:10,代碼來源:PLPToolIOMemoryModule.java

示例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));
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:31,代碼來源:PLPAddressBus.java

示例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;
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:28,代碼來源:ChartItemBuilder.java

示例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;
}
 
開發者ID:PacktPublishing,項目名稱:Java-9-Programming-Blueprints,代碼行數:38,代碼來源:BeanPathAdapter.java


注:本文中的javafx.beans.property.LongProperty類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。