All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webswing.toolkit.WebMouseInfoPeer Maven / Gradle / Ivy

There is a newer version: 20.2.4
Show newest version
package org.webswing.toolkit;

import java.awt.Point;
import java.awt.Window;
import java.awt.peer.MouseInfoPeer;

import org.webswing.toolkit.util.Util;


public class WebMouseInfoPeer implements MouseInfoPeer{

    public int fillPointWithCoords(Point point) {
        if(point!=null){
            Point last = Util.getWebToolkit().getEventDispatcher().getLastMousePosition();
            point.x=last.x;
            point.y=last.y;
        }
        return 0;
    }

    public boolean isWindowUnderMouse(Window w) {
        Point last = Util.getWebToolkit().getEventDispatcher().getLastMousePosition();
        Window wx= Util.getWebToolkit().getWindowManager().getVisibleWindowOnPosition(last.x, last.y);
        if(w==wx){
            return true;
        }else{
            return false;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy