Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ <h2>Parameters</h2>
<td>The list of source bands.</td>
<td></td>
</tr>
<tr>
Comment thread
Florian1209 marked this conversation as resolved.
Outdated
<td><code>tiePointGrids</code></td>
<td><code>String[]</code></td>
<td><code></code></td>
<td>The list of source tie-point grids.</td>
<td></td>
</tr>
<tr>
<td><code>region</code></td>
<td><code>Rectangle</code></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ protected String[] getBandNames() {
return bandNames.toArray(new String[bandNames.size()]);
}

protected String[] getTiePointGridNames(){
final ArrayList<String> tiePointGridNames = new ArrayList<>(3);
if (sourceProducts != null) {
for (Product prod : sourceProducts) {
if (sourceProducts.length > 1) {
for (String name : prod.getTiePointGridNames()) {
tiePointGridNames.add(name + "::" + prod.getName());
}
} else {
tiePointGridNames.addAll(Arrays.asList(prod.getTiePointGridNames()));
}
}
}
return tiePointGridNames.toArray(new String[tiePointGridNames.size()]);
}

protected String[] getGeometries() {
final ArrayList<String> geometryNames = new ArrayList<>(5);
if (sourceProducts != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ private JComponent createPanel() {
contentPanel.add(formatNameComboBox, gbc);
gbc = SwingUtils.buildConstraints(0, 2, GridBagConstraints.NONE, GridBagConstraints.WEST, 1, 1, gapBetweenRows, 0);
contentPanel.add(advancedOptionsBtn, gbc);
gbc = SwingUtils.buildConstraints(0, 3, GridBagConstraints.BOTH, GridBagConstraints.WEST, 2, 1, 0, 0);
gbc = SwingUtils.buildConstraints(0, 4, GridBagConstraints.BOTH, GridBagConstraints.WEST, 2, 1, 0, 0);
advancedOptionsPanel.setVisible(false);
contentPanel.add(advancedOptionsPanel, gbc);
gbc = SwingUtils.buildConstraints(0, 4, GridBagConstraints.BOTH, GridBagConstraints.WEST, 2, 1, 0, 0);
gbc = SwingUtils.buildConstraints(0, 3, GridBagConstraints.BOTH, GridBagConstraints.WEST, 2, 1, 0, 0);
contentPanel.add(new JPanel(), gbc);

gbc = SwingUtils.buildConstraints(0, 0, GridBagConstraints.NONE, GridBagConstraints.CENTER, 1, 1, gapBetweenRows, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
public class SubsetUI extends BaseOperatorUI {

private final JList bandList = new JList();
private final JList tiePointGridList = new JList();

private final JComboBox referenceCombo = new JComboBox();
private final JTextField regionX = new JTextField("");
Expand Down Expand Up @@ -91,7 +92,8 @@ public void actionPerformed(ActionEvent e) {
@Override
public void initParameters() {

OperatorUIUtils.initParamList(bandList, getBandNames(), (Object[])paramMap.get("sourceBands"));
OperatorUIUtils.initParamList(bandList, getBandNames(), (Object[])paramMap.get("bandNames"));
OperatorUIUtils.initParamList(tiePointGridList, getTiePointGridNames(), (Object[])paramMap.get("tiePointGridNames"));

String _oldSelected = (String) referenceCombo.getSelectedItem();
referenceCombo.removeAllItems();
Expand All @@ -102,14 +104,14 @@ public void initParameters() {
referenceCombo.setSelectedItem(string);
}
}

//enable or disable referenceCombo depending on sourceProduct
if(sourceProducts == null || sourceProducts.length == 0 || !sourceProducts[0].isMultiSize()) {
referenceCombo.setEnabled(false);
} else {
referenceCombo.setEnabled(true);
}


final Rectangle region = (Rectangle)paramMap.get("region");
if(region != null) {
regionX.setText(String.valueOf(region.x));
Expand Down Expand Up @@ -172,7 +174,7 @@ public void updateParameters() {
}
}
}

OperatorUIUtils.updateParamList(tiePointGridList, paramMap, "tiePointGridNames");

final String subSamplingXStr = subSamplingX.getText();
if (subSamplingXStr != null && !subSamplingXStr.isEmpty())
Expand Down Expand Up @@ -216,6 +218,12 @@ private JComponent createPanel() {
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = 1;
contentPane.add(new JScrollPane(bandList), gbc);
gbc.gridx = 0;
gbc.gridy++;
contentPane.add(new JLabel("Tie-Point Grids:"), gbc);
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = 1;
contentPane.add(new JScrollPane(tiePointGridList), gbc);

gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.gridx = 0;
Expand Down