Question is pretty much the title, here’s some context:
I want to create a grid of squares and exchange two after I click one and drag to an adjacent square.
The first one should call onMouseClick() and notify the parent (or a singleton object which serves as GameController for the gamelogic, not sure yet), and then when you drag your mouse into an adjancent square that object should call onMouseDrag() to tell the GameController a switch shall be performed.