transEdit = new MapLayerEdit(layer, createLayerCopy(layer));
transEdit = new MapLayerEdit(currentLayer, createLayerCopy(currentLayer));  if(marqueeSelection != null) { if (currentLayer instanceof TileLayer) { layer = new TileLayer( marqueeSelection.getSelectedAreaBounds()); } else if (currentLayer instanceof ObjectGroup) { layer = new ObjectGroup( marqueeSelection.getSelectedAreaBounds()); }  layer.maskedCopyFrom( currentLayer, marqueeSelection.getSelectedArea()); }
        public void actionPerformed(ActionEvent evt) {            MapLayer layer = getCurrentLayer();            MapLayerEdit transEdit;            transEdit = new MapLayerEdit(layer, createLayerCopy(layer));            switch (transform) {                case MapLayer.ROTATE_90:                    transEdit.setPresentationName("Rotate");                    layer.rotate(MapLayer.ROTATE_90);                    break;                case MapLayer.ROTATE_180:                    transEdit.setPresentationName("Rotate");                    layer.rotate(MapLayer.ROTATE_180);                    break;                case MapLayer.ROTATE_270:                    transEdit.setPresentationName("Rotate");                    layer.rotate(MapLayer.ROTATE_270);                    break;                case MapLayer.MIRROR_VERTICAL:                    transEdit.setPresentationName("Vertical Flip");                    layer.mirror(MapLayer.MIRROR_VERTICAL);                    break;                case MapLayer.MIRROR_HORIZONTAL:                    transEdit.setPresentationName("Horizontal Flip");                    layer.mirror(MapLayer.MIRROR_HORIZONTAL);                    break;            }            transEdit.end(createLayerCopy(layer));            undoSupport.postEdit(transEdit);            mapView.repaint();        }