Package gistoolkit.display.drawmodel

Examples of gistoolkit.display.drawmodel.SelectDrawModel


        // 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){
                               
                                // Create copies of the records.
                                Record[] tempCopyRecords = new Record[tempRecords.length];
                                for (int i=0; i<tempRecords.length; i++){
                                    tempCopyRecords[i] = (Record) tempRecords[i].clone();
                                }
                                                               
                                // copy the records to a place where they can be retrieved.
                                getGISEditor().setCopyBuffer(tempRecords);
                                getGISDisplay().redraw();
                                tempSelectDrawModel.reset();
                               
                            }
                        }
                    }
                }
View Full Code Here


        // 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();

                            }
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of gistoolkit.display.drawmodel.SelectDrawModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.