本文整理汇总了Java中org.esa.snap.core.gpf.ui.OperatorParameterSupport类的典型用法代码示例。如果您正苦于以下问题:Java OperatorParameterSupport类的具体用法?Java OperatorParameterSupport怎么用?Java OperatorParameterSupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperatorParameterSupport类属于org.esa.snap.core.gpf.ui包,在下文中一共展示了OperatorParameterSupport类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimpleExampleDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
public SimpleExampleDialog(String alias, AppContext appContext, String title, String helpId) {
super(appContext, title, helpId);
this.alias = alias;
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(alias);
parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor());
form = new SimpleForm(appContext, operatorSpi, parameterSupport.getPropertySet(),
getTargetProductSelector());
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpId);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
示例2: S2tbxMosaicDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
S2tbxMosaicDialog(final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
final TargetProductSelector selector = getTargetProductSelector();
selector.getModel().setSaveToFileSelected(false);
selector.getModel().setProductName("Multi-size Mosaic");
selector.getSaveToFileCheckBox().setEnabled(true);
form = new S2tbxMosaicForm(selector, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi("Multi-size Mosaic");
S2tbxMosaicFormModel formModel = form.getFormModel();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
null);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
示例3: BinningDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
protected BinningDialog(AppContext appContext, String title, String helpID) {
super(appContext, title, ID_APPLY_CLOSE_HELP, helpID, new TargetProductSelectorModel(), true);
formModel = new BinningFormModel();
form = new BinningForm(appContext, formModel, getTargetProductSelector());
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(OPERATOR_NAME);
ParameterUpdater parameterUpdater = new BinningParameterUpdater();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
parameterUpdater);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
示例4: ReprojectionDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
ReprojectionDialog(boolean orthorectify, final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
form = new ReprojectionForm(getTargetProductSelector(), orthorectify, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(OPERATOR_NAME);
ParameterUpdater parameterUpdater = new ReprojectionParameterUpdater();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
null,
null,
parameterUpdater);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
示例5: MosaicDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
MosaicDialog(final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
final TargetProductSelector selector = getTargetProductSelector();
selector.getModel().setSaveToFileSelected(true);
selector.getModel().setProductName("mosaic");
selector.getSaveToFileCheckBox().setEnabled(false);
form = new MosaicForm(selector, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi("Mosaic");
MosaicFormModel formModel = form.getFormModel();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
null);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
示例6: CollocationDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
public CollocationDialog(AppContext appContext) {
super(appContext, "Collocation", ID_APPLY_CLOSE, HELP_ID);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(CollocateOp.Spi.class.getName());
parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor());
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
HELP_ID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
form = new CollocationForm(parameterSupport.getPropertySet(), getTargetProductSelector(), appContext);
}
示例7: CreateOpTab
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
@Override
public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) {
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(operatorName);
if (operatorSpi == null) {
throw new IllegalArgumentException("No SPI found for operator name '" + operatorName + "'");
}
operatorDescriptor = operatorSpi.getOperatorDescriptor();
parameterSupport = new OperatorParameterSupport(operatorDescriptor);
final PropertySet propertySet = parameterSupport.getPropertySet();
bindingContext = new BindingContext(propertySet);
if (sourceProducts != null) {
for (Band band : sourceProducts[0].getBands()) {
listBands.add(band.getName());
}
}
initializeOperatorUI(operatorName, parameterMap);
final JComponent panel = createPanel();
initParameters();
return new JScrollPane(panel);
}
示例8: ResamplingDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的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);
}
示例9: SingleOperatorDialog
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的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);
}
示例10: OperatorParametersTable
import org.esa.snap.core.gpf.ui.OperatorParameterSupport; //导入依赖的package包/类
public OperatorParametersTable(ToolAdapterOperatorDescriptor operator, AppContext appContext) {
this.operator = operator;
this.appContext = appContext;
propertiesValueUIDescriptorMap = new HashMap<>();
dataTypesComboCellRenderer = new DefaultTableCellRenderer();
labelTypeCellRenderer = new DefaultTableCellRenderer();
labelTypeCellRenderer.setText(Bundle.Type_ProductList_Text());
List<ToolParameterDescriptor> data = operator.getToolParameterDescriptors();
PropertySet propertySet = new OperatorParameterSupport(operator).getPropertySet();
//if there is an exception in the line above, can be because the default value does not match the type
//TODO determine if (and which) param has a wrong type
context = new BindingContext(propertySet);
for (ToolParameterDescriptor paramDescriptor : data) {
if (paramDescriptor.getName().equals(ToolAdapterConstants.TOOL_SOURCE_PRODUCT_ID)) {
propertiesValueUIDescriptorMap.put(paramDescriptor, PropertyMemberUIWrapperFactory.buildEmptyPropertyWrapper());
} else {
propertiesValueUIDescriptorMap.put(paramDescriptor, PropertyMemberUIWrapperFactory.buildPropertyWrapper("defaultValue", paramDescriptor, operator, context, null));
}
}
tableRenderer = new MultiRenderer();
setModel(new OperatorParametersTableNewTableModel());
setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
for (int i = 0; i < widths.length; i++) {
getColumnModel().getColumn(i).setPreferredWidth(widths[i]);
}
this.putClientProperty("JComboBox.isTableCellEditor", Boolean.FALSE);
this.setRowHeight(20);
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent event) {
int clickedColumn = columnAtPoint(event.getPoint());
int clickedRow = rowAtPoint(event.getPoint());
if (clickedColumn >= 0 && clickedRow >= 0 && isTableCellEditable(clickedRow, clickedColumn)) {
mouseClickOnCell(clickedColumn, clickedRow);
}
}
});
FocusListener focusListener = new FocusAdapter() {
@Override
public void focusLost(FocusEvent focusEvent) {
hideCurrentDisplayedCellComponent(focusEvent);
}
};
createCellDefaultValueList(focusListener);
createCellDefaultValueFileChooser(focusListener);
createCellDefaultValueCheckBox(focusListener);
createCellDefaultValueComboBox(focusListener);
createCellTextComponent(focusListener);
createCellDataTypesComponent();
resetCellComponentPosition();
}