本文整理汇总了Java中com.bc.ceres.binding.ValueSet类的典型用法代码示例。如果您正苦于以下问题:Java ValueSet类的具体用法?Java ValueSet怎么用?Java ValueSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValueSet类属于com.bc.ceres.binding包,在下文中一共展示了ValueSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateBandList
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private void updateBandList(final Product product, final Property bandProperty, boolean considerReferenceSize) {
if (product == null) {
return;
}
final ValueSet bandValueSet = new ValueSet(createAvailableBandList(product, considerReferenceSize));
bandProperty.getDescriptor().setValueSet(bandValueSet);
if (bandValueSet.getItems().length > 0) {
RasterDataNode currentRaster = getRaster();
if (bandValueSet.contains(getRaster())) {
currentRaster = getRaster();
}
try {
bandProperty.setValue(currentRaster);
} catch (ValidationException ignored) {
Debug.trace(ignored);
}
}
}
示例2: updatePointDataSource
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
public void updatePointDataSource(Product product) {
if (product != null) {
final Class pointClass = com.vividsolutions.jts.geom.Point.class;
final ProductNodeGroup<VectorDataNode> vectorDataGroup = product.getVectorDataGroup();
final List<VectorDataNode> vectorDataNodes = new ArrayList<VectorDataNode>();
for (VectorDataNode vectorDataNode : vectorDataGroup.toArray(new VectorDataNode[vectorDataGroup.getNodeCount()])) {
final GeometryDescriptor geometryDescriptor = vectorDataNode.getFeatureType().getGeometryDescriptor();
if (geometryDescriptor != null &&
pointClass.isAssignableFrom(geometryDescriptor.getType().getBinding())) {
vectorDataNodes.add(vectorDataNode);
}
}
final ValueSet valueSet = new ValueSet(vectorDataNodes.toArray());
pointDataSourceProperty.getDescriptor().setValueSet(valueSet);
} else {
pointDataSourceProperty.getDescriptor().setValueSet(null);
dataFieldProperty.getDescriptor().setValueSet(null);
try {
pointDataSourceProperty.setValue(null);
dataFieldProperty.setValue(null);
} catch (ValidationException ignore) {
}
}
}
示例3: updateDataField
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
public void updateDataField() {
if (pointDataSourceProperty.getValue() != null) {
final List<AttributeDescriptor> attributeDescriptors = ((VectorDataNode) pointDataSourceProperty.getValue()).getFeatureType().getAttributeDescriptors();
final List<AttributeDescriptor> result = new ArrayList<AttributeDescriptor>();
result.add(new NullAttributeDescriptor());
for (AttributeDescriptor attributeDescriptor : attributeDescriptors) {
if (Number.class.isAssignableFrom(attributeDescriptor.getType().getBinding())) {
result.add(attributeDescriptor);
}
}
dataFieldProperty.getDescriptor().setValueSet(new ValueSet(result.toArray()));
} else {
dataFieldProperty.getDescriptor().setValueSet(null);
try {
dataFieldProperty.setValue(null);
} catch (ValidationException ignore) {
}
}
}
示例4: updateRoiMasks
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private void updateRoiMasks() {
final Property property = bindingContext.getPropertySet().getProperty(PROPERTY_NAME_ROI_MASK);
if (product != null && raster != null) {
//todo [multisize_products] compare scenerastertransform (or its successor) rather than size
final ProductNodeGroup<Mask> maskGroup = product.getMaskGroup();
List<ProductNode> maskList = new ArrayList<>();
final Dimension refRrasterSize = raster.getRasterSize();
for (int i = 0; i < maskGroup.getNodeCount(); i++) {
final Mask mask = maskGroup.get(i);
if (refRrasterSize.equals(mask.getRasterSize())) {
maskList.add(mask);
}
}
property.getDescriptor().setValueSet(new ValueSet(maskList.toArray(new ProductNode[maskList.size()])));
} else {
property.getDescriptor().setValueSet(new ValueSet(new Mask[0]));
}
useRoiEnablement.apply();
roiMaskEnablement.apply();
}
示例5: updateDatabaseCombo
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private void updateDatabaseCombo(PropertySet propertySet) {
String localFolder = propertySet.getValue(PREFERENCE_DB_LOCAL_PATH);
String remoteAddress = propertySet.getValue(PREFERENCE_DB_REMOTE_URI);
String remoteOrLocal = propertySet.getValue(PREFERENCE_DB_REMOTE_OR_LOCAL);
String uri = DB_IS_REMOTE.equals(remoteOrLocal) ? remoteAddress: localFolder;
try {
URI databaseManagerURI = getDatabaseManagerURI(uri);
if (databaseManager == null || !databaseManager.getURI().equals(databaseManagerURI)) {
databaseManager = createDatabaseManager(databaseManagerURI);
}
PropertyDescriptor dbNameProperty = propertySet.getProperty(PREFERENCE_DB_NAME).getDescriptor();
if (databaseManager.isAlive()) {
String[] databases = databaseManager.listDatabases();
Arrays.sort(databases);
dbNameProperty.setValueSet(new ValueSet(databases));
} else {
dbNameProperty.setValueSet(new ValueSet(new String[0]));
SnapApp.getDefault().handleError("Failed to connect to Database.", null);
}
} catch (URISyntaxException|IOException|IllegalArgumentException e) {
SnapApp.getDefault().handleError("Error reading applications:" + e.getMessage(), e);
}
}
示例6: updateValueSet
import com.bc.ceres.binding.ValueSet; //导入依赖的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));
}
示例7: updateSourceBands
import com.bc.ceres.binding.ValueSet; //导入依赖的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());
}
}
}
}
}
示例8: updateValueSet
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private static void updateValueSet(PropertyDescriptor propertyDescriptor, Product product) {
String[] values = new String[0];
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));
}
示例9: configurePropertyContainer
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private void configurePropertyContainer(PropertySet ps) {
PropertySet thisPS = PropertyContainer.createObjectBacked(this);
ps.addProperties(thisPS.getProperties());
ps.getDescriptor("referencePixelLocation").setValueSet(new ValueSet(new Integer[]{0, 1, 2}));
setAxisUnits(ps);
ps.getDescriptor("orientation").setUnit("°");
ps.addPropertyChangeListener(new ChangeListener());
}
示例10: configureNameProperty
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private static void configureNameProperty(PropertySet propertySet, String propertyName, String[] names, String defaultValue) {
final PropertyDescriptor descriptor = propertySet.getProperty(propertyName).getDescriptor();
descriptor.setValueSet(new ValueSet(names));
descriptor.setDefaultValue(defaultValue);
descriptor.setNotNull(true);
descriptor.setNotEmpty(true);
}
示例11: updateListModel
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private void updateListModel() {
ValueSet valueSet = getPropertyDescriptor().getValueSet();
if (valueSet != null) {
list.setListData(valueSet.getItems());
adjustComponents();
}
}
示例12: createPropertyPanel
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private JPanel createPropertyPanel(PropertySet propertySet) {
Property[] properties = propertySet.getProperties();
for (Property property : properties) {
String propertyName = property.getName();
if ("type".equals(propertyName)) {
property.getDescriptor().setAttribute("visible", false);
}
if (AggregatorTableController.isSourcePropertyName(propertyName)) {
property.getDescriptor().setValueSet(new ValueSet(sourceVarNames));
}
}
return new PropertyPane(propertySet).createPanel();
}
示例13: BinningFormModel
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
public BinningFormModel() {
parameterMap = new HashMap<>();
propertySet = ParameterDescriptorFactory.createMapBackedOperatorPropertyContainer("Binning", parameterMap);
hideProperties();
// dynamically init the value set
String[] readerFormats = ProductIOPlugInManager.getInstance().getAllProductReaderFormatStrings();
Arrays.sort(readerFormats);
PropertyDescriptor descriptor = propertySet.getDescriptor(PROPERTY_KEY_SOURCE_PRODUCT_FORMAT);
descriptor.setValueSet(new ValueSet(readerFormats));
// Just for GUI
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_GLOBAL, Boolean.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_COMPUTE_REGION, Boolean.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_MANUAL_WKT, Boolean.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_WKT, String.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_BOUNDS, Boolean.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_EAST_BOUND, Double.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_NORTH_BOUND, Double.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_WEST_BOUND, Double.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_SOUTH_BOUND, Double.class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_SOURCE_PRODUCTS, Product[].class)); // temp
propertySet.addProperty(createTransientProperty(PROPERTY_KEY_CONTEXT_SOURCE_PRODUCT, Product.class)); // temp
propertySet.setDefaultValues();
propertySet.getProperty(PROPERTY_KEY_REGION).addPropertyChangeListener(evt -> {
Geometry newGeometry = (Geometry) evt.getNewValue();
propertySet.setValue(PROPERTY_KEY_MANUAL_WKT, true);
propertySet.setValue(PROPERTY_KEY_WKT, newGeometry.toText());
});
}
示例14: configureDemNameProperty
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
private static void configureDemNameProperty(PropertySet propertySet, String propertyName, String[] demNames, String defaultValue) {
PropertyDescriptor descriptor = propertySet.getProperty(propertyName).getDescriptor();
descriptor.setValueSet(new ValueSet(demNames));
descriptor.setDefaultValue(defaultValue);
descriptor.setNotNull(true);
descriptor.setNotEmpty(true);
}
示例15: ResamplingDialog
import com.bc.ceres.binding.ValueSet; //导入依赖的package包/类
ResamplingDialog(AppContext appContext, Product product, boolean modal) {
super(appContext, "Resampling", ID_APPLY_CLOSE, "resampleAction");
this.operatorName = "Resample";
targetProductNameSuffix = "_resampled";
getTargetProductSelector().getModel().setSaveToFileSelected(false);
getJDialog().setModal(modal);
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(), true);
targetProduct = null;
parameterSupport = new OperatorParameterSupport(operatorDescriptor, null, null, new ResamplingParameterUpdater());
final ArrayList<SourceProductSelector> sourceProductSelectorList = ioParametersPanel.getSourceProductSelectorList();
final PropertySet propertySet = parameterSupport.getPropertySet();
bindingContext = new BindingContext(propertySet);
final Property referenceBandNameProperty = bindingContext.getPropertySet().getProperty(REFERENCE_BAND_NAME_PROPERTY_NAME);
referenceBandNameProperty.getDescriptor().addAttributeChangeListener(evt -> {
if (evt.getPropertyName().equals("valueSet")) {
final Object[] valueSetItems = ((ValueSet) evt.getNewValue()).getItems();
if (valueSetItems.length > 0) {
try {
referenceBandNameProperty.setValue(valueSetItems[0].toString());
} catch (ValidationException e) {
//don't set it then
}
}
}
});
final ValueRange valueRange = new ValueRange(0, Integer.MAX_VALUE);
bindingContext.getPropertySet().getProperty(TARGET_WIDTH_PROPERTY_NAME).getDescriptor().setValueRange(valueRange);
bindingContext.getPropertySet().getProperty(TARGET_HEIGHT_PROPERTY_NAME).getDescriptor().setValueRange(valueRange);
bindingContext.getPropertySet().getProperty(TARGET_RESOLUTION_PROPERTY_NAME).getDescriptor().setValueRange(valueRange);
productChangedHandler = new ProductChangedHandler();
sourceProductSelectorList.get(0).setSelectedProduct(product);
sourceProductSelectorList.get(0).addSelectionChangeListener(productChangedHandler);
}