// determine if there is a current selection
try{
if (getGISDisplay() != null){
if (getGISDisplay().getDrawModel() != null){
if (getGISDisplay().getDrawModel() instanceof SelectDrawModel){
SelectDrawModel tempSelectDrawModel = (SelectDrawModel) getGISDisplay().getDrawModel();
Record[] tempRecords = tempSelectDrawModel.getSelectedRecords();
if (tempRecords != null){
Layer tempSelectedLayer = getGISDisplay().getSelectedLayer();
if (tempSelectedLayer != null){
// If the layer is updateable, then delete the records
if (tempSelectedLayer.isUpdateable()){
for (int i=0; i<tempRecords.length; i++){
tempSelectedLayer.delete(tempRecords[i]);
}
}
// The layer is not updateable, so show an information message.
else{
showInformation("Layer Not Updatable", "Can Not Cut, a Copy will be performed");
}
// copy the records to a place where they can be retrieved.
getGISEditor().setCopyBuffer(tempRecords);
getGISDisplay().redraw();
tempSelectDrawModel.reset();
}
}
}
}