Package de.yaams.extensions.basemap.tiled.mapeditor.undo

Examples of de.yaams.extensions.basemap.tiled.mapeditor.undo.MapLayerEdit


        if (layer instanceof TileLayer) {
          currentBrush.startPaint(currentMap, tile.x, tile.y, mouseButton, currentLayer);
        }
      case PS_ERASE:
      case PS_POUR:
        paintEdit = new MapLayerEdit(layer, createLayerCopy(layer), null);
        break;
      default:
      }
    }
View Full Code Here


    Rectangle bounds = new Rectangle(area.x, area.y, area.width + 1, area.height + 1);
    after = new TileLayer(bounds);
    after.copyFrom(layer);

    MapLayerEdit mle = new MapLayerEdit(layer, before, after);
    mle.setPresentationName(TOOL_FILL);
    undoSupport.postEdit(mle);
  }
View Full Code Here

    @Override
    public void actionPerformed(ActionEvent evt) {
      MapLayer currentLayer = getCurrentLayer();
      MapLayer layer = currentLayer;
      MapLayerEdit transEdit;
      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.setMap(currentMap);
        layer.maskedCopyFrom(currentLayer, marqueeSelection.getSelectedArea());
      }

      switch (transform) {
      case MapLayer.ROTATE_90:
      case MapLayer.ROTATE_180:
      case MapLayer.ROTATE_270:
        transEdit.setPresentationName("Rotate");
        layer.rotate(transform);
        // if(marqueeSelection != null)
        // marqueeSelection.rotate(transform);
        break;
      case MapLayer.MIRROR_VERTICAL:
        transEdit.setPresentationName("Vertical Flip");
        layer.mirror(MapLayer.MIRROR_VERTICAL);
        // if(marqueeSelection != null)
        // marqueeSelection.mirror(transform);
        break;
      case MapLayer.MIRROR_HORIZONTAL:
        transEdit.setPresentationName("Horizontal Flip");
        layer.mirror(MapLayer.MIRROR_HORIZONTAL);
        // if(marqueeSelection != null)
        // marqueeSelection.mirror(transform);
        break;
      }

      if (marqueeSelection != null) {
        layer.mergeOnto(currentLayer);
      }

      transEdit.end(createLayerCopy(currentLayer));
      undoSupport.postEdit(transEdit);
      mapView.repaint();
    }
View Full Code Here

TOP

Related Classes of de.yaams.extensions.basemap.tiled.mapeditor.undo.MapLayerEdit

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.