if (mouseButton == MouseEvent.BUTTON1) {
if (mouseButton == MouseEvent.BUTTON2 || (mouseButton == MouseEvent.BUTTON1 && (e.getModifiersEx() & MouseEvent.ALT_DOWN_MASK) != 0)) {  mouseInitialScreenLocation = new Point(e.getX(), e.getY()); } else if (mouseButton == MouseEvent.BUTTON1) {
    public void mousePressed(MouseEvent e) {        Point tile = mapView.screenToTileCoords(e.getX(), e.getY());        mouseButton = e.getButton();        bMouseIsDown = true;        bMouseIsDragging = false;        mousePressLocation = mapView.screenToTileCoords(e.getX(), e.getY());        mouseInitialPressLocation = mousePressLocation;        if (mouseButton == MouseEvent.BUTTON1) {            switch (currentPointerState) {                case PS_PAINT:                    currentBrush.startPaint(currentMap, tile.x, tile.y,                            mouseButton, currentLayer);                case PS_ERASE:                case PS_POUR:                    MapLayer layer = getCurrentLayer();                    paintEdit =                        new MapLayerEdit(layer, createLayerCopy(layer), null);                    break;                default:            }        }        else if (mouseButton == MouseEvent.BUTTON2) {            // Remember screen location for scrolling with middle mouse button            mouseInitialScreenLocation = new Point(e.getX(), e.getY());        }        if (currentPointerState == PS_MARQUEE) {            if (marqueeSelection == null) {                marqueeSelection = new SelectionLayer(                        currentMap.getWidth(), currentMap.getHeight());                currentMap.addLayerSpecial(marqueeSelection);            }        } else if (currentPointerState == PS_MOVE) {            // Initialize move distance to (0, 0)            moveDist = new Point(0, 0);        }        doMouse(e);    }