package tech.nevets.jaml.listeners;

import tech.nevets.jaml.gui.RightClickGui;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class RightClickListener extends MouseAdapter {
    public void mousePressed(MouseEvent e) {
        if (e.isPopupTrigger()) {
            doPop(e);
        }
    }

    public void mouseReleased(MouseEvent e) {
        if (e.isPopupTrigger()) {
            doPop(e);
        }
    }

    private void doPop(MouseEvent e) {
        RightClickGui menu = new RightClickGui();
        menu.show(e.getComponent(), e.getX(), e.getY());
    }
}
