Search in sources :

Example 1 with ClientEventType

use of mage.client.util.ClientEventType in project mage by magefree.

the class MageActionCallback method mouseClicked.

@Override
public void mouseClicked(MouseEvent e, TransferData data, boolean doubleClick) {
    // send mouse clicked event to the card's area and other cards list components for processing
    if (e.isConsumed()) {
        return;
    }
    if (data.getComponent().getCardContainer() instanceof CardEventProducer) {
        ClientEventType clickType = doubleClick ? ClientEventType.CARD_DOUBLE_CLICK : ClientEventType.CARD_CLICK;
        CardEventProducer cardContainer = (CardEventProducer) data.getComponent().getCardContainer();
        mage.client.util.Event clientEvent = new mage.client.util.Event(data.getComponent().getOriginal(), clickType, 0, e.getX(), e.getY(), data.getComponent(), e, false);
        cardContainer.getCardEventSource().fireEvent(clientEvent);
    }
}
Also used : BufferedImage(java.awt.image.BufferedImage) java.util(java.util) ClientEventType(mage.client.util.ClientEventType) MouseWheelEvent(java.awt.event.MouseWheelEvent) MouseEvent(java.awt.event.MouseEvent) CardEventProducer(mage.client.cards.CardEventProducer)

Aggregations

MouseEvent (java.awt.event.MouseEvent)1 MouseWheelEvent (java.awt.event.MouseWheelEvent)1 BufferedImage (java.awt.image.BufferedImage)1 java.util (java.util)1 CardEventProducer (mage.client.cards.CardEventProducer)1 ClientEventType (mage.client.util.ClientEventType)1