if (currentPointerState == PS_MARQUEE) {
if (currentPointerState == PS_MARQUEE) {  /*
    public void mouseReleased(MouseEvent event) {        MapLayer layer = getCurrentLayer();        Point limp = mouseInitialPressLocation;       if (currentPointerState == PS_MARQUEE) {           Point tile = mapView.screenToTileCoords(event.getX(), event.getY());           if (tile.y - limp.y == 0 && tile.x - limp.x == 0) {               if (marqueeSelection != null) {                   currentMap.removeLayerSpecial(marqueeSelection);                   marqueeSelection = null;               }           }        } else if (currentPointerState == PS_MOVE) {            if (layer != null && moveDist.x != 0 || moveDist.x != 0) {                undoSupport.postEdit(new MoveLayerEdit(layer, moveDist));            }        } else if (currentPointerState == PS_PAINT) {            currentBrush.endPaint();        }       //STAMP       if (bMouseIsDragging && mouseButton == MouseEvent.BUTTON3 &&               getCurrentLayer() instanceof TileLayer &&               currentPointerState == PS_PAINT)       {           Point tile = mapView.screenToTileCoords(event.getX(), event.getY());           int minx = Math.min(limp.x, tile.x);           int miny = Math.min(limp.y, tile.y);           Rectangle bounds = new Rectangle(                   minx, miny,                   (Math.max(limp.x, tile.x) - minx)+1,                   (Math.max(limp.y, tile.y) - miny)+1);           // Right mouse button dragged: create and set custom brush           MultilayerPlane mlp =               new MultilayerPlane(bounds.width, bounds.height);           TileLayer brushLayer = new TileLayer(bounds);           brushLayer.copyFrom(getCurrentLayer());           //do a quick check to make sure the selection is not empty           if(brushLayer.isEmpty()) {        	   JOptionPane.showMessageDialog(appFrame,        			   Resources.getString("dialog.selection.empty"),        			   Resources.getString("dialog.selection.empty"),                       JOptionPane.WARNING_MESSAGE);           } else {        	   mlp.addLayer(brushLayer);        	   setBrush(new CustomBrush(mlp));           }           //get rid of any visible marquee           if (marqueeSelection != null) {               currentMap.removeLayerSpecial(marqueeSelection);               marqueeSelection = null;           }       }        if (paintEdit != null) {            if (layer != null) {                try {                    MapLayer endLayer = paintEdit.getStart().createDiff(layer);                    paintEdit.end(endLayer);                    undoSupport.postEdit(paintEdit);                } catch (Exception e) {                    e.printStackTrace();                }            }            paintEdit = null;        }        mouseButton = MouseEvent.NOBUTTON;        bMouseIsDown = false;        bMouseIsDragging = false;    }