// find all the shapes within this distance.
Layer tempLayer = getGISDisplay().getSelectedLayer();
if (tempLayer != null){
// get the dataset from this layer
GISDataset tempDataset = tempLayer.getDataset();
GISDataset tempSelectedDataset = new GISDataset();
for (int i=0; i<tempDataset.size(); i++){
gistoolkit.features.Shape tempShape = tempDataset.getShape(i);
if (tempShape != null){
if (tempShape.getDistanceToPoint(tempPoint.getX(), tempPoint.getY())<tempDistance){
tempSelectedDataset.add(tempDataset.getRecord(i));
}
}
}
// set the selected records.
((SelectPointModel) inDrawModel).setSelectedLayer(tempLayer);
((SelectPointModel) inDrawModel).setSelectedRecords(tempSelectedDataset.getRecords());
}
else{
JOptionPane.showMessageDialog(getGISDisplay(), "Please select a layer.", "Layer not selected", JOptionPane.ERROR_MESSAGE);
}
}