当前位置: 首页>>代码示例>>Java>>正文


Java PropertyContainer.createObjectBacked方法代码示例

本文整理汇总了Java中com.bc.ceres.binding.PropertyContainer.createObjectBacked方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyContainer.createObjectBacked方法的具体用法?Java PropertyContainer.createObjectBacked怎么用?Java PropertyContainer.createObjectBacked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.bc.ceres.binding.PropertyContainer的用法示例。


在下文中一共展示了PropertyContainer.createObjectBacked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testValidValuesAreNotChanged

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
@Test
public void testValidValuesAreNotChanged() {
    //preparation
    propertiesObject.northBound = 15.0;
    propertiesObject.eastBound = 15.0;
    propertiesObject.southBound = -15.0;
    propertiesObject.westBound = -15.0;
    final PropertyContainer objectBacked = PropertyContainer.createObjectBacked(propertiesObject);

    //execution
    RegionSelectableWorldMapPane.ensureValidBindingContext(new BindingContext(objectBacked));

    //verification
    assertEquals(Double.valueOf(15.0), propertiesObject.northBound);
    assertEquals(Double.valueOf(15.0), propertiesObject.eastBound);
    assertEquals(Double.valueOf(-15.0), propertiesObject.southBound);
    assertEquals(Double.valueOf(-15.0), propertiesObject.westBound);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:19,代码来源:RegionSelectableWorldMapPane_BindingContextValidationTest.java

示例2: AggregatorItemDialog

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
public AggregatorItemDialog(Window parent, String[] sourceVarNames, AggregatorItem aggregatorItem, boolean initWithDefaults) {
    super(parent, "Edit Aggregator", ID_OK | ID_CANCEL, null);
    this.sourceVarNames = sourceVarNames;
    this.aggregatorItem = aggregatorItem;
    aggregatorConfig = aggregatorItem.aggregatorConfig;
    aggregatorDescriptor = aggregatorItem.aggregatorDescriptor;
    aggregatorPropertySet = createPropertySet(aggregatorConfig);
    if (initWithDefaults) {
        aggregatorPropertySet.setDefaultValues();
    } else {
        PropertySet objectPropertySet = PropertyContainer.createObjectBacked(aggregatorConfig);
        Property[] objectProperties = objectPropertySet.getProperties();
        for (Property objectProperty : objectProperties) {
            aggregatorPropertySet.setValue(objectProperty.getName(), objectProperty.getValue());
        }
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:18,代码来源:AggregatorItemDialog.java

示例3: ReprojectionForm

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
ReprojectionForm(TargetProductSelector targetProductSelector, boolean orthorectify, AppContext appContext) {
    this.targetProductSelector = targetProductSelector;
    this.orthoMode = orthorectify;
    this.appContext = appContext;
    this.sourceProductSelector = new SourceProductSelector(appContext, "Source Product:");
    if (orthoMode) {
        targetProductSuffix = "orthorectified";
        this.sourceProductSelector.setProductFilter(new OrthorectifyProductFilter());
    } else {
        targetProductSuffix = "reprojected";
        this.sourceProductSelector.setProductFilter(new GeoCodingProductFilter());
    }
    this.reprojectionModel = new Model();
    this.reprojectionContainer = PropertyContainer.createObjectBacked(reprojectionModel);
    createUI();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:ReprojectionForm.java

示例4: configurePropertySet

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
private void configurePropertySet(PropertySet propertySet) {
    final PropertySet presetPropertySet = PropertyContainer.createObjectBacked(new PresetContainer());

    // awkward - purpose is to insert 'preset' property at the first position of the binding context's property set
    final Property[] properties = propertySet.getProperties();
    propertySet.removeProperties(properties);
    propertySet.addProperty(presetPropertySet.getProperty("preset"));
    propertySet.addProperties(properties);
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:10,代码来源:S2MciAction.java

示例5: CustomCrsPanel

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
public CustomCrsPanel(Window parent, Set<GeodeticDatum> datumSet, Set<AbstractCrsProvider> crsProviderSet) {
    this.parent = parent;

    this.datumSet = datumSet;
    this.crsProviderSet = crsProviderSet;

    GeodeticDatum wgs84Datum = null;
    // This is necessary because DefaultGeodeticDatum.WGS84 is
    // not equal to the geodetic WGS84 datum from the database
    for (GeodeticDatum geodeticDatum : datumSet) {
        if (DefaultGeodeticDatum.isWGS84(geodeticDatum)) {
            wgs84Datum = geodeticDatum;
            break;
        }
    }
    AbstractCrsProvider defaultMethod = new WGS84CrsProvider(wgs84Datum);
    crsProviderSet.add(defaultMethod);
    crsProviderSet.add(new UTMZonesCrsProvider(wgs84Datum));
    crsProviderSet.add(new UTMAutomaticCrsProvider(wgs84Datum));

    model = new Model();
    model.operationWrapper = defaultMethod;
    model.datum = wgs84Datum;

    vc = PropertyContainer.createObjectBacked(model);
    vc.addPropertyChangeListener(new UpdateListener());

    createUI();
    updateModel(OPERATION_WRAPPER);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:31,代码来源:CustomCrsPanel.java

示例6: resetToDefaults

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
public void resetToDefaults(ImageGeometry ig) {
    PropertyContainer pc = PropertyContainer.createObjectBacked(ig);
    Property[] properties = pc.getProperties();
    for (Property property : properties) {
        propertyContainer.setValue(property.getName(), property.getValue());
    }
    propertyContainer.setValue("referencePixelLocation", REFERENCE_PIXEL_DEFAULT);
    propertyContainer.setValue("fitProductSize", FIT_PRODUCT_SIZE_DEFAULT);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:10,代码来源:OutputGeometryFormModel.java

示例7: configurePropertyContainer

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的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());
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:11,代码来源:OutputGeometryFormModel.java

示例8: createBindingContext

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
private BindingContext createBindingContext() {
    final PropertyContainer container = PropertyContainer.createObjectBacked(variableItem.variableConfig, new ParameterDescriptorFactory());
    final BindingContext context = new BindingContext(container);

    PropertyDescriptor descriptor = container.getDescriptor(PROPERTY_VARIABLE_NAME);
    descriptor.setDescription("The name for the source band.");
    descriptor.setValidator(new VariableNameValidator());
    container.setDefaultValues();

    return context;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:12,代码来源:VariableItemDialog.java

示例9: RangeEditorDialog

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
RangeEditorDialog(Window window, Model model) {
    super(window, "New Range Mask",
            ModalDialog.ID_OK_CANCEL | ModalDialog.ID_HELP, "rangeEditor");
    this.model = model;
    container = PropertyContainer.createObjectBacked(this.model);
    getJDialog().setResizable(false);
    rasterModel = new DefaultComboBoxModel(this.model.rasterNames);

    setContent(createUI());
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:11,代码来源:RangeEditorDialog.java

示例10: createBindingContext

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
private BindingContext createBindingContext() {
    final PropertyContainer container = PropertyContainer.createObjectBacked(this);
    final BindingContext context = new BindingContext(container);
    PropertyDescriptor descriptor;

    descriptor = container.getDescriptor(PROPERTY_NAME_BAND_NAME);
    descriptor.setDisplayName("Uncertainty band name");
    descriptor.setDescription("The name for the new uncertainty band.");
    descriptor.setNotEmpty(true);
    descriptor.setValidator(new ProductNodeNameValidator(sourceBand.getProduct()));
    descriptor.setDefaultValue(getDefaultBandName(sourceBand.getName() + "_unc"));

    descriptor = container.getDescriptor(PROPERTY_NAME_ORDER);
    descriptor.setDisplayName("Order of Taylor polynomial");
    descriptor.setDescription("The number of Taylor series expansion terms used for the Standard Combined Uncertainty (GUM 1995).");
    descriptor.setDefaultValue(1);
    descriptor.setValueSet(new ValueSet(new Integer[]{1, 2, 3}));

    descriptor = container.getDescriptor(PROPERTY_NAME_RELATION);
    descriptor.setDisplayName("Relation name of ancillary bands");
    descriptor.setDescription("Relation  name of ancillary variables that represent uncertainties (NetCDF-U 'rel' attribute).");
    descriptor.setDefaultValue("uncertainty");
    descriptor.setNotNull(true);
    descriptor.setNotEmpty(true);

    container.setDefaultValues();

    PropertyChangeListener targetExprUpdater = evt -> {
        updateTargetExprArea();
    };
    context.addPropertyChangeListener(PROPERTY_NAME_ORDER, targetExprUpdater);
    context.addPropertyChangeListener(PROPERTY_NAME_RELATION, targetExprUpdater);

    return context;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:36,代码来源:PropagateUncertaintyDialog.java

示例11: MetadataPlotSettings

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
public MetadataPlotSettings() {
    context = new BindingContext(PropertyContainer.createObjectBacked(this, new ParameterDescriptorFactory()));
    Property propertyRecordStart = context.getPropertySet().getProperty(PROP_NAME_RECORD_START_INDEX);
    propertyRecordStart.getDescriptor().setAttribute("stepSize", 1);
    Property propertyMetaElement = context.getPropertySet().getProperty(PROP_NAME_METADATA_ELEMENT);
    propertyMetaElement.addPropertyChangeListener(evt -> {
        try {
            if (!isSynchronising.getAndSet(true)) {

                PropertySet propertySet = context.getPropertySet();
                // clear current settings
                propertySet.setValue(PROP_NAME_RECORD_START_INDEX, 1.0);
                propertySet.setValue(PROP_NAME_RECORDS_PER_PLOT, 1);
                propertySet.setValue(PROP_NAME_FIELD_X, null);
                propertySet.setValue(PROP_NAME_FIELD_Y1, null);
                propertySet.setValue(PROP_NAME_FIELD_Y2, null);

                List<String> usableFieldNames = retrieveUsableFieldNames(metadataElement);
                ArrayList<String> usableYFieldNames = new ArrayList<>(usableFieldNames);
                usableYFieldNames.add(0, FIELD_NAME_NONE);
                PropertyDescriptor propertyFieldY1 = propertySet.getProperty(PROP_NAME_FIELD_Y1).getDescriptor();
                propertyFieldY1.setValueSet(new ValueSet(usableYFieldNames.toArray(new String[0])));
                PropertyDescriptor propertyFieldY2 = propertySet.getProperty(PROP_NAME_FIELD_Y2).getDescriptor();
                propertyFieldY2.setValueSet(new ValueSet(usableYFieldNames.toArray(new String[0])));

                PropertyDescriptor propertyFieldX = propertySet.getProperty(PROP_NAME_FIELD_X).getDescriptor();
                ArrayList<String> usableXFieldNames = new ArrayList<>(usableFieldNames);
                usableXFieldNames.add(0, FIELD_NAME_RECORD_INDEX);
                usableXFieldNames.add(1, FIELD_NAME_ARRAY_FIELD_INDEX);
                propertyFieldX.setValueSet(new ValueSet(usableXFieldNames.toArray(new String[0])));
            }
        } finally {
            isSynchronising.set(false);
        }

    });

}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:39,代码来源:MetadataPlotSettings.java

示例12: createPropertySet

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
/**
 * Creates a PropertyContainer for any bean. The bean parameters need to be annotated with {@link Preference}.
 *
 * @param bean a bean with fields annoted with {@link Preference}.
 *
 * @return an instance of {@link PropertyContainer}, fit for passing within overridden
 * {@link #createPropertySet()}.
 */
protected final PropertyContainer createPropertySet(Object bean) {
    return PropertyContainer.createObjectBacked(bean, field -> {
        Class<Preference> annotationClass = Preference.class;
        Preference annotation = field.getAnnotation(annotationClass);
        if (annotation == null) {
            throw new IllegalStateException("Field '" + field.getName() + "' must be annotated with '" +
                                            annotationClass.getSimpleName() + "'.");
        }
        String label = annotation.label();
        String key = annotation.key();
        String[] valueSet = annotation.valueSet();
        String valueRange = annotation.interval();
        String description = annotation.description();

        Validator validator = createValidator(annotation.validatorClass());
        Assert.state(StringUtils.isNotNullAndNotEmpty(label),
                     "Label of field '" + field.getName() + "' must not be null or empty.");
        Assert.state(StringUtils.isNotNullAndNotEmpty(key),
                     "Key of field '" + field.getName() + "' must not be null or empty.");
        boolean isDeprecated = field.getAnnotation(Deprecated.class) != null;

        PropertyDescriptor valueDescriptor = new PropertyDescriptor(key, field.getType());
        valueDescriptor.setDeprecated(isDeprecated);
        valueDescriptor.setAttribute("key", key);
        valueDescriptor.setAttribute("displayName", label);
        valueDescriptor.setAttribute("configName", annotation.config());
        valueDescriptor.setAttribute("propertyValidator", validator);
        valueDescriptor.setDescription(description);


        if (valueSet.length > 0) {
            valueDescriptor.setValueSet(new ValueSet(valueSet));
        }
        if (StringUtils.isNotNullAndNotEmpty(valueRange)) {
            valueDescriptor.setValueRange(ValueRange.parseValueRange(valueRange));
        }
        return valueDescriptor;
    });
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:48,代码来源:DefaultConfigController.java

示例13: createBindingContext

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
private static BindingContext createBindingContext(double northBound, double eastBound, double southBound, double westBound) {
    final Bounds bounds = new Bounds(northBound, eastBound, southBound, westBound);
    final PropertyContainer container = PropertyContainer.createObjectBacked(bounds);
    return new BindingContext(container);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:6,代码来源:RegionBoundsInputUI.java

示例14: setUp

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    propertiesObject = new PropertiesObject();
    bindingContext = new BindingContext(PropertyContainer.createObjectBacked(propertiesObject));
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:6,代码来源:RegionSelectableWorldMapPane_BindingContextValidationTest.java

示例15: requestDialogData

import com.bc.ceres.binding.PropertyContainer; //导入方法依赖的package包/类
private AddLandCoverOp.LandCoverParameters requestDialogData(final Product product) {

        String[] Names = LandCoverFactory.getNameList();

        // sort the list
        final List<String> sortedNames = Arrays.asList(Names);
        java.util.Collections.sort(sortedNames);
        Names = sortedNames.toArray(new String[sortedNames.size()]);

        final AddLandCoverOp.LandCoverParameters dialogData = new AddLandCoverOp.LandCoverParameters(Names[0], ResamplingFactory.NEAREST_NEIGHBOUR_NAME);
        final PropertySet propertySet = PropertyContainer.createObjectBacked(dialogData);
        configureNameProperty(propertySet, "name", Names, Names[0]);
        configureNameProperty(propertySet, "resamplingMethod", ResamplingFactory.resamplingNames,
                ResamplingFactory.NEAREST_NEIGHBOUR_NAME);
        configureBandNameProperty(propertySet, "bandName", product);
        final BindingContext ctx = new BindingContext(propertySet);

        final JList landCoverList = new JList();
        landCoverList.setVisibleRowCount(10);
        ctx.bind("name", new SingleSelectionListComponentAdapter(landCoverList, product));

        final JTextField bandNameField = new JTextField();
        bandNameField.setColumns(30);
        ctx.bind("bandName", bandNameField);

        final TableLayout tableLayout = new TableLayout(2);
        tableLayout.setTableAnchor(TableLayout.Anchor.WEST);
        tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL);
        tableLayout.setTablePadding(4, 4);
        for (int i = 0; i < 8; i++) {
            tableLayout.setCellColspan(i, 0, 2);
        }

        final JPanel parameterPanel = new JPanel(tableLayout);
        /*row 0*/
        parameterPanel.add(new JLabel("Land Cover Model:"));
        parameterPanel.add(new JScrollPane(landCoverList));
        /*row 1*/
        parameterPanel.add(new JLabel("Resampling method:"));
        final JComboBox resamplingCombo = new JComboBox(ResamplingFactory.resamplingNames);
        parameterPanel.add(resamplingCombo);
        ctx.bind("resamplingMethod", resamplingCombo);
        parameterPanel.add(new JLabel("Integer data types will use nearest neighbour"));

        parameterPanel.add(new JLabel("Land cover band name:"));
        parameterPanel.add(bandNameField);

        final ModalDialog dialog = new ModalDialog(SnapApp.getDefault().getMainFrame(), DIALOG_TITLE, ModalDialog.ID_OK_CANCEL, HELP_ID);
        dialog.setContent(parameterPanel);
        if (dialog.show() == ModalDialog.ID_OK) {
            return dialogData;
        }

        return null;
    }
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:56,代码来源:AddLandCoverAction.java


注:本文中的com.bc.ceres.binding.PropertyContainer.createObjectBacked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。