private void addTiePointCheckers(final StringBuffer description, final JPanel checkersPane, final GridBagConstraints gbc, final ActionListener checkListener) { for (int i = 0; i < allTiePointGrids.length; i++) { TiePointGrid grid = allTiePointGrids[i]; boolean checked = false; for (TiePointGrid selectedGrid : selectedTiePointGrids) { if (grid == selectedGrid) { checked = true; numSelected++; break; } } description.setLength(0); description.append(grid.getDescription() == null ? "" : grid.getDescription()); final JCheckBox check = new JCheckBox(getRasterDisplayName(grid), checked); check.setFont(SMALL_PLAIN_FONT); check.addActionListener(checkListener); final JLabel label = new JLabel(description.toString()); label.setFont(SMALL_ITALIC_FONT); gbc.gridy++; GridBagUtils.addToPanel(checkersPane, check, gbc, "weightx=0,gridx=0"); GridBagUtils.addToPanel(checkersPane, label, gbc, "weightx=1,gridx=1"); checkBoxes[i + allBands.length] = check; } }
ExpectedTiePointGrid(TiePointGrid tiePointGrid, Random random) { this(); this.name = tiePointGrid.getName(); this.description = tiePointGrid.getDescription(); this.offsetX = String.valueOf(tiePointGrid.getOffsetX()); this.offsetY = String.valueOf(tiePointGrid.getOffsetY()); this.subSamplingX = String.valueOf(tiePointGrid.getSubSamplingX()); this.subSamplingY = String.valueOf(tiePointGrid.getSubSamplingY()); expectedPixels = createExpectedPixels(tiePointGrid, random); }
public TiePointGrid cloneTiePointGrid() { final float[] srcTiePoints = this.getTiePoints(); final float[] destTiePoints = new float[srcTiePoints.length]; System.arraycopy(srcTiePoints, 0, destTiePoints, 0, srcTiePoints.length); TiePointGrid clone = new TiePointGrid(this.getName(), this.getRasterWidth(), this.getRasterHeight(), this.getOffsetX(), this.getOffsetY(), this.getSubSamplingX(), this.getSubSamplingY(), destTiePoints, this.getDiscontinuity()); clone.setUnit(getUnit()); clone.setDescription(getDescription()); return clone; }
sourceTiePointGrid.getDiscontinuity()); tiePointGrid.setUnit(sourceTiePointGrid.getUnit()); tiePointGrid.setDescription(sourceTiePointGrid.getDescription()); return tiePointGrid;
addEntry("Name:", grid.getName(), ""); addEntry("Type:", "Tie Point Grid", ""); addEntry("Description:", grid.getDescription(), ""); addEntry("Geophysical unit:", grid.getUnit(), ""); addEntry("Geophysical data type:", ProductData.getTypeString(grid.getGeophysicalDataType()), null);
diff.append("Data of TiePointGrid " + i + " are not equal>\r\n"); if (!expTPGrid.getDescription().equals(currentTPGrid.getDescription())) { diff.append( "Description of TiePointGrid " + i + " expected <" + expTPGrid.getDescription() + "> but was <" + currentTPGrid.getDescription() + ">\r\n");
JDomHelper.addElement(DimapProductConstants.TAG_TIE_POINT_GRID_INDEX, i, tiePointGridInfo); JDomHelper.addElement(DimapProductConstants.TAG_TIE_POINT_DESCRIPTION, tiePointGrid.getDescription(), tiePointGridInfo); JDomHelper.addElement(DimapProductConstants.TAG_TIE_POINT_PHYSICAL_UNIT, tiePointGrid.getUnit(), tiePointGridInfo);
targetProduct.getSceneRasterHeight()); targetBand.setUnit(sourceGrid.getUnit()); if (sourceGrid.getDescription() != null) { targetBand.setDescription(sourceGrid.getDescription());
createScalarAttribute(datasetID, "raster_height", grid.getRasterHeight()); createScalarAttribute(datasetID, "unit", grid.getUnit()); createScalarAttribute(datasetID, "description", grid.getDescription()); createScalarAttribute(datasetID, "CLASS", "IMAGE"); createScalarAttribute(datasetID, "IMAGE_VERSION", 1.0F);
sourceTiePointGrid.getDiscontinuity()); tiePointGrid.setUnit(sourceTiePointGrid.getUnit()); tiePointGrid.setDescription(sourceTiePointGrid.getDescription()); product.addTiePointGrid(tiePointGrid);
println(tpgiTags[0]); printLine(indent + 2, DimapProductConstants.TAG_TIE_POINT_GRID_INDEX, i); printLine(indent + 2, DimapProductConstants.TAG_TIE_POINT_DESCRIPTION, tiePointGrid.getDescription()); printLine(indent + 2, DimapProductConstants.TAG_TIE_POINT_PHYSICAL_UNIT, tiePointGrid.getUnit()); printLine(indent + 2, DimapProductConstants.TAG_TIE_POINT_GRID_NAME, tiePointGrid.getName());
public void testClone() { TiePointGrid grid = new TiePointGrid("abc", 2, 2, 0.1f, 0.2f, 0.3f, 0.4f, new float[]{1.2f, 2.3f, 3.4f, 4.5f}); grid.setDescription("Aha!"); grid.setDiscontinuity(TiePointGrid.DISCONT_AT_180); TiePointGrid gridClone = grid.cloneTiePointGrid(); assertEquals("abc", gridClone.getName()); assertEquals("Aha!", gridClone.getDescription()); assertEquals(TiePointGrid.DISCONT_AT_180, gridClone.getDiscontinuity()); assertEquals(2, gridClone.getRasterWidth()); assertEquals(2, gridClone.getRasterHeight()); assertEquals(0.1f, gridClone.getOffsetX()); assertEquals(0.2f, gridClone.getOffsetY()); assertEquals(0.3f, gridClone.getSubSamplingX()); assertEquals(0.4f, gridClone.getSubSamplingY()); assertNotNull(gridClone.getData()); assertEquals(true, gridClone.getData().getElems() instanceof float[]); float[] dataClone = (float[]) gridClone.getData().getElems(); assertEquals(4, dataClone.length); assertEquals(1.2f, dataClone[0]); assertEquals(2.3f, dataClone[1]); assertEquals(3.4f, dataClone[2]); assertEquals(4.5f, dataClone[3]); assertNotSame(grid.getData().getElems(), dataClone); } }