本文整理了Java中com.bc.ceres.binding.Property.<init>()
方法的一些代码示例,展示了Property.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.<init>()
方法的具体详情如下:
包路径:com.bc.ceres.binding.Property
类名称:Property
方法名:<init>
暂无
代码示例来源:origin: senbox-org/snap-desktop
private static Property createTransientProperty(String name, Class type) {
final DefaultPropertyAccessor defaultAccessor = new DefaultPropertyAccessor();
final PropertyDescriptor descriptor = new PropertyDescriptor(name, type);
descriptor.setTransient(true);
descriptor.setDefaultConverter();
return new Property(descriptor, defaultAccessor);
}
代码示例来源:origin: bcdev/beam
private static Property createTransientProperty(String name, Class type) {
final DefaultPropertyAccessor defaultAccessor = new DefaultPropertyAccessor();
final PropertyDescriptor descriptor = new PropertyDescriptor(name, type);
descriptor.setTransient(true);
descriptor.setDefaultConverter();
return new Property(descriptor, defaultAccessor);
}
代码示例来源:origin: bcdev/beam
private void addTransientProperty(String propertyName, Class<?> propertyType) {
PropertyDescriptor descriptor = new PropertyDescriptor(propertyName, propertyType);
descriptor.setTransient(true);
container.addProperty(new Property(descriptor,
new MapEntryAccessor(parameterMap, propertyName)));
}
代码示例来源:origin: senbox-org/snap-desktop
private void addTransientProperty(String propertyName, Class<?> propertyType) {
PropertyDescriptor descriptor = new PropertyDescriptor(propertyName, propertyType);
descriptor.setTransient(true);
container.addProperty(new Property(descriptor,
new MapEntryAccessor(parameterMap, propertyName)));
}
代码示例来源:origin: senbox-org/s2tbx
private void addTransientProperty(String propertyName, Class<?> propertyType) {
PropertyDescriptor descriptor = new PropertyDescriptor(propertyName, propertyType);
descriptor.setTransient(true);
container.addProperty(new Property(descriptor,
new MapEntryAccessor(parameterMap, propertyName)));
}
代码示例来源:origin: bcdev/beam
@Override
public PropertySet createLayerConfig(LayerContext ctx) {
final PropertyContainer propertyContainer = new PropertyContainer();
// todo - how do I know whether my value model type can be serialized or not? (nf)
propertyContainer.addProperty(new Property(new PropertyDescriptor("windu", RasterDataNode.class), new DefaultPropertyAccessor()));
propertyContainer.addProperty(new Property(new PropertyDescriptor("windv", RasterDataNode.class), new DefaultPropertyAccessor()));
return propertyContainer;
}
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
public PropertySet createLayerConfig(LayerContext ctx) {
final PropertyContainer propertyContainer = new PropertyContainer();
// todo - how do I know whether my value model type can be serialized or not? (nf)
propertyContainer.addProperty(new Property(new PropertyDescriptor("windu", RasterDataNode.class), new DefaultPropertyAccessor()));
propertyContainer.addProperty(new Property(new PropertyDescriptor("windv", RasterDataNode.class), new DefaultPropertyAccessor()));
return propertyContainer;
}
}
代码示例来源:origin: senbox-org/snap-desktop
private void initValueContainer() {
final PropertyDescriptor widthDescriptor = new PropertyDescriptor(PROPERTY_NAME_WIDTH, Integer.class);
widthDescriptor.setConverter(new IntegerConverter());
propertyContainer.addProperty(new Property(widthDescriptor, new DefaultPropertyAccessor()));
final PropertyDescriptor heightDescriptor = new PropertyDescriptor(PROPERTY_NAME_HEIGHT, Integer.class);
heightDescriptor.setConverter(new IntegerConverter());
propertyContainer.addProperty(new Property(heightDescriptor, new DefaultPropertyAccessor()));
}
代码示例来源:origin: bcdev/beam
private void initValueContainer() {
final PropertyDescriptor widthDescriptor = new PropertyDescriptor(PROPERTY_NAME_WIDTH, Integer.class);
widthDescriptor.setConverter(new IntegerConverter());
propertyContainer.addProperty(new Property(widthDescriptor, new DefaultPropertyAccessor()));
final PropertyDescriptor heightDescriptor = new PropertyDescriptor(PROPERTY_NAME_HEIGHT, Integer.class);
heightDescriptor.setConverter(new IntegerConverter());
propertyContainer.addProperty(new Property(heightDescriptor, new DefaultPropertyAccessor()));
}
代码示例来源:origin: bcdev/beam
/**
* Creates a prototype image configuration.
*
* @return The image configuration.
*/
@Override
public PropertyContainer createImageConfig() {
PropertyDescriptor vectorDataDescriptor = new PropertyDescriptor(PROPERTY_NAME_VECTOR_DATA,
VectorDataNode.class);
vectorDataDescriptor.setNotNull(true);
PropertyContainer imageConfig = super.createImageConfig();
imageConfig.addProperty(new Property(vectorDataDescriptor, new DefaultPropertyAccessor()));
return imageConfig;
}
代码示例来源:origin: bcdev/beam
/**
* Creates a prototype image configuration.
*
* @return The image configuration.
*/
@SuppressWarnings({"MethodMayBeStatic"})
public PropertyContainer createImageConfig() {
PropertyDescriptor colorType = new PropertyDescriptor(PROPERTY_NAME_COLOR, Color.class);
colorType.setNotNull(true);
colorType.setDefaultValue(DEFAULT_COLOR);
PropertyDescriptor transparencyType = new PropertyDescriptor(PROPERTY_NAME_TRANSPARENCY, Double.TYPE);
transparencyType.setDefaultValue(DEFAULT_TRANSPARENCY);
PropertyContainer imageConfig = new PropertyContainer();
imageConfig.addProperty(new Property(colorType, new DefaultPropertyAccessor()));
imageConfig.addProperty(new Property(transparencyType, new DefaultPropertyAccessor()));
setImageStyle(imageConfig, DEFAULT_COLOR, DEFAULT_TRANSPARENCY);
return imageConfig;
}
代码示例来源:origin: bcdev/beam
/**
* Creates a prototype image configuration.
*
* @return The image configuration.
*/
@Override
public PropertyContainer createImageConfig() {
PropertyDescriptor expressionDescriptor = new PropertyDescriptor(PROPERTY_NAME_EXPRESSION, String.class);
expressionDescriptor.setNotNull(true);
expressionDescriptor.setNotEmpty(true);
PropertyContainer imageConfig = super.createImageConfig();
final Property property = new Property(expressionDescriptor, new DefaultPropertyAccessor());
imageConfig.addProperty(property);
return imageConfig;
}
代码示例来源:origin: bcdev/beam
private static PropertyContainer getConfigurationCopy(PropertySet propertyContainer) {
PropertyContainer configuration = new PropertyContainer();
for (Property model : propertyContainer.getProperties()) {
PropertyDescriptor descriptor = new PropertyDescriptor(model.getDescriptor());
DefaultPropertyAccessor valueAccessor = new DefaultPropertyAccessor();
valueAccessor.setValue(model.getValue());
configuration.addProperty(new Property(descriptor, valueAccessor));
}
return configuration;
}
代码示例来源:origin: senbox-org/snap-desktop
private static PropertyContainer getConfigurationCopy(PropertySet propertyContainer) {
PropertyContainer configuration = new PropertyContainer();
for (Property model : propertyContainer.getProperties()) {
PropertyDescriptor descriptor = new PropertyDescriptor(model.getDescriptor());
DefaultPropertyAccessor valueAccessor = new DefaultPropertyAccessor();
valueAccessor.setValue(model.getValue());
configuration.addProperty(new Property(descriptor, valueAccessor));
}
return configuration;
}
代码示例来源:origin: bcdev/beam
/**
* Defines an editable property.
*
* @param propertyDescriptor The property's descriptor.
*/
protected final void addPropertyDescriptor(PropertyDescriptor propertyDescriptor) {
String propertyName = propertyDescriptor.getName();
Object value = getCurrentLayer().getConfiguration().getValue(propertyName);
if (value == null) {
value = propertyDescriptor.getDefaultValue();
}
Property editorProperty = new Property(propertyDescriptor, new DefaultPropertyAccessor(value));
bindingContext.getPropertySet().addProperty(editorProperty);
}
代码示例来源:origin: bcdev/beam
private Property createProperty(String propertyName, Class<?> type) {
return new Property(new PropertyDescriptor(propertyName, type), new DefaultPropertyAccessor());
}
代码示例来源:origin: senbox-org/snap-desktop
/**
* Defines an editable property.
*
* @param propertyDescriptor The property's descriptor.
*/
protected final void addPropertyDescriptor(PropertyDescriptor propertyDescriptor) {
String propertyName = propertyDescriptor.getName();
Object value = getCurrentLayer().getConfiguration().getValue(propertyName);
if (value == null) {
value = propertyDescriptor.getDefaultValue();
}
Property editorProperty = new Property(propertyDescriptor, new DefaultPropertyAccessor(value));
bindingContext.getPropertySet().addProperty(editorProperty);
}
代码示例来源:origin: senbox-org/snap-desktop
private Property createProperty(String propertyName, Class<?> type) {
return new Property(new PropertyDescriptor(propertyName, type), new DefaultPropertyAccessor());
}
代码示例来源:origin: bcdev/beam
@Test
public void testThresholdFail() {
PropertyDescriptor propertyDescriptor = propertyContainer.getDescriptor("threshold");
PropertyAccessor propertyAccessor = new DefaultPropertyAccessor();
Property property = new Property(propertyDescriptor, propertyAccessor);
Validator validator = property.getValidator();
try {
validator.validateValue(property, 10.0);
fail("validation should fail");
} catch (ValidationException ignored) {
// expected
}
}
代码示例来源:origin: bcdev/beam
PropertyContainer createConfigurationTemplate() {
final PropertyContainer configuration = new PropertyContainer();
final PropertyDescriptor rasterRefDescriptor = new PropertyDescriptor("rasterRef", RasterRef.class);
rasterRefDescriptor.setNotNull(true);
final PropertyDescriptor borderShownDescriptor = new PropertyDescriptor("borderShown", Boolean.class);
borderShownDescriptor.setDefaultValue(DEFAULT_BORDER_SHOWN);
final PropertyDescriptor borderWidthDescriptor = new PropertyDescriptor("borderWidth", Double.class);
borderWidthDescriptor.setDefaultValue(DEFAULT_BORDER_WIDTH);
final PropertyDescriptor borderColorDescriptor = new PropertyDescriptor("borderColor", Color.class);
borderColorDescriptor.setDefaultValue(DEFAULT_BORDER_COLOR);
configuration.addProperty(new Property(rasterRefDescriptor, new DefaultPropertyAccessor()));
configuration.addProperty(new Property(borderShownDescriptor, new DefaultPropertyAccessor()));
configuration.addProperty(new Property(borderWidthDescriptor, new DefaultPropertyAccessor()));
configuration.addProperty(new Property(borderColorDescriptor, new DefaultPropertyAccessor()));
configuration.setDefaultValues();
return configuration;
}
}
内容来源于网络,如有侵权,请联系作者删除!