本文整理汇总了Java中com.bc.ceres.binding.Property.getDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getDescriptor方法的具体用法?Java Property.getDescriptor怎么用?Java Property.getDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bc.ceres.binding.Property
的用法示例。
在下文中一共展示了Property.getDescriptor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateValueSet
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private void updateValueSet(Property property, Product product) {
String[] values = new String[0];
PropertyDescriptor propertyDescriptor = property.getDescriptor();
if (product != null) {
Object object = propertyDescriptor.getAttribute(RasterDataNodeValues.ATTRIBUTE_NAME);
if (object != null) {
@SuppressWarnings("unchecked")
Class<? extends RasterDataNode> rasterDataNodeType = (Class<? extends RasterDataNode>) object;
boolean includeEmptyValue = !propertyDescriptor.isNotNull() && !propertyDescriptor.isNotEmpty() &&
!propertyDescriptor.getType().isArray();
values = RasterDataNodeValues.getNames(product, rasterDataNodeType, includeEmptyValue);
}
}
propertyDescriptor.setValueSet(new ValueSet(values));
}
示例2: updateSourceBands
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private void updateSourceBands() {
if (propertySet == null) return;
final Property[] properties = propertySet.getProperties();
for (Property p : properties) {
final PropertyDescriptor descriptor = p.getDescriptor();
final String alias = descriptor.getAlias();
if (sourceProducts != null && alias != null && alias.equals("sourceBands")) {
final String[] bandNames = getBandNames();
if (bandNames.length > 0) {
final ValueSet valueSet = new ValueSet(bandNames);
descriptor.setValueSet(valueSet);
try {
if (descriptor.getType().isArray()) {
if (p.getValue() == null)
p.setValue(bandNames);//new String[] {bandNames[0]});
} else {
p.setValue(bandNames[0]);
}
} catch (ValidationException e) {
System.out.println(e.toString());
}
}
}
}
}
示例3: addParameters
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private void addParameters() {
final PropertySet propertySet = parameterSupport.getPropertySet();
final List<SourceProductSelector> sourceProductSelectorList = ioParametersPanel.getSourceProductSelectorList();
if (sourceProductSelectorList.isEmpty()) {
Dialogs.showError("SourceProduct @Parameter not found in operator");
} else {
sourceProductSelectorList.get(0).addSelectionChangeListener(new AbstractSelectionChangeListener() {
@Override
public void selectionChanged(SelectionChangeEvent event) {
final Product selectedProduct = (Product) event.getSelection().getSelectedValue();
if (selectedProduct != null) { //&& form != null) {
final TargetProductSelectorModel targetProductSelectorModel = getTargetProductSelector().getModel();
targetProductSelectorModel.setProductName(selectedProduct.getName() + getTargetProductNameSuffix());
opUI.setSourceProducts(new Product[]{selectedProduct});
}
}
});
}
if (propertySet.getProperties().length > 0) {
if (!sourceProductSelectorList.isEmpty()) {
Property[] properties = propertySet.getProperties();
List<PropertyDescriptor> rdnTypeProperties = new ArrayList<>(properties.length);
for (Property property : properties) {
PropertyDescriptor parameterDescriptor = property.getDescriptor();
if (parameterDescriptor.getAttribute(RasterDataNodeValues.ATTRIBUTE_NAME) != null) {
rdnTypeProperties.add(parameterDescriptor);
}
}
rasterDataNodeTypeProperties = rdnTypeProperties.toArray(
new PropertyDescriptor[rdnTypeProperties.size()]);
}
}
}
示例4: getConverter
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private static Converter getConverter(final PropertyContainer valueContainer, final String name) {
final Property[] properties = valueContainer.getProperties();
for (Property p : properties) {
final PropertyDescriptor descriptor = p.getDescriptor();
if (descriptor != null && (descriptor.getName().equals(name) ||
(descriptor.getAlias() != null && descriptor.getAlias().equals(name)))) {
return descriptor.getConverter();
}
}
return null;
}
示例5: getDomConverter
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private static DomConverter getDomConverter(final PropertyContainer valueContainer, final String name) {
final Property[] properties = valueContainer.getProperties();
for (Property p : properties) {
final PropertyDescriptor descriptor = p.getDescriptor();
if (descriptor != null && (descriptor.getName().equals(name) ||
(descriptor.getAlias() != null && descriptor.getAlias().equals(name)))) {
return descriptor.getDomConverter();
}
}
return null;
}
示例6: configureBandNameProperty
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private static void configureBandNameProperty(PropertySet propertySet, String propertyName, Product product) {
final Property property = propertySet.getProperty(propertyName);
final PropertyDescriptor descriptor = property.getDescriptor();
descriptor.setNotNull(true);
descriptor.setNotEmpty(true);
descriptor.setValidator(new BandNameValidator(product));
}
示例7: configureBandNameProperty
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private static void configureBandNameProperty(PropertySet propertySet, String propertyName, Product product) {
Property property = propertySet.getProperty(propertyName);
PropertyDescriptor descriptor = property.getDescriptor();
descriptor.setNotNull(true);
descriptor.setNotEmpty(true);
descriptor.setValidator(new BandNameValidator(product));
setValidBandName(property, product);
}
示例8: DefaultSingleTargetProductDialog
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
public DefaultSingleTargetProductDialog(String operatorName, AppContext appContext, String title, String helpID, boolean targetProductSelectorDisplay) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
this.operatorName = operatorName;
targetProductNameSuffix = "";
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(operatorName);
if (operatorSpi == null) {
throw new IllegalArgumentException("No SPI found for operator name '" + operatorName + "'");
}
operatorDescriptor = operatorSpi.getOperatorDescriptor();
ioParametersPanel = new DefaultIOParametersPanel(getAppContext(), operatorDescriptor, getTargetProductSelector(), targetProductSelectorDisplay);
parameterSupport = new OperatorParameterSupport(operatorDescriptor);
final ArrayList<SourceProductSelector> sourceProductSelectorList = ioParametersPanel.getSourceProductSelectorList();
final PropertySet propertySet = parameterSupport.getPropertySet();
bindingContext = new BindingContext(propertySet);
if (propertySet.getProperties().length > 0) {
if (!sourceProductSelectorList.isEmpty()) {
Property[] properties = propertySet.getProperties();
List<PropertyDescriptor> rdnTypeProperties = new ArrayList<>(properties.length);
for (Property property : properties) {
PropertyDescriptor parameterDescriptor = property.getDescriptor();
if (parameterDescriptor.getAttribute(RasterDataNodeValues.ATTRIBUTE_NAME) != null) {
rdnTypeProperties.add(parameterDescriptor);
}
}
rasterDataNodeTypeProperties = rdnTypeProperties.toArray(
new PropertyDescriptor[rdnTypeProperties.size()]);
}
}
productChangedHandler = new ProductChangedHandler();
if (!sourceProductSelectorList.isEmpty()) {
sourceProductSelectorList.get(0).addSelectionChangeListener(productChangedHandler);
}
}
示例9: getConfigurationCopy
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
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;
}
示例10: compareConfigurations
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
private static void compareConfigurations(PropertySet originalConfiguration,
PropertySet restoredConfiguration) {
for (final Property originalModel : originalConfiguration.getProperties()) {
final PropertyDescriptor originalDescriptor = originalModel.getDescriptor();
final Property restoredModel = restoredConfiguration.getProperty(originalDescriptor.getName());
final PropertyDescriptor restoredDescriptor = restoredModel.getDescriptor();
assertNotNull(restoredModel);
assertSame(originalDescriptor.getName(), restoredDescriptor.getName());
assertSame(originalDescriptor.getType(), restoredDescriptor.getType());
if (originalDescriptor.isTransient()) {
assertEquals(originalDescriptor.isTransient(), restoredDescriptor.isTransient());
} else {
final Object originalValue = originalModel.getValue();
final Object restoredValue = restoredModel.getValue();
assertSame(originalValue.getClass(), restoredValue.getClass());
if (originalValue.getClass().isArray()) {
final int originalLength = Array.getLength(originalValue);
final int restoredLength = Array.getLength(restoredValue);
assertEquals(originalLength, restoredLength);
for (int i = 0; i < restoredLength; i++) {
assertEquals(Array.get(originalValue, i), Array.get(restoredValue, i));
}
}
}
}
}
示例11: SingleOperatorDialog
import com.bc.ceres.binding.Property; //导入方法依赖的package包/类
public SingleOperatorDialog(String operatorName, AppContext appContext, String title, String helpID) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
this.operatorName = operatorName;
targetProductNameSuffix = "";
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(operatorName);
if (operatorSpi == null) {
throw new IllegalArgumentException("No SPI found for operator name '" + operatorName + "'");
}
operatorDescriptor = operatorSpi.getOperatorDescriptor();
ioParametersPanel = new DefaultIOParametersPanel(getAppContext(), operatorDescriptor, getTargetProductSelector());
parameterSupport = new OperatorParameterSupport(operatorDescriptor, null, null, new GraphBuilderParameterUpdater());
final ArrayList<SourceProductSelector> sourceProductSelectorList = ioParametersPanel.getSourceProductSelectorList();
final PropertySet propertySet = parameterSupport.getPropertySet();
bindingContext = new BindingContext(propertySet);
if (propertySet.getProperties().length > 0) {
if (!sourceProductSelectorList.isEmpty()) {
Property[] properties = propertySet.getProperties();
List<PropertyDescriptor> rdnTypeProperties = new ArrayList<>(properties.length);
for (Property property : properties) {
PropertyDescriptor parameterDescriptor = property.getDescriptor();
if (parameterDescriptor.getAttribute(RasterDataNodeValues.ATTRIBUTE_NAME) != null) {
rdnTypeProperties.add(parameterDescriptor);
}
}
rasterDataNodeTypeProperties = rdnTypeProperties.toArray(
new PropertyDescriptor[rdnTypeProperties.size()]);
}
}
productChangedHandler = new ProductChangedHandler();
if (!sourceProductSelectorList.isEmpty()) {
sourceProductSelectorList.get(0).addSelectionChangeListener(productChangedHandler);
}
opUI = OperatorUIRegistry.CreateOperatorUI(operatorName);
addParameters();
getJDialog().setMinimumSize(new Dimension(450, 450));
statusLabel = new JLabel("");
statusLabel.setForeground(new Color(255, 0, 0));
this.getJDialog().getContentPane().add(statusLabel, BorderLayout.NORTH);
}