@Override public int getColumnCount() { return vectorDataNode.getFeatureType().getAttributeCount(); }
public static boolean isTrackPointNode(VectorDataNode node) { final Object trackPoints = node.getFeatureType().getUserData().get("trackPoints"); return trackPoints != null && trackPoints.toString().equals("true"); }
@Override public boolean accept(Layer layer) { return layer instanceof VectorDataLayer && featureTypeName.equals(((VectorDataLayer) layer).getVectorDataNode().getFeatureType().getTypeName()); } }
private int getAttributeIndex(VectorDataNode pointDataSource, AttributeDescriptor dataField) { final String fieldName = dataField.getLocalName(); if (fieldName.equals(CorrelativeFieldSelector.NULL_NAME)) { return -1; } return pointDataSource.getFeatureType().indexOf(fieldName); }
@Override public String getColumnName(int columnIndex) { return vectorDataNode.getFeatureType().getDescriptor(columnIndex).getLocalName(); }
public SeparateGeometriesDialog(Window mainFrame, VectorDataNode vectorDataNode, String helpId, String text) { super(mainFrame, "Import Geometry", ModalDialog.ID_YES_NO_HELP, helpId); JPanel content = new JPanel(new BorderLayout()); content.add(new JLabel(text), BorderLayout.NORTH); List<AttributeType> types = vectorDataNode.getFeatureType().getTypes(); ArrayList<String> names = new ArrayList<String>(); for (AttributeType type : types) { if (type.getBinding().equals(String.class)) { names.add(type.getName().getLocalPart()); } } comboBox = new JComboBox(names.toArray(new String[names.size()])); if (names.size() > 0) { JPanel content2 = new JPanel(new BorderLayout()); content2.add(new JLabel("Attribute for mask/layer naming: "), BorderLayout.WEST); content2.add(comboBox, BorderLayout.CENTER); content.add(content2, BorderLayout.SOUTH); } setContent(content); }
private String createToolTip(final VectorDataNode vectorDataNode) { final StringBuilder tooltip = new StringBuilder(); append(tooltip, vectorDataNode.getDescription()); append(tooltip, String.format("type %s, %d feature(s)", vectorDataNode.getFeatureType().getTypeName(), vectorDataNode.getFeatureCollection().size())); return tooltip.toString(); } }
private SimpleFeatureType[] getFeatureTypes() { if (!hasSelectedMasks()) { return new SimpleFeatureType[0]; } List<SimpleFeatureType> result = new ArrayList<>(); final Histogram[] histograms = provider.getHistograms(); for (int i = 0; i < selectedMasks.length; i++) { final Mask selectedMask = selectedMasks[i]; mask2Histogram.put(selectedMask, histograms[i]); if (selectedMask.getImageType().getName().equals(Mask.VectorDataType.TYPE_NAME)) { VectorDataNode vectorDataNode = Mask.VectorDataType.getVectorData(selectedMask); SimpleFeatureType featureType = vectorDataNode.getFeatureType(); if (!result.contains(featureType)) { result.add(featureType); } if (!featureType2Mask.containsKey(featureType)) { featureType2Mask.put(featureType, new HashSet<Mask>()); } featureType2Mask.get(featureType).add(selectedMask); featureType2VDN.put(featureType, vectorDataNode); setMaskRegionName(selectedMask, vectorDataNode); } } return result.toArray(new SimpleFeatureType[result.size()]); }
@Override public Class<?> getColumnClass(int columnIndex) { return vectorDataNode.getFeatureType().getDescriptor(columnIndex).getType().getBinding(); }
corrDataName = dataSourceConfig.dataField.getLocalName(); features = dataSourceConfig.pointDataSource.getFeatureCollection().toArray(new SimpleFeature[0]); dataFieldIndex = dataSourceConfig.pointDataSource.getFeatureType().indexOf(corrDataName); } else { corrDataName = "";
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) { } } }
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) { } } }
private static Map<Class<?>, List<SimpleFeature>> createGeometryToFeaturesListMap(VectorDataNode vectorNode) throws TransformException, SchemaException { FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = vectorNode.getFeatureCollection(); CoordinateReferenceSystem crs = vectorNode.getFeatureType().getCoordinateReferenceSystem(); if (crs == null) { // for pins and GCPs crs is null crs = vectorNode.getProduct().getSceneCRS();
protected VectorDataLayer(VectorDataLayerType vectorDataLayerType, VectorDataNode vectorDataNode, SceneTransformProvider provider, PropertySet configuration) { super(vectorDataLayerType, configuration); setUniqueId(); this.vectorDataNode = vectorDataNode; setName(vectorDataNode.getName()); figureFactory = new SimpleFeatureFigureFactory(vectorDataNode.getFeatureType(), provider); figureCollection = new DefaultFigureCollection(); updateFigureCollection(); vectorDataChangeHandler = new VectorDataChangeHandler(); vectorDataNode.getProduct().addProductNodeListener(vectorDataChangeHandler); figureCollection.addChangeListener(new FigureChangeHandler()); }
final VectorDataLayer vectorLayer = (VectorDataLayer) selLayer; if (vectorLayer.getVectorDataNode() != null) { final String typeName = vectorLayer.getVectorDataNode().getFeatureType().getTypeName(); if (Product.GEOMETRY_FEATURE_TYPE_NAME.equals(typeName)) { layer = vectorLayer;
GeometryDescriptor geometryDescriptor = vectorDataNode.getFeatureType().getGeometryDescriptor(); int featureCount = vectorDataNode.getFeatureCollection().size(); if (featureCount > 1
contextProduct.getVectorDataGroup().add(new VectorDataNode(vectorDataName, vectorData.getFeatureType()));